summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--ChangeLog4
-rw-r--r--Makefile.am10
-rw-r--r--NEWS6
-rw-r--r--configure.ac63
-rw-r--r--m4/evas_check_engine.m434
-rw-r--r--pc/ecore-directfb.pc.in12
-rw-r--r--pc/evas-directfb.pc.in3
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile_Ecore_DirectFB.am34
-rw-r--r--src/Makefile_Ecore_Evas.am13
-rw-r--r--src/Makefile_Evas.am37
-rw-r--r--src/lib/ecore_directfb/Ecore_DirectFB.h181
-rw-r--r--src/lib/ecore_directfb/ecore_directfb.c758
-rw-r--r--src/lib/ecore_directfb/ecore_directfb_keys.h184
-rw-r--r--src/lib/ecore_directfb/ecore_directfb_private.h52
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h6
-rw-r--r--src/lib/ecore_evas/ecore_evas.c28
-rw-r--r--src/lib/ecore_evas/ecore_evas_directfb.c586
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h13
-rw-r--r--src/lib/evas/Evas.h3
-rw-r--r--src/lib/evas/file/evas_module.c4
-rw-r--r--src/modules/evas/engines/directfb/Evas_Engine_DirectFB.h25
-rw-r--r--src/modules/evas/engines/directfb/evas_engine.c1755
-rw-r--r--src/modules/evas/engines/directfb/evas_engine.h71
-rw-r--r--src/modules/evas/engines/directfb/polygon.c269
26 files changed, 16 insertions, 4141 deletions
diff --git a/.gitignore b/.gitignore
index 8cbc80b..4e26642 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,7 +41,6 @@ Makefile.in
41/pc/evil.pc 41/pc/evil.pc
42/pc/embryo.pc 42/pc/embryo.pc
43/pc/evas-direct3d.pc 43/pc/evas-direct3d.pc
44/pc/evas-directfb.pc
45/pc/evas-fb.pc 44/pc/evas-fb.pc
46/pc/evas-opengl-cocoa.pc 45/pc/evas-opengl-cocoa.pc
47/pc/evas-opengl-sdl.pc 46/pc/evas-opengl-sdl.pc
@@ -99,7 +98,6 @@ m4/wint_t.m4
99m4/xsize.m4 98m4/xsize.m4
100pc/ecore-cocoa.pc 99pc/ecore-cocoa.pc
101pc/ecore-con.pc 100pc/ecore-con.pc
102pc/ecore-directfb.pc
103pc/ecore-evas.pc 101pc/ecore-evas.pc
104pc/ecore-fb.pc 102pc/ecore-fb.pc
105pc/ecore-file.pc 103pc/ecore-file.pc
diff --git a/ChangeLog b/ChangeLog
index faeefbc..92d4e0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12012-12-05 Gustavo Sverzut Barbieri (k-s)
2
3 * Removed DirectFB support (both ecore_directfb, evas and ecore_evas).
4
12012-12-04 Gwanglim Lee 52012-12-04 Gwanglim Lee
2 6
3 * Add window profile support: 7 * Add window profile support:
diff --git a/Makefile.am b/Makefile.am
index 0cca9c2..117a632 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,7 +67,6 @@ pc/eina.pc \
67pc/eet.pc \ 67pc/eet.pc \
68pc/eo.pc \ 68pc/eo.pc \
69pc/evas.pc \ 69pc/evas.pc \
70pc/evas-directfb.pc \
71pc/evas-fb.pc \ 70pc/evas-fb.pc \
72pc/evas-opengl-x11.pc \ 71pc/evas-opengl-x11.pc \
73pc/evas-opengl-sdl.pc \ 72pc/evas-opengl-sdl.pc \
@@ -85,7 +84,6 @@ pc/ecore-file.pc \
85pc/ecore-input.pc \ 84pc/ecore-input.pc \
86pc/ecore-input-evas.pc \ 85pc/ecore-input-evas.pc \
87pc/ecore-cocoa.pc \ 86pc/ecore-cocoa.pc \
88pc/ecore-directfb.pc \
89pc/ecore-fb.pc \ 87pc/ecore-fb.pc \
90pc/ecore-psl1ght.pc \ 88pc/ecore-psl1ght.pc \
91pc/ecore-sdl.pc \ 89pc/ecore-sdl.pc \
@@ -131,10 +129,6 @@ if BUILD_ENGINE_SOFTWARE_X11
131pkgconfig_DATA += pc/evas-software-x11.pc 129pkgconfig_DATA += pc/evas-software-x11.pc
132endif 130endif
133 131
134if BUILD_ENGINE_DIRECTFB
135pkgconfig_DATA += pc/evas-directfb.pc
136endif
137
138if BUILD_ENGINE_FB 132if BUILD_ENGINE_FB
139pkgconfig_DATA += pc/evas-fb.pc 133pkgconfig_DATA += pc/evas-fb.pc
140endif 134endif
@@ -179,10 +173,6 @@ if HAVE_ECORE_COCOA
179pkgconfig_DATA += pc/ecore-cocoa.pc 173pkgconfig_DATA += pc/ecore-cocoa.pc
180endif 174endif
181 175
182if HAVE_ECORE_DIRECTFB
183pkgconfig_DATA += pc/ecore-directfb.pc
184endif
185
186if HAVE_ECORE_FB 176if HAVE_ECORE_FB
187pkgconfig_DATA += pc/ecore-fb.pc 177pkgconfig_DATA += pc/ecore-fb.pc
188endif 178endif
diff --git a/NEWS b/NEWS
index 09a0500..660948d 100644
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,10 @@ Deprecations:
46 ECORE_X_ATOM_E_PROFILE_LIST 46 ECORE_X_ATOM_E_PROFILE_LIST
47 ecore_x_e_window_profile_list_set() 47 ecore_x_e_window_profile_list_set()
48 ecore_x_e_window_profile_list_get() 48 ecore_x_e_window_profile_list_get()
49 * ecore_evas: deprecate directfb engine.
50
51Removed:
52 * directfb support: ecore_directfb and evas directfb engine.
49 53
50Improvements: 54Improvements:
51 * Single EFL tree covering all EFL library components. 55 * Single EFL tree covering all EFL library components.
@@ -63,4 +67,4 @@ Fixes:
63 to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters. 67 to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters.
64 * Fixed textblock textprop leak. 68 * Fixed textblock textprop leak.
65 * Fixed evas_object_box to reset size_hint_min to zero when no child. 69 * Fixed evas_object_box to reset size_hint_min to zero when no child.
66 * Fix build of Ecore_Evas_Extn on Solaris. \ No newline at end of file 70 * Fix build of Ecore_Evas_Extn on Solaris.
diff --git a/configure.ac b/configure.ac
index 525456d..77a85d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,7 +99,6 @@ requirements_libs_ecore_ipc=""
99requirements_libs_ecore_file="" 99requirements_libs_ecore_file=""
100requirements_libs_ecore_input="" 100requirements_libs_ecore_input=""
101requirements_libs_ecore_cocoa="" 101requirements_libs_ecore_cocoa=""
102requirements_libs_ecore_directfb=""
103requirements_libs_ecore_fb="" 102requirements_libs_ecore_fb=""
104requirements_libs_ecore_psl1ght="" 103requirements_libs_ecore_psl1ght=""
105requirements_libs_ecore_sdl="" 104requirements_libs_ecore_sdl=""
@@ -129,7 +128,6 @@ requirements_pc_ecore_file=""
129requirements_pc_ecore_input="" 128requirements_pc_ecore_input=""
130requirements_pc_ecore_input_evas="" 129requirements_pc_ecore_input_evas=""
131requirements_pc_ecore_cocoa="" 130requirements_pc_ecore_cocoa=""
132requirements_pc_ecore_directfb=""
133requirements_pc_ecore_fb="" 131requirements_pc_ecore_fb=""
134requirements_pc_ecore_psl1ght="" 132requirements_pc_ecore_psl1ght=""
135requirements_pc_ecore_sdl="" 133requirements_pc_ecore_sdl=""
@@ -178,7 +176,6 @@ AC_SUBST([requirements_libs_ecore_ipc])
178AC_SUBST([requirements_libs_ecore_file]) 176AC_SUBST([requirements_libs_ecore_file])
179AC_SUBST([requirements_libs_ecore_input]) 177AC_SUBST([requirements_libs_ecore_input])
180AC_SUBST([requirements_libs_ecore_cocoa]) 178AC_SUBST([requirements_libs_ecore_cocoa])
181AC_SUBST([requirements_libs_ecore_directfb])
182AC_SUBST([requirements_libs_ecore_fb]) 179AC_SUBST([requirements_libs_ecore_fb])
183AC_SUBST([requirements_libs_ecore_psl1ght]) 180AC_SUBST([requirements_libs_ecore_psl1ght])
184AC_SUBST([requirements_libs_ecore_sdl]) 181AC_SUBST([requirements_libs_ecore_sdl])
@@ -208,7 +205,6 @@ AC_SUBST([requirements_pc_ecore_file])
208AC_SUBST([requirements_pc_ecore_input]) 205AC_SUBST([requirements_pc_ecore_input])
209AC_SUBST([requirements_pc_ecore_input_evas]) 206AC_SUBST([requirements_pc_ecore_input_evas])
210AC_SUBST([requirements_pc_ecore_cocoa]) 207AC_SUBST([requirements_pc_ecore_cocoa])
211AC_SUBST([requirements_pc_ecore_directfb])
212AC_SUBST([requirements_pc_ecore_fb]) 208AC_SUBST([requirements_pc_ecore_fb])
213AC_SUBST([requirements_pc_ecore_psl1ght]) 209AC_SUBST([requirements_pc_ecore_psl1ght])
214AC_SUBST([requirements_pc_ecore_sdl]) 210AC_SUBST([requirements_pc_ecore_sdl])
@@ -1323,7 +1319,6 @@ want_evas_engine_gl_xcb="no"
1323want_evas_engine_gl_sdl="no" 1319want_evas_engine_gl_sdl="no"
1324want_evas_engine_gl_cocoa="no" 1320want_evas_engine_gl_cocoa="no"
1325want_evas_engine_fb="no" 1321want_evas_engine_fb="no"
1326want_evas_engine_directfb="no"
1327want_evas_engine_psl1ght="no" 1322want_evas_engine_psl1ght="no"
1328want_evas_engine_wayland_shm="no" 1323want_evas_engine_wayland_shm="no"
1329want_evas_engine_wayland_egl="no" 1324want_evas_engine_wayland_egl="no"
@@ -1502,7 +1497,6 @@ fi
1502## Engines 1497## Engines
1503 1498
1504EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [yes], [Buffer]) 1499EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [yes], [Buffer])
1505EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
1506EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer]) 1500EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
1507EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa]) 1501EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa])
1508EVAS_CHECK_ENGINE([gl-sdl], [${want_evas_engine_gl_sdl}], [no], [OpenGL SDL]) 1502EVAS_CHECK_ENGINE([gl-sdl], [${want_evas_engine_gl_sdl}], [no], [OpenGL SDL])
@@ -2726,47 +2720,6 @@ AM_CONDITIONAL([HAVE_ECORE_COCOA], [test "x${have_ecore_cocoa}" = "xyes"])
2726#### End of Ecore_Cocoa 2720#### End of Ecore_Cocoa
2727 2721
2728 2722
2729#### Ecore_DirectFB
2730
2731AC_MSG_NOTICE([Ecore_DirectFB checks])
2732
2733### Additional options to configure
2734
2735### Default values
2736
2737### Checks for programs
2738
2739### Checks for libraries
2740
2741## Eina, Ecore
2742
2743requirements_pc_ecore_directfb="ecore >= ${PACKAGE_VERSION} eina >= ${PACKAGE_VERSION} ${requirements_pc_ecore_directfb}"
2744
2745## DirectFB
2746
2747PKG_CHECK_MODULES([ECORE_DIRECTFB],
2748 [directfb >= 0.9.16],
2749 [
2750 have_ecore_directfb="yes"
2751 requirements_pc_ecore_directfb="directfb >= 0.9.16 ${requirements_pc_ecore_directfb}"
2752 ],
2753 [have_ecore_directfb="no"])
2754
2755AM_CONDITIONAL([HAVE_ECORE_DIRECTFB], [test "x${have_ecore_directfb}" = "xyes"])
2756
2757### Checks for header files
2758
2759### Checks for types
2760
2761### Checks for structures
2762
2763### Checks for compiler characteristics
2764
2765### Checks for linker characteristics
2766
2767### Checks for library functions
2768
2769#### End of Ecore_Directfb
2770 2723
2771 2724
2772#### Ecore_FB 2725#### Ecore_FB
@@ -3781,7 +3734,6 @@ want_ecore_evas_software_ddraw="no"
3781want_ecore_evas_software_sdl="no" 3734want_ecore_evas_software_sdl="no"
3782want_ecore_evas_gl_sdl="no" 3735want_ecore_evas_gl_sdl="no"
3783want_ecore_evas_gl_cocoa="no" 3736want_ecore_evas_gl_cocoa="no"
3784want_ecore_evas_directfb="no"
3785want_ecore_evas_fb="no" 3737want_ecore_evas_fb="no"
3786want_ecore_evas_ews="yes" 3738want_ecore_evas_ews="yes"
3787want_ecore_evas_extn="yes" 3739want_ecore_evas_extn="yes"
@@ -3811,7 +3763,6 @@ case "$host_os" in
3811 want_ecore_evas_software_sdl="yes" 3763 want_ecore_evas_software_sdl="yes"
3812 want_ecore_evas_gl_sdl="yes" 3764 want_ecore_evas_gl_sdl="yes"
3813 want_ecore_evas_gl_cocoa="no" 3765 want_ecore_evas_gl_cocoa="no"
3814 want_ecore_evas_directfb="yes"
3815 want_ecore_evas_fb="yes" 3766 want_ecore_evas_fb="yes"
3816 want_ecore_evas_wayland_shm="yes" 3767 want_ecore_evas_wayland_shm="yes"
3817 want_ecore_evas_wayland_egl="yes" 3768 want_ecore_evas_wayland_egl="yes"
@@ -3845,15 +3796,6 @@ ECORE_EVAS_CHECK_MODULE_FULL([opengl-cocoa],
3845 [${have_ecore_cocoa}], 3796 [${have_ecore_cocoa}],
3846 [requirements_pc_ecore_evas="ecore-cocoa >= ${PACKAGE_VERSION} ${requirements_pc_ecore_evas}"]) 3797 [requirements_pc_ecore_evas="ecore-cocoa >= ${PACKAGE_VERSION} ${requirements_pc_ecore_evas}"])
3847 3798
3848# ecore_evas_directfb
3849
3850ECORE_EVAS_CHECK_MODULE_FULL([directfb],
3851 [${have_evas_engine_directfb}],
3852 [${want_ecore_evas_directfb}],
3853 [DirectFB],
3854 [${have_ecore_directfb}],
3855 [requirements_pc_ecore_evas="ecore-directfb >= ${PACKAGE_VERSION} ${requirements_pc_ecore_evas}"])
3856
3857# ecore_evas_ews 3799# ecore_evas_ews
3858 3800
3859ECORE_EVAS_CHECK_MODULE_FULL([ews], 3801ECORE_EVAS_CHECK_MODULE_FULL([ews],
@@ -4187,7 +4129,6 @@ pc/escape.pc
4187pc/eina.pc 4129pc/eina.pc
4188pc/eet.pc 4130pc/eet.pc
4189pc/eo.pc 4131pc/eo.pc
4190pc/evas-directfb.pc
4191pc/evas-fb.pc 4132pc/evas-fb.pc
4192pc/evas-opengl-x11.pc 4133pc/evas-opengl-x11.pc
4193pc/evas-opengl-sdl.pc 4134pc/evas-opengl-sdl.pc
@@ -4208,7 +4149,6 @@ pc/ecore-file.pc
4208pc/ecore-input.pc 4149pc/ecore-input.pc
4209pc/ecore-input-evas.pc 4150pc/ecore-input-evas.pc
4210pc/ecore-cocoa.pc 4151pc/ecore-cocoa.pc
4211pc/ecore-directfb.pc
4212pc/ecore-fb.pc 4152pc/ecore-fb.pc
4213pc/ecore-psl1ght.pc 4153pc/ecore-psl1ght.pc
4214pc/ecore-sdl.pc 4154pc/ecore-sdl.pc
@@ -4271,7 +4211,6 @@ else
4271fi 4211fi
4272echo " OpenGL Cocoa...............: $have_evas_engine_gl_cocoa" 4212echo " OpenGL Cocoa...............: $have_evas_engine_gl_cocoa"
4273echo " Software Framebuffer.......: $have_evas_engine_fb" 4213echo " Software Framebuffer.......: $have_evas_engine_fb"
4274echo " DirectFB...................: $have_evas_engine_directfb"
4275echo " PSL1GHT....................: $have_evas_engine_psl1ght" 4214echo " PSL1GHT....................: $have_evas_engine_psl1ght"
4276echo " Wayland Shm................: $have_evas_engine_wayland_shm" 4215echo " Wayland Shm................: $have_evas_engine_wayland_shm"
4277echo " Wayland Egl................: $have_evas_engine_wayland_egl" 4216echo " Wayland Egl................: $have_evas_engine_wayland_egl"
@@ -4413,7 +4352,6 @@ echo " Ecore_FB...................: $have_ecore_fb"
4413if test "x${have_ecore_fb}" = "xyes" ; then 4352if test "x${have_ecore_fb}" = "xyes" ; then
4414 echo " Touchscreen..............: $have_tslib" 4353 echo " Touchscreen..............: $have_tslib"
4415fi 4354fi
4416echo " Ecore_DirectFB.............: $have_ecore_directfb"
4417echo " Ecore_WinCE................: $have_wince" 4355echo " Ecore_WinCE................: $have_wince"
4418echo " Ecore_PSL1GHT..............: $have_ps3" 4356echo " Ecore_PSL1GHT..............: $have_ps3"
4419echo " Ecore_Wayland..............: $have_ecore_wayland" 4357echo " Ecore_Wayland..............: $have_ecore_wayland"
@@ -4436,7 +4374,6 @@ echo " Ecore_Evas...................: $have_ecore_evas"
4436 echo " Software SDL...............: $have_ecore_evas_software_sdl" 4374 echo " Software SDL...............: $have_ecore_evas_software_sdl"
4437 echo " OpenGL SDL.................: $have_ecore_evas_opengl_sdl" 4375 echo " OpenGL SDL.................: $have_ecore_evas_opengl_sdl"
4438 echo " OpenGL Cocoa...............: $have_ecore_evas_opengl_cocoa" 4376 echo " OpenGL Cocoa...............: $have_ecore_evas_opengl_cocoa"
4439 echo " DirectFB...................: $have_ecore_evas_directfb"
4440 echo " PSL1GHT....................: $have_ecore_evas_psl1ght" 4377 echo " PSL1GHT....................: $have_ecore_evas_psl1ght"
4441 echo " Software Framebuffer.......: $have_ecore_evas_fb" 4378 echo " Software Framebuffer.......: $have_ecore_evas_fb"
4442 echo " Sing.Proc. Windowing System: $have_ecore_evas_ews" 4379 echo " Sing.Proc. Windowing System: $have_ecore_evas_ews"
diff --git a/m4/evas_check_engine.m4 b/m4/evas_check_engine.m4
index 6e4ef4f..7362377 100644
--- a/m4/evas_check_engine.m4
+++ b/m4/evas_check_engine.m4
@@ -599,40 +599,6 @@ AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
599 599
600]) 600])
601 601
602dnl use: EVAS_CHECK_ENGINE_DEP_DIRECTFB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
603
604AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DIRECTFB],
605[
606
607requirement=""
608have_dep="no"
609evas_engine_[]$1[]_cflags=""
610evas_engine_[]$1[]_libs=""
611
612PKG_CHECK_EXISTS([directfb >= 0.9.16],
613 [
614 have_dep="yes"
615 requirement="directfb >= 0.9.16"
616 ],
617 [have_dep="no"])
618
619if test "x${have_dep}" = "xyes" ; then
620 if test "x$3" = "xstatic" ; then
621 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
622 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
623 else
624 PKG_CHECK_MODULES([DIRECTFB], [${requirement}])
625 evas_image_loader_[]$1[]_cflags="${DIRECTFB_CFLAGS}"
626 evas_image_loader_[]$1[]_libs="${DIRECTFB_LIBS}"
627 fi
628fi
629
630AC_SUBST([evas_engine_$1_cflags])
631AC_SUBST([evas_engine_$1_libs])
632
633AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
634
635])
636 602
637dnl use: EVAS_CHECK_ENGINE_DEP_PSL1GHT(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) 603dnl use: EVAS_CHECK_ENGINE_DEP_PSL1GHT(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
638 604
diff --git a/pc/ecore-directfb.pc.in b/pc/ecore-directfb.pc.in
deleted file mode 100644
index b02870b..0000000
--- a/pc/ecore-directfb.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: ecore-directfb
7Description: E core library, DirectFB module
8Requires.private: @requirements_pc_ecore_directfb@
9Version: @VERSION@
10Libs: -L${libdir} -lecore_directfb
11Libs.private: @requirements_libs_ecore_directfb@
12Cflags: -I${includedir}/ecore-@VMAJ@
diff --git a/pc/evas-directfb.pc.in b/pc/evas-directfb.pc.in
deleted file mode 100644
index 9a1bc3a..0000000
--- a/pc/evas-directfb.pc.in
+++ /dev/null
@@ -1,3 +0,0 @@
1Name: evas-directfb
2Description: Evas DirectFB engine
3Version: @VERSION@
diff --git a/src/Makefile.am b/src/Makefile.am
index 73ac3a9..4cca020 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,9 +29,6 @@ include Makefile_Ecore_Input.am
29if HAVE_ECORE_COCOA 29if HAVE_ECORE_COCOA
30include Makefile_Ecore_Cocoa.am 30include Makefile_Ecore_Cocoa.am
31endif 31endif
32if HAVE_ECORE_DIRECTFB
33include Makefile_Ecore_DirectFB.am
34endif
35if HAVE_ECORE_FB 32if HAVE_ECORE_FB
36include Makefile_Ecore_FB.am 33include Makefile_Ecore_FB.am
37endif 34endif
@@ -92,7 +89,6 @@ clean-local:
92 rm -rf modules/eina/mp/chained_pool/*.gcno 89 rm -rf modules/eina/mp/chained_pool/*.gcno
93 rm -rf modules/evas/engines/buffer/*.gcno 90 rm -rf modules/evas/engines/buffer/*.gcno
94 rm -rf modules/evas/engines/direct3d/*.gcno 91 rm -rf modules/evas/engines/direct3d/*.gcno
95 rm -rf modules/evas/engines/directfb/*.gcno
96 rm -rf modules/evas/engines/fb/*.gcno 92 rm -rf modules/evas/engines/fb/*.gcno
97 rm -rf modules/evas/engines/gl_cocoa/*.gcno 93 rm -rf modules/evas/engines/gl_cocoa/*.gcno
98 rm -rf modules/evas/engines/gl_common/*.gcno 94 rm -rf modules/evas/engines/gl_common/*.gcno
diff --git a/src/Makefile_Ecore_DirectFB.am b/src/Makefile_Ecore_DirectFB.am
deleted file mode 100644
index 6e2d54c..0000000
--- a/src/Makefile_Ecore_DirectFB.am
+++ /dev/null
@@ -1,34 +0,0 @@
1
2### Library
3
4lib_LTLIBRARIES += lib/ecore_directfb/libecore_directfb.la
5
6installed_ecoredirectfbmainheadersdir = $(includedir)/ecore-@VMAJ@
7dist_installed_ecoredirectfbmainheaders_DATA = \
8lib/ecore_directfb/Ecore_DirectFB.h
9
10lib_ecore_directfb_libecore_directfb_la_SOURCES = \
11lib/ecore_directfb/ecore_directfb.c \
12lib/ecore_directfb/ecore_directfb_keys.h \
13lib/ecore_directfb/ecore_directfb_private.h
14
15lib_ecore_directfb_libecore_directfb_la_CPPFLAGS = \
16-I$(top_srcdir)/src/lib/eina \
17-I$(top_srcdir)/src/lib/eo \
18-I$(top_srcdir)/src/lib/ecore \
19-I$(top_srcdir)/src/lib/ecore_directfb \
20-I$(top_builddir)/src/lib/eina \
21-I$(top_builddir)/src/lib/eo \
22-I$(top_builddir)/src/lib/ecore \
23-I$(top_builddir)/src/lib/ecore_directfb \
24@EFL_CFLAGS@ \
25@EFL_COV_CFLAGS@ \
26@ECORE_DIRECTFB_CFLAGS@
27
28lib_ecore_directfb_libecore_directfb_la_LIBADD = \
29lib/ecore/libecore.la \
30lib/eo/libeo.la \
31lib/eina/libeina.la \
32@ECORE_DIRECTFB_LIBS@
33
34lib_ecore_directfb_libecore_directfb_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am
index 40036b7..70a5579 100644
--- a/src/Makefile_Ecore_Evas.am
+++ b/src/Makefile_Ecore_Evas.am
@@ -61,14 +61,6 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
61-I$(top_builddir)/src/modules/evas/engines/gl_cocoa 61-I$(top_builddir)/src/modules/evas/engines/gl_cocoa
62endif 62endif
63 63
64if HAVE_ECORE_DIRECTFB
65lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
66-I$(top_srcdir)/src/lib/ecore_directfb \
67-I$(top_srcdir)/src/modules/evas/engines/directfb \
68-I$(top_builddir)/src/lib/ecore_directfb \
69-I$(top_builddir)/src/modules/evas/engines/directfb
70endif
71
72if HAVE_ECORE_FB 64if HAVE_ECORE_FB
73lib_ecore_evas_libecore_evas_la_CPPFLAGS += \ 65lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
74-I$(top_srcdir)/src/lib/ecore_fb \ 66-I$(top_srcdir)/src/lib/ecore_fb \
@@ -144,11 +136,6 @@ lib_ecore_evas_libecore_evas_la_LIBADD += \
144lib/ecore_cocoa/libecore_cocoa.la 136lib/ecore_cocoa/libecore_cocoa.la
145endif 137endif
146 138
147if HAVE_ECORE_DIRECTFB
148lib_ecore_evas_libecore_evas_la_LIBADD += \
149lib/ecore_directfb/libecore_directfb.la
150endif
151
152if HAVE_ECORE_FB 139if HAVE_ECORE_FB
153lib_ecore_evas_libecore_evas_la_LIBADD += \ 140lib_ecore_evas_libecore_evas_la_LIBADD += \
154lib/ecore_fb/libecore_fb.la 141lib/ecore_fb/libecore_fb.la
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 3b7aa80..bcd5fe7 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -439,43 +439,6 @@ modules_evas_engines_buffer_module_la_LIBTOOLFLAGS = --tag=disable-static
439endif 439endif
440endif 440endif
441 441
442if BUILD_ENGINE_DIRECTFB
443dist_installed_evasmainheaders_DATA += modules/evas/engines/directfb/Evas_Engine_DirectFB.h
444DIRECTFB_SOURCES = \
445modules/evas/engines/directfb/evas_engine.c \
446modules/evas/engines/directfb/polygon.c \
447modules/evas/engines/directfb/evas_engine.h
448if EVAS_STATIC_BUILD_DIRECTFB
449lib_evas_libevas_la_SOURCES += $(DIRECTFB_SOURCES)
450lib_evas_libevas_la_CPPFLAGS += @evas_engine_directfb_cflags@
451lib_evas_libevas_la_LIBADD += @evas_engine_directfb_libs@
452else
453enginedirectfbpkgdir = $(libdir)/evas/modules/engines/directfb/$(MODULE_ARCH)
454enginedirectfbpkg_LTLIBRARIES = modules/evas/engines/directfb/module.la
455modules_evas_engines_directfb_module_la_SOURCES = $(DIRECTFB_SOURCES)
456modules_evas_engines_directfb_module_la_CPPFLAGS = \
457-I$(top_srcdir)/src/lib/eina \
458-I$(top_builddir)/src/lib/eina \
459-I$(top_srcdir)/src/lib/eo \
460-I$(top_builddir)/src/lib/eo \
461-I$(top_srcdir)/src/lib/evas \
462-I$(top_builddir)/src/lib/evas \
463-I$(top_srcdir)/src/lib/evas/include \
464-I$(top_builddir)/src/lib/evas/include \
465-I$(top_srcdir)/src/lib/evas/cserve2 \
466-I$(top_builddir)/src/lib/evas/cserve2 \
467@evas_engine_directfb_cflags@ \
468@EFL_CFLAGS@ \
469@EVAS_CFLAGS@
470modules_evas_engines_directfb_module_la_LIBADD = \
471lib/evas/libevas.la \
472@EFL_LIBS@ \
473@evas_engine_directfb_libs@
474modules_evas_engines_directfb_module_la_LDFLAGS = -no-undefined -module -avoid-version
475modules_evas_engines_directfb_module_la_LIBTOOLFLAGS = --tag=disable-static
476endif
477endif
478
479if BUILD_ENGINE_FB 442if BUILD_ENGINE_FB
480dist_installed_evasmainheaders_DATA += modules/evas/engines/fb/Evas_Engine_FB.h 443dist_installed_evasmainheaders_DATA += modules/evas/engines/fb/Evas_Engine_FB.h
481FB_SOURCES = \ 444FB_SOURCES = \
diff --git a/src/lib/ecore_directfb/Ecore_DirectFB.h b/src/lib/ecore_directfb/Ecore_DirectFB.h
deleted file mode 100644
index 3b94816..0000000
--- a/src/lib/ecore_directfb/Ecore_DirectFB.h
+++ /dev/null
@@ -1,181 +0,0 @@
1#ifndef _ECORE_DIRECTFB_H
2#define _ECORE_DIRECTFB_H
3
4#include <Eina.h>
5
6#include <directfb.h>
7
8#ifdef EAPI
9# undef EAPI
10#endif /* ifdef EAPI */
11
12#ifdef __GNUC__
13# if __GNUC__ >= 4
14# define EAPI __attribute__ ((visibility("default")))
15# else /* if __GNUC__ >= 4 */
16# define EAPI
17# endif /* if __GNUC__ >= 4 */
18#else /* ifdef __GNUC__ */
19# define EAPI
20#endif /* ifdef __GNUC__ */
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* ifdef __cplusplus */
25
26EAPI extern int ECORE_DIRECTFB_EVENT_POSITION;
27EAPI extern int ECORE_DIRECTFB_EVENT_SIZE;
28EAPI extern int ECORE_DIRECTFB_EVENT_CLOSE;
29EAPI extern int ECORE_DIRECTFB_EVENT_DESTROYED;
30EAPI extern int ECORE_DIRECTFB_EVENT_GOT_FOCUS;
31EAPI extern int ECORE_DIRECTFB_EVENT_LOST_FOCUS;
32EAPI extern int ECORE_DIRECTFB_EVENT_KEY_DOWN;
33EAPI extern int ECORE_DIRECTFB_EVENT_KEY_UP;
34EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_DOWN;
35EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_UP;
36EAPI extern int ECORE_DIRECTFB_EVENT_MOTION;
37EAPI extern int ECORE_DIRECTFB_EVENT_ENTER;
38EAPI extern int ECORE_DIRECTFB_EVENT_LEAVE;
39EAPI extern int ECORE_DIRECTFB_EVENT_WHEEL;
40
41#ifndef _ECORE_DIRECTFB_WINDOW_PREDEF
42typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
43#endif /* ifndef _ECORE_DIRECTFB_WINDOW_PREDEF */
44typedef struct _Ecore_DirectFB_Cursor Ecore_DirectFB_Cursor;
45
46typedef struct _Ecore_DirectFB_Event_Key_Down Ecore_DirectFB_Event_Key_Down;
47typedef struct _Ecore_DirectFB_Event_Key_Up Ecore_DirectFB_Event_Key_Up;
48typedef struct _Ecore_DirectFB_Event_Button_Down Ecore_DirectFB_Event_Button_Down;
49typedef struct _Ecore_DirectFB_Event_Button_Up Ecore_DirectFB_Event_Button_Up;
50typedef struct _Ecore_DirectFB_Event_Motion Ecore_DirectFB_Event_Motion;
51typedef struct _Ecore_DirectFB_Event_Enter Ecore_DirectFB_Event_Enter;
52typedef struct _Ecore_DirectFB_Event_Leave Ecore_DirectFB_Event_Leave;
53typedef struct _Ecore_DirectFB_Event_Wheel Ecore_DirectFB_Event_Wheel;
54typedef struct _Ecore_DirectFB_Event_Got_Focus Ecore_DirectFB_Event_Got_Focus;
55typedef struct _Ecore_DirectFB_Event_Lost_Focus Ecore_DirectFB_Event_Lost_Focus;
56
57/* this struct is to keep windows data (id, window itself and surface) in memory as every call
58 * to DirectFB for this values (e.g window->GetSurface(window,&surface)) will increment the
59 * reference count, then we will have to release N times the data, so better we just ask for
60 them once */
61struct _Ecore_DirectFB_Window
62{
63 DFBWindowID id;
64 IDirectFBWindow *window;
65 IDirectFBSurface *surface;
66 Ecore_DirectFB_Cursor *cursor;
67};
68
69struct _Ecore_DirectFB_Cursor
70{
71 IDirectFBSurface *surface;
72 int hot_x;
73 int hot_y;
74};
75
76struct _Ecore_DirectFB_Event_Key_Down /** DirectFB Key Down event */
77{
78 char *name; /**< The name of the key that was released */
79 char *string; /**< The logical symbol of the key that was pressed */
80 char *key_compose; /**< The UTF-8 string conversion if any */
81 unsigned int time;
82 DFBWindowID win;
83};
84
85struct _Ecore_DirectFB_Event_Key_Up /** DirectFB Key Up event */
86{
87 char *name; /**< The name of the key that was released */
88 char *string; /**< The logical symbol of the key that was pressed */
89 char *key_compose; /**< The UTF-8 string conversion if any */
90 unsigned int time;
91 DFBWindowID win;
92};
93
94struct _Ecore_DirectFB_Event_Button_Down
95{
96 int button;
97 int modifiers;
98 int x, y;
99 unsigned int time;
100 int double_click : 1;
101 int triple_click : 1;
102 DFBWindowID win;
103};
104struct _Ecore_DirectFB_Event_Button_Up
105{
106 int button;
107 int modifiers;
108 int x, y;
109 unsigned int time;
110 DFBWindowID win;
111 int double_click : 1;
112 int triple_click : 1;
113};
114struct _Ecore_DirectFB_Event_Motion
115{
116 int modifiers;
117 int x, y;
118 unsigned int time;
119 DFBWindowID win;
120};
121
122struct _Ecore_DirectFB_Event_Enter
123{
124 int modifiers;
125 int x, y;
126 unsigned int time;
127 DFBWindowID win;
128};
129
130struct _Ecore_DirectFB_Event_Leave
131{
132 int modifiers;
133 int x, y;
134 unsigned int time;
135 DFBWindowID win;
136};
137
138struct _Ecore_DirectFB_Event_Wheel
139{
140 int direction;
141 int z;
142 int modifiers;
143 unsigned int time;
144 DFBWindowID win;
145};
146
147struct _Ecore_DirectFB_Event_Got_Focus
148{
149 unsigned int time;
150 DFBWindowID win;
151};
152
153struct _Ecore_DirectFB_Event_Lost_Focus
154{
155 unsigned int time;
156 DFBWindowID win;
157};
158
159/* main functions */
160EAPI int ecore_directfb_init(const char *name);
161EAPI int ecore_directfb_shutdown(void);
162EAPI IDirectFB * ecore_directfb_interface_get(void);
163
164/* window operations */
165EAPI Ecore_DirectFB_Window *ecore_directfb_window_new(int x, int y, int w, int h);
166EAPI void ecore_directfb_window_free(Ecore_DirectFB_Window *window);
167EAPI void ecore_directfb_window_move(Ecore_DirectFB_Window *window, int x, int y);
168EAPI void ecore_directfb_window_resize(Ecore_DirectFB_Window *window, int w, int h);
169EAPI void ecore_directfb_window_focus(Ecore_DirectFB_Window *window);
170EAPI void ecore_directfb_window_show(Ecore_DirectFB_Window *window);
171EAPI void ecore_directfb_window_hide(Ecore_DirectFB_Window *window);
172EAPI void ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *window, Eina_Bool set);
173EAPI void ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *window, Eina_Bool set);
174EAPI void ecore_directfb_window_size_get(Ecore_DirectFB_Window *window, int *w, int *h);
175EAPI void ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *window, Eina_Bool show);
176
177#ifdef __cplusplus
178}
179#endif /* ifdef __cplusplus */
180
181#endif /* ifndef _ECORE_DIRECTFB_H */
diff --git a/src/lib/ecore_directfb/ecore_directfb.c b/src/lib/ecore_directfb/ecore_directfb.c
deleted file mode 100644
index 008fa1d..0000000
--- a/src/lib/ecore_directfb/ecore_directfb.c
+++ /dev/null
@@ -1,758 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif /* ifdef HAVE_CONFIG_H */
4
5#include <stdio.h>
6#include <string.h>
7#include <unistd.h>
8
9#include "Ecore_DirectFB.h"
10#include "ecore_directfb_private.h"
11#include "ecore_directfb_keys.h"
12#include "Ecore.h"
13#include "ecore_private.h"
14
15/* ecore_directfb */
16/******************/
17/* About */
18/* with this you can create windows of directfb and handle events through ecore
19 * TODO:
20 * - handle all event types
21 * -
22 * */
23int _ecore_directfb_log_dom = -1;
24
25static int _ecore_directfb_init_count = 0;
26
27static int _window_event_fd = 0;
28static int _input_event_fd = 0;
29
30static int _ecore_directfb_fullscreen_window_id = 0;
31static int _cursor_x = 0;
32static int _cursor_y = 0;
33
34EAPI int ECORE_DIRECTFB_EVENT_POSITION = 0;
35EAPI int ECORE_DIRECTFB_EVENT_SIZE = 0;
36EAPI int ECORE_DIRECTFB_EVENT_CLOSE = 0;
37EAPI int ECORE_DIRECTFB_EVENT_DESTROYED = 0;
38EAPI int ECORE_DIRECTFB_EVENT_GOT_FOCUS = 0;
39EAPI int ECORE_DIRECTFB_EVENT_LOST_FOCUS = 0;
40EAPI int ECORE_DIRECTFB_EVENT_KEY_DOWN = 0;
41EAPI int ECORE_DIRECTFB_EVENT_KEY_UP = 0;
42EAPI int ECORE_DIRECTFB_EVENT_BUTTON_DOWN = 0;
43EAPI int ECORE_DIRECTFB_EVENT_BUTTON_UP = 0;
44EAPI int ECORE_DIRECTFB_EVENT_MOTION = 0;
45EAPI int ECORE_DIRECTFB_EVENT_ENTER = 0;
46EAPI int ECORE_DIRECTFB_EVENT_LEAVE = 0;
47EAPI int ECORE_DIRECTFB_EVENT_WHEEL = 0;
48
49static Ecore_Fd_Handler *_window_event_fd_handler_handle = NULL;
50static Ecore_Fd_Handler *_input_event_fd_handler_handle = NULL;
51
52/* this hash is to store all the possible key names for fast lookup */
53static Eina_Hash *_ecore_directfb_key_symbols_hash = NULL;
54
55static IDirectFB *_dfb = NULL; // the main interface
56static IDirectFBEventBuffer *_window_event; // the main event buffer (all windows are attached to this)
57static IDirectFBEventBuffer *_input_event; // the main event buffer (all windows are attached to this)
58static IDirectFBDisplayLayer *_layer; // the main layer
59static DFBResult _err; // useful for DFBCHECK
60
61/*******************/
62/* local functions */
63/*******************/
64
65/* free ecore directfb events functions */
66/****************************************/
67
68static void
69_ecore_directfb_event_free_key_down(void *data EINA_UNUSED, void *ev)
70{
71 Ecore_DirectFB_Event_Key_Down *e;
72
73 e = ev;
74 if(e->name)
75 free(e->name);
76
77 if (e->string)
78 free(e->string);
79
80 if (e->key_compose)
81 free(e->key_compose);
82
83 free(e);
84}
85
86static void
87_ecore_directfb_event_free_key_up(void *data EINA_UNUSED, void *ev)
88{
89 Ecore_DirectFB_Event_Key_Up *e;
90
91 e = ev;
92 if(e->name)
93 free(e->name);
94
95 if (e->string)
96 free(e->string);
97
98 if (e->key_compose)
99 free(e->key_compose);
100
101 free(e);
102}
103
104/* directfb window input events handler */
105/****************************************/
106
107static void
108_ecore_directfb_event_handle_motion(DFBEvent *evt)
109{
110 Ecore_DirectFB_Event_Motion *e;
111 e = calloc(1, sizeof(Ecore_DirectFB_Event_Motion));
112
113 switch(evt->clazz)
114 {
115 case DFEC_INPUT:
116 e->modifiers = 0;
117 switch(evt->input.axis)
118 {
119 case DIAI_X:
120 e->x = _cursor_x = evt->input.axisabs;
121 e->y = _cursor_y;
122 break;
123
124 case DIAI_Y:
125 e->y = _cursor_y = evt->input.axisabs;
126 e->x = _cursor_x;
127 break;
128
129 case DIAI_Z:
130 //_ecore_directfb_event_handle_wheel(evt);
131 return;
132
133 default:
134 return;
135 }
136 e->win = _ecore_directfb_fullscreen_window_id;
137 e->time = 0;
138 break;
139
140 case DFEC_WINDOW:
141 e->modifiers = 0;
142 e->x = evt->window.x;
143 e->y = evt->window.y;
144 e->win = evt->window.window_id;
145 e->time = 0;
146 break;
147
148 default:
149 break;
150 }
151 ecore_event_add(ECORE_DIRECTFB_EVENT_MOTION, e, NULL, NULL);
152}
153
154static void
155_ecore_directfb_event_handle_key_down(DFBEvent *evt)
156{
157 Ecore_DirectFB_Event_Key_Down *e;
158 unsigned int key_symbol;
159 struct keymap *k;
160
161 e = calloc(1, sizeof(Ecore_DirectFB_Event_Key_Down));
162
163 switch(evt->clazz)
164 {
165 case DFEC_INPUT:
166 key_symbol = evt->input.key_symbol;
167 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
168
169 if(!k)
170 {
171 ERR("Symbol %0X of class DFEC_INPUT not found.", evt->input.key_symbol);
172 return;
173 }
174
175 e->name = strdup(k->name);
176 e->string = strdup(k->string);
177 e->key_compose = NULL;
178 e->win = _ecore_directfb_fullscreen_window_id;
179 e->time = 0;
180 break;
181
182 case DFEC_WINDOW:
183 key_symbol = evt->window.key_symbol;
184 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
185
186 if(!k)
187 {
188 ERR("Symbol %0X of class DFEC_WINDOW not found.", evt->window.key_symbol);
189 return;
190 }
191
192 e->name = strdup(k->name);
193 e->string = strdup(k->string);
194 e->key_compose = NULL;
195 e->win = evt->window.window_id;
196 e->time = 0;
197 break;
198
199 default:
200 break;
201 }
202
203 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, e, _ecore_directfb_event_free_key_down, NULL);
204}
205
206static void
207_ecore_directfb_event_handle_key_up(DFBEvent *evt)
208{
209 Ecore_DirectFB_Event_Key_Up *e;
210 unsigned int key_symbol;
211 struct keymap *k;
212
213 e = calloc(1, sizeof(Ecore_DirectFB_Event_Key_Up));
214
215 switch(evt->clazz)
216 {
217 case DFEC_INPUT:
218 key_symbol = evt->input.key_symbol;
219 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
220
221 if(!k)
222 {
223 ERR("Symbol %0X of class DFEC_INPUT not found.", evt->input.key_symbol);
224 return;
225 }
226
227 e->name = strdup(k->name);
228 e->string = strdup(k->string);
229 e->key_compose = NULL;
230 e->win = _ecore_directfb_fullscreen_window_id;
231 e->time = 0;
232 break;
233
234 case DFEC_WINDOW:
235 key_symbol = evt->window.key_symbol;
236 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
237
238 if(!k)
239 {
240 ERR("Symbol %0X of class DFEC_WINDOW not found.", evt->window.key_symbol);
241 return;
242 }
243
244 e->name = strdup(k->name);
245 e->string = strdup(k->string);
246 e->key_compose = NULL;
247 e->win = evt->window.window_id;
248 e->time = 0;
249 break;
250
251 default:
252 break;
253 }
254 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_UP, e, _ecore_directfb_event_free_key_up, NULL);
255}
256
257static void
258_ecore_directfb_event_handle_button_down(DFBEvent *evt)
259{
260 Ecore_DirectFB_Event_Button_Down *e;
261 e = calloc(1, sizeof(Ecore_DirectFB_Event_Button_Down));
262
263 switch(evt->clazz)
264 {
265 case DFEC_INPUT:
266 e->button = evt->input.button + 1;
267 e->modifiers = 0;
268 DFBCHECK(_layer->GetCursorPosition(_layer,&e->x,&e->y));
269 e->x = _cursor_x;
270 e->y = _cursor_y;
271 e->win = _ecore_directfb_fullscreen_window_id;
272 e->time = 0;
273
274 break;
275
276 case DFEC_WINDOW:
277 e->button = evt->window.button + 1;
278 e->modifiers = 0;
279 e->x = evt->window.x;
280 e->y = evt->window.y;
281 e->win = evt->window.window_id;
282 e->time = 0;
283 break;
284
285 default:
286 break;
287 }
288
289 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, e, NULL, NULL);
290}
291
292static void
293_ecore_directfb_event_handle_button_up(DFBEvent *evt)
294{
295 Ecore_DirectFB_Event_Button_Up *e;
296 e = calloc(1, sizeof(Ecore_DirectFB_Event_Button_Up));
297
298 switch(evt->clazz)
299 {
300 case DFEC_INPUT:
301 e->button = evt->input.button + 1;
302 e->modifiers = 0;
303 e->x = _cursor_x;
304 e->y = _cursor_y;
305 e->win = _ecore_directfb_fullscreen_window_id;
306 e->time = 0;
307
308 break;
309
310 case DFEC_WINDOW:
311 e->button = evt->window.button + 1;
312 e->modifiers = 0;
313 e->x = evt->window.x;
314 e->y = evt->window.y;
315 e->win = evt->window.window_id;
316 e->time = 0;
317 break;
318
319 default:
320 break;
321 }
322 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, e, NULL, NULL);
323}
324
325static void
326_ecore_directfb_event_handle_enter(DFBWindowEvent *evt)
327{
328 Ecore_DirectFB_Event_Enter *e;
329 e = calloc(1, sizeof(Ecore_DirectFB_Event_Enter));
330
331 e->modifiers = 0;
332 e->x = evt->x;
333 e->y = evt->y;
334 e->win = evt->window_id;
335 e->time = 0;
336
337 ecore_event_add(ECORE_DIRECTFB_EVENT_ENTER, e, NULL, NULL);
338}
339
340static void
341_ecore_directfb_event_handle_leave(DFBWindowEvent *evt)
342{
343 Ecore_DirectFB_Event_Leave *e;
344 e = calloc(1, sizeof(Ecore_DirectFB_Event_Leave));
345
346 e->modifiers = 0;
347 e->x = evt->x;
348 e->y = evt->y;
349 e->win = evt->window_id;
350 e->time = 0;
351
352 ecore_event_add(ECORE_DIRECTFB_EVENT_LEAVE, e, NULL, NULL);
353}
354
355static void
356_ecore_directfb_event_handle_wheel(DFBWindowEvent *evt)
357{
358 Ecore_DirectFB_Event_Wheel *e;
359 e = calloc(1, sizeof(Ecore_DirectFB_Event_Wheel));
360
361 // currently there's no direction (only up/down);
362 e->direction = 0;
363 e->z = evt->step;
364 e->modifiers = 0;
365 e->win = evt->window_id;
366 e->time = 0;
367
368 ecore_event_add(ECORE_DIRECTFB_EVENT_WHEEL, e, NULL, NULL);
369}
370
371static void
372_ecore_directfb_event_handle_got_focus(DFBWindowEvent *evt)
373{
374 Ecore_DirectFB_Event_Got_Focus *e;
375 e = calloc(1, sizeof(Ecore_DirectFB_Event_Got_Focus));
376
377 e->win = evt->window_id;
378 e->time = 0;
379
380 ecore_event_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, e, NULL, NULL);
381}
382
383static void
384_ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt)
385{
386 Ecore_DirectFB_Event_Lost_Focus *e;
387 e = calloc(1, sizeof(Ecore_DirectFB_Event_Lost_Focus));
388
389 e->win = evt->window_id;
390 e->time = 0;
391
392 ecore_event_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, e, NULL, NULL);
393}
394
395/* inputs and windows fds handlers */
396/***********************************/
397/* TODO fix this to handle windows and input events (fullscreen/window mode)
398 * in fullscreen theres no window_id so get the id from a global var (only one fullscreen
399 * window at a time */
400
401static Eina_Bool
402_ecore_directfb_input_event_fd_handler(void *data EINA_UNUSED,Ecore_Fd_Handler *fd_handler EINA_UNUSED)
403{
404 DFBEvent evt;
405 int v = 0;
406
407 v = read(_input_event_fd, &evt, sizeof(DFBEvent));
408 if (v < 0)
409 return EINA_TRUE;
410
411 if (v < 1)
412 return EINA_TRUE;
413
414 /* we are getting duplicate events, only parse if we are in fullscreen */
415 //if(_ecore_directfb_fullscreen_window_id == 0) break;
416 if(evt.input.type == DIET_KEYPRESS)
417 _ecore_directfb_event_handle_key_down(&evt);
418
419 if(evt.input.type == DIET_KEYRELEASE)
420 _ecore_directfb_event_handle_key_up(&evt);
421
422 if(evt.input.type == DIET_BUTTONPRESS)
423 _ecore_directfb_event_handle_button_down(&evt);
424
425 if(evt.input.type == DIET_BUTTONRELEASE)
426 _ecore_directfb_event_handle_button_up(&evt);
427
428 if(evt.input.type == DIET_AXISMOTION)
429 _ecore_directfb_event_handle_motion(&evt);
430
431 return EINA_TRUE;
432}
433
434static Eina_Bool
435_ecore_directfb_window_event_fd_handler(void *data EINA_UNUSED,Ecore_Fd_Handler *fd_handler EINA_UNUSED)
436{
437 DFBEvent evt;
438 int v = 0;
439
440 v = read(_window_event_fd, &evt, sizeof(DFBEvent));
441 if (v < 0)
442 return EINA_TRUE;
443
444 if (v < 1)
445 return EINA_TRUE;
446
447 if(evt.window.type & DWET_POSITION)
448 INF("position");
449
450 if(evt.window.type & DWET_SIZE)
451 INF("size");
452
453 if(evt.window.type & DWET_CLOSE)
454 INF("close");
455
456 if(evt.window.type & DWET_DESTROYED)
457 INF("destroyed");
458
459 if(evt.window.type & DWET_GOTFOCUS)
460 _ecore_directfb_event_handle_got_focus(&evt.window);
461
462 if(evt.window.type & DWET_LOSTFOCUS)
463 _ecore_directfb_event_handle_lost_focus(&evt.window);
464
465 if(evt.window.type & DWET_KEYDOWN)
466 _ecore_directfb_event_handle_key_down(&evt);
467
468 if(evt.window.type & DWET_KEYUP)
469 _ecore_directfb_event_handle_key_up(&evt);
470
471 if(evt.window.type & DWET_BUTTONDOWN)
472 _ecore_directfb_event_handle_button_down(&evt);
473
474 if(evt.window.type & DWET_BUTTONUP)
475 _ecore_directfb_event_handle_button_up(&evt);
476
477 if(evt.window.type & DWET_MOTION)
478 _ecore_directfb_event_handle_motion(&evt);
479
480 if(evt.window.type & DWET_ENTER)
481 _ecore_directfb_event_handle_enter(&evt.window);
482
483 if(evt.window.type & DWET_LEAVE)
484 _ecore_directfb_event_handle_leave(&evt.window);
485
486 if(evt.window.type & DWET_WHEEL)
487 _ecore_directfb_event_handle_wheel(&evt.window);
488
489 return EINA_TRUE;
490}
491
492/* api functions */
493/*****************/
494
495EAPI IDirectFB *
496ecore_directfb_interface_get(void)
497{
498 return _dfb;
499}
500
501EAPI Ecore_DirectFB_Window *
502ecore_directfb_window_new(int x, int y, int w, int h)
503{
504 Ecore_DirectFB_Window *window;
505 IDirectFBWindow *dfb_window;
506 IDirectFBSurface *dfb_surface = NULL;
507 DFBWindowDescription desc;
508 DFBWindowID id;
509
510 memset(&desc, 0, sizeof(DFBWindowDescription));
511 desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS);
512 desc.posx = x;
513 desc.posy = y;
514 desc.width = w;
515 desc.height = h;
516 desc.caps = DWCAPS_ALPHACHANNEL;
517
518 DFBCHECK(_layer->CreateWindow(_layer, &desc, &dfb_window));
519
520 dfb_window->AttachEventBuffer(dfb_window, _window_event);
521 dfb_window->SetOptions(dfb_window,DWOP_NONE);
522 dfb_window->SetOpacity(dfb_window, 0xFF);
523
524 DFBCHECK(dfb_window->GetID(dfb_window, &id));
525 DFBCHECK(dfb_window->GetSurface(dfb_window,&dfb_surface));
526
527 window = malloc(sizeof(Ecore_DirectFB_Window));
528 window->id = id;
529 window->window = dfb_window;
530 window->surface = dfb_surface;
531 window->cursor = NULL;
532
533 return window;
534}
535
536EAPI void
537ecore_directfb_window_free(Ecore_DirectFB_Window *ecore_window)
538{
539 DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
540 DFBCHECK(ecore_window->window->Release(ecore_window->window));
541 free(ecore_window);
542}
543
544EAPI void
545ecore_directfb_window_move(Ecore_DirectFB_Window *ecore_window, int x, int y)
546{
547 DFBCHECK(ecore_window->window->MoveTo(ecore_window->window, x, y));
548}
549
550EAPI void
551ecore_directfb_window_resize(Ecore_DirectFB_Window *ecore_window, int w, int h)
552{
553 DFBCHECK(ecore_window->window->Resize(ecore_window->window, w, h));
554}
555
556EAPI void
557ecore_directfb_window_focus(Ecore_DirectFB_Window *ecore_window)
558{
559 DFBCHECK(ecore_window->window->RequestFocus(ecore_window->window));
560}
561
562EAPI void
563ecore_directfb_window_hide(Ecore_DirectFB_Window *ecore_window)
564{
565 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0));
566}
567
568EAPI void
569ecore_directfb_window_show(Ecore_DirectFB_Window *ecore_window)
570{
571 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0xFF));
572}
573
574EAPI void
575ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool set)
576{
577 DFBWindowOptions opts;
578
579 DFBCHECK(ecore_window->window->GetOptions(ecore_window->window, &opts));
580 if(set)
581 {
582 opts |= DWOP_SHAPED;
583 opts |= DWOP_ALPHACHANNEL;
584 DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
585 }
586 else
587 {
588 opts &= ~DWOP_SHAPED;
589 opts &= ~DWOP_ALPHACHANNEL;
590 DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
591 }
592}
593
594EAPI void
595ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *ecore_window, Eina_Bool show)
596{
597 if(!show)
598 {
599 /* create an empty cursor and set it */
600 IDirectFBSurface *cursor;
601 DFBSurfaceDescription desc;
602
603 memset(&desc, 0, sizeof(DFBSurfaceDescription));
604 desc.flags = (DSDESC_HEIGHT | DSDESC_WIDTH | DSDESC_PIXELFORMAT);
605 desc.width = 1;
606 desc.height = 1;
607 desc.pixelformat = DSPF_A1;
608
609 DFBCHECK(_dfb->CreateSurface(_dfb,&desc,&cursor));
610 DFBCHECK(cursor->Clear(cursor,0,0,0,0));
611 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor, 0, 0));
612 }
613 else
614 {
615 /* we already have a cursor surface so set it*/
616 if(ecore_window->cursor)
617 {
618 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, ecore_window->cursor->surface, ecore_window->cursor->hot_x, ecore_window->cursor->hot_y));
619 }
620 /* or just set the default directfb cursor */
621 else
622 {
623 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
624 }
625 }
626}
627
628EAPI void
629ecore_directfb_window_cursor_set(Ecore_DirectFB_Window *ecore_window, Ecore_DirectFB_Cursor *cursor)
630{
631 if((!cursor) && (ecore_window->cursor))
632 {
633 ecore_window->cursor = NULL;
634 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
635 return;
636 }
637
638 if(cursor)
639 {
640 ecore_window->cursor = cursor;
641 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor->surface, cursor->hot_x, cursor->hot_y));
642 }
643}
644
645EAPI void
646ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool on)
647{
648 // always release the surface (we are going to get a new one in both cases)
649 DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
650 if(on)
651 {
652 DFBCHECK(_layer->SetCooperativeLevel(_layer,DLSCL_EXCLUSIVE));
653 DFBCHECK(_layer->GetSurface(_layer,&ecore_window->surface));
654 DFBCHECK(_dfb->CreateInputEventBuffer(_dfb, DICAPS_ALL, DFB_FALSE, &_input_event));
655 DFBCHECK(_input_event->CreateFileDescriptor(_input_event,&_input_event_fd));
656 /* the event of axismove sends one axis at a time, so we must store both */
657 DFBCHECK(_layer->GetCursorPosition(_layer,&_cursor_x,&_cursor_y));
658
659 _input_event_fd_handler_handle = ecore_main_fd_handler_add(_input_event_fd,ECORE_FD_READ,_ecore_directfb_input_event_fd_handler, NULL,NULL,NULL);
660 _ecore_directfb_fullscreen_window_id = ecore_window->id;
661 }
662 else
663 {
664 ecore_main_fd_handler_del(_input_event_fd_handler_handle);
665 DFBCHECK(_input_event->Release(_input_event));
666 DFBCHECK(_layer->SetCooperativeLevel(_layer,DLSCL_SHARED));
667 DFBCHECK(ecore_window->window->GetSurface(ecore_window->window, &ecore_window->surface));
668 _ecore_directfb_fullscreen_window_id = 0;
669 }
670}
671
672EAPI void
673ecore_directfb_window_size_get(Ecore_DirectFB_Window *ecore_window, int *w, int *h)
674{
675 DFBCHECK(ecore_window->surface->GetSize(ecore_window->surface,w,h));
676 return;
677}
678
679EAPI int
680ecore_directfb_init(const char *name EINA_UNUSED)
681{
682 int i = 0;
683
684 if (++_ecore_directfb_init_count != 1)
685 return _ecore_directfb_init_count;
686
687 _ecore_directfb_log_dom = eina_log_domain_register
688 ("ecore_directfb", ECORE_DIRECTFB_DEFAULT_LOG_COLOR);
689 if(_ecore_directfb_log_dom < 0)
690 {
691 EINA_LOG_ERR("Impossible to create a log domain for the Ecore directFB module.");
692 return _ecore_directfb_init_count--;
693 }
694
695 DFBCHECK(DirectFBInit(NULL,NULL));
696 DFBCHECK(DirectFBCreate(&_dfb));
697
698 DFBCHECK(_dfb->GetDisplayLayer(_dfb, DLID_PRIMARY, &_layer));
699 DFBCHECK(_layer->SetCooperativeLevel(_layer, DLSCL_SHARED));
700
701 /* window events and fd */
702 DFBCHECK(_dfb->CreateEventBuffer(_dfb, &_window_event));
703 DFBCHECK(_window_event->CreateFileDescriptor(_window_event,&_window_event_fd));
704 _window_event_fd_handler_handle = ecore_main_fd_handler_add(_window_event_fd,ECORE_FD_READ,_ecore_directfb_window_event_fd_handler, NULL,NULL,NULL);
705
706 /* register ecore directfb events */
707 ECORE_DIRECTFB_EVENT_POSITION = ecore_event_type_new();
708 ECORE_DIRECTFB_EVENT_SIZE = ecore_event_type_new();
709 ECORE_DIRECTFB_EVENT_CLOSE = ecore_event_type_new();
710 ECORE_DIRECTFB_EVENT_DESTROYED = ecore_event_type_new();
711 ECORE_DIRECTFB_EVENT_GOT_FOCUS = ecore_event_type_new();
712 ECORE_DIRECTFB_EVENT_LOST_FOCUS = ecore_event_type_new();
713 ECORE_DIRECTFB_EVENT_KEY_DOWN = ecore_event_type_new();
714 ECORE_DIRECTFB_EVENT_KEY_UP = ecore_event_type_new();
715 ECORE_DIRECTFB_EVENT_BUTTON_DOWN = ecore_event_type_new();
716 ECORE_DIRECTFB_EVENT_BUTTON_UP = ecore_event_type_new();
717 ECORE_DIRECTFB_EVENT_MOTION = ecore_event_type_new();
718 ECORE_DIRECTFB_EVENT_ENTER = ecore_event_type_new();
719 ECORE_DIRECTFB_EVENT_LEAVE = ecore_event_type_new();
720 ECORE_DIRECTFB_EVENT_WHEEL = ecore_event_type_new();
721
722 /* create the hash table for the keynames */
723 _ecore_directfb_key_symbols_hash = eina_hash_int32_new(free);
724 for(i = 0; i < _ecore_directfb_key_symbols_count; i++)
725 {
726 struct keymap *k;
727 k = malloc(sizeof(struct keymap));
728 k->name = _ecore_directfb_key_symbols[i].name;
729 k->string = _ecore_directfb_key_symbols[i].string;
730 eina_hash_add(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id, k);
731 }
732 /* create the hash for the windows(key = windowid, val = Ecore_DirectFB_Window struct) */
733 return _ecore_directfb_init_count;
734}
735
736EAPI int
737ecore_directfb_shutdown(void)
738{
739 if (--_ecore_directfb_init_count != 0)
740 return _ecore_directfb_init_count;
741
742 ecore_main_fd_handler_del(_window_event_fd_handler_handle);
743 eina_hash_free(_ecore_directfb_key_symbols_hash);
744
745 if(_ecore_directfb_fullscreen_window_id)
746 {
747 DFBCHECK(_input_event->Release(_input_event));
748 ecore_main_fd_handler_del(_input_event_fd_handler_handle);
749 }
750
751 DFBCHECK(_window_event->Release(_window_event));
752 DFBCHECK(_layer->Release(_layer));
753 DFBCHECK(_dfb->Release(_dfb));
754 eina_log_domain_unregister(_ecore_directfb_log_dom);
755 _ecore_directfb_log_dom = -1;
756 return _ecore_directfb_init_count;
757}
758
diff --git a/src/lib/ecore_directfb/ecore_directfb_keys.h b/src/lib/ecore_directfb/ecore_directfb_keys.h
deleted file mode 100644
index 19cca46..0000000
--- a/src/lib/ecore_directfb/ecore_directfb_keys.h
+++ /dev/null
@@ -1,184 +0,0 @@
1typedef struct _Ecore_DirectFB_Key_Symbols Ecore_DirectFB_Key_Symbols;
2struct _Ecore_DirectFB_Key_Symbols
3{
4 char *string;
5 char *name;
6 unsigned int id;
7};
8
9static const Ecore_DirectFB_Key_Symbols _ecore_directfb_key_symbols[] = {
10 {"\010", "BackSpace",DIKS_BACKSPACE},
11 {"\011", "Tab", DIKS_TAB},
12 {"\015", "Return", DIKS_RETURN},
13 {"", "Cancel", DIKS_CANCEL},
14 {"", "Escape", DIKS_ESCAPE},
15 {" ", "space", DIKS_SPACE},
16 {"!", "exclam", DIKS_EXCLAMATION_MARK},
17 {"\"", "quotedbl", DIKS_QUOTATION},
18 {"#", "numbersign", DIKS_NUMBER_SIGN},
19 {"$", "dollar", DIKS_DOLLAR_SIGN},
20 {"%", "percent", DIKS_PERCENT_SIGN},
21 {"&", "ampersand", DIKS_AMPERSAND},
22 {"'", "apostrophe", DIKS_APOSTROPHE},
23 {"(", "parenleft", DIKS_PARENTHESIS_LEFT},
24 {")", "parenright", DIKS_PARENTHESIS_RIGHT},
25 {"*", "asterisk", DIKS_ASTERISK},
26 {"+", "plus", DIKS_PLUS_SIGN},
27 {",", "comma", DIKS_COMMA},
28 {"-", "minus", DIKS_MINUS_SIGN},
29 {".", "period", DIKS_PERIOD},
30 {"/", "slash", DIKS_SLASH},
31 {"0", "0", DIKS_0},
32 {"1", "1", DIKS_1},
33 {"2", "2", DIKS_2},
34 {"3", "3", DIKS_3},
35 {"4", "4", DIKS_4},
36 {"5", "5", DIKS_5},
37 {"6", "6", DIKS_6},
38 {"7", "7", DIKS_7},
39 {"8", "8", DIKS_8},
40 {"9", "9", DIKS_9},
41 {":", "colon", DIKS_COLON},
42 {";", "semicolon", DIKS_SEMICOLON},
43 {"<", "less", DIKS_LESS_THAN_SIGN},
44 {"=", "equal", DIKS_EQUALS_SIGN},
45 {">", "greater", DIKS_GREATER_THAN_SIGN},
46 {"?", "question", DIKS_QUESTION_MARK},
47 {"@", "at", DIKS_AT},
48 {"A", "A", DIKS_CAPITAL_A },
49 {"B", "B", DIKS_CAPITAL_B },
50 {"C", "C", DIKS_CAPITAL_C },
51 {"D", "D", DIKS_CAPITAL_D },
52 {"E", "E", DIKS_CAPITAL_E },
53 {"F", "F", DIKS_CAPITAL_F },
54 {"G", "G", DIKS_CAPITAL_G },
55 {"H", "H", DIKS_CAPITAL_H },
56 {"I", "I", DIKS_CAPITAL_I },
57 {"J", "J", DIKS_CAPITAL_J },
58 {"K", "K", DIKS_CAPITAL_K },
59 {"L", "L", DIKS_CAPITAL_L },
60 {"M", "M", DIKS_CAPITAL_M },
61 {"N", "N", DIKS_CAPITAL_N },
62 {"O", "O", DIKS_CAPITAL_O },
63 {"P", "P", DIKS_CAPITAL_P },
64 {"Q", "Q", DIKS_CAPITAL_Q },
65 {"R", "R", DIKS_CAPITAL_R },
66 {"S", "S", DIKS_CAPITAL_S },
67 {"T", "T", DIKS_CAPITAL_T },
68 {"U", "U", DIKS_CAPITAL_U },
69 {"V", "V", DIKS_CAPITAL_V },
70 {"W", "W", DIKS_CAPITAL_W },
71 {"X", "X", DIKS_CAPITAL_X },
72 {"Y", "Y", DIKS_CAPITAL_Y },
73 {"Z", "Z", DIKS_CAPITAL_Z },
74 {"[", "bracketleft", DIKS_SQUARE_BRACKET_LEFT },
75 {"\\", "backslash", DIKS_BACKSLASH },
76 {"]", "bracketright", DIKS_SQUARE_BRACKET_RIGHT },
77 {"^", "asciicircum", DIKS_CIRCUMFLEX_ACCENT },
78 {"_", "underscore", DIKS_UNDERSCORE },
79 {"`", "grave", DIKS_GRAVE_ACCENT},
80 {"a", "a", DIKS_SMALL_A },
81 {"b","b", DIKS_SMALL_B },
82 {"c","c", DIKS_SMALL_C },
83 {"d","d", DIKS_SMALL_D },
84 {"e","e", DIKS_SMALL_E },
85 {"f","f", DIKS_SMALL_F },
86 {"g","g", DIKS_SMALL_G },
87 {"h","h", DIKS_SMALL_H },
88 {"i","i", DIKS_SMALL_I },
89 {"j","j", DIKS_SMALL_J },
90 {"k","k", DIKS_SMALL_K },
91 {"l","l", DIKS_SMALL_L },
92 {"m","m", DIKS_SMALL_M },
93 {"n","n", DIKS_SMALL_N },
94 {"o", "o", DIKS_SMALL_O },
95 {"p", "p", DIKS_SMALL_P },
96 {"q", "q", DIKS_SMALL_Q },
97 {"r", "r", DIKS_SMALL_R },
98 {"s", "s", DIKS_SMALL_S },
99 {"t", "t", DIKS_SMALL_T },
100 {"u", "u", DIKS_SMALL_U },
101 {"v", "v", DIKS_SMALL_V },
102 {"w", "w", DIKS_SMALL_W },
103 {"x", "x", DIKS_SMALL_X },
104 {"y", "y", DIKS_SMALL_Y },
105 {"z", "z", DIKS_SMALL_Z },
106 {"{", "braceleft",DIKS_CURLY_BRACKET_LEFT },
107 {"|", "bar", DIKS_VERTICAL_BAR },
108 {"}", "braceright", DIKS_CURLY_BRACKET_RIGHT },
109 {"~", "asciitilde", DIKS_TILDE },
110 {"\177", "Delete", DIKS_DELETE },
111 {"", "Left", DIKS_CURSOR_LEFT },
112 {"", "Right", DIKS_CURSOR_RIGHT},
113 {"", "Up", DIKS_CURSOR_UP},
114 {"", "Down", DIKS_CURSOR_DOWN},
115 {"", "Insert", DIKS_INSERT},
116 {"", "Home", DIKS_HOME},
117 {"", "End", DIKS_END},
118 {"", "Page_Up", DIKS_PAGE_UP},
119 {"", "Page_Down", DIKS_PAGE_DOWN},
120 {"", "Print", DIKS_PRINT},
121 {"", "Pause", DIKS_PAUSE},
122 /* ok */
123 {"", "Select",DIKS_SELECT},
124 /* goto */
125 {"", "Clear", DIKS_CLEAR},
126 /* power */
127 /* power 2 */
128 /* option */
129 {"", "Menu",DIKS_MENU},
130 {"", "Help",DIKS_HELP},
131 /* info */
132 /* time */
133 /* vendor */
134 /* archive */
135 /* program */
136 /* channel */
137 /* favorites */
138 /* hasta next */
139 {"", "Next",DIKS_NEXT},
140 {"", "Begin",DIKS_BEGIN},
141 /* digits */
142 /* teen */
143 /* twen */
144 {"", "Break", DIKS_BREAK},
145 /* exit */
146 /* setup */
147 {"", "upleftcorner", DIKS_CURSOR_LEFT_UP },
148 {"", "lowleftcorner", DIKS_CURSOR_LEFT_DOWN },
149 {"", "uprightcorner", DIKS_CURSOR_UP_RIGHT },
150 {"", "lowrightcorner",DIKS_CURSOR_DOWN_RIGHT },
151 {"", "F1",DIKS_F1},
152 {"", "F2",DIKS_F2},
153 {"", "F3",DIKS_F3},
154 {"", "F4",DIKS_F4},
155 {"", "F5",DIKS_F5},
156 {"", "F6",DIKS_F6},
157 {"", "F7",DIKS_F7},
158 {"", "F8",DIKS_F8},
159 {"", "F9",DIKS_F9},
160 {"", "F10",DIKS_F10},
161 {"", "F11",DIKS_F11},
162 {"", "F12",DIKS_F12},
163 /* this are only mapped to one, not left right */
164 {"", "Shift_L", DIKS_SHIFT},
165 /*{"Shift_R",0xFFE2},*/
166 {"", "Control_L", DIKS_CONTROL},
167 /*{"Control_R",0xFFE4},*/
168 {"", "Meta_L", DIKS_META},
169 /* {"Meta_R",0xFFE8},*/
170 {"", "Alt_L", DIKS_ALT},
171 {"", "Alt_R", DIKS_ALTGR},
172 {"", "Super_L", DIKS_SUPER},
173 /*{"Super_R",0xFFEC},*/
174 {"", "Hyper_L", DIKS_HYPER},
175 /*{"Hyper_R",0xFFEE},*/
176
177 {"", "Caps_Lock", DIKS_CAPS_LOCK},
178 {"", "Num_Lock", DIKS_NUM_LOCK},
179 {"", "Scroll_Lock", DIKS_SCROLL_LOCK},
180 /* not included the dead keys */
181 /* not included the custom keys */
182 {"", "VoidSymbol", DIKS_NULL}
183};
184static int _ecore_directfb_key_symbols_count = sizeof(_ecore_directfb_key_symbols) / sizeof(Ecore_DirectFB_Key_Symbols);
diff --git a/src/lib/ecore_directfb/ecore_directfb_private.h b/src/lib/ecore_directfb/ecore_directfb_private.h
deleted file mode 100644
index ed34587..0000000
--- a/src/lib/ecore_directfb/ecore_directfb_private.h
+++ /dev/null
@@ -1,52 +0,0 @@
1#ifndef _ECORE_DIRECTFB_PRIVATE_H
2#define _ECORE_DIRECTFB_PRIVATE_H
3/* eina_log related things */
4
5extern int _ecore_directfb_log_dom;
6
7#ifdef ECORE_DIRECTFB_DEFAULT_LOG_COLOR
8#undef ECORE_DIRECTFB_DEFAULT_LOG_COLOR
9#endif /* ifdef ECORE_DIRECTFB_DEFAULT_LOG_COLOR */
10#define ECORE_DIRECTFB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
11
12#ifdef ERR
13# undef ERR
14#endif /* ifdef ERR */
15#define ERR(...) EINA_LOG_DOM_ERR(_ecore_directfb_log_dom, __VA_ARGS__)
16
17#ifdef DBG
18# undef DBG
19#endif /* ifdef DBG */
20#define DBG(...) EINA_LOG_DOM_DBG(_ecore_directfb_log_dom, __VA_ARGS__)
21
22#ifdef INF
23# undef INF
24#endif /* ifdef INF */
25#define INF(...) EINA_LOG_DOM_INFO(_ecore_directfb_log_dom, __VA_ARGS__)
26
27#ifdef WRN
28# undef WRN
29#endif /* ifdef WRN */
30#define WRN(...) EINA_LOG_DOM_WARN(_ecore_directfb_log_dom, __VA_ARGS__)
31
32#ifdef CRIT
33# undef CRIT
34#endif /* ifdef CRIT */
35#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_directfb_log_dom, __VA_ARGS__)
36
37/* macro for a safe call to DirectFB functions */
38#define DFBCHECK(x ...)\
39 {\
40 _err = x;\
41 if (_err != DFB_OK) {\
42 CRIT("%s <%d>:\n\t", __FILE__, __LINE__ );\
43 DirectFBErrorFatal( # x, _err );\
44 }\
45 }
46
47struct keymap
48{
49 char *name;
50 char *string;
51};
52#endif /* ifndef _ECORE_DIRECTFB_PRIVATE_H */
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index b701aee..01f13b6 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -93,7 +93,7 @@ extern "C" {
93#define HAVE_ECORE_EVAS_FB 1 93#define HAVE_ECORE_EVAS_FB 1
94#define HAVE_ECORE_EVAS_X11_GL 1 94#define HAVE_ECORE_EVAS_X11_GL 1
95//#define HAVE_ECORE_EVAS_X11_16 1 95//#define HAVE_ECORE_EVAS_X11_16 1
96#define HAVE_ECORE_EVAS_DIRECTFB 1 96//#define HAVE_ECORE_EVAS_DIRECTFB 1
97#define HAVE_ECORE_EVAS_WIN32 1 97#define HAVE_ECORE_EVAS_WIN32 1
98#define HAVE_ECORE_EVAS_COCOA 1 98#define HAVE_ECORE_EVAS_COCOA 1
99#define HAVE_ECORE_EVAS_SDL 1 99#define HAVE_ECORE_EVAS_SDL 1
@@ -935,8 +935,8 @@ EAPI void ecore_evas_software_x11_16_extra_event_window_add(Ecore_Eva
935 935
936EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h); 936EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
937 937
938EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h); 938EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h) EINA_DEPRECATED;
939EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee); 939EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee) EINA_DEPRECATED;
940 940
941 941
942EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame); 942EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 9a665fd..49d90fb 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -146,11 +146,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
146 return EINA_FALSE; 146 return EINA_FALSE;
147#endif 147#endif
148 case ECORE_EVAS_ENGINE_DIRECTFB: 148 case ECORE_EVAS_ENGINE_DIRECTFB:
149#ifdef BUILD_ECORE_EVAS_DIRECTFB
150 return EINA_TRUE;
151#else
152 return EINA_FALSE; 149 return EINA_FALSE;
153#endif
154 case ECORE_EVAS_ENGINE_SOFTWARE_FB: 150 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
155#ifdef BUILD_ECORE_EVAS_FB 151#ifdef BUILD_ECORE_EVAS_FB
156 return EINA_TRUE; 152 return EINA_TRUE;
@@ -304,9 +300,6 @@ ecore_evas_shutdown(void)
304#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER 300#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
305 while (_ecore_evas_buffer_shutdown()); 301 while (_ecore_evas_buffer_shutdown());
306#endif 302#endif
307#ifdef BUILD_ECORE_EVAS_DIRECTFB
308 while (_ecore_evas_directfb_shutdown());
309#endif
310 303
311 if (_ecore_evas_async_events_fd) 304 if (_ecore_evas_async_events_fd)
312 ecore_main_fd_handler_del(_ecore_evas_async_events_fd); 305 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
@@ -518,24 +511,6 @@ _ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w,
518} 511}
519#endif 512#endif
520 513
521#ifdef BUILD_ECORE_EVAS_DIRECTFB
522static Ecore_Evas *
523_ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
524{
525 Ecore_Evas *ee;
526 char *disp_name = NULL;
527 unsigned int windowed = 1;
528
529 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
530 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
531
532 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
533 free(disp_name);
534
535 return ee;
536}
537#endif
538
539#ifdef BUILD_ECORE_EVAS_FB 514#ifdef BUILD_ECORE_EVAS_FB
540static Ecore_Evas * 515static Ecore_Evas *
541_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 516_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
@@ -667,9 +642,6 @@ static const struct ecore_evas_engine _engines[] = {
667#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11 642#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
668 {"software_8_x11", _ecore_evas_constructor_software_8_x11}, 643 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
669#endif 644#endif
670#ifdef BUILD_ECORE_EVAS_DIRECTFB
671 {"directfb", _ecore_evas_constructor_directfb},
672#endif
673#ifdef BUILD_ECORE_EVAS_FB 645#ifdef BUILD_ECORE_EVAS_FB
674 {"fb", _ecore_evas_constructor_fb}, 646 {"fb", _ecore_evas_constructor_fb},
675#endif 647#endif
diff --git a/src/lib/ecore_evas/ecore_evas_directfb.c b/src/lib/ecore_evas/ecore_evas_directfb.c
index caeed21..9557d12 100644
--- a/src/lib/ecore_evas/ecore_evas_directfb.c
+++ b/src/lib/ecore_evas/ecore_evas_directfb.c
@@ -6,602 +6,22 @@
6 6
7#include <Ecore.h> 7#include <Ecore.h>
8#include "ecore_private.h" 8#include "ecore_private.h"
9#ifdef BUILD_ECORE_EVAS_DIRECTFB
10#include <Ecore_DirectFB.h>
11#endif
12 9
13#include "ecore_evas_private.h" 10#include "ecore_evas_private.h"
14#include "Ecore_Evas.h" 11#include "Ecore_Evas.h"
15 12
16#ifdef BUILD_ECORE_EVAS_DIRECTFB 13/* Ecore_Evas DirectFB support was removed. However we keep the functions
17static int _ecore_evas_init_count = 0; 14 * to not break ABI.
18static Ecore_Event_Handler *ecore_evas_event_handlers[13]; 15 */
19
20static Eina_Hash *ecore_evases_hash = NULL;
21
22static int
23_ecore_evas_directfb_render(Ecore_Evas *ee)
24{
25 Eina_List *updates, *ll;
26 Ecore_Evas *ee2;
27 int rend = 0;
28
29 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
30 {
31 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
32 if (ee2->engine.func->fn_render)
33 rend |= ee2->engine.func->fn_render(ee2);
34 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
35 }
36
37 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
38 updates = evas_render_updates(ee->evas);
39 if (updates)
40 {
41 evas_render_updates_free(updates);
42 _ecore_evas_idle_timeout_update(ee);
43 }
44 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
45
46 return updates ? 1 : rend;
47}
48
49static char *
50_ecore_evas_directfb_winid_str_get(Ecore_X_Window win)
51{
52 const char *vals = "qWeRtYuIoP5$&<~";
53 static char id[9];
54 unsigned int val;
55 val = (unsigned int)win;
56 id[0] = vals[(val >> 28) & 0xf];
57 id[1] = vals[(val >> 24) & 0xf];
58 id[2] = vals[(val >> 20) & 0xf];
59 id[3] = vals[(val >> 16) & 0xf];
60 id[4] = vals[(val >> 12) & 0xf];
61 id[5] = vals[(val >> 8) & 0xf];
62 id[6] = vals[(val >> 4) & 0xf];
63 id[7] = vals[(val ) & 0xf];
64 id[8] = 0;
65 return id;
66}
67
68static Ecore_Evas *
69_ecore_evas_directfb_match(DFBWindowID win)
70{
71 Ecore_Evas *ee;
72
73 ee = eina_hash_find(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(win));
74 return ee;
75}
76
77static Eina_Bool
78_ecore_evas_directfb_event_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
79{
80 Ecore_Evas *ee;
81 Ecore_DirectFB_Event_Key_Down *e;
82
83 e = event;
84 ee = _ecore_evas_directfb_match(e->win);
85
86 if (!ee) return EINA_TRUE; /* pass on event */
87 evas_event_feed_key_down(ee->evas, e->name, e->name, e->string,
88 e->key_compose, e->time, NULL);
89 return EINA_TRUE;
90}
91
92static Eina_Bool
93_ecore_evas_directfb_event_key_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
94{
95 Ecore_Evas *ee;
96 Ecore_DirectFB_Event_Key_Up *e;
97
98 e = event;
99 ee = _ecore_evas_directfb_match(e->win);
100
101 if (!ee) return EINA_TRUE; /* pass on event */
102 evas_event_feed_key_up(ee->evas, e->name, e->name, e->string,
103 e->key_compose, e->time, NULL);
104 return EINA_TRUE;
105}
106
107static Eina_Bool
108_ecore_evas_directfb_event_motion(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
109{
110 Ecore_Evas *ee;
111 Ecore_DirectFB_Event_Motion *e;
112
113 e = event;
114 ee = _ecore_evas_directfb_match(e->win);
115
116 if (!ee) return EINA_TRUE; /* pass on event */
117 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
118 return EINA_TRUE;
119}
120
121static Eina_Bool
122_ecore_evas_directfb_event_button_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
123{
124 Ecore_Evas *ee;
125 Ecore_DirectFB_Event_Button_Down *e;
126
127 e = event;
128 ee = _ecore_evas_directfb_match(e->win);
129
130 if (!ee) return EINA_TRUE; /* pass on event */
131 // _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
132 evas_event_feed_mouse_down(ee->evas, e->button, EVAS_BUTTON_NONE, e->time, NULL);
133 return EINA_TRUE;
134}
135
136static Eina_Bool
137_ecore_evas_directfb_event_button_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
138{
139 Ecore_Evas *ee;
140 Ecore_DirectFB_Event_Button_Up *e;
141 Evas_Button_Flags flags = EVAS_BUTTON_NONE;
142
143 e = event;
144 ee = _ecore_evas_directfb_match(e->win);
145
146 if (!ee) return EINA_TRUE; /* pass on event */
147 //_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
148 evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
149 return EINA_TRUE;
150}
151
152static Eina_Bool
153_ecore_evas_directfb_event_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
154{
155 Ecore_Evas *ee;
156 Ecore_DirectFB_Event_Enter *e;
157
158 e = event;
159 ee = _ecore_evas_directfb_match(e->win);
160
161 if (!ee) return EINA_TRUE; /* pass on event */
162 evas_event_feed_mouse_in(ee->evas, e->time, NULL);
163 //_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
164 return EINA_TRUE;
165}
166
167static Eina_Bool
168_ecore_evas_directfb_event_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
169{
170 Ecore_Evas *ee;
171 Ecore_DirectFB_Event_Leave *e;
172
173 e = event;
174 ee = _ecore_evas_directfb_match(e->win);
175
176 if (!ee) return EINA_TRUE; /* pass on event */
177 evas_event_feed_mouse_out(ee->evas, e->time, NULL);
178 //_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
179 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
180 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
181 return EINA_TRUE;
182}
183
184static Eina_Bool
185_ecore_evas_directfb_event_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
186{
187 Ecore_Evas *ee;
188 Ecore_DirectFB_Event_Wheel *e;
189
190 e = event;
191 ee = _ecore_evas_directfb_match(e->win);
192
193 if (!ee) return EINA_TRUE; /* pass on event */
194 evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->time, NULL);
195 return EINA_TRUE;
196}
197
198static Eina_Bool
199_ecore_evas_directfb_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
200{
201 Ecore_Evas *ee;
202 Ecore_DirectFB_Event_Got_Focus *e;
203
204 e = event;
205 ee = _ecore_evas_directfb_match(e->win);
206
207 if (!ee) return EINA_TRUE; /* pass on event */
208 ee->prop.focused = 1;
209 return EINA_TRUE;
210}
211
212static Eina_Bool
213_ecore_evas_directfb_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
214{
215 Ecore_Evas *ee;
216 Ecore_DirectFB_Event_Lost_Focus *e;
217
218 e = event;
219 ee = _ecore_evas_directfb_match(e->win);
220
221 if (!ee) return EINA_TRUE; /* pass on event */
222 ee->prop.focused = 0;
223 return EINA_TRUE;
224}
225
226int
227_ecore_evas_directfb_shutdown(void)
228{
229 _ecore_evas_init_count--;
230 if (_ecore_evas_init_count == 0)
231 {
232 int i;
233
234 for (i = 0; i < 8; i++)
235 ecore_event_handler_del(ecore_evas_event_handlers[i]);
236 }
237 if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
238 return _ecore_evas_init_count;
239}
240
241
242
243
244
245int
246_ecore_evas_directfb_init(void)
247{
248 _ecore_evas_init_count++;
249 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
250
251 ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, _ecore_evas_directfb_event_key_down, NULL);
252 ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_KEY_UP, _ecore_evas_directfb_event_key_up, NULL);
253 ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, _ecore_evas_directfb_event_button_down, NULL);
254 ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, _ecore_evas_directfb_event_button_up, NULL);
255 ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_MOTION, _ecore_evas_directfb_event_motion, NULL);
256 ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_ENTER, _ecore_evas_directfb_event_enter, NULL);
257 ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_LEAVE, _ecore_evas_directfb_event_leave, NULL);
258 ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_WHEEL, _ecore_evas_directfb_event_wheel, NULL);
259 ecore_evas_event_handlers[8] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, _ecore_evas_directfb_event_got_focus, NULL);
260 ecore_evas_event_handlers[9] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, _ecore_evas_directfb_event_lost_focus, NULL);
261 ecore_evas_event_handlers[10] = NULL;
262 ecore_evas_event_handlers[11] = NULL;
263 ecore_evas_event_handlers[12] = NULL;
264
265 return _ecore_evas_init_count;
266}
267
268/* engine functions */
269/********************/
270
271static void
272_ecore_evas_directfb_free(Ecore_Evas *ee)
273{
274 eina_hash_del(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
275 ecore_directfb_window_free(ee->engine.directfb.window);
276 _ecore_evas_directfb_shutdown();
277 ecore_directfb_shutdown();
278}
279
280static void
281_ecore_evas_directfb_move(Ecore_Evas *ee, int x, int y)
282{
283 ecore_directfb_window_move(ee->engine.directfb.window, x, y);
284}
285
286static void
287_ecore_evas_directfb_resize(Ecore_Evas *ee, int w, int h)
288{
289 ee->req.w = w;
290 ee->req.h = h;
291 if ((w == ee->w) && (h == ee->h)) return;
292 ecore_directfb_window_resize(ee->engine.directfb.window, w, h);
293 ee->w = w;
294 ee->h = h;
295 if ((ee->rotation == 90) || (ee->rotation == 270))
296 {
297 evas_output_size_set(ee->evas, ee->h, ee->w);
298 evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
299 }
300 else
301 {
302 evas_output_size_set(ee->evas, ee->w, ee->h);
303 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
304 }
305}
306
307static void
308_ecore_evas_directfb_focus_set(Ecore_Evas *ee, int on EINA_UNUSED)
309{
310 ecore_directfb_window_focus(ee->engine.directfb.window);
311}
312
313static void
314_ecore_evas_directfb_hide(Ecore_Evas *ee)
315{
316 ecore_directfb_window_hide(ee->engine.directfb.window);
317 ee->should_be_visible = 0;
318}
319
320static void
321_ecore_evas_directfb_show(Ecore_Evas *ee)
322{
323 ecore_directfb_window_show(ee->engine.directfb.window);
324 ee->should_be_visible = 1;
325}
326
327static void
328_ecore_evas_directfb_shaped_set(Ecore_Evas *ee, int shaped)
329{
330 if (((ee->shaped) && (shaped)) || ((!ee->shaped) && (!shaped)))
331 return;
332 ee->shaped = shaped;
333 if(ee->shaped)
334 ecore_directfb_window_shaped_set(ee->engine.directfb.window, 1);
335 else
336 ecore_directfb_window_shaped_set(ee->engine.directfb.window, 0);
337
338}
339
340static void
341_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
342{
343 Ecore_Evas *ee;
344
345 ee = data;
346 if (ee)
347 ee->prop.cursor.object = NULL;
348}
349
350static void
351_ecore_evas_directfb_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
352{
353 int x, y;
354
355 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
356
357 if (!obj)
358 {
359 ee->prop.cursor.object = NULL;
360 ee->prop.cursor.layer = 0;
361 ee->prop.cursor.hot.x = 0;
362 ee->prop.cursor.hot.y = 0;
363 ecore_directfb_window_cursor_show(ee->engine.directfb.window, 1);
364 return;
365
366 }
367
368 ee->prop.cursor.object = obj;
369 ee->prop.cursor.layer = layer;
370 ee->prop.cursor.hot.x = hot_x;
371 ee->prop.cursor.hot.y = hot_y;
372 16
373 ecore_directfb_window_cursor_show(ee->engine.directfb.window, 0);
374
375 evas_pointer_output_xy_get(ee->evas, &x, &y);
376 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
377 evas_object_move(ee->prop.cursor.object,x - ee->prop.cursor.hot.x,y - ee->prop.cursor.hot.y);
378 evas_object_pass_events_set(ee->prop.cursor.object, 1);
379 if (evas_pointer_inside_get(ee->evas))
380 evas_object_show(ee->prop.cursor.object);
381
382 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
383}
384
385static void
386_ecore_evas_directfb_fullscreen_set(Ecore_Evas *ee, int on)
387{
388 Evas_Engine_Info_DirectFB *einfo;
389 int w;
390 int h;
391 int resized = 0;
392
393 if (((ee->prop.fullscreen) && (on)) || ((!ee->prop.fullscreen) && (!on)))
394 return;
395
396 if (on)
397 ecore_directfb_window_fullscreen_set(ee->engine.directfb.window, 1);
398 else
399 ecore_directfb_window_fullscreen_set(ee->engine.directfb.window, 0);
400 /* set the new size of the evas */
401 ecore_directfb_window_size_get(ee->engine.directfb.window, &w, &h);
402 if( (ee->w != w) || (ee->h != h))
403 {
404 resized = 1;
405 ee->w = w;
406 ee->h = h;
407 ee->req.w = ee->w;
408 ee->req.h = ee->h;
409 if ((ee->rotation == 90) || (ee->rotation == 270))
410 {
411 evas_output_size_set(ee->evas, ee->h, ee->w);
412 evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
413 }
414 else
415 {
416 evas_output_size_set(ee->evas, ee->w, ee->h);
417 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
418 }
419 }
420 einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(ee->evas);
421 if (einfo)
422 {
423 einfo->info.surface = ee->engine.directfb.window->surface;
424 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
425 {
426 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
427 }
428 }
429 ee->prop.fullscreen = on;
430 if (resized)
431 {
432 if(ee->func.fn_resize) ee->func.fn_resize(ee);
433 }
434}
435
436static void *
437_ecore_evas_directfb_window_get(const Ecore_Evas *ee)
438{
439 return ee->engine.directfb.window;
440}
441#endif
442
443#ifdef BUILD_ECORE_EVAS_DIRECTFB
444static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
445{
446 _ecore_evas_directfb_free, /* free an ecore_evas */
447 NULL, /* cb resize */
448 NULL, /* cb move */
449 NULL, /* cb show */
450 NULL, /* cb hide */
451 NULL, /* cb delete request */
452 NULL, /* cb destroy */
453 NULL, /* cb focus in */
454 NULL, /* cb focus out */
455 NULL, /* cb sticky */
456 NULL, /* cb unsticky */
457 NULL, /* cb mouse in */
458 NULL, /* cb mouse out */
459 NULL, /* cb pre render */
460 NULL, /* cb post render */
461 _ecore_evas_directfb_move, /* move */
462 NULL, /* managed move */
463 _ecore_evas_directfb_resize, /* resize */
464 NULL, /* move resize */
465 NULL,//_ecore_evas_directfb_rotation_set,/* rotation */
466 _ecore_evas_directfb_shaped_set, /* shaped */
467 _ecore_evas_directfb_show, /* show */
468 _ecore_evas_directfb_hide, /* hide */
469 NULL, /* raise */
470 NULL, /* lower */
471 NULL, /* activate */
472 NULL, /* title set */
473 NULL, /* name class set */
474 NULL, /* size min */
475 NULL, /* size max */
476 NULL, /* size base */
477 NULL, /* size step */
478 _ecore_evas_directfb_object_cursor_set, /* set cursor to an evas object */
479 NULL, /* layer set */
480 _ecore_evas_directfb_focus_set, /* focus */
481 NULL, /* iconified */
482 NULL, /* borderless */
483 NULL, /* override */
484 NULL, /* maximized */
485 _ecore_evas_directfb_fullscreen_set,/* fullscreen */
486 NULL, /* avoid damage */
487 NULL, /* withdrawn */
488 NULL, /* sticky */
489 NULL, /* ignore events */
490 NULL, /* alpha */
491 NULL, //transparent
492 NULL, // profiles_set
493 NULL, // profile_set
494
495 NULL,
496 NULL,
497 NULL,
498 NULL,
499 NULL,
500 NULL,
501
502 NULL, // render
503 NULL, // screen_geometry_get
504 NULL // screen_dpi_get
505};
506#endif
507
508/* api */
509/*******/
510
511#ifdef BUILD_ECORE_EVAS_DIRECTFB
512EAPI Ecore_Evas *
513ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h)
514{
515 Evas_Engine_Info_DirectFB *einfo;
516 Ecore_Evas *ee;
517 Ecore_DirectFB_Window *window;
518 int rmethod;
519
520 rmethod = evas_render_method_lookup("directfb");
521 if (!rmethod) return NULL;
522 if (!ecore_directfb_init(disp_name)) return NULL;
523 ee = calloc(1, sizeof(Ecore_Evas));
524 if (!ee) return NULL;
525
526 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
527 _ecore_evas_directfb_init();
528 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_directfb_engine_func;
529
530 ee->driver = "directfb";
531 if (disp_name) ee->name = strdup(disp_name);
532
533 if (w < 1) w = 1;
534 if (h < 1) h = 1;
535
536 ee->rotation = 0;
537 ee->visible = 1;
538 ee->x = x;
539 ee->y = y;
540 ee->w = w;
541 ee->h = h;
542 ee->req.x = ee->x;
543 ee->req.y = ee->y;
544 ee->req.w = ee->w;
545 ee->req.h = ee->h;
546 ee->prop.layer = 1;
547 ee->prop.fullscreen = 0;
548
549 /* init evas here */
550 ee->evas = evas_new();
551 evas_data_attach_set(ee->evas, ee);
552 evas_output_method_set(ee->evas, rmethod);
553 evas_output_size_set(ee->evas, w, h);
554 evas_output_viewport_set(ee->evas, 0, 0, w, h);
555 einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(ee->evas);
556
557 window = ecore_directfb_window_new(x,y,w,h);
558 ee->engine.directfb.window = window;
559 if (einfo)
560 {
561 einfo->info.dfb = ecore_directfb_interface_get();
562 einfo->info.surface = window->surface;
563 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
564 {
565 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
566 ecore_evas_free(ee);
567 return NULL;
568 }
569 }
570 else
571 {
572 ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
573 ecore_evas_free(ee);
574 return NULL;
575 }
576
577 ee->engine.func->fn_render = _ecore_evas_directfb_render;
578 _ecore_evas_register(ee);
579
580 if (!ecore_evases_hash)
581 ecore_evases_hash = eina_hash_string_superfast_new(NULL);
582 eina_hash_add(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
583
584 return ee;
585}
586#else
587EAPI Ecore_Evas * 17EAPI Ecore_Evas *
588ecore_evas_directfb_new(const char *disp_name EINA_UNUSED, int windowed EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED) 18ecore_evas_directfb_new(const char *disp_name EINA_UNUSED, int windowed EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
589{ 19{
590 return NULL; 20 return NULL;
591} 21}
592#endif
593 22
594#ifdef BUILD_ECORE_EVAS_DIRECTFB
595EAPI Ecore_DirectFB_Window *
596ecore_evas_directfb_window_get(const Ecore_Evas *ee)
597{
598 if (!(!strcmp(ee->driver, "directfb"))) return 0;
599 return (Ecore_DirectFB_Window *) _ecore_evas_directfb_window_get(ee);
600}
601#else
602EAPI Ecore_DirectFB_Window * 23EAPI Ecore_DirectFB_Window *
603ecore_evas_directfb_window_get(const Ecore_Evas *ee EINA_UNUSED) 24ecore_evas_directfb_window_get(const Ecore_Evas *ee EINA_UNUSED)
604{ 25{
605 return NULL; 26 return NULL;
606} 27}
607#endif
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 2d9cb01..d6cff8f 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -33,11 +33,6 @@
33# include <Evas_Engine_FB.h> 33# include <Evas_Engine_FB.h>
34#endif 34#endif
35 35
36#ifdef BUILD_ECORE_EVAS_DIRECTFB
37# include <Evas_Engine_DirectFB.h>
38# include "Ecore_DirectFB.h"
39#endif
40
41#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS) 36#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
42# include <Evas_Engine_Buffer.h> 37# include <Evas_Engine_Buffer.h>
43#endif 38#endif
@@ -242,11 +237,6 @@ struct _Ecore_Evas_Engine
242 void *data; 237 void *data;
243 } buffer; 238 } buffer;
244#endif 239#endif
245#ifdef BUILD_ECORE_EVAS_DIRECTFB
246 struct {
247 Ecore_DirectFB_Window *window;
248 } directfb;
249#endif
250#ifdef BUILD_ECORE_EVAS_WIN32 240#ifdef BUILD_ECORE_EVAS_WIN32
251 struct { 241 struct {
252 Ecore_Win32_Window *parent; 242 Ecore_Win32_Window *parent;
@@ -404,9 +394,6 @@ int _ecore_evas_fb_shutdown(void);
404int _ecore_evas_buffer_shutdown(void); 394int _ecore_evas_buffer_shutdown(void);
405int _ecore_evas_buffer_render(Ecore_Evas *ee); 395int _ecore_evas_buffer_render(Ecore_Evas *ee);
406#endif 396#endif
407#ifdef BUILD_ECORE_EVAS_DIRECTFB
408int _ecore_evas_directfb_shutdown(void);
409#endif
410#ifdef BUILD_ECORE_EVAS_WIN32 397#ifdef BUILD_ECORE_EVAS_WIN32
411int _ecore_evas_win32_shutdown(void); 398int _ecore_evas_win32_shutdown(void);
412#endif 399#endif
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index acd2886..8c30a1d 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -8639,8 +8639,7 @@ EAPI void evas_object_image_data_set(Evas_Object *obj,
8639 * Each time you call this function on an image object, its data 8639 * Each time you call this function on an image object, its data
8640 * buffer will have an internal reference counter 8640 * buffer will have an internal reference counter
8641 * incremented. Decrement it back by using 8641 * incremented. Decrement it back by using
8642 * evas_object_image_data_set(). This is specially important for the 8642 * evas_object_image_data_set().
8643 * directfb Evas engine.
8644 * 8643 *
8645 * This is best suited for when you want to modify an existing image, 8644 * This is best suited for when you want to modify an existing image,
8646 * without changing its dimensions. 8645 * without changing its dimensions.
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index 8c693ad..cae88d8 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -93,7 +93,6 @@ evas_module_paths_init(void)
93 { evas_##Tn##_##Name##_init, evas_##Tn##_##Name##_shutdown } 93 { evas_##Tn##_##Name##_init, evas_##Tn##_##Name##_shutdown }
94 94
95EVAS_EINA_STATIC_MODULE_DEFINE(engine, buffer); 95EVAS_EINA_STATIC_MODULE_DEFINE(engine, buffer);
96EVAS_EINA_STATIC_MODULE_DEFINE(engine, directfb);
97EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb); 96EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb);
98EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11); 97EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11);
99EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl); 98EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl);
@@ -131,9 +130,6 @@ static const struct {
131#ifdef EVAS_STATIC_BUILD_BUFFER 130#ifdef EVAS_STATIC_BUILD_BUFFER
132 EVAS_EINA_STATIC_MODULE_USE(engine, buffer), 131 EVAS_EINA_STATIC_MODULE_USE(engine, buffer),
133#endif 132#endif
134#ifdef EVAS_STATIC_BUILD_DIRECTFB
135 EVAS_EINA_STATIC_MODULE_USE(engine, directfb),
136#endif
137#ifdef EVAS_STATIC_BUILD_FB 133#ifdef EVAS_STATIC_BUILD_FB
138 EVAS_EINA_STATIC_MODULE_USE(engine, fb), 134 EVAS_EINA_STATIC_MODULE_USE(engine, fb),
139#endif 135#endif
diff --git a/src/modules/evas/engines/directfb/Evas_Engine_DirectFB.h b/src/modules/evas/engines/directfb/Evas_Engine_DirectFB.h
deleted file mode 100644
index 53352b7..0000000
--- a/src/modules/evas/engines/directfb/Evas_Engine_DirectFB.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _EVAS_ENGINE_DIRECTFB_H
2#define _EVAS_ENGINE_DIRECTFB_H
3
4#include <Evas.h>
5#include <directfb.h>
6
7typedef struct _Evas_Engine_Info_DirectFB Evas_Engine_Info_DirectFB;
8
9struct _Evas_Engine_Info_DirectFB
10{
11 /* PRIVATE - don't mess with this baby or evas will poke its tongue out */
12 /* at you and make nasty noises */
13 Evas_Engine_Info magic;
14
15 struct Evas_Engine_DirectFB_Spec {
16 IDirectFB *dfb;
17 IDirectFBSurface *surface;
18 } info;
19
20 /* non-blocking or blocking mode */
21 Evas_Engine_Render_Mode render_mode;
22};
23#endif
24
25
diff --git a/src/modules/evas/engines/directfb/evas_engine.c b/src/modules/evas/engines/directfb/evas_engine.c
deleted file mode 100644
index 3dc599f..0000000
--- a/src/modules/evas/engines/directfb/evas_engine.c
+++ /dev/null
@@ -1,1755 +0,0 @@
1#include <assert.h>
2#include <math.h>
3#include <string.h>
4#include <sys/time.h>
5#include <time.h>
6#include "evas_engine.h"
7#include "evas_common.h" /* Also includes international specific stuff */
8
9/* Uses Evas own image_draw primitive, for comparison purposes only. */
10//#define DFB_USE_EVAS_IMAGE_DRAW 1
11//#define DFB_USE_EVAS_RECT_DRAW 1
12//#define DFB_USE_EVAS_POLYGON_DRAW 1
13//#define DFB_UPDATE_INDIVIDUAL_RECTS 1
14#define DFB_FLIP_FLAGS DSFLIP_NONE
15//#define DFB_FLIP_FLAGS (DSFLIP_ONSYNC | DSFLIP_WAIT)
16
17/* Turn on debug */
18//#define DFB_DEBUG_IMAGE 1
19//#define DFB_DEBUG_FLAGS 1
20//#define DFB_DEBUG_ACCELERATION 1
21int _evas_engine_directfb_log_dom = -1;
22
23static Evas_Func func = {};
24static Evas_Func parent_func = {};
25static IDirectFB *dfb = NULL; /* XXX HACK to work around evas image cache
26 * lack of extra data. Fix it instead later.
27 */
28
29
30/***********************************************************************
31 * Evas helpers
32 **********************************************************************/
33static void
34_context_get_color(RGBA_Draw_Context *dc, int *r, int *g, int *b, int *a)
35{
36 DATA32 col;
37
38 if (dc->mul.use)
39 col = dc->mul.col;
40 else
41 col = dc->col.col;
42
43 *r = R_VAL(&col);
44 *g = G_VAL(&col);
45 *b = B_VAL(&col);
46 *a = A_VAL(&col);
47}
48
49
50/***********************************************************************
51 * DirectFB helpers
52 **********************************************************************/
53static void
54_dfb_surface_clear(IDirectFBSurface *surface, int x, int y, int w, int h)
55{
56 DFBRegion cr;
57 DFBResult r;
58
59 cr.x1 = x;
60 cr.y1 = y;
61 cr.x2 = x + w - 1;
62 cr.y2 = y + h - 1;
63 r = surface->SetClip(surface, &cr);
64 if (r != DFB_OK)
65 goto error;
66
67 r = surface->Clear(surface, 0, 0, 0, 0);
68 if (r != DFB_OK)
69 goto error;
70
71 return;
72
73 error:
74 ERR("DirectFB: could not clear surface: %s",
75 DirectFBErrorString(r));
76}
77
78static void
79_image_clear(DirectFB_Engine_Image_Entry *image, int x, int y, int w, int h)
80{
81 if (image->cache_entry.src->flags.alpha)
82 _dfb_surface_clear(image->surface, x, y, w, h);
83}
84
85static void
86_image_autoset_alpha(DirectFB_Engine_Image_Entry *image)
87{
88 DFBResult r;
89 DFBSurfacePixelFormat fmt;
90 IDirectFBSurface *surface;
91 RGBA_Image *im;
92 int has_alpha;
93
94 surface = image->surface;
95 r = surface->GetPixelFormat(surface, &fmt);
96 if (r != DFB_OK)
97 {
98 ERR("Could not get pixel format: %s",
99 DirectFBErrorString(r));
100 return;
101 }
102
103 /* XXX: check this in more depth in future, if other PF are supported */
104 image->cache_entry.src->flags.alpha = (fmt == DSPF_ARGB);
105}
106
107static void
108_dfb_surface_update(IDirectFBSurface *surface, int x, int y, int w, int h)
109{
110 DFBRegion cr;
111 DFBResult r;
112
113 cr.x1 = x;
114 cr.y1 = y;
115 cr.x2 = x + w - 1;
116 cr.y2 = y + h - 1;
117 r = surface->Flip(surface, &cr, DSFLIP_NONE);
118 if (r != DFB_OK)
119 WRN("Could not update surface: %s",
120 DirectFBErrorString(r));
121}
122
123static IDirectFBSurface *
124_dfb_surface_from_data(IDirectFB *dfb, int w, int h, void *data)
125{
126 IDirectFBSurface *s;
127 DFBSurfaceDescription desc;
128 DFBResult r;
129
130 desc.flags = (DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT |
131 DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED);
132 desc.caps = DSCAPS_PREMULTIPLIED;
133 desc.width = w;
134 desc.height = h;
135 desc.preallocated[0].data = data;
136 desc.preallocated[0].pitch = w * 4;
137 desc.preallocated[1].data = NULL;
138 desc.preallocated[1].pitch = 0;
139 desc.pixelformat = DSPF_ARGB;
140 r = dfb->CreateSurface(dfb, &desc, &s);
141 if (r != DFB_OK)
142 {
143 ERR("Cannot create DirectFB surface: %s",
144 DirectFBErrorString(r));
145 return NULL;
146 }
147
148 s->SetPorterDuff(s, DSPD_SRC_OVER);
149
150 return s;
151}
152
153static void
154_dfb_surface_free(IDirectFBSurface *surface)
155{
156 if (surface)
157 surface->Release(surface);
158}
159
160static void
161_dfb_blit_accel_caps_print(IDirectFBSurface *dst, IDirectFBSurface *src)
162{
163#ifdef DFB_DEBUG_ACCELERATION
164 DFBAccelerationMask mask;
165 DFBResult r;
166
167 r = dst->GetAccelerationMask(dst, src, &mask);
168 if (r != DFB_OK)
169 {
170 ERR("Could not retrieve acceleration mask: %s",
171 DirectFBErrorString(r));
172 return;
173 }
174
175 DBG("Acceleration: ");
176
177#define O(m) if (mask & m) DBG(#m " ")
178 O(DFXL_FILLRECTANGLE);
179 O(DFXL_DRAWRECTANGLE);
180 O(DFXL_DRAWLINE);
181 O(DFXL_FILLTRIANGLE);
182 O(DFXL_BLIT);
183 O(DFXL_STRETCHBLIT);
184 O(DFXL_TEXTRIANGLES);
185 O(DFXL_DRAWSTRING);
186#undef O
187
188 if (mask == DFXL_NONE) DBG("<NONE>");
189#endif /* DFB_DEBUG_ACCELERATION */
190}
191
192#ifdef DFB_DEBUG_FLAGS
193static const char *
194_dfb_blit_flags_str(DFBSurfaceBlittingFlags flags)
195{
196 static char buf[1024];
197
198 buf[0] = 0;
199
200#define T(m, n) \
201 do { \
202 if (flags & m) { \
203 if (buf[0] != 0) strcat(buf, " | "); \
204 strcat(buf, n); \
205 } \
206 } while (0)
207
208 T(DSBLIT_BLEND_ALPHACHANNEL, "BLEND_ALPHACHANNEL");
209 T(DSBLIT_BLEND_COLORALPHA, "BLEND_COLORALPHA");
210 T(DSBLIT_COLORIZE, "COLORIZE");
211 T(DSBLIT_SRC_COLORKEY, "SRC_COLORKEY");
212 T(DSBLIT_DST_COLORKEY, "DST_COLORKEY");
213 T(DSBLIT_SRC_PREMULTIPLY, "SRC_PREMULTIPLY");
214 T(DSBLIT_DST_PREMULTIPLY, "DST_PREMULTIPLY");
215 T(DSBLIT_DEMULTIPLY, "DEMULTIPLY");
216 T(DSBLIT_DEINTERLACE, "DSBLIT_DEINTERLACE");
217 T(DSBLIT_SRC_PREMULTCOLOR, "SRC_PREMULTCOLOR");
218 T(DSBLIT_XOR, "XOR");
219 T(DSBLIT_INDEX_TRANSLATION, "INDEX_TRANSLATION");
220#undef T
221
222 if (buf[0] == 0)
223 strcpy(buf, "NOFX");
224
225 return buf;
226}
227
228static const char *
229_dfb_draw_flags_str(DFBSurfaceDrawingFlags flags)
230{
231 static char buf[1024];
232
233 buf[0] = 0;
234
235#define T(m, n) \
236 do { \
237 if (flags & m) { \
238 if (buf[0] != 0) strcat(buf, " | "); \
239 strcat(buf, n); \
240 } \
241 } while (0)
242 T(DSDRAW_BLEND, "BLEND");
243 T(DSDRAW_DST_COLORKEY, "DST_COLORKEY");
244 T(DSDRAW_SRC_PREMULTIPLY, "SRC_PREMULTIPLY");
245 T(DSDRAW_DST_PREMULTIPLY, "DST_PREMULTIPLY");
246 T(DSDRAW_DEMULTIPLY, "DEMULTIPLY");
247 T(DSDRAW_XOR, "DSDRAW_XOR");
248#undef T
249 if (buf[0] == 0)
250 strcpy(buf, "NOFX");
251
252 return buf;
253}
254
255static const char *
256_dfb_blend_func_str(DFBSurfaceBlendFunction func)
257{
258 static char *names[] = {
259 "ZERO",
260 "ONE",
261 "SRCCOLOR",
262 "INVSRCCOLOR",
263 "SRCALPHA",
264 "INVSRCALPHA",
265 "DESTALPHA",
266 "INVDESTALPHA",
267 "DESTCOLOR",
268 "INVDESTCOLOR",
269 "SRCALPHASAT"
270 };
271 func--;
272 if ((func >= 0) && (func <= sizeof(names)/sizeof(*names)))
273 return names[func];
274 else
275 return NULL;
276}
277#endif /* DFB_DEBUG_FLAGS */
278
279int
280_dfb_surface_set_color_from_context(IDirectFBSurface *surface, RGBA_Draw_Context *dc)
281{
282 DFBSurfaceDrawingFlags flags;
283 int r, g, b, a;
284 DFBResult res;
285
286 _context_get_color(dc, &r, &g, &b, &a);
287 if (a == 0)
288 return 0;
289
290 r = 0xff * r / a;
291 g = 0xff * g / a;
292 b = 0xff * b / a;
293
294 res = surface->SetColor(surface, r, g, b, a);
295 if (res != DFB_OK)
296 goto error;
297
298 flags = (a != 255) ? DSDRAW_BLEND : DSDRAW_NOFX;
299 res = surface->SetDrawingFlags(surface, flags);
300 if (res != DFB_OK)
301 goto error;
302
303#ifdef DFB_DEBUG_FLAGS
304 DBG("Color=%d %d %d %d, flags=%s",
305 r, g, b, a, _dfb_draw_flags_str(flags));
306#endif /* DFB_DEBUG_FLAGS */
307
308 return 1;
309
310 error:
311 ERR("Could not set color from context: %s",
312 DirectFBErrorString(res));
313 return 0;
314}
315
316static int
317_dfb_surface_set_blit_params(DirectFB_Engine_Image_Entry *d, DirectFB_Engine_Image_Entry *s, RGBA_Draw_Context *dc)
318{
319 IDirectFBSurface *surface;
320 DFBSurfaceBlittingFlags blit_flags = DSBLIT_NOFX;
321 DFBResult res;
322 int r, g, b, a;
323
324 _context_get_color(dc, &r, &g, &b, &a);
325 if (a == 0)
326 return 0;
327
328 if (a != 255)
329 blit_flags = DSBLIT_BLEND_COLORALPHA | DSBLIT_SRC_PREMULTCOLOR;
330
331 if ((r != a) || (g != a) || (b != a))
332 {
333 blit_flags |= DSBLIT_COLORIZE;
334
335 r = 0xff * r / a;
336 g = 0xff * g / a;
337 b = 0xff * b / a;
338 }
339
340 if (s->cache_entry.src->flags.alpha)
341 blit_flags |= DSBLIT_BLEND_ALPHACHANNEL;
342
343 surface = d->surface;
344
345 if (blit_flags &
346 (DSBLIT_BLEND_COLORALPHA | DSBLIT_SRC_PREMULTCOLOR | DSBLIT_COLORIZE))
347 {
348 res = surface->SetColor(surface, r, g, b, a);
349 if (res != DFB_OK)
350 goto error;
351 }
352
353 res = surface->SetBlittingFlags(surface, blit_flags);
354 if (res != DFB_OK)
355 goto error;
356
357#ifdef DFB_DEBUG_FLAGS
358 DBG("sfunc=%s, dfunc=%s, color=%d %d %d %d, blit=%s, draw=%s",
359 _dfb_blend_func_str(src_func), _dfb_blend_func_str(dst_func),
360 r, g, b, a,
361 _dfb_blit_flags_str(blit_flags), _dfb_draw_flags_str(draw_flags));
362#endif /* DFB_DEBUG_FLAGS */
363
364 return 1;
365
366 error:
367 ERR("Could not set blit params: %s",
368 DirectFBErrorString(res));
369 return 0;
370}
371
372static int
373_dfb_lock_and_sync_image(IDirectFBSurface *surface, RGBA_Image *image, DFBSurfaceLockFlags flags)
374{
375 DFBResult r;
376 int pitch, sw, sh;
377 void *pixels;
378
379 r = surface->GetSize(surface, &sw, &sh);
380 if (r != DFB_OK)
381 return 0;
382
383 r = surface->Lock(surface, flags, &pixels, &pitch);
384 if (r != DFB_OK)
385 return 0;
386
387 if (pitch != (sw * 4))
388 {
389 /* XXX TODO: support other pixel formats. */
390 ERR("IDirectFBSurface pitch(%d) is not supported: "
391 "should be %d.",
392 pitch, sw * 4);
393 surface->Unlock(surface);
394 return 0;
395 }
396
397 image->cache_entry.w = sw;
398 image->cache_entry.h = sh;
399 image->image.data = pixels;
400 return 1;
401}
402
403typedef void (*_cb_for_each_cutout_t)(IDirectFBSurface *surface, RGBA_Draw_Context *dc, const DFBRegion *region, void *data);
404static void
405_dfb_surface_for_each_cutout(IDirectFBSurface *surface, RGBA_Draw_Context *dc, _cb_for_each_cutout_t cb, void *data)
406{
407 static Cutout_Rects *rects = NULL;
408 int i;
409
410 rects = evas_common_draw_context_apply_cutouts(dc, rects);
411 if (!rects)
412 {
413 DFBRegion cr;
414 cr.x1 = 0;
415 cr.y1 = 0;
416 surface->GetSize(surface, &cr.x2, &cr.y2);
417 cr.x2 -= 1;
418 cr.y2 -= 1;
419 surface->SetClip(surface, NULL);
420 cb(surface, dc, &cr, data);
421 return;
422 }
423
424 for (i = 0; i < rects->active; ++i)
425 {
426 Cutout_Rect *r;
427 DFBRegion cr;
428
429 r = rects->rects + i;
430
431 cr.x1 = r->x;
432 cr.y1 = r->y;
433 cr.x2 = r->x + r->w - 1;
434 cr.y2 = r->y + r->h - 1;
435 surface->SetClip(surface, &cr);
436 cb(surface, dc, &cr, data);
437 }
438}
439
440static void
441_dfb_rect_set(DFBRectangle *r, int x, int y, int w, int h)
442{
443 r->x = x;
444 r->y = y;
445 r->w = w;
446 r->h = h;
447}
448
449
450/***********************************************************************
451 * Image Cache
452 **********************************************************************/
453static Engine_Image_Entry *
454evas_cache_image_dfb_alloc(void)
455{
456 DirectFB_Engine_Image_Entry *deie;
457
458 deie = calloc(1, sizeof (DirectFB_Engine_Image_Entry));
459
460 return (Engine_Image_Entry *)deie;
461}
462
463static void
464evas_cache_image_dfb_delete(Engine_Image_Entry *eie)
465{
466 free(eie);
467}
468
469static int
470evas_cache_image_dfb_constructor(Engine_Image_Entry *eie, void *data)
471{
472 DirectFB_Engine_Image_Entry *deie = (DirectFB_Engine_Image_Entry *)eie;
473 Render_Engine *re = data;
474 IDirectFBSurface *s;
475 RGBA_Image *im;
476
477 im = (RGBA_Image *)eie->src;
478 if (!im)
479 return EVAS_LOAD_ERROR_NONE; // XXX TODO: confirm?
480
481 evas_cache_image_load_data(&im->cache_entry);
482 if (!im->image.data)
483 return EVAS_LOAD_ERROR_NONE; // XXX TODO: confirm?
484
485 s = _dfb_surface_from_data(re->spec->dfb, eie->w, eie->h, im->image.data);
486 if (!s)
487 return EVAS_LOAD_ERROR_GENERIC;
488
489 deie->surface = s;
490 deie->flags.engine_surface = 0;
491
492 return EVAS_LOAD_ERROR_NONE;
493}
494
495static void
496evas_cache_image_dfb_destructor(Engine_Image_Entry *eie)
497{
498 DirectFB_Engine_Image_Entry *deie = (DirectFB_Engine_Image_Entry *)eie;
499
500 if (!deie->flags.engine_surface)
501 _dfb_surface_free(deie->surface);
502 deie->surface = NULL;
503}
504
505/* note: dst have some properties set, like desired size (w, h) */
506static int
507_cache_image_copy(Engine_Image_Entry *dst, const Engine_Image_Entry *src)
508{
509 DirectFB_Engine_Image_Entry *dst_deie;
510 const DirectFB_Engine_Image_Entry *src_deie;
511 IDirectFBSurface *s;
512 RGBA_Image *im;
513
514 dst_deie = (DirectFB_Engine_Image_Entry *)dst;
515 src_deie = (const DirectFB_Engine_Image_Entry *)src;
516 im = (RGBA_Image *)dst->src;
517 s = _dfb_surface_from_data(dfb, dst->w, dst->h, im->image.data);
518 if (!s)
519 return -1;
520
521 dst_deie->surface = s;
522 dst_deie->flags.engine_surface = 0;
523
524 return 0;
525}
526
527static int
528evas_cache_image_dfb_dirty(Engine_Image_Entry *dst, const Engine_Image_Entry *src)
529{
530 return _cache_image_copy(dst, src);
531}
532
533static void
534evas_cache_image_dfb_dirty_region(Engine_Image_Entry *eim, unsigned int x EINA_UNUSED, unsigned int y EINA_UNUSED, unsigned int w EINA_UNUSED, unsigned int h EINA_UNUSED)
535{
536 RGBA_Image *im;
537
538 im = (RGBA_Image *)eim->src;
539 im->flags |= RGBA_IMAGE_IS_DIRTY;
540}
541
542static int
543evas_cache_image_dfb_update_data(Engine_Image_Entry *dst, void *engine_data)
544{
545 DirectFB_Engine_Image_Entry *deie = (DirectFB_Engine_Image_Entry *)dst;
546 IDirectFBSurface *s = engine_data;
547 Image_Entry *ie;
548 RGBA_Image *im;
549
550 ie = dst->src;
551 im = (RGBA_Image *)ie;
552
553 if (s)
554 {
555 deie->surface = s;
556
557 /* XXX why size is required here? */
558 s->GetSize(s, &dst->w, &dst->h);
559
560 if (im)
561 {
562 im->image.data = NULL; /* IDirectFBSurface requires lock */
563 im->image.no_free = 1;
564 ie->w = dst->w;
565 ie->h = dst->h;
566 _image_autoset_alpha(deie);
567 }
568 }
569 else
570 {
571 _dfb_surface_free(deie->surface);
572 s = _dfb_surface_from_data(dfb, dst->w, dst->h, im->image.data);
573 deie->surface = s;
574 }
575
576 return 0;
577}
578
579static int
580evas_cache_image_dfb_size_set(Engine_Image_Entry *dst, const Engine_Image_Entry *src)
581{
582 return _cache_image_copy(dst, src);
583}
584
585static void
586evas_cache_image_dfb_load(Engine_Image_Entry *eim, const Image_Entry *ie)
587{
588 DirectFB_Engine_Image_Entry *deie = (DirectFB_Engine_Image_Entry *)eim;
589 IDirectFBSurface *s;
590 const RGBA_Image *im;
591
592 if (deie->surface)
593 return;
594
595 im = (const RGBA_Image *)ie;
596 s = _dfb_surface_from_data(dfb, eim->w, eim->h, im->image.data);
597 deie->surface = s;
598}
599
600static int
601evas_cache_image_dfb_mem_size_get(Engine_Image_Entry *eie)
602{
603 DirectFB_Engine_Image_Entry *deie = (DirectFB_Engine_Image_Entry *)eie;
604 DFBResult r;
605 int size, w, h;
606
607 if (!deie->surface)
608 return 0;
609
610 size = sizeof(*deie->surface);
611
612 r = deie->surface->GetSize(deie->surface, &w, &h);
613 if (r != DFB_OK)
614 {
615 ERR("Could not get surface size: %s",
616 DirectFBErrorString(r));
617 return size;
618 }
619
620 size += w * h * 4; // XXX get correct surface size using pixelformat
621
622 return size;
623}
624
625#ifdef DFB_DEBUG_IMAGE
626static void
627evas_cache_image_dfb_debug(const char *context, Engine_Image_Entry* eie)
628{
629 DirectFB_Engine_Image_Entry *eim = (DirectFB_Engine_Image_Entry *)eie;
630
631 DBG("*** %s image (%p) ***", context, eim);
632 if (eim)
633 {
634 DBG("W: %d, H: %d, R: %d, Key: %s, DFB Surface: %p",
635 eie->w, eie->h, eie->references, eie->cache_key, eim->surface);
636
637 if (eie->src)
638 DBG("Pixels: %p", ((RGBA_Image*) eie->src)->image.data);
639 }
640 DBG("*** ***");
641}
642#endif
643
644static const Evas_Cache_Engine_Image_Func _dfb_cache_engine_image_cb = {
645 NULL /* key */,
646 evas_cache_image_dfb_alloc /* alloc */,
647 evas_cache_image_dfb_delete /* dealloc */,
648 evas_cache_image_dfb_constructor /* constructor */,
649 evas_cache_image_dfb_destructor /* destructor */,
650 evas_cache_image_dfb_dirty_region /* dirty_region */,
651 evas_cache_image_dfb_dirty /* dirty */,
652 evas_cache_image_dfb_size_set /* size_set */,
653 evas_cache_image_dfb_update_data /* update_data */,
654 evas_cache_image_dfb_load /* load */,
655 evas_cache_image_dfb_mem_size_get /* mem_size_get */,
656#ifdef DFB_DEBUG_IMAGE /* debug */
657 evas_cache_image_dfb_debug
658#else
659 NULL
660#endif
661};
662
663
664/***********************************************************************
665 * Evas Engine
666 **********************************************************************/
667static void *
668evas_engine_dfb_info(Evas* e EINA_UNUSED)
669{
670 Evas_Engine_Info_DirectFB *info;
671 info = calloc(1, sizeof(Evas_Engine_Info_DirectFB));
672 if (!info)
673 return NULL;
674 info->magic.magic = rand();
675 return info;
676}
677
678static void
679evas_engine_dfb_info_free(Evas *e EINA_UNUSED, void *in)
680{
681 Evas_Engine_Info_DirectFB *info = in;
682 free(info);
683}
684
685static Eina_Bool
686_is_dfb_data_ok(IDirectFB *idfb, IDirectFBSurface *surface, int w, int h)
687{
688 DFBResult r;
689 int sw, sh;
690
691 if (!idfb)
692 {
693 ERR("missing IDirectFB");
694 return EINA_FALSE;
695 }
696 dfb = idfb;
697
698 if (!surface)
699 {
700 ERR("missing IDirectFBSurface");
701 return EINA_FALSE;
702 }
703
704 r = surface->GetSize(surface, &sw, &sh);
705 if (r != DFB_OK)
706 {
707 ERR("Could not get surface %p size: %s",
708 surface, DirectFBErrorString(r));
709 return EINA_FALSE;
710 }
711
712 if ((w > sw) || (h > sh))
713 {
714 ERR("Requested size is larger than surface: %dx%d > %dx%d",
715 w, h, sw, sh);
716 return EINA_FALSE;
717 }
718 else if ((w <= 0) || (h <= 0))
719 {
720 w = sw;
721 h = sh;
722 }
723
724 return EINA_TRUE;
725}
726
727static void
728_evas_common_init(void)
729{
730 evas_common_cpu_init();
731 evas_common_blend_init();
732 evas_common_image_init();
733 evas_common_convert_init();
734 evas_common_scale_init();
735 evas_common_rectangle_init();
736 evas_common_polygon_init();
737 evas_common_line_init();
738 evas_common_font_init();
739 evas_common_draw_init();
740 evas_common_tilebuf_init();
741}
742
743static int
744evas_engine_dfb_output_reconfigure(Render_Engine *re, int w, int h)
745{
746 if (re->screen_image)
747 evas_cache_engine_image_drop(&re->screen_image->cache_entry);
748
749 if (re->tb)
750 evas_common_tilebuf_free(re->tb);
751
752 re->tb = evas_common_tilebuf_new(w, h);
753 if (!re->tb)
754 {
755 ERR("Could not allocate tile buffer.");
756 goto failed_tilebuf;
757 }
758 evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
759
760 /* We create a "fake" RGBA_Image which points to the IDirectFB surface.
761 * Each access to that surface is wrapped in Lock / Unlock calls whenever
762 * the data is manipulated directly.
763 */
764 re->screen_image = (DirectFB_Engine_Image_Entry *)
765 evas_cache_engine_image_engine(re->cache, re->spec->surface);
766 if (!re->screen_image)
767 {
768 ERR("RGBA_Image allocation from DFB failed");
769 goto failed_image;
770 }
771 re->screen_image->flags.engine_surface = 1;
772
773 _image_autoset_alpha(re->screen_image);
774 _image_clear(re->screen_image, 0, 0, w, h);
775
776 return 1;
777
778 failed_image:
779 evas_common_tilebuf_free(re->tb);
780 re->tb = NULL;
781 failed_tilebuf:
782 re->screen_image = NULL;
783 ERR("Evas DirectFB reconfigure failed");
784 return 0;
785}
786
787static void *
788_dfb_output_setup(int w, int h, const struct Evas_Engine_DirectFB_Spec *spec)
789{
790 Render_Engine *re;
791
792 if (!_is_dfb_data_ok(spec->dfb, spec->surface, w, h))
793 goto fatal;
794
795 _evas_common_init();
796
797 re = calloc(1, sizeof(Render_Engine));
798 if (!re)
799 {
800 perror("calloc");
801 goto fatal;
802 }
803 re->dfb = spec->dfb;
804 re->spec = spec;
805 re->cache = evas_cache_engine_image_init(&_dfb_cache_engine_image_cb,
806 evas_common_image_cache_get());
807 if (!re->cache)
808 {
809 ERR("Evas_Cache_Engine_Image allocation failed!");
810 goto fatal_after_engine;
811 }
812
813 if (!evas_engine_dfb_output_reconfigure(re, w, h))
814 {
815 ERR("Could not reconfigure evas engine.");
816 goto fatal_after_reconfigure;
817 }
818
819 _dfb_blit_accel_caps_print(spec->surface, NULL);
820
821 return re;
822
823
824 fatal_after_reconfigure:
825 evas_cache_engine_image_shutdown(re->cache);
826 fatal_after_engine:
827 free(re);
828 fatal:
829 CRIT("DirectFB: unable to continue, abort()!");
830 abort();
831 return NULL;
832}
833
834static int
835evas_engine_dfb_setup(Evas *eo_e, void *in)
836{
837 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
838 Evas_Engine_Info_DirectFB *info = in;
839
840 if (!e->engine.data.output)
841 e->engine.data.output = _dfb_output_setup(e->output.w, e->output.h,
842 &info->info);
843 // XXX TODO: else reconfigure existing...
844
845 if (!e->engine.data.output)
846 return 0;
847
848 if (!e->engine.data.context)
849 e->engine.data.context =
850 e->engine.func->context_new(e->engine.data.output);
851
852 return 1;
853}
854
855static void
856evas_engine_dfb_output_free(void *data)
857{
858 Render_Engine *re = data;
859
860 if (!re)
861 return;
862
863 if (re->cache)
864 evas_cache_engine_image_shutdown(re->cache);
865
866 evas_common_tilebuf_free(re->tb);
867 if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
868 free(re);
869
870 evas_common_font_shutdown();
871 evas_common_image_shutdown();
872}
873
874static void
875evas_engine_dfb_output_resize(void *data, int w, int h)
876{
877 if (!evas_engine_dfb_output_reconfigure(data, w, h))
878 ERR("Failed to resize DirectFB evas");
879}
880
881static void
882evas_engine_dfb_output_tile_size_set(void *data, int w, int h)
883{
884 Render_Engine *re = data;
885
886 evas_common_tilebuf_set_tile_size(re->tb, w, h);
887}
888
889static void
890evas_engine_dfb_output_redraws_rect_add(void *data, int x, int y, int w, int h)
891{
892 Render_Engine *re = data;
893
894 evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
895}
896
897static void
898evas_engine_dfb_output_redraws_rect_del(void *data, int x, int y, int w, int h)
899{
900 Render_Engine *re = data;
901
902 evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
903}
904
905static void
906evas_engine_dfb_output_redraws_clear(void *data)
907{
908 Render_Engine *re = data;
909
910 evas_common_tilebuf_clear(re->tb);
911}
912
913static void *
914evas_engine_dfb_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch)
915{
916 Render_Engine *re = data;
917 Tilebuf_Rect *tb_rect;
918
919 if (re->end)
920 {
921 re->end = 0;
922 return NULL;
923 }
924 if (!re->rects)
925 {
926 re->rects = evas_common_tilebuf_get_render_rects(re->tb);
927 re->cur_rect = EINA_INLIST_GET(re->rects);
928 }
929 if (!re->cur_rect)
930 return NULL;
931
932 tb_rect = (Tilebuf_Rect*) re->cur_rect;
933 *cx = *x = tb_rect->x;
934 *cy = *y = tb_rect->y;
935 *cw = *w = tb_rect->w;
936 *ch = *h = tb_rect->h;
937 re->cur_rect = re->cur_rect->next;
938 if (!re->cur_rect)
939 {
940 evas_common_tilebuf_free_render_rects(re->rects);
941 re->rects = NULL;
942 re->end = 1;
943 }
944
945 return re->screen_image;
946}
947
948static void
949evas_engine_dfb_output_redraws_next_update_push(void *data, void *surface EINA_UNUSED, int x, int y, int w, int h)
950{
951 Render_Engine *re = data;
952 DFBRegion *r;
953
954 if (re->update_regions_count >= re->update_regions_limit)
955 {
956 void *tmp;
957
958 re->update_regions_limit += 16;
959
960 tmp = realloc(re->update_regions,
961 sizeof(DFBRegion) * re->update_regions_limit);
962 if (!tmp)
963 {
964 perror("realloc");
965 return;
966 }
967 re->update_regions = tmp;
968 }
969
970 r = re->update_regions + re->update_regions_count;
971 re->update_regions_count++;
972
973 r->x1 = x;
974 r->y1 = y;
975 r->x2 = x + w - 1;
976 r->y2 = y + h - 1;
977}
978
979static void
980evas_engine_dfb_output_flush(void *data)
981{
982 Render_Engine *re = data;
983 IDirectFBSurface *s = re->screen_image->surface;
984 DFBRegion *r, *r_end;
985
986 r = re->update_regions;
987 r_end = re->update_regions + re->update_regions_count;
988
989#ifdef DFB_UPDATE_INDIVIDUAL_RECTS
990 for (; r < r_end; r++)
991 s->Flip(s, r, DFB_FLIP_FLAGS);
992#else
993 DFBRegion bb;
994
995 bb.x1 = bb.y1 = 10000;
996 bb.x2 = bb.y2 = 0;
997 for (; r < r_end; r++)
998 {
999 if (bb.x1 > r->x1)
1000 bb.x1 = r->x1;
1001 if (bb.y1 > r->y1)
1002 bb.y1 = r->y1;
1003
1004 if (bb.x2 < r->x2)
1005 bb.x2 = r->x2;
1006 if (bb.y2 < r->y2)
1007 bb.y2 = r->y2;
1008 }
1009
1010 s->Flip(s, &bb, DFB_FLIP_FLAGS);
1011#endif
1012
1013 re->update_regions_count = 0;
1014}
1015
1016static void
1017evas_engine_dfb_output_idle_flush(void *data)
1018{
1019 Render_Engine *re = data;
1020
1021 if (re->update_regions_count != 0)
1022 ERR("update_regions_count not 0 as it should be!");
1023
1024 free(re->update_regions);
1025 re->update_regions_count = 0;
1026 re->update_regions_limit = 0;
1027 re->update_regions = NULL;
1028}
1029
1030/* HACK!!! -- KLUDGE!!!
1031 *
1032 * This should really use IDirectFBFont and IDirectFBSurface::DrawString(),
1033 * but to be edje-compatible IDirectFBFont::CreateFont() should be able to
1034 * load fonts from non-files, which it does not.
1035 *
1036 * Try to find a way to create own IDirectFBFont in future and load from
1037 * memory.
1038 */
1039static void
1040evas_engine_dfb_font_draw(void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props)
1041{
1042 DirectFB_Engine_Image_Entry *eim = surface;
1043 IDirectFBSurface *screen;
1044 Render_Engine *re = data;
1045 RGBA_Image *im;
1046
1047 im = (RGBA_Image *)eim->cache_entry.src;
1048 screen = eim->surface;
1049 if (!_dfb_lock_and_sync_image(screen, im, DSLF_READ | DSLF_WRITE))
1050 return;
1051
1052 evas_common_font_draw_prepare(intl_props);
1053 evas_common_font_draw(im, context, x, y, intl_props);
1054 evas_common_cpu_end_opt();
1055
1056 im->image.data = NULL;
1057
1058 screen->Unlock(screen);
1059}
1060
1061
1062static void
1063_cb_draw_line(IDirectFBSurface *surface, RGBA_Draw_Context *dc EINA_UNUSED, const DFBRegion *region EINA_UNUSED, void *data)
1064{
1065 const Eina_Rectangle *r = data;
1066
1067 surface->DrawLine(surface, r->x, r->y, r->w, r->h); /* x2, y2 really */
1068}
1069
1070static void
1071evas_engine_dfb_line_draw(void *data EINA_UNUSED, void *context, void *surface, int x1, int y1, int x2, int y2)
1072{
1073 DirectFB_Engine_Image_Entry *eim = surface;
1074 Eina_Rectangle r;
1075
1076 if (!_dfb_surface_set_color_from_context(eim->surface, context))
1077 return;
1078
1079 EINA_RECTANGLE_SET(&r, x1, y1, x2, y2); /* x2, y2 (ab)used as w, h */
1080 _dfb_surface_for_each_cutout(eim->surface, context, _cb_draw_line, &r);
1081}
1082
1083#ifndef DFB_USE_EVAS_RECT_DRAW
1084static void
1085_cb_draw_rectangle(IDirectFBSurface *surface, RGBA_Draw_Context *dc EINA_UNUSED, const DFBRegion *region EINA_UNUSED, void *data)
1086{
1087 const Eina_Rectangle *r = data;
1088
1089 surface->FillRectangle(surface, r->x, r->y, r->w, r->h);
1090}
1091
1092static void
1093evas_engine_dfb_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h)
1094{
1095 DirectFB_Engine_Image_Entry *eim = surface;
1096 IDirectFBSurface *screen;
1097 Render_Engine *re = data;
1098 RGBA_Draw_Context *dc = context;
1099 Eina_Rectangle r;
1100
1101 screen = eim->surface;
1102 if (!_dfb_surface_set_color_from_context(screen, context))
1103 {
1104 if (dc->render_op != EVAS_RENDER_COPY)
1105 return;
1106 if (!eim->cache_entry.src->flags.alpha)
1107 return;
1108 screen->SetColor(screen, 0, 0, 0, 0);
1109 screen->SetDrawingFlags(screen, DSDRAW_NOFX);
1110 }
1111
1112 EINA_RECTANGLE_SET(&r, x, y, w, h);
1113 _dfb_surface_for_each_cutout(screen, context, _cb_draw_rectangle, &r);
1114}
1115#else
1116static void
1117evas_engine_dfb_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h)
1118{
1119 DirectFB_Engine_Image_Entry *eim = surface;
1120 IDirectFBSurface *screen;
1121 Render_Engine *re = data;
1122 RGBA_Image *dst;
1123
1124 dst = (RGBA_Image *)eim->cache_entry.src;
1125 screen = eim->surface;
1126 if (!_dfb_lock_and_sync_image(screen, dst, DSLF_READ | DSLF_WRITE))
1127 return;
1128
1129 evas_common_rectangle_draw(dst, context, x, y, w, h);
1130 evas_common_cpu_end_opt();
1131
1132 dst->image.data = NULL;
1133
1134 screen->Unlock(screen);
1135}
1136#endif
1137
1138#ifndef DFB_USE_EVAS_POLYGON_DRAW
1139static void
1140evas_engine_dfb_polygon_draw(void *data EINA_UNUSED, void *context, void *surface, void *polygon, int x, int y)
1141{
1142 DirectFB_Engine_Image_Entry *eim = surface;
1143 _dfb_polygon_draw(eim->surface, context, polygon, x, y);
1144}
1145#else
1146static void
1147evas_engine_dfb_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
1148{
1149 DirectFB_Engine_Image_Entry *eim = surface;
1150 IDirectFBSurface *screen;
1151 Render_Engine *re = data;
1152 RGBA_Image *dst;
1153
1154 dst = (RGBA_Image *)eim->cache_entry.src;
1155 screen = eim->surface;
1156 if (!_dfb_lock_and_sync_image(screen, dst, DSLF_READ | DSLF_WRITE))
1157 return;
1158
1159 evas_common_polygon_draw(dst, context, polygon, x, y);
1160 evas_common_cpu_end_opt();
1161
1162 dst->image.data = NULL;
1163
1164 screen->Unlock(screen);
1165}
1166#endif
1167
1168/** Image Object *******************************************************/
1169static void *
1170evas_engine_dfb_image_load(void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
1171{
1172 Render_Engine *re = data;
1173
1174 *error = 0;
1175 return evas_cache_engine_image_request(re->cache, file, key, lo,
1176 data, error);
1177}
1178
1179static int
1180evas_engine_dfb_image_alpha_get(void *data EINA_UNUSED, void *image)
1181{
1182 DirectFB_Engine_Image_Entry *eim = image;
1183 Image_Entry *ie;
1184 RGBA_Image *im;
1185
1186 if (!eim) return 1;