directfb says bye...
After agreement in the mail list, core developers agree to remove this engine that was not being supported for a long time. Given that most operations Evas uses are not accelerated in DirectFB, or at least hardware that exclusively supports DirectFB, it's better for those people to just use Evas/Ecore software (buffer) rendering and expose DirectFB's framebuffer as destination surface. SVN revision: 80232
This commit is contained in:
parent
aa53580814
commit
dfe93a7f0a
|
@ -41,7 +41,6 @@ Makefile.in
|
|||
/pc/evil.pc
|
||||
/pc/embryo.pc
|
||||
/pc/evas-direct3d.pc
|
||||
/pc/evas-directfb.pc
|
||||
/pc/evas-fb.pc
|
||||
/pc/evas-opengl-cocoa.pc
|
||||
/pc/evas-opengl-sdl.pc
|
||||
|
@ -99,7 +98,6 @@ m4/wint_t.m4
|
|||
m4/xsize.m4
|
||||
pc/ecore-cocoa.pc
|
||||
pc/ecore-con.pc
|
||||
pc/ecore-directfb.pc
|
||||
pc/ecore-evas.pc
|
||||
pc/ecore-fb.pc
|
||||
pc/ecore-file.pc
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2012-12-05 Gustavo Sverzut Barbieri (k-s)
|
||||
|
||||
* Removed DirectFB support (both ecore_directfb, evas and ecore_evas).
|
||||
|
||||
2012-12-04 Gwanglim Lee
|
||||
|
||||
* Add window profile support:
|
||||
|
|
10
Makefile.am
10
Makefile.am
|
@ -67,7 +67,6 @@ pc/eina.pc \
|
|||
pc/eet.pc \
|
||||
pc/eo.pc \
|
||||
pc/evas.pc \
|
||||
pc/evas-directfb.pc \
|
||||
pc/evas-fb.pc \
|
||||
pc/evas-opengl-x11.pc \
|
||||
pc/evas-opengl-sdl.pc \
|
||||
|
@ -85,7 +84,6 @@ pc/ecore-file.pc \
|
|||
pc/ecore-input.pc \
|
||||
pc/ecore-input-evas.pc \
|
||||
pc/ecore-cocoa.pc \
|
||||
pc/ecore-directfb.pc \
|
||||
pc/ecore-fb.pc \
|
||||
pc/ecore-psl1ght.pc \
|
||||
pc/ecore-sdl.pc \
|
||||
|
@ -131,10 +129,6 @@ if BUILD_ENGINE_SOFTWARE_X11
|
|||
pkgconfig_DATA += pc/evas-software-x11.pc
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_DIRECTFB
|
||||
pkgconfig_DATA += pc/evas-directfb.pc
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_FB
|
||||
pkgconfig_DATA += pc/evas-fb.pc
|
||||
endif
|
||||
|
@ -179,10 +173,6 @@ if HAVE_ECORE_COCOA
|
|||
pkgconfig_DATA += pc/ecore-cocoa.pc
|
||||
endif
|
||||
|
||||
if HAVE_ECORE_DIRECTFB
|
||||
pkgconfig_DATA += pc/ecore-directfb.pc
|
||||
endif
|
||||
|
||||
if HAVE_ECORE_FB
|
||||
pkgconfig_DATA += pc/ecore-fb.pc
|
||||
endif
|
||||
|
|
6
NEWS
6
NEWS
|
@ -46,6 +46,10 @@ Deprecations:
|
|||
ECORE_X_ATOM_E_PROFILE_LIST
|
||||
ecore_x_e_window_profile_list_set()
|
||||
ecore_x_e_window_profile_list_get()
|
||||
* ecore_evas: deprecate directfb engine.
|
||||
|
||||
Removed:
|
||||
* directfb support: ecore_directfb and evas directfb engine.
|
||||
|
||||
Improvements:
|
||||
* Single EFL tree covering all EFL library components.
|
||||
|
@ -63,4 +67,4 @@ Fixes:
|
|||
to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters.
|
||||
* Fixed textblock textprop leak.
|
||||
* Fixed evas_object_box to reset size_hint_min to zero when no child.
|
||||
* Fix build of Ecore_Evas_Extn on Solaris.
|
||||
* Fix build of Ecore_Evas_Extn on Solaris.
|
||||
|
|
63
configure.ac
63
configure.ac
|
@ -99,7 +99,6 @@ requirements_libs_ecore_ipc=""
|
|||
requirements_libs_ecore_file=""
|
||||
requirements_libs_ecore_input=""
|
||||
requirements_libs_ecore_cocoa=""
|
||||
requirements_libs_ecore_directfb=""
|
||||
requirements_libs_ecore_fb=""
|
||||
requirements_libs_ecore_psl1ght=""
|
||||
requirements_libs_ecore_sdl=""
|
||||
|
@ -129,7 +128,6 @@ requirements_pc_ecore_file=""
|
|||
requirements_pc_ecore_input=""
|
||||
requirements_pc_ecore_input_evas=""
|
||||
requirements_pc_ecore_cocoa=""
|
||||
requirements_pc_ecore_directfb=""
|
||||
requirements_pc_ecore_fb=""
|
||||
requirements_pc_ecore_psl1ght=""
|
||||
requirements_pc_ecore_sdl=""
|
||||
|
@ -178,7 +176,6 @@ AC_SUBST([requirements_libs_ecore_ipc])
|
|||
AC_SUBST([requirements_libs_ecore_file])
|
||||
AC_SUBST([requirements_libs_ecore_input])
|
||||
AC_SUBST([requirements_libs_ecore_cocoa])
|
||||
AC_SUBST([requirements_libs_ecore_directfb])
|
||||
AC_SUBST([requirements_libs_ecore_fb])
|
||||
AC_SUBST([requirements_libs_ecore_psl1ght])
|
||||
AC_SUBST([requirements_libs_ecore_sdl])
|
||||
|
@ -208,7 +205,6 @@ AC_SUBST([requirements_pc_ecore_file])
|
|||
AC_SUBST([requirements_pc_ecore_input])
|
||||
AC_SUBST([requirements_pc_ecore_input_evas])
|
||||
AC_SUBST([requirements_pc_ecore_cocoa])
|
||||
AC_SUBST([requirements_pc_ecore_directfb])
|
||||
AC_SUBST([requirements_pc_ecore_fb])
|
||||
AC_SUBST([requirements_pc_ecore_psl1ght])
|
||||
AC_SUBST([requirements_pc_ecore_sdl])
|
||||
|
@ -1323,7 +1319,6 @@ want_evas_engine_gl_xcb="no"
|
|||
want_evas_engine_gl_sdl="no"
|
||||
want_evas_engine_gl_cocoa="no"
|
||||
want_evas_engine_fb="no"
|
||||
want_evas_engine_directfb="no"
|
||||
want_evas_engine_psl1ght="no"
|
||||
want_evas_engine_wayland_shm="no"
|
||||
want_evas_engine_wayland_egl="no"
|
||||
|
@ -1502,7 +1497,6 @@ fi
|
|||
## Engines
|
||||
|
||||
EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [yes], [Buffer])
|
||||
EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
|
||||
EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
|
||||
EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa])
|
||||
EVAS_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"])
|
|||
#### End of Ecore_Cocoa
|
||||
|
||||
|
||||
#### Ecore_DirectFB
|
||||
|
||||
AC_MSG_NOTICE([Ecore_DirectFB checks])
|
||||
|
||||
### Additional options to configure
|
||||
|
||||
### Default values
|
||||
|
||||
### Checks for programs
|
||||
|
||||
### Checks for libraries
|
||||
|
||||
## Eina, Ecore
|
||||
|
||||
requirements_pc_ecore_directfb="ecore >= ${PACKAGE_VERSION} eina >= ${PACKAGE_VERSION} ${requirements_pc_ecore_directfb}"
|
||||
|
||||
## DirectFB
|
||||
|
||||
PKG_CHECK_MODULES([ECORE_DIRECTFB],
|
||||
[directfb >= 0.9.16],
|
||||
[
|
||||
have_ecore_directfb="yes"
|
||||
requirements_pc_ecore_directfb="directfb >= 0.9.16 ${requirements_pc_ecore_directfb}"
|
||||
],
|
||||
[have_ecore_directfb="no"])
|
||||
|
||||
AM_CONDITIONAL([HAVE_ECORE_DIRECTFB], [test "x${have_ecore_directfb}" = "xyes"])
|
||||
|
||||
### Checks for header files
|
||||
|
||||
### Checks for types
|
||||
|
||||
### Checks for structures
|
||||
|
||||
### Checks for compiler characteristics
|
||||
|
||||
### Checks for linker characteristics
|
||||
|
||||
### Checks for library functions
|
||||
|
||||
#### End of Ecore_Directfb
|
||||
|
||||
|
||||
#### Ecore_FB
|
||||
|
@ -3781,7 +3734,6 @@ want_ecore_evas_software_ddraw="no"
|
|||
want_ecore_evas_software_sdl="no"
|
||||
want_ecore_evas_gl_sdl="no"
|
||||
want_ecore_evas_gl_cocoa="no"
|
||||
want_ecore_evas_directfb="no"
|
||||
want_ecore_evas_fb="no"
|
||||
want_ecore_evas_ews="yes"
|
||||
want_ecore_evas_extn="yes"
|
||||
|
@ -3811,7 +3763,6 @@ case "$host_os" in
|
|||
want_ecore_evas_software_sdl="yes"
|
||||
want_ecore_evas_gl_sdl="yes"
|
||||
want_ecore_evas_gl_cocoa="no"
|
||||
want_ecore_evas_directfb="yes"
|
||||
want_ecore_evas_fb="yes"
|
||||
want_ecore_evas_wayland_shm="yes"
|
||||
want_ecore_evas_wayland_egl="yes"
|
||||
|
@ -3845,15 +3796,6 @@ ECORE_EVAS_CHECK_MODULE_FULL([opengl-cocoa],
|
|||
[${have_ecore_cocoa}],
|
||||
[requirements_pc_ecore_evas="ecore-cocoa >= ${PACKAGE_VERSION} ${requirements_pc_ecore_evas}"])
|
||||
|
||||
# ecore_evas_directfb
|
||||
|
||||
ECORE_EVAS_CHECK_MODULE_FULL([directfb],
|
||||
[${have_evas_engine_directfb}],
|
||||
[${want_ecore_evas_directfb}],
|
||||
[DirectFB],
|
||||
[${have_ecore_directfb}],
|
||||
[requirements_pc_ecore_evas="ecore-directfb >= ${PACKAGE_VERSION} ${requirements_pc_ecore_evas}"])
|
||||
|
||||
# ecore_evas_ews
|
||||
|
||||
ECORE_EVAS_CHECK_MODULE_FULL([ews],
|
||||
|
@ -4187,7 +4129,6 @@ pc/escape.pc
|
|||
pc/eina.pc
|
||||
pc/eet.pc
|
||||
pc/eo.pc
|
||||
pc/evas-directfb.pc
|
||||
pc/evas-fb.pc
|
||||
pc/evas-opengl-x11.pc
|
||||
pc/evas-opengl-sdl.pc
|
||||
|
@ -4208,7 +4149,6 @@ pc/ecore-file.pc
|
|||
pc/ecore-input.pc
|
||||
pc/ecore-input-evas.pc
|
||||
pc/ecore-cocoa.pc
|
||||
pc/ecore-directfb.pc
|
||||
pc/ecore-fb.pc
|
||||
pc/ecore-psl1ght.pc
|
||||
pc/ecore-sdl.pc
|
||||
|
@ -4271,7 +4211,6 @@ else
|
|||
fi
|
||||
echo " OpenGL Cocoa...............: $have_evas_engine_gl_cocoa"
|
||||
echo " Software Framebuffer.......: $have_evas_engine_fb"
|
||||
echo " DirectFB...................: $have_evas_engine_directfb"
|
||||
echo " PSL1GHT....................: $have_evas_engine_psl1ght"
|
||||
echo " Wayland Shm................: $have_evas_engine_wayland_shm"
|
||||
echo " Wayland Egl................: $have_evas_engine_wayland_egl"
|
||||
|
@ -4413,7 +4352,6 @@ echo " Ecore_FB...................: $have_ecore_fb"
|
|||
if test "x${have_ecore_fb}" = "xyes" ; then
|
||||
echo " Touchscreen..............: $have_tslib"
|
||||
fi
|
||||
echo " Ecore_DirectFB.............: $have_ecore_directfb"
|
||||
echo " Ecore_WinCE................: $have_wince"
|
||||
echo " Ecore_PSL1GHT..............: $have_ps3"
|
||||
echo " Ecore_Wayland..............: $have_ecore_wayland"
|
||||
|
@ -4436,7 +4374,6 @@ echo " Ecore_Evas...................: $have_ecore_evas"
|
|||
echo " Software SDL...............: $have_ecore_evas_software_sdl"
|
||||
echo " OpenGL SDL.................: $have_ecore_evas_opengl_sdl"
|
||||
echo " OpenGL Cocoa...............: $have_ecore_evas_opengl_cocoa"
|
||||
echo " DirectFB...................: $have_ecore_evas_directfb"
|
||||
echo " PSL1GHT....................: $have_ecore_evas_psl1ght"
|
||||
echo " Software Framebuffer.......: $have_ecore_evas_fb"
|
||||
echo " Sing.Proc. Windowing System: $have_ecore_evas_ews"
|
||||
|
|
|
@ -599,40 +599,6 @@ AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
|
|||
|
||||
])
|
||||
|
||||
dnl use: EVAS_CHECK_ENGINE_DEP_DIRECTFB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
|
||||
AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DIRECTFB],
|
||||
[
|
||||
|
||||
requirement=""
|
||||
have_dep="no"
|
||||
evas_engine_[]$1[]_cflags=""
|
||||
evas_engine_[]$1[]_libs=""
|
||||
|
||||
PKG_CHECK_EXISTS([directfb >= 0.9.16],
|
||||
[
|
||||
have_dep="yes"
|
||||
requirement="directfb >= 0.9.16"
|
||||
],
|
||||
[have_dep="no"])
|
||||
|
||||
if test "x${have_dep}" = "xyes" ; then
|
||||
if test "x$3" = "xstatic" ; then
|
||||
requirements_pc_evas="${requirement} ${requirements_pc_evas}"
|
||||
requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
|
||||
else
|
||||
PKG_CHECK_MODULES([DIRECTFB], [${requirement}])
|
||||
evas_image_loader_[]$1[]_cflags="${DIRECTFB_CFLAGS}"
|
||||
evas_image_loader_[]$1[]_libs="${DIRECTFB_LIBS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST([evas_engine_$1_cflags])
|
||||
AC_SUBST([evas_engine_$1_libs])
|
||||
|
||||
AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
|
||||
|
||||
])
|
||||
|
||||
dnl use: EVAS_CHECK_ENGINE_DEP_PSL1GHT(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: ecore-directfb
|
||||
Description: E core library, DirectFB module
|
||||
Requires.private: @requirements_pc_ecore_directfb@
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lecore_directfb
|
||||
Libs.private: @requirements_libs_ecore_directfb@
|
||||
Cflags: -I${includedir}/ecore-@VMAJ@
|
|
@ -1,3 +0,0 @@
|
|||
Name: evas-directfb
|
||||
Description: Evas DirectFB engine
|
||||
Version: @VERSION@
|
|
@ -29,9 +29,6 @@ include Makefile_Ecore_Input.am
|
|||
if HAVE_ECORE_COCOA
|
||||
include Makefile_Ecore_Cocoa.am
|
||||
endif
|
||||
if HAVE_ECORE_DIRECTFB
|
||||
include Makefile_Ecore_DirectFB.am
|
||||
endif
|
||||
if HAVE_ECORE_FB
|
||||
include Makefile_Ecore_FB.am
|
||||
endif
|
||||
|
@ -92,7 +89,6 @@ clean-local:
|
|||
rm -rf modules/eina/mp/chained_pool/*.gcno
|
||||
rm -rf modules/evas/engines/buffer/*.gcno
|
||||
rm -rf modules/evas/engines/direct3d/*.gcno
|
||||
rm -rf modules/evas/engines/directfb/*.gcno
|
||||
rm -rf modules/evas/engines/fb/*.gcno
|
||||
rm -rf modules/evas/engines/gl_cocoa/*.gcno
|
||||
rm -rf modules/evas/engines/gl_common/*.gcno
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
### Library
|
||||
|
||||
lib_LTLIBRARIES += lib/ecore_directfb/libecore_directfb.la
|
||||
|
||||
installed_ecoredirectfbmainheadersdir = $(includedir)/ecore-@VMAJ@
|
||||
dist_installed_ecoredirectfbmainheaders_DATA = \
|
||||
lib/ecore_directfb/Ecore_DirectFB.h
|
||||
|
||||
lib_ecore_directfb_libecore_directfb_la_SOURCES = \
|
||||
lib/ecore_directfb/ecore_directfb.c \
|
||||
lib/ecore_directfb/ecore_directfb_keys.h \
|
||||
lib/ecore_directfb/ecore_directfb_private.h
|
||||
|
||||
lib_ecore_directfb_libecore_directfb_la_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/lib/eina \
|
||||
-I$(top_srcdir)/src/lib/eo \
|
||||
-I$(top_srcdir)/src/lib/ecore \
|
||||
-I$(top_srcdir)/src/lib/ecore_directfb \
|
||||
-I$(top_builddir)/src/lib/eina \
|
||||
-I$(top_builddir)/src/lib/eo \
|
||||
-I$(top_builddir)/src/lib/ecore \
|
||||
-I$(top_builddir)/src/lib/ecore_directfb \
|
||||
@EFL_CFLAGS@ \
|
||||
@EFL_COV_CFLAGS@ \
|
||||
@ECORE_DIRECTFB_CFLAGS@
|
||||
|
||||
lib_ecore_directfb_libecore_directfb_la_LIBADD = \
|
||||
lib/ecore/libecore.la \
|
||||
lib/eo/libeo.la \
|
||||
lib/eina/libeina.la \
|
||||
@ECORE_DIRECTFB_LIBS@
|
||||
|
||||
lib_ecore_directfb_libecore_directfb_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
|
|
@ -61,14 +61,6 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|||
-I$(top_builddir)/src/modules/evas/engines/gl_cocoa
|
||||
endif
|
||||
|
||||
if HAVE_ECORE_DIRECTFB
|
||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
||||
-I$(top_srcdir)/src/lib/ecore_directfb \
|
||||
-I$(top_srcdir)/src/modules/evas/engines/directfb \
|
||||
-I$(top_builddir)/src/lib/ecore_directfb \
|
||||
-I$(top_builddir)/src/modules/evas/engines/directfb
|
||||
endif
|
||||
|
||||
if HAVE_ECORE_FB
|
||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
||||
-I$(top_srcdir)/src/lib/ecore_fb \
|
||||
|
@ -144,11 +136,6 @@ lib_ecore_evas_libecore_evas_la_LIBADD += \
|
|||
lib/ecore_cocoa/libecore_cocoa.la
|
||||
endif
|
||||
|
||||
if HAVE_ECORE_DIRECTFB
|
||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
||||
lib/ecore_directfb/libecore_directfb.la
|
||||
endif
|
||||
|
||||
if HAVE_ECORE_FB
|
||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
||||
lib/ecore_fb/libecore_fb.la
|
||||
|
|
|
@ -439,43 +439,6 @@ modules_evas_engines_buffer_module_la_LIBTOOLFLAGS = --tag=disable-static
|
|||
endif
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_DIRECTFB
|
||||
dist_installed_evasmainheaders_DATA += modules/evas/engines/directfb/Evas_Engine_DirectFB.h
|
||||
DIRECTFB_SOURCES = \
|
||||
modules/evas/engines/directfb/evas_engine.c \
|
||||
modules/evas/engines/directfb/polygon.c \
|
||||
modules/evas/engines/directfb/evas_engine.h
|
||||
if EVAS_STATIC_BUILD_DIRECTFB
|
||||
lib_evas_libevas_la_SOURCES += $(DIRECTFB_SOURCES)
|
||||
lib_evas_libevas_la_CPPFLAGS += @evas_engine_directfb_cflags@
|
||||
lib_evas_libevas_la_LIBADD += @evas_engine_directfb_libs@
|
||||
else
|
||||
enginedirectfbpkgdir = $(libdir)/evas/modules/engines/directfb/$(MODULE_ARCH)
|
||||
enginedirectfbpkg_LTLIBRARIES = modules/evas/engines/directfb/module.la
|
||||
modules_evas_engines_directfb_module_la_SOURCES = $(DIRECTFB_SOURCES)
|
||||
modules_evas_engines_directfb_module_la_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/lib/eina \
|
||||
-I$(top_builddir)/src/lib/eina \
|
||||
-I$(top_srcdir)/src/lib/eo \
|
||||
-I$(top_builddir)/src/lib/eo \
|
||||
-I$(top_srcdir)/src/lib/evas \
|
||||
-I$(top_builddir)/src/lib/evas \
|
||||
-I$(top_srcdir)/src/lib/evas/include \
|
||||
-I$(top_builddir)/src/lib/evas/include \
|
||||
-I$(top_srcdir)/src/lib/evas/cserve2 \
|
||||
-I$(top_builddir)/src/lib/evas/cserve2 \
|
||||
@evas_engine_directfb_cflags@ \
|
||||
@EFL_CFLAGS@ \
|
||||
@EVAS_CFLAGS@
|
||||
modules_evas_engines_directfb_module_la_LIBADD = \
|
||||
lib/evas/libevas.la \
|
||||
@EFL_LIBS@ \
|
||||
@evas_engine_directfb_libs@
|
||||
modules_evas_engines_directfb_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
modules_evas_engines_directfb_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
endif
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_FB
|
||||
dist_installed_evasmainheaders_DATA += modules/evas/engines/fb/Evas_Engine_FB.h
|
||||
FB_SOURCES = \
|
||||
|
|
|
@ -1,181 +0,0 @@
|
|||
#ifndef _ECORE_DIRECTFB_H
|
||||
#define _ECORE_DIRECTFB_H
|
||||
|
||||
#include <Eina.h>
|
||||
|
||||
#include <directfb.h>
|
||||
|
||||
#ifdef EAPI
|
||||
# undef EAPI
|
||||
#endif /* ifdef EAPI */
|
||||
|
||||
#ifdef __GNUC__
|
||||
# if __GNUC__ >= 4
|
||||
# define EAPI __attribute__ ((visibility("default")))
|
||||
# else /* if __GNUC__ >= 4 */
|
||||
# define EAPI
|
||||
# endif /* if __GNUC__ >= 4 */
|
||||
#else /* ifdef __GNUC__ */
|
||||
# define EAPI
|
||||
#endif /* ifdef __GNUC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* ifdef __cplusplus */
|
||||
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_POSITION;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_SIZE;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_CLOSE;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_DESTROYED;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_GOT_FOCUS;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_LOST_FOCUS;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_KEY_DOWN;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_KEY_UP;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_DOWN;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_UP;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_MOTION;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_ENTER;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_LEAVE;
|
||||
EAPI extern int ECORE_DIRECTFB_EVENT_WHEEL;
|
||||
|
||||
#ifndef _ECORE_DIRECTFB_WINDOW_PREDEF
|
||||
typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
|
||||
#endif /* ifndef _ECORE_DIRECTFB_WINDOW_PREDEF */
|
||||
typedef struct _Ecore_DirectFB_Cursor Ecore_DirectFB_Cursor;
|
||||
|
||||
typedef struct _Ecore_DirectFB_Event_Key_Down Ecore_DirectFB_Event_Key_Down;
|
||||
typedef struct _Ecore_DirectFB_Event_Key_Up Ecore_DirectFB_Event_Key_Up;
|
||||
typedef struct _Ecore_DirectFB_Event_Button_Down Ecore_DirectFB_Event_Button_Down;
|
||||
typedef struct _Ecore_DirectFB_Event_Button_Up Ecore_DirectFB_Event_Button_Up;
|
||||
typedef struct _Ecore_DirectFB_Event_Motion Ecore_DirectFB_Event_Motion;
|
||||
typedef struct _Ecore_DirectFB_Event_Enter Ecore_DirectFB_Event_Enter;
|
||||
typedef struct _Ecore_DirectFB_Event_Leave Ecore_DirectFB_Event_Leave;
|
||||
typedef struct _Ecore_DirectFB_Event_Wheel Ecore_DirectFB_Event_Wheel;
|
||||
typedef struct _Ecore_DirectFB_Event_Got_Focus Ecore_DirectFB_Event_Got_Focus;
|
||||
typedef struct _Ecore_DirectFB_Event_Lost_Focus Ecore_DirectFB_Event_Lost_Focus;
|
||||
|
||||
/* this struct is to keep windows data (id, window itself and surface) in memory as every call
|
||||
* to DirectFB for this values (e.g window->GetSurface(window,&surface)) will increment the
|
||||
* reference count, then we will have to release N times the data, so better we just ask for
|
||||
them once */
|
||||
struct _Ecore_DirectFB_Window
|
||||
{
|
||||
DFBWindowID id;
|
||||
IDirectFBWindow *window;
|
||||
IDirectFBSurface *surface;
|
||||
Ecore_DirectFB_Cursor *cursor;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Cursor
|
||||
{
|
||||
IDirectFBSurface *surface;
|
||||
int hot_x;
|
||||
int hot_y;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Key_Down /** DirectFB Key Down event */
|
||||
{
|
||||
char *name; /**< The name of the key that was released */
|
||||
char *string; /**< The logical symbol of the key that was pressed */
|
||||
char *key_compose; /**< The UTF-8 string conversion if any */
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Key_Up /** DirectFB Key Up event */
|
||||
{
|
||||
char *name; /**< The name of the key that was released */
|
||||
char *string; /**< The logical symbol of the key that was pressed */
|
||||
char *key_compose; /**< The UTF-8 string conversion if any */
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Button_Down
|
||||
{
|
||||
int button;
|
||||
int modifiers;
|
||||
int x, y;
|
||||
unsigned int time;
|
||||
int double_click : 1;
|
||||
int triple_click : 1;
|
||||
DFBWindowID win;
|
||||
};
|
||||
struct _Ecore_DirectFB_Event_Button_Up
|
||||
{
|
||||
int button;
|
||||
int modifiers;
|
||||
int x, y;
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
int double_click : 1;
|
||||
int triple_click : 1;
|
||||
};
|
||||
struct _Ecore_DirectFB_Event_Motion
|
||||
{
|
||||
int modifiers;
|
||||
int x, y;
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Enter
|
||||
{
|
||||
int modifiers;
|
||||
int x, y;
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Leave
|
||||
{
|
||||
int modifiers;
|
||||
int x, y;
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Wheel
|
||||
{
|
||||
int direction;
|
||||
int z;
|
||||
int modifiers;
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Got_Focus
|
||||
{
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
struct _Ecore_DirectFB_Event_Lost_Focus
|
||||
{
|
||||
unsigned int time;
|
||||
DFBWindowID win;
|
||||
};
|
||||
|
||||
/* main functions */
|
||||
EAPI int ecore_directfb_init(const char *name);
|
||||
EAPI int ecore_directfb_shutdown(void);
|
||||
EAPI IDirectFB * ecore_directfb_interface_get(void);
|
||||
|
||||
/* window operations */
|
||||
EAPI Ecore_DirectFB_Window *ecore_directfb_window_new(int x, int y, int w, int h);
|
||||
EAPI void ecore_directfb_window_free(Ecore_DirectFB_Window *window);
|
||||
EAPI void ecore_directfb_window_move(Ecore_DirectFB_Window *window, int x, int y);
|
||||
EAPI void ecore_directfb_window_resize(Ecore_DirectFB_Window *window, int w, int h);
|
||||
EAPI void ecore_directfb_window_focus(Ecore_DirectFB_Window *window);
|
||||
EAPI void ecore_directfb_window_show(Ecore_DirectFB_Window *window);
|
||||
EAPI void ecore_directfb_window_hide(Ecore_DirectFB_Window *window);
|
||||
EAPI void ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *window, Eina_Bool set);
|
||||
EAPI void ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *window, Eina_Bool set);
|
||||
EAPI void ecore_directfb_window_size_get(Ecore_DirectFB_Window *window, int *w, int *h);
|
||||
EAPI void ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *window, Eina_Bool show);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* ifdef __cplusplus */
|
||||
|
||||
#endif /* ifndef _ECORE_DIRECTFB_H */
|
|
@ -1,758 +0,0 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* ifdef HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "Ecore_DirectFB.h"
|
||||
#include "ecore_directfb_private.h"
|
||||
#include "ecore_directfb_keys.h"
|
||||
#include "Ecore.h"
|
||||
#include "ecore_private.h"
|
||||
|
||||
/* ecore_directfb */
|
||||
/******************/
|
||||
/* About */
|
||||
/* with this you can create windows of directfb and handle events through ecore
|
||||
* TODO:
|
||||
* - handle all event types
|
||||
* -
|
||||
* */
|
||||
int _ecore_directfb_log_dom = -1;
|
||||
|
||||
static int _ecore_directfb_init_count = 0;
|
||||
|
||||
static int _window_event_fd = 0;
|
||||
static int _input_event_fd = 0;
|
||||
|
||||
static int _ecore_directfb_fullscreen_window_id = 0;
|
||||
static int _cursor_x = 0;
|
||||
static int _cursor_y = 0;
|
||||
|
||||
EAPI int ECORE_DIRECTFB_EVENT_POSITION = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_SIZE = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_CLOSE = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_DESTROYED = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_GOT_FOCUS = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_LOST_FOCUS = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_KEY_DOWN = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_KEY_UP = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_BUTTON_DOWN = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_BUTTON_UP = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_MOTION = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_ENTER = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_LEAVE = 0;
|
||||
EAPI int ECORE_DIRECTFB_EVENT_WHEEL = 0;
|
||||
|
||||
static Ecore_Fd_Handler *_window_event_fd_handler_handle = NULL;
|
||||
static Ecore_Fd_Handler *_input_event_fd_handler_handle = NULL;
|
||||
|
||||
/* this hash is to store all the possible key names for fast lookup */
|
||||
static Eina_Hash *_ecore_directfb_key_symbols_hash = NULL;
|
||||
|
||||
static IDirectFB *_dfb = NULL; // the main interface
|
||||
static IDirectFBEventBuffer *_window_event; // the main event buffer (all windows are attached to this)
|
||||
static IDirectFBEventBuffer *_input_event; // the main event buffer (all windows are attached to this)
|
||||
static IDirectFBDisplayLayer *_layer; // the main layer
|
||||
static DFBResult _err; // useful for DFBCHECK
|
||||
|
||||
/*******************/
|
||||
/* local functions */
|
||||
/*******************/
|
||||
|
||||
/* free ecore directfb events functions */
|
||||
/****************************************/
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_free_key_down(void *data EINA_UNUSED, void *ev)
|
||||
{
|
||||
Ecore_DirectFB_Event_Key_Down *e;
|
||||
|
||||
e = ev;
|
||||
if(e->name)
|
||||
free(e->name);
|
||||
|
||||
if (e->string)
|
||||
free(e->string);
|
||||
|
||||
if (e->key_compose)
|
||||
free(e->key_compose);
|
||||
|
||||
free(e);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_free_key_up(void *data EINA_UNUSED, void *ev)
|
||||
{
|
||||
Ecore_DirectFB_Event_Key_Up *e;
|
||||
|
||||
e = ev;
|
||||
if(e->name)
|
||||
free(e->name);
|
||||
|
||||
if (e->string)
|
||||
free(e->string);
|
||||
|
||||
if (e->key_compose)
|
||||
free(e->key_compose);
|
||||
|
||||
free(e);
|
||||
}
|
||||
|
||||
/* directfb window input events handler */
|
||||
/****************************************/
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_motion(DFBEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Motion *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Motion));
|
||||
|
||||
switch(evt->clazz)
|
||||
{
|
||||
case DFEC_INPUT:
|
||||
e->modifiers = 0;
|
||||
switch(evt->input.axis)
|
||||
{
|
||||
case DIAI_X:
|
||||
e->x = _cursor_x = evt->input.axisabs;
|
||||
e->y = _cursor_y;
|
||||
break;
|
||||
|
||||
case DIAI_Y:
|
||||
e->y = _cursor_y = evt->input.axisabs;
|
||||
e->x = _cursor_x;
|
||||
break;
|
||||
|
||||
case DIAI_Z:
|
||||
//_ecore_directfb_event_handle_wheel(evt);
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
e->win = _ecore_directfb_fullscreen_window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
case DFEC_WINDOW:
|
||||
e->modifiers = 0;
|
||||
e->x = evt->window.x;
|
||||
e->y = evt->window.y;
|
||||
e->win = evt->window.window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_MOTION, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_key_down(DFBEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Key_Down *e;
|
||||
unsigned int key_symbol;
|
||||
struct keymap *k;
|
||||
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Key_Down));
|
||||
|
||||
switch(evt->clazz)
|
||||
{
|
||||
case DFEC_INPUT:
|
||||
key_symbol = evt->input.key_symbol;
|
||||
k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
|
||||
|
||||
if(!k)
|
||||
{
|
||||
ERR("Symbol %0X of class DFEC_INPUT not found.", evt->input.key_symbol);
|
||||
return;
|
||||
}
|
||||
|
||||
e->name = strdup(k->name);
|
||||
e->string = strdup(k->string);
|
||||
e->key_compose = NULL;
|
||||
e->win = _ecore_directfb_fullscreen_window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
case DFEC_WINDOW:
|
||||
key_symbol = evt->window.key_symbol;
|
||||
k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
|
||||
|
||||
if(!k)
|
||||
{
|
||||
ERR("Symbol %0X of class DFEC_WINDOW not found.", evt->window.key_symbol);
|
||||
return;
|
||||
}
|
||||
|
||||
e->name = strdup(k->name);
|
||||
e->string = strdup(k->string);
|
||||
e->key_compose = NULL;
|
||||
e->win = evt->window.window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, e, _ecore_directfb_event_free_key_down, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_key_up(DFBEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Key_Up *e;
|
||||
unsigned int key_symbol;
|
||||
struct keymap *k;
|
||||
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Key_Up));
|
||||
|
||||
switch(evt->clazz)
|
||||
{
|
||||
case DFEC_INPUT:
|
||||
key_symbol = evt->input.key_symbol;
|
||||
k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
|
||||
|
||||
if(!k)
|
||||
{
|
||||
ERR("Symbol %0X of class DFEC_INPUT not found.", evt->input.key_symbol);
|
||||
return;
|
||||
}
|
||||
|
||||
e->name = strdup(k->name);
|
||||
e->string = strdup(k->string);
|
||||
e->key_compose = NULL;
|
||||
e->win = _ecore_directfb_fullscreen_window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
case DFEC_WINDOW:
|
||||
key_symbol = evt->window.key_symbol;
|
||||
k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
|
||||
|
||||
if(!k)
|
||||
{
|
||||
ERR("Symbol %0X of class DFEC_WINDOW not found.", evt->window.key_symbol);
|
||||
return;
|
||||
}
|
||||
|
||||
e->name = strdup(k->name);
|
||||
e->string = strdup(k->string);
|
||||
e->key_compose = NULL;
|
||||
e->win = evt->window.window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_UP, e, _ecore_directfb_event_free_key_up, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_button_down(DFBEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Button_Down *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Button_Down));
|
||||
|
||||
switch(evt->clazz)
|
||||
{
|
||||
case DFEC_INPUT:
|
||||
e->button = evt->input.button + 1;
|
||||
e->modifiers = 0;
|
||||
DFBCHECK(_layer->GetCursorPosition(_layer,&e->x,&e->y));
|
||||
e->x = _cursor_x;
|
||||
e->y = _cursor_y;
|
||||
e->win = _ecore_directfb_fullscreen_window_id;
|
||||
e->time = 0;
|
||||
|
||||
break;
|
||||
|
||||
case DFEC_WINDOW:
|
||||
e->button = evt->window.button + 1;
|
||||
e->modifiers = 0;
|
||||
e->x = evt->window.x;
|
||||
e->y = evt->window.y;
|
||||
e->win = evt->window.window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_button_up(DFBEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Button_Up *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Button_Up));
|
||||
|
||||
switch(evt->clazz)
|
||||
{
|
||||
case DFEC_INPUT:
|
||||
e->button = evt->input.button + 1;
|
||||
e->modifiers = 0;
|
||||
e->x = _cursor_x;
|
||||
e->y = _cursor_y;
|
||||
e->win = _ecore_directfb_fullscreen_window_id;
|
||||
e->time = 0;
|
||||
|
||||
break;
|
||||
|
||||
case DFEC_WINDOW:
|
||||
e->button = evt->window.button + 1;
|
||||
e->modifiers = 0;
|
||||
e->x = evt->window.x;
|
||||
e->y = evt->window.y;
|
||||
e->win = evt->window.window_id;
|
||||
e->time = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_enter(DFBWindowEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Enter *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Enter));
|
||||
|
||||
e->modifiers = 0;
|
||||
e->x = evt->x;
|
||||
e->y = evt->y;
|
||||
e->win = evt->window_id;
|
||||
e->time = 0;
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_ENTER, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_leave(DFBWindowEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Leave *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Leave));
|
||||
|
||||
e->modifiers = 0;
|
||||
e->x = evt->x;
|
||||
e->y = evt->y;
|
||||
e->win = evt->window_id;
|
||||
e->time = 0;
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_LEAVE, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_wheel(DFBWindowEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Wheel *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Wheel));
|
||||
|
||||
// currently there's no direction (only up/down);
|
||||
e->direction = 0;
|
||||
e->z = evt->step;
|
||||
e->modifiers = 0;
|
||||
e->win = evt->window_id;
|
||||
e->time = 0;
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_WHEEL, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_got_focus(DFBWindowEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Got_Focus *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Got_Focus));
|
||||
|
||||
e->win = evt->window_id;
|
||||
e->time = 0;
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, e, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt)
|
||||
{
|
||||
Ecore_DirectFB_Event_Lost_Focus *e;
|
||||
e = calloc(1, sizeof(Ecore_DirectFB_Event_Lost_Focus));
|
||||
|
||||
e->win = evt->window_id;
|
||||
e->time = 0;
|
||||
|
||||
ecore_event_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, e, NULL, NULL);
|
||||
}
|
||||
|
||||
/* inputs and windows fds handlers */
|
||||
/***********************************/
|
||||
/* TODO fix this to handle windows and input events (fullscreen/window mode)
|
||||
* in fullscreen theres no window_id so get the id from a global var (only one fullscreen
|
||||
* window at a time */
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_directfb_input_event_fd_handler(void *data EINA_UNUSED,Ecore_Fd_Handler *fd_handler EINA_UNUSED)
|
||||
{
|
||||
DFBEvent evt;
|
||||
int v = 0;
|
||||
|
||||
v = read(_input_event_fd, &evt, sizeof(DFBEvent));
|
||||
if (v < 0)
|
||||
return EINA_TRUE;
|
||||
|
||||
if (v < 1)
|
||||
return EINA_TRUE;
|
||||
|
||||
/* we are getting duplicate events, only parse if we are in fullscreen */
|
||||
//if(_ecore_directfb_fullscreen_window_id == 0) break;
|
||||
if(evt.input.type == DIET_KEYPRESS)
|
||||
_ecore_directfb_event_handle_key_down(&evt);
|
||||
|
||||
if(evt.input.type == DIET_KEYRELEASE)
|
||||
_ecore_directfb_event_handle_key_up(&evt);
|
||||
|
||||
if(evt.input.type == DIET_BUTTONPRESS)
|
||||
_ecore_directfb_event_handle_button_down(&evt);
|
||||
|
||||
if(evt.input.type == DIET_BUTTONRELEASE)
|
||||
_ecore_directfb_event_handle_button_up(&evt);
|
||||
|
||||
if(evt.input.type == DIET_AXISMOTION)
|
||||
_ecore_directfb_event_handle_motion(&evt);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_directfb_window_event_fd_handler(void *data EINA_UNUSED,Ecore_Fd_Handler *fd_handler EINA_UNUSED)
|
||||
{
|
||||
DFBEvent evt;
|
||||
int v = 0;
|
||||
|
||||
v = read(_window_event_fd, &evt, sizeof(DFBEvent));
|
||||
if (v < 0)
|
||||
return EINA_TRUE;
|
||||
|
||||
if (v < 1)
|
||||
return EINA_TRUE;
|
||||
|
||||
if(evt.window.type & DWET_POSITION)
|
||||
INF("position");
|
||||
|
||||
if(evt.window.type & DWET_SIZE)
|
||||
INF("size");
|
||||
|
||||
if(evt.window.type & DWET_CLOSE)
|
||||
INF("close");
|
||||
|
||||
if(evt.window.type & DWET_DESTROYED)
|
||||
INF("destroyed");
|
||||
|
||||
if(evt.window.type & DWET_GOTFOCUS)
|
||||
_ecore_directfb_event_handle_got_focus(&evt.window);
|
||||
|
||||
if(evt.window.type & DWET_LOSTFOCUS)
|
||||
_ecore_directfb_event_handle_lost_focus(&evt.window);
|
||||
|
||||
if(evt.window.type & DWET_KEYDOWN)
|
||||
_ecore_directfb_event_handle_key_down(&evt);
|
||||
|
||||
if(evt.window.type & DWET_KEYUP)
|
||||
_ecore_directfb_event_handle_key_up(&evt);
|
||||
|
||||
if(evt.window.type & DWET_BUTTONDOWN)
|
||||
_ecore_directfb_event_handle_button_down(&evt);
|
||||
|
||||
if(evt.window.type & DWET_BUTTONUP)
|
||||
_ecore_directfb_event_handle_button_up(&evt);
|
||||
|
||||
if(evt.window.type & DWET_MOTION)
|
||||
_ecore_directfb_event_handle_motion(&evt);
|
||||
|
||||
if(evt.window.type & DWET_ENTER)
|
||||
_ecore_directfb_event_handle_enter(&evt.window);
|
||||
|
||||
if(evt.window.type & DWET_LEAVE)
|
||||
_ecore_directfb_event_handle_leave(&evt.window);
|
||||
|
||||
if(evt.window.type & DWET_WHEEL)
|
||||
_ecore_directfb_event_handle_wheel(&evt.window);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* api functions */
|
||||
/*****************/
|
||||
|
||||
EAPI IDirectFB *
|
||||
ecore_directfb_interface_get(void)
|
||||
{
|
||||
return _dfb;
|
||||
}
|
||||
|
||||
EAPI Ecore_DirectFB_Window *
|
||||
ecore_directfb_window_new(int x, int y, int w, int h)
|
||||
{
|
||||
Ecore_DirectFB_Window *window;
|
||||
IDirectFBWindow *dfb_window;
|
||||
IDirectFBSurface *dfb_surface = NULL;
|
||||
DFBWindowDescription desc;
|
||||
DFBWindowID id;
|
||||
|
||||
memset(&desc, 0, sizeof(DFBWindowDescription));
|
||||
desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS);
|
||||
desc.posx = x;
|
||||
desc.posy = y;
|
||||
desc.width = w;
|
||||
desc.height = h;
|
||||
desc.caps = DWCAPS_ALPHACHANNEL;
|
||||
|
||||
DFBCHECK(_layer->CreateWindow(_layer, &desc, &dfb_window));
|
||||
|
||||
dfb_window->AttachEventBuffer(dfb_window, _window_event);
|
||||
dfb_window->SetOptions(dfb_window,DWOP_NONE);
|
||||
dfb_window->SetOpacity(dfb_window, 0xFF);
|
||||
|
||||
DFBCHECK(dfb_window->GetID(dfb_window, &id));
|
||||
DFBCHECK(dfb_window->GetSurface(dfb_window,&dfb_surface));
|
||||
|
||||
window = malloc(sizeof(Ecore_DirectFB_Window));
|
||||
window->id = id;
|
||||
window->window = dfb_window;
|
||||
window->surface = dfb_surface;
|
||||
window->cursor = NULL;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_free(Ecore_DirectFB_Window *ecore_window)
|
||||
{
|
||||
DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
|
||||
DFBCHECK(ecore_window->window->Release(ecore_window->window));
|
||||
free(ecore_window);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_move(Ecore_DirectFB_Window *ecore_window, int x, int y)
|
||||
{
|
||||
DFBCHECK(ecore_window->window->MoveTo(ecore_window->window, x, y));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_resize(Ecore_DirectFB_Window *ecore_window, int w, int h)
|
||||
{
|
||||
DFBCHECK(ecore_window->window->Resize(ecore_window->window, w, h));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_focus(Ecore_DirectFB_Window *ecore_window)
|
||||
{
|
||||
DFBCHECK(ecore_window->window->RequestFocus(ecore_window->window));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_hide(Ecore_DirectFB_Window *ecore_window)
|
||||
{
|
||||
DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_show(Ecore_DirectFB_Window *ecore_window)
|
||||
{
|
||||
DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0xFF));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool set)
|
||||
{
|
||||
DFBWindowOptions opts;
|
||||
|
||||
DFBCHECK(ecore_window->window->GetOptions(ecore_window->window, &opts));
|
||||
if(set)
|
||||
{
|
||||
opts |= DWOP_SHAPED;
|
||||
opts |= DWOP_ALPHACHANNEL;
|
||||
DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
|
||||
}
|
||||
else
|
||||
{
|
||||
opts &= ~DWOP_SHAPED;
|
||||
opts &= ~DWOP_ALPHACHANNEL;
|
||||
DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *ecore_window, Eina_Bool show)
|
||||
{
|
||||
if(!show)
|
||||
{
|
||||
/* create an empty cursor and set it */
|
||||
IDirectFBSurface *cursor;
|
||||
DFBSurfaceDescription desc;
|
||||
|
||||
memset(&desc, 0, sizeof(DFBSurfaceDescription));
|
||||
desc.flags = (DSDESC_HEIGHT | DSDESC_WIDTH | DSDESC_PIXELFORMAT);
|
||||
desc.width = 1;
|
||||
desc.height = 1;
|
||||
desc.pixelformat = DSPF_A1;
|
||||
|
||||
DFBCHECK(_dfb->CreateSurface(_dfb,&desc,&cursor));
|
||||
DFBCHECK(cursor->Clear(cursor,0,0,0,0));
|
||||
DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor, 0, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* we already have a cursor surface so set it*/
|
||||
if(ecore_window->cursor)
|
||||
{
|
||||
DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, ecore_window->cursor->surface, ecore_window->cursor->hot_x, ecore_window->cursor->hot_y));
|
||||
}
|
||||
/* or just set the default directfb cursor */
|
||||
else
|
||||
{
|
||||
DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_cursor_set(Ecore_DirectFB_Window *ecore_window, Ecore_DirectFB_Cursor *cursor)
|
||||
{
|
||||
if((!cursor) && (ecore_window->cursor))
|
||||
{
|
||||
ecore_window->cursor = NULL;
|
||||
DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
|
||||
return;
|
||||
}
|
||||
|
||||
if(cursor)
|
||||
{
|
||||
ecore_window->cursor = cursor;
|
||||
DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor->surface, cursor->hot_x, cursor->hot_y));
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool on)
|
||||
{
|
||||
// always release the surface (we are going to get a new one in both cases)
|
||||
DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
|
||||
if(on)
|
||||
{
|
||||
DFBCHECK(_layer->SetCooperativeLevel(_layer,DLSCL_EXCLUSIVE));
|
||||
DFBCHECK(_layer->GetSurface(_layer,&ecore_window->surface));
|
||||
DFBCHECK(_dfb->CreateInputEventBuffer(_dfb, DICAPS_ALL, DFB_FALSE, &_input_event));
|
||||
DFBCHECK(_input_event->CreateFileDescriptor(_input_event,&_input_event_fd));
|
||||
/* the event of axismove sends one axis at a time, so we must store both */
|
||||
DFBCHECK(_layer->GetCursorPosition(_layer,&_cursor_x,&_cursor_y));
|
||||
|
||||
_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);
|
||||
_ecore_directfb_fullscreen_window_id = ecore_window->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
ecore_main_fd_handler_del(_input_event_fd_handler_handle);
|
||||
DFBCHECK(_input_event->Release(_input_event));
|
||||
DFBCHECK(_layer->SetCooperativeLevel(_layer,DLSCL_SHARED));
|
||||
DFBCHECK(ecore_window->window->GetSurface(ecore_window->window, &ecore_window->surface));
|
||||
_ecore_directfb_fullscreen_window_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_directfb_window_size_get(Ecore_DirectFB_Window *ecore_window, int *w, int *h)
|
||||
{
|
||||
DFBCHECK(ecore_window->surface->GetSize(ecore_window->surface,w,h));
|
||||
return;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
ecore_directfb_init(const char *name EINA_UNUSED)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (++_ecore_directfb_init_count != 1)
|
||||
return _ecore_directfb_init_count;
|
||||
|
||||
_ecore_directfb_log_dom = eina_log_domain_register
|
||||
("ecore_directfb", ECORE_DIRECTFB_DEFAULT_LOG_COLOR);
|
||||
if(_ecore_directfb_log_dom < 0)
|
||||
{
|
||||
EINA_LOG_ERR("Impossible to create a log domain for the Ecore directFB module.");
|
||||
return _ecore_directfb_init_count--;
|
||||
}
|
||||
|
||||
DFBCHECK(DirectFBInit(NULL,NULL));
|
||||
DFBCHECK(DirectFBCreate(&_dfb));
|
||||
|
||||
DFBCHECK(_dfb->GetDisplayLayer(_dfb, DLID_PRIMARY, &_layer));
|
||||
DFBCHECK(_layer->SetCooperativeLevel(_layer, DLSCL_SHARED));
|
||||
|
||||
/* window events and fd */
|
||||
DFBCHECK(_dfb->CreateEventBuffer(_dfb, &_window_event));
|
||||
DFBCHECK(_window_event->CreateFileDescriptor(_window_event,&_window_event_fd));
|
||||
_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);
|
||||
|
||||
/* register ecore directfb events */
|
||||
ECORE_DIRECTFB_EVENT_POSITION = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_SIZE = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_CLOSE = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_DESTROYED = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_GOT_FOCUS = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_LOST_FOCUS = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_KEY_DOWN = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_KEY_UP = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_BUTTON_DOWN = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_BUTTON_UP = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_MOTION = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_ENTER = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_LEAVE = ecore_event_type_new();
|
||||
ECORE_DIRECTFB_EVENT_WHEEL = ecore_event_type_new();
|
||||
|
||||
/* create the hash table for the keynames */
|
||||
_ecore_directfb_key_symbols_hash = eina_hash_int32_new(free);
|
||||
for(i = 0; i < _ecore_directfb_key_symbols_count; i++)
|
||||
{
|
||||
struct keymap *k;
|
||||
k = malloc(sizeof(struct keymap));
|
||||
k->name = _ecore_directfb_key_symbols[i].name;
|
||||
k->string = _ecore_directfb_key_symbols[i].string;
|
||||
eina_hash_add(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id, k);
|
||||
}
|
||||
/* create the hash for the windows(key = windowid, val = Ecore_DirectFB_Window struct) */
|
||||
return _ecore_directfb_init_count;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
ecore_directfb_shutdown(void)
|
||||
{
|
||||
if (--_ecore_directfb_init_count != 0)
|
||||
return _ecore_directfb_init_count;
|
||||
|
||||
ecore_main_fd_handler_del(_window_event_fd_handler_handle);
|
||||
eina_hash_free(_ecore_directfb_key_symbols_hash);
|
||||
|
||||
if(_ecore_directfb_fullscreen_window_id)
|
||||
{
|
||||
DFBCHECK(_input_event->Release(_input_event));
|
||||
ecore_main_fd_handler_del(_input_event_fd_handler_handle);
|
||||
}
|
||||
|
||||
DFBCHECK(_window_event->Release(_window_event));
|
||||
DFBCHECK(_layer->Release(_layer));
|
||||
DFBCHECK(_dfb->Release(_dfb));
|
||||
eina_log_domain_unregister(_ecore_directfb_log_dom);
|
||||
_ecore_directfb_log_dom = -1;
|
||||
return _ecore_directfb_init_count;
|
||||
}
|
||||
|
|
@ -1,184 +0,0 @@
|
|||
typedef struct _Ecore_DirectFB_Key_Symbols Ecore_DirectFB_Key_Symbols;
|
||||
struct _Ecore_DirectFB_Key_Symbols
|
||||
{
|
||||
char *string;
|
||||
char *name;
|
||||
unsigned int id;
|
||||
};
|
||||
|
||||
static const Ecore_DirectFB_Key_Symbols _ecore_directfb_key_symbols[] = {
|
||||
{"\010", "BackSpace",DIKS_BACKSPACE},
|
||||
{"\011", "Tab", DIKS_TAB},
|
||||
{"\015", "Return", DIKS_RETURN},
|
||||
{"", "Cancel", DIKS_CANCEL},
|
||||
{"", "Escape", DIKS_ESCAPE},
|
||||
{" ", "space", DIKS_SPACE},
|
||||
{"!", "exclam", DIKS_EXCLAMATION_MARK},
|
||||
{"\"", "quotedbl", DIKS_QUOTATION},
|
||||
{"#", "numbersign", DIKS_NUMBER_SIGN},
|
||||
{"$", "dollar", DIKS_DOLLAR_SIGN},
|
||||
{"%", "percent", DIKS_PERCENT_SIGN},
|
||||
{"&", "ampersand", DIKS_AMPERSAND},
|
||||
{"'", "apostrophe", DIKS_APOSTROPHE},
|
||||
{"(", "parenleft", DIKS_PARENTHESIS_LEFT},
|
||||
{")", "parenright", DIKS_PARENTHESIS_RIGHT},
|
||||
{"*", "asterisk", DIKS_ASTERISK},
|
||||
{"+", "plus", DIKS_PLUS_SIGN},
|
||||
{",", "comma", DIKS_COMMA},
|
||||
{"-", "minus", DIKS_MINUS_SIGN},
|
||||
{".", "period", DIKS_PERIOD},
|
||||
{"/", "slash", DIKS_SLASH},
|
||||
{"0", "0", DIKS_0},
|
||||
{"1", "1", DIKS_1},
|
||||
{"2", "2", DIKS_2},
|
||||
{"3", "3", DIKS_3},
|
||||
{"4", "4", DIKS_4},
|
||||
{"5", "5", DIKS_5},
|
||||
{"6", "6", DIKS_6},
|
||||
{"7", "7", DIKS_7},
|
||||
{"8", "8", DIKS_8},
|
||||
{"9", "9", DIKS_9},
|
||||
{":", "colon", DIKS_COLON},
|
||||
{";", "semicolon", DIKS_SEMICOLON},
|
||||
{"<", "less", DIKS_LESS_THAN_SIGN},
|
||||
{"=", "equal", DIKS_EQUALS_SIGN},
|
||||
{">", "greater", DIKS_GREATER_THAN_SIGN},
|
||||
{"?", "question", DIKS_QUESTION_MARK},
|
||||
{"@", "at", DIKS_AT},
|
||||
{"A", "A", DIKS_CAPITAL_A },
|
||||
{"B", "B", DIKS_CAPITAL_B },
|
||||
{"C", "C", DIKS_CAPITAL_C },
|
||||
{"D", "D", DIKS_CAPITAL_D },
|
||||
{"E", "E", DIKS_CAPITAL_E },
|
||||
{"F", "F", DIKS_CAPITAL_F },
|
||||
{"G", "G", DIKS_CAPITAL_G },
|
||||
{"H", "H", DIKS_CAPITAL_H },
|
||||
{"I", "I", DIKS_CAPITAL_I },
|
||||
{"J", "J", DIKS_CAPITAL_J },
|
||||
{"K", "K", DIKS_CAPITAL_K },
|
||||
{"L", "L", DIKS_CAPITAL_L },
|
||||
{"M", "M", DIKS_CAPITAL_M },
|
||||
{"N", "N", DIKS_CAPITAL_N },
|
||||
{"O", "O", DIKS_CAPITAL_O },
|
||||
{"P", "P", DIKS_CAPITAL_P },
|
||||
{"Q", "Q", DIKS_CAPITAL_Q },
|
||||
{"R", "R", DIKS_CAPITAL_R },
|
||||
{"S", "S", DIKS_CAPITAL_S },
|
||||
{"T", "T", DIKS_CAPITAL_T },
|
||||
{"U", "U", DIKS_CAPITAL_U },
|
||||
{"V", "V", DIKS_CAPITAL_V },
|
||||
{"W", "W", DIKS_CAPITAL_W },
|
||||
{"X", "X", DIKS_CAPITAL_X },
|
||||
{"Y", "Y", DIKS_CAPITAL_Y },
|
||||
{"Z", "Z", DIKS_CAPITAL_Z },
|
||||
{"[", "bracketleft", DIKS_SQUARE_BRACKET_LEFT },
|
||||
{"\\", "backslash", DIKS_BACKSLASH },
|
||||
{"]", "bracketright", DIKS_SQUARE_BRACKET_RIGHT },
|
||||
{"^", "asciicircum", DIKS_CIRCUMFLEX_ACCENT },
|
||||
{"_", "underscore", DIKS_UNDERSCORE },
|
||||
{"`", "grave", DIKS_GRAVE_ACCENT},
|
||||
{"a", "a", DIKS_SMALL_A },
|
||||
{"b","b", DIKS_SMALL_B },
|
||||
{"c","c", DIKS_SMALL_C },
|
||||
{"d","d", DIKS_SMALL_D },
|
||||
{"e","e", DIKS_SMALL_E },
|
||||
{"f","f", DIKS_SMALL_F },
|
||||
{"g","g", DIKS_SMALL_G },
|
||||
{"h","h", DIKS_SMALL_H },
|
||||
{"i","i", DIKS_SMALL_I },
|
||||
{"j","j", DIKS_SMALL_J },
|
||||
{"k","k", DIKS_SMALL_K },
|
||||
{"l","l", DIKS_SMALL_L },
|
||||
{"m","m", DIKS_SMALL_M },
|
||||
{"n","n", DIKS_SMALL_N },
|
||||
{"o", "o", DIKS_SMALL_O },
|
||||
{"p", "p", DIKS_SMALL_P },
|
||||
{"q", "q", DIKS_SMALL_Q },
|
||||
{"r", "r", DIKS_SMALL_R },
|
||||
{"s", "s", DIKS_SMALL_S },
|
||||
{"t", "t", DIKS_SMALL_T },
|
||||
{"u", "u", DIKS_SMALL_U },
|
||||
{"v", "v", DIKS_SMALL_V },
|
||||
{"w", "w", DIKS_SMALL_W },
|
||||
{"x", "x", DIKS_SMALL_X },
|
||||
{"y", "y", DIKS_SMALL_Y },
|
||||
{"z", "z", DIKS_SMALL_Z },
|
||||
{"{", "braceleft",DIKS_CURLY_BRACKET_LEFT },
|
||||
{"|", "bar", DIKS_VERTICAL_BAR },
|
||||
{"}", "braceright", DIKS_CURLY_BRACKET_RIGHT },
|
||||
{"~", "asciitilde", DIKS_TILDE },
|
||||
{"\177", "Delete", DIKS_DELETE },
|
||||
{"", "Left", DIKS_CURSOR_LEFT },
|
||||
{"", "Right", DIKS_CURSOR_RIGHT},
|
||||
{"", "Up", DIKS_CURSOR_UP},
|
||||
{"", "Down", DIKS_CURSOR_DOWN},
|
||||
{"", "Insert", DIKS_INSERT},
|
||||
{"", "Home", DIKS_HOME},
|
||||
{"", "End", DIKS_END},
|
||||
{"", "Page_Up", DIKS_PAGE_UP},
|
||||
{"", "Page_Down", DIKS_PAGE_DOWN},
|
||||
{"", "Print", DIKS_PRINT},
|
||||
{"", "Pause", DIKS_PAUSE},
|
||||
/* ok */
|
||||
{"", "Select",DIKS_SELECT},
|
||||
/* goto */
|
||||
{"", "Clear", DIKS_CLEAR},
|
||||
/* power */
|
||||
/* power 2 */
|
||||
/* option */
|
||||
{"", "Menu",DIKS_MENU},
|
||||
{"", "Help",DIKS_HELP},
|
||||
/* info */
|
||||
/* time */
|
||||
/* vendor */
|
||||
/* archive */
|
||||
/* program */
|
||||
/* channel */
|
||||
/* favorites */
|
||||
/* hasta next */
|
||||
{"", "Next",DIKS_NEXT},
|
||||
{"", "Begin",DIKS_BEGIN},
|
||||
/* digits */
|
||||
/* teen */
|
||||
/* twen */
|
||||
{"", "Break", DIKS_BREAK},
|
||||
/* exit */
|
||||
/* setup */
|
||||
{"", "upleftcorner", DIKS_CURSOR_LEFT_UP },
|
||||
{"", "lowleftcorner", DIKS_CURSOR_LEFT_DOWN },
|
||||
{"", "uprightcorner", DIKS_CURSOR_UP_RIGHT },
|
||||
{"", "lowrightcorner",DIKS_CURSOR_DOWN_RIGHT },
|
||||
{"", "F1",DIKS_F1},
|
||||
{"", "F2",DIKS_F2},
|
||||
{"", "F3",DIKS_F3},
|
||||
{"", "F4",DIKS_F4},
|
||||
{"", "F5",DIKS_F5},
|
||||
{"", "F6",DIKS_F6},
|
||||
{"", "F7",DIKS_F7},
|
||||
{"", "F8",DIKS_F8},
|
||||
{"", "F9",DIKS_F9},
|
||||
{"", "F10",DIKS_F10},
|
||||
{"", "F11",DIKS_F11},
|
||||
{"", "F12",DIKS_F12},
|
||||
/* this are only mapped to one, not left right */
|
||||
{"", "Shift_L", DIKS_SHIFT},
|
||||
/*{"Shift_R",0xFFE2},*/
|
||||
{"", "Control_L", DIKS_CONTROL},
|
||||
/*{"Control_R",0xFFE4},*/
|
||||
{"", "Meta_L", DIKS_META},
|
||||
/* {"Meta_R",0xFFE8},*/
|
||||
{"", "Alt_L", DIKS_ALT},
|
||||
{"", "Alt_R", DIKS_ALTGR},
|
||||
{"", "Super_L", DIKS_SUPER},
|
||||
/*{"Super_R",0xFFEC},*/
|
||||
{"", "Hyper_L", DIKS_HYPER},
|
||||
/*{"Hyper_R",0xFFEE},*/
|
||||
|
||||
{"", "Caps_Lock", DIKS_CAPS_LOCK},
|
||||
{"", "Num_Lock", DIKS_NUM_LOCK},
|
||||
{"", "Scroll_Lock", DIKS_SCROLL_LOCK},
|
||||
/* not included the dead keys */
|
||||
/* not included the custom keys */
|
||||
{"", "VoidSymbol", DIKS_NULL}
|
||||
};
|
||||
static int _ecore_directfb_key_symbols_count = sizeof(_ecore_directfb_key_symbols) / sizeof(Ecore_DirectFB_Key_Symbols);
|
|
@ -1,52 +0,0 @@
|
|||
#ifndef _ECORE_DIRECTFB_PRIVATE_H
|
||||
#define _ECORE_DIRECTFB_PRIVATE_H
|
||||
/* eina_log related things */
|
||||
|
||||
extern int _ecore_directfb_log_dom;
|
||||
|
||||
#ifdef ECORE_DIRECTFB_DEFAULT_LOG_COLOR
|
||||
#undef ECORE_DIRECTFB_DEFAULT_LOG_COLOR
|
||||
#endif /* ifdef ECORE_DIRECTFB_DEFAULT_LOG_COLOR */
|
||||
#define ECORE_DIRECTFB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
|
||||
|
||||
#ifdef ERR
|
||||
# undef ERR
|
||||
#endif /* ifdef ERR */
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_ecore_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef DBG
|
||||
# undef DBG
|
||||
#endif /* ifdef DBG */
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_ecore_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef INF
|
||||
# undef INF
|
||||
#endif /* ifdef INF */
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_ecore_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef WRN
|
||||
# undef WRN
|
||||
#endif /* ifdef WRN */
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_ecore_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef CRIT
|
||||
# undef CRIT
|
||||
#endif /* ifdef CRIT */
|
||||
#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
/* macro for a safe call to DirectFB functions */
|
||||
#define DFBCHECK(x ...)\
|
||||
{\
|
||||
_err = x;\
|
||||
if (_err != DFB_OK) {\
|
||||
CRIT("%s <%d>:\n\t", __FILE__, __LINE__ );\
|
||||
DirectFBErrorFatal( # x, _err );\
|
||||
}\
|
||||
}
|
||||
|
||||
struct keymap
|
||||
{
|
||||
char *name;
|
||||
char *string;
|
||||
};
|
||||
#endif /* ifndef _ECORE_DIRECTFB_PRIVATE_H */
|
|
@ -93,7 +93,7 @@ extern "C" {
|
|||
#define HAVE_ECORE_EVAS_FB 1
|
||||
#define HAVE_ECORE_EVAS_X11_GL 1
|
||||
//#define HAVE_ECORE_EVAS_X11_16 1
|
||||
#define HAVE_ECORE_EVAS_DIRECTFB 1
|
||||
//#define HAVE_ECORE_EVAS_DIRECTFB 1
|
||||
#define HAVE_ECORE_EVAS_WIN32 1
|
||||
#define HAVE_ECORE_EVAS_COCOA 1
|
||||
#define HAVE_ECORE_EVAS_SDL 1
|
||||
|
@ -935,8 +935,8 @@ EAPI void ecore_evas_software_x11_16_extra_event_window_add(Ecore_Eva
|
|||
|
||||
EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
|
||||
|
||||
EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
|
||||
EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
|
||||
EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h) EINA_DEPRECATED;
|
||||
EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee) EINA_DEPRECATED;
|
||||
|
||||
|
||||
EAPI 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);
|
||||
|
|
|
@ -146,11 +146,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
|
|||
return EINA_FALSE;
|
||||
#endif
|
||||
case ECORE_EVAS_ENGINE_DIRECTFB:
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
return EINA_TRUE;
|
||||
#else
|
||||
return EINA_FALSE;
|
||||
#endif
|
||||
case ECORE_EVAS_ENGINE_SOFTWARE_FB:
|
||||
#ifdef BUILD_ECORE_EVAS_FB
|
||||
return EINA_TRUE;
|
||||
|
@ -304,9 +300,6 @@ ecore_evas_shutdown(void)
|
|||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
||||
while (_ecore_evas_buffer_shutdown());
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
while (_ecore_evas_directfb_shutdown());
|
||||
#endif
|
||||
|
||||
if (_ecore_evas_async_events_fd)
|
||||
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,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
static Ecore_Evas *
|
||||
_ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
char *disp_name = NULL;
|
||||
unsigned int windowed = 1;
|
||||
|
||||
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
|
||||
_ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
|
||||
|
||||
ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
|
||||
free(disp_name);
|
||||
|
||||
return ee;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_FB
|
||||
static Ecore_Evas *
|
||||
_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[] = {
|
|||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
|
||||
{"software_8_x11", _ecore_evas_constructor_software_8_x11},
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
{"directfb", _ecore_evas_constructor_directfb},
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_FB
|
||||
{"fb", _ecore_evas_constructor_fb},
|
||||
#endif
|
||||
|
|
|
@ -6,602 +6,22 @@
|
|||
|
||||
#include <Ecore.h>
|
||||
#include "ecore_private.h"
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
#include <Ecore_DirectFB.h>
|
||||
#endif
|
||||
|
||||
#include "ecore_evas_private.h"
|
||||
#include "Ecore_Evas.h"
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
static int _ecore_evas_init_count = 0;
|
||||
static Ecore_Event_Handler *ecore_evas_event_handlers[13];
|
||||
/* Ecore_Evas DirectFB support was removed. However we keep the functions
|
||||
* to not break ABI.
|
||||
*/
|
||||
|
||||
static Eina_Hash *ecore_evases_hash = NULL;
|
||||
|
||||
static int
|
||||
_ecore_evas_directfb_render(Ecore_Evas *ee)
|
||||
{
|
||||
Eina_List *updates, *ll;
|
||||
Ecore_Evas *ee2;
|
||||
int rend = 0;
|
||||
|
||||
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
||||
{
|
||||
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
||||
if (ee2->engine.func->fn_render)
|
||||
rend |= ee2->engine.func->fn_render(ee2);
|
||||
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
||||
}
|
||||
|
||||
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
||||
updates = evas_render_updates(ee->evas);
|
||||
if (updates)
|
||||
{
|
||||
evas_render_updates_free(updates);
|
||||
_ecore_evas_idle_timeout_update(ee);
|
||||
}
|
||||
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
||||
|
||||
return updates ? 1 : rend;
|
||||
}
|
||||
|
||||
static char *
|
||||
_ecore_evas_directfb_winid_str_get(Ecore_X_Window win)
|
||||
{
|
||||
const char *vals = "qWeRtYuIoP5$&<~";
|
||||
static char id[9];
|
||||
unsigned int val;
|
||||
val = (unsigned int)win;
|
||||
id[0] = vals[(val >> 28) & 0xf];
|
||||
id[1] = vals[(val >> 24) & 0xf];
|
||||
id[2] = vals[(val >> 20) & 0xf];
|
||||
id[3] = vals[(val >> 16) & 0xf];
|
||||
id[4] = vals[(val >> 12) & 0xf];
|
||||
id[5] = vals[(val >> 8) & 0xf];
|
||||
id[6] = vals[(val >> 4) & 0xf];
|
||||
id[7] = vals[(val ) & 0xf];
|
||||
id[8] = 0;
|
||||
return id;
|
||||
}
|
||||
|
||||
static Ecore_Evas *
|
||||
_ecore_evas_directfb_match(DFBWindowID win)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
|
||||
ee = eina_hash_find(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(win));
|
||||
return ee;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Key_Down *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
evas_event_feed_key_down(ee->evas, e->name, e->name, e->string,
|
||||
e->key_compose, e->time, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_key_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Key_Up *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
evas_event_feed_key_up(ee->evas, e->name, e->name, e->string,
|
||||
e->key_compose, e->time, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_motion(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Motion *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_button_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Button_Down *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
// _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
||||
evas_event_feed_mouse_down(ee->evas, e->button, EVAS_BUTTON_NONE, e->time, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_button_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Button_Up *e;
|
||||
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
//_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
||||
evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Enter *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
evas_event_feed_mouse_in(ee->evas, e->time, NULL);
|
||||
//_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Leave *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
|
||||
//_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
||||
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
||||
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Wheel *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->time, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Got_Focus *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
ee->prop.focused = 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_evas_directfb_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Event_Lost_Focus *e;
|
||||
|
||||
e = event;
|
||||
ee = _ecore_evas_directfb_match(e->win);
|
||||
|
||||
if (!ee) return EINA_TRUE; /* pass on event */
|
||||
ee->prop.focused = 0;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
_ecore_evas_directfb_shutdown(void)
|
||||
{
|
||||
_ecore_evas_init_count--;
|
||||
if (_ecore_evas_init_count == 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
ecore_event_handler_del(ecore_evas_event_handlers[i]);
|
||||
}
|
||||
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
||||
return _ecore_evas_init_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int
|
||||
_ecore_evas_directfb_init(void)
|
||||
{
|
||||
_ecore_evas_init_count++;
|
||||
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
||||
|
||||
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, _ecore_evas_directfb_event_key_down, NULL);
|
||||
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_KEY_UP, _ecore_evas_directfb_event_key_up, NULL);
|
||||
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, _ecore_evas_directfb_event_button_down, NULL);
|
||||
ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, _ecore_evas_directfb_event_button_up, NULL);
|
||||
ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_MOTION, _ecore_evas_directfb_event_motion, NULL);
|
||||
ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_ENTER, _ecore_evas_directfb_event_enter, NULL);
|
||||
ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_LEAVE, _ecore_evas_directfb_event_leave, NULL);
|
||||
ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_WHEEL, _ecore_evas_directfb_event_wheel, NULL);
|
||||
ecore_evas_event_handlers[8] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, _ecore_evas_directfb_event_got_focus, NULL);
|
||||
ecore_evas_event_handlers[9] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, _ecore_evas_directfb_event_lost_focus, NULL);
|
||||
ecore_evas_event_handlers[10] = NULL;
|
||||
ecore_evas_event_handlers[11] = NULL;
|
||||
ecore_evas_event_handlers[12] = NULL;
|
||||
|
||||
return _ecore_evas_init_count;
|
||||
}
|
||||
|
||||
/* engine functions */
|
||||
/********************/
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_free(Ecore_Evas *ee)
|
||||
{
|
||||
eina_hash_del(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
|
||||
ecore_directfb_window_free(ee->engine.directfb.window);
|
||||
_ecore_evas_directfb_shutdown();
|
||||
ecore_directfb_shutdown();
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_move(Ecore_Evas *ee, int x, int y)
|
||||
{
|
||||
ecore_directfb_window_move(ee->engine.directfb.window, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_resize(Ecore_Evas *ee, int w, int h)
|
||||
{
|
||||
ee->req.w = w;
|
||||
ee->req.h = h;
|
||||
if ((w == ee->w) && (h == ee->h)) return;
|
||||
ecore_directfb_window_resize(ee->engine.directfb.window, w, h);
|
||||
ee->w = w;
|
||||
ee->h = h;
|
||||
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||
{
|
||||
evas_output_size_set(ee->evas, ee->h, ee->w);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_focus_set(Ecore_Evas *ee, int on EINA_UNUSED)
|
||||
{
|
||||
ecore_directfb_window_focus(ee->engine.directfb.window);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_hide(Ecore_Evas *ee)
|
||||
{
|
||||
ecore_directfb_window_hide(ee->engine.directfb.window);
|
||||
ee->should_be_visible = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_show(Ecore_Evas *ee)
|
||||
{
|
||||
ecore_directfb_window_show(ee->engine.directfb.window);
|
||||
ee->should_be_visible = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_shaped_set(Ecore_Evas *ee, int shaped)
|
||||
{
|
||||
if (((ee->shaped) && (shaped)) || ((!ee->shaped) && (!shaped)))
|
||||
return;
|
||||
ee->shaped = shaped;
|
||||
if(ee->shaped)
|
||||
ecore_directfb_window_shaped_set(ee->engine.directfb.window, 1);
|
||||
else
|
||||
ecore_directfb_window_shaped_set(ee->engine.directfb.window, 0);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
|
||||
ee = data;
|
||||
if (ee)
|
||||
ee->prop.cursor.object = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
ee->prop.cursor.object = NULL;
|
||||
ee->prop.cursor.layer = 0;
|
||||
ee->prop.cursor.hot.x = 0;
|
||||
ee->prop.cursor.hot.y = 0;
|
||||
ecore_directfb_window_cursor_show(ee->engine.directfb.window, 1);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
ee->prop.cursor.object = obj;
|
||||
ee->prop.cursor.layer = layer;
|
||||
ee->prop.cursor.hot.x = hot_x;
|
||||
ee->prop.cursor.hot.y = hot_y;
|
||||
|
||||
ecore_directfb_window_cursor_show(ee->engine.directfb.window, 0);
|
||||
|
||||
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
||||
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
|
||||
evas_object_move(ee->prop.cursor.object,x - ee->prop.cursor.hot.x,y - ee->prop.cursor.hot.y);
|
||||
evas_object_pass_events_set(ee->prop.cursor.object, 1);
|
||||
if (evas_pointer_inside_get(ee->evas))
|
||||
evas_object_show(ee->prop.cursor.object);
|
||||
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_directfb_fullscreen_set(Ecore_Evas *ee, int on)
|
||||
{
|
||||
Evas_Engine_Info_DirectFB *einfo;
|
||||
int w;
|
||||
int h;
|
||||
int resized = 0;
|
||||
|
||||
if (((ee->prop.fullscreen) && (on)) || ((!ee->prop.fullscreen) && (!on)))
|
||||
return;
|
||||
|
||||
if (on)
|
||||
ecore_directfb_window_fullscreen_set(ee->engine.directfb.window, 1);
|
||||
else
|
||||
ecore_directfb_window_fullscreen_set(ee->engine.directfb.window, 0);
|
||||
/* set the new size of the evas */
|
||||
ecore_directfb_window_size_get(ee->engine.directfb.window, &w, &h);
|
||||
if( (ee->w != w) || (ee->h != h))
|
||||
{
|
||||
resized = 1;
|
||||
ee->w = w;
|
||||
ee->h = h;
|
||||
ee->req.w = ee->w;
|
||||
ee->req.h = ee->h;
|
||||
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||
{
|
||||
evas_output_size_set(ee->evas, ee->h, ee->w);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||
}
|
||||
}
|
||||
einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(ee->evas);
|
||||
if (einfo)
|
||||
{
|
||||
einfo->info.surface = ee->engine.directfb.window->surface;
|
||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||
{
|
||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||
}
|
||||
}
|
||||
ee->prop.fullscreen = on;
|
||||
if (resized)
|
||||
{
|
||||
if(ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
_ecore_evas_directfb_window_get(const Ecore_Evas *ee)
|
||||
{
|
||||
return ee->engine.directfb.window;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
|
||||
{
|
||||
_ecore_evas_directfb_free, /* free an ecore_evas */
|
||||
NULL, /* cb resize */
|
||||
NULL, /* cb move */
|
||||
NULL, /* cb show */
|
||||
NULL, /* cb hide */
|
||||
NULL, /* cb delete request */
|
||||
NULL, /* cb destroy */
|
||||
NULL, /* cb focus in */
|
||||
NULL, /* cb focus out */
|
||||
NULL, /* cb sticky */
|
||||
NULL, /* cb unsticky */
|
||||
NULL, /* cb mouse in */
|
||||
NULL, /* cb mouse out */
|
||||
NULL, /* cb pre render */
|
||||
NULL, /* cb post render */
|
||||
_ecore_evas_directfb_move, /* move */
|
||||
NULL, /* managed move */
|
||||
_ecore_evas_directfb_resize, /* resize */
|
||||
NULL, /* move resize */
|
||||
NULL,//_ecore_evas_directfb_rotation_set,/* rotation */
|
||||
_ecore_evas_directfb_shaped_set, /* shaped */
|
||||
_ecore_evas_directfb_show, /* show */
|
||||
_ecore_evas_directfb_hide, /* hide */
|
||||
NULL, /* raise */
|
||||
NULL, /* lower */
|
||||
NULL, /* activate */
|
||||
NULL, /* title set */
|
||||
NULL, /* name class set */
|
||||
NULL, /* size min */
|
||||
NULL, /* size max */
|
||||
NULL, /* size base */
|
||||
NULL, /* size step */
|
||||
_ecore_evas_directfb_object_cursor_set, /* set cursor to an evas object */
|
||||
NULL, /* layer set */
|
||||
_ecore_evas_directfb_focus_set, /* focus */
|
||||
NULL, /* iconified */
|
||||
NULL, /* borderless */
|
||||
NULL, /* override */
|
||||
NULL, /* maximized */
|
||||
_ecore_evas_directfb_fullscreen_set,/* fullscreen */
|
||||
NULL, /* avoid damage */
|
||||
NULL, /* withdrawn */
|
||||
NULL, /* sticky */
|
||||
NULL, /* ignore events */
|
||||
NULL, /* alpha */
|
||||
NULL, //transparent
|
||||
NULL, // profiles_set
|
||||
NULL, // profile_set
|
||||
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
NULL, // render
|
||||
NULL, // screen_geometry_get
|
||||
NULL // screen_dpi_get
|
||||
};
|
||||
#endif
|
||||
|
||||
/* api */
|
||||
/*******/
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
EAPI Ecore_Evas *
|
||||
ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h)
|
||||
{
|
||||
Evas_Engine_Info_DirectFB *einfo;
|
||||
Ecore_Evas *ee;
|
||||
Ecore_DirectFB_Window *window;
|
||||
int rmethod;
|
||||
|
||||
rmethod = evas_render_method_lookup("directfb");
|
||||
if (!rmethod) return NULL;
|
||||
if (!ecore_directfb_init(disp_name)) return NULL;
|
||||
ee = calloc(1, sizeof(Ecore_Evas));
|
||||
if (!ee) return NULL;
|
||||
|
||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||
_ecore_evas_directfb_init();
|
||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_directfb_engine_func;
|
||||
|
||||
ee->driver = "directfb";
|
||||
if (disp_name) ee->name = strdup(disp_name);
|
||||
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
|
||||
ee->rotation = 0;
|
||||
ee->visible = 1;
|
||||
ee->x = x;
|
||||
ee->y = y;
|
||||
ee->w = w;
|
||||
ee->h = h;
|
||||
ee->req.x = ee->x;
|
||||
ee->req.y = ee->y;
|
||||
ee->req.w = ee->w;
|
||||
ee->req.h = ee->h;
|
||||
ee->prop.layer = 1;
|
||||
ee->prop.fullscreen = 0;
|
||||
|
||||
/* init evas here */
|
||||
ee->evas = evas_new();
|
||||
evas_data_attach_set(ee->evas, ee);
|
||||
evas_output_method_set(ee->evas, rmethod);
|
||||
evas_output_size_set(ee->evas, w, h);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
||||
einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(ee->evas);
|
||||
|
||||
window = ecore_directfb_window_new(x,y,w,h);
|
||||
ee->engine.directfb.window = window;
|
||||
if (einfo)
|
||||
{
|
||||
einfo->info.dfb = ecore_directfb_interface_get();
|
||||
einfo->info.surface = window->surface;
|
||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||
{
|
||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||
ecore_evas_free(ee);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
|
||||
ecore_evas_free(ee);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ee->engine.func->fn_render = _ecore_evas_directfb_render;
|
||||
_ecore_evas_register(ee);
|
||||
|
||||
if (!ecore_evases_hash)
|
||||
ecore_evases_hash = eina_hash_string_superfast_new(NULL);
|
||||
eina_hash_add(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
|
||||
|
||||
return ee;
|
||||
}
|
||||
#else
|
||||
EAPI Ecore_Evas *
|
||||
ecore_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)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
EAPI Ecore_DirectFB_Window *
|
||||
ecore_evas_directfb_window_get(const Ecore_Evas *ee)
|
||||
{
|
||||
if (!(!strcmp(ee->driver, "directfb"))) return 0;
|
||||
return (Ecore_DirectFB_Window *) _ecore_evas_directfb_window_get(ee);
|
||||
}
|
||||
#else
|
||||
EAPI Ecore_DirectFB_Window *
|
||||
ecore_evas_directfb_window_get(const Ecore_Evas *ee EINA_UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -33,11 +33,6 @@
|
|||
# include <Evas_Engine_FB.h>
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
# include <Evas_Engine_DirectFB.h>
|
||||
# include "Ecore_DirectFB.h"
|
||||
#endif
|
||||
|
||||
#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
|
||||
# include <Evas_Engine_Buffer.h>
|
||||
#endif
|
||||
|
@ -242,11 +237,6 @@ struct _Ecore_Evas_Engine
|
|||
void *data;
|
||||
} buffer;
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
struct {
|
||||
Ecore_DirectFB_Window *window;
|
||||
} directfb;
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
||||
struct {
|
||||
Ecore_Win32_Window *parent;
|
||||
|
@ -404,9 +394,6 @@ int _ecore_evas_fb_shutdown(void);
|
|||
int _ecore_evas_buffer_shutdown(void);
|
||||
int _ecore_evas_buffer_render(Ecore_Evas *ee);
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_DIRECTFB
|
||||
int _ecore_evas_directfb_shutdown(void);
|
||||
#endif
|
||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
||||
int _ecore_evas_win32_shutdown(void);
|
||||
#endif
|
||||
|
|
|
@ -8639,8 +8639,7 @@ EAPI void evas_object_image_data_set(Evas_Object *obj,
|
|||
* Each time you call this function on an image object, its data
|
||||
* buffer will have an internal reference counter
|
||||
* incremented. Decrement it back by using
|
||||
* evas_object_image_data_set(). This is specially important for the
|
||||
* directfb Evas engine.
|
||||
* evas_object_image_data_set().
|
||||
*
|
||||
* This is best suited for when you want to modify an existing image,
|
||||
* without changing its dimensions.
|
||||
|
|
|
@ -93,7 +93,6 @@ evas_module_paths_init(void)
|
|||
{ evas_##Tn##_##Name##_init, evas_##Tn##_##Name##_shutdown }
|
||||
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(engine, buffer);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(engine, directfb);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11);
|
||||
EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl);
|
||||
|
@ -131,9 +130,6 @@ static const struct {
|
|||
#ifdef EVAS_STATIC_BUILD_BUFFER
|
||||
EVAS_EINA_STATIC_MODULE_USE(engine, buffer),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_DIRECTFB
|
||||
EVAS_EINA_STATIC_MODULE_USE(engine, directfb),
|
||||
#endif
|
||||
#ifdef EVAS_STATIC_BUILD_FB
|
||||
EVAS_EINA_STATIC_MODULE_USE(engine, fb),
|
||||
#endif
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef _EVAS_ENGINE_DIRECTFB_H
|
||||
#define _EVAS_ENGINE_DIRECTFB_H
|
||||
|
||||
#include <Evas.h>
|
||||
#include <directfb.h>
|
||||
|
||||
typedef struct _Evas_Engine_Info_DirectFB Evas_Engine_Info_DirectFB;
|
||||
|
||||
struct _Evas_Engine_Info_DirectFB
|
||||
{
|
||||
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||
/* at you and make nasty noises */
|
||||
Evas_Engine_Info magic;
|
||||
|
||||
struct Evas_Engine_DirectFB_Spec {
|
||||
IDirectFB *dfb;
|
||||
IDirectFBSurface *surface;
|
||||
} info;
|
||||
|
||||
/* non-blocking or blocking mode */
|
||||
Evas_Engine_Render_Mode render_mode;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,71 +0,0 @@
|
|||
#ifndef EVAS_ENGINE_DIRECTFB_H
|
||||
#define EVAS_ENGINE_DIRECTFB_H
|
||||
|
||||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
#include "Evas_Engine_DirectFB.h"
|
||||
|
||||
extern int _evas_engine_directfb_log_dom ;
|
||||
|
||||
#ifdef ERR
|
||||
# undef ERR
|
||||
#endif
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef DBG
|
||||
# undef DBG
|
||||
#endif
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef INF
|
||||
# undef INF
|
||||
#endif
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef WRN
|
||||
# undef WRN
|
||||
#endif
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef CRIT
|
||||
# undef CRIT
|
||||
#endif
|
||||
#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_directfb_log_dom, __VA_ARGS__)
|
||||
|
||||
typedef struct _DirectFB_Engine_Image_Entry DirectFB_Engine_Image_Entry;
|
||||
struct _DirectFB_Engine_Image_Entry
|
||||
{
|
||||
Engine_Image_Entry cache_entry;
|
||||
IDirectFBSurface *surface;
|
||||
|
||||
struct
|
||||
{
|
||||
Eina_Bool engine_surface : 1;
|
||||
Eina_Bool is_locked : 1;
|
||||
} flags;
|
||||
};
|
||||
|
||||
typedef struct _Render_Engine Render_Engine;
|
||||
struct _Render_Engine
|
||||
{
|
||||
DirectFB_Engine_Image_Entry *screen_image;
|
||||
const struct Evas_Engine_DirectFB_Spec *spec;
|
||||
IDirectFB *dfb;
|
||||
|
||||
Evas_Cache_Engine_Image *cache;
|
||||
|
||||
Tilebuf *tb;
|
||||
Tilebuf_Rect *rects;
|
||||
Eina_Inlist *cur_rect;
|
||||
|
||||
DFBRegion *update_regions;
|
||||
unsigned int update_regions_count;
|
||||
unsigned int update_regions_limit;
|
||||
|
||||
Eina_Bool end : 1;
|
||||
};
|
||||
|
||||
int _dfb_surface_set_color_from_context(IDirectFBSurface *surface, RGBA_Draw_Context *dc);
|
||||
void _dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist *points, int x, int y);
|
||||
|
||||
#endif
|
|
@ -1,269 +0,0 @@
|
|||
#include <math.h>
|
||||
#include "evas_engine.h"
|
||||
|
||||
/* reduce calls to DirectFB (FillSpans), but uses twice as much memory */
|
||||
//#define USE_SPAN_RECTS 1
|
||||
|
||||
#define MAX_SPANS 512
|
||||
typedef struct _RGBA_Edge RGBA_Edge;
|
||||
typedef struct _RGBA_Vertex RGBA_Vertex;
|
||||
|
||||
struct _RGBA_Edge
|
||||
{
|
||||
double x, dx;
|
||||
int i;
|
||||
};
|
||||
|
||||
struct _RGBA_Vertex
|
||||
{
|
||||
double x, y;
|
||||
int i;
|
||||
};
|
||||
|
||||
#define POLY_EDGE_DEL(_i) \
|
||||
{ \
|
||||
int _j; \
|
||||
\
|
||||
for (_j = 0; (_j < num_active_edges) && (edges[_j].i != _i); _j++); \
|
||||
if (_j < num_active_edges) \
|
||||
{ \
|
||||
num_active_edges--; \
|
||||
memmove(&(edges[_j]), &(edges[_j + 1]), \
|
||||
(num_active_edges - _j) * sizeof(RGBA_Edge)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define POLY_EDGE_ADD(_i, _y) \
|
||||
{ \
|
||||
int _j; \
|
||||
float _dx; \
|
||||
RGBA_Vertex *_p, *_q; \
|
||||
if (_i < (n - 1)) _j = _i + 1; \
|
||||
else _j = 0; \
|
||||
if (point[_i].y < point[_j].y) \
|
||||
{ \
|
||||
_p = &(point[_i]); \
|
||||
_q = &(point[_j]); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
_p = &(point[_j]); \
|
||||
_q = &(point[_i]); \
|
||||
} \
|
||||
edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \
|
||||
edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \
|
||||
edges[num_active_edges].i = _i; \
|
||||
num_active_edges++; \
|
||||
}
|
||||
|
||||
static int
|
||||
polygon_point_sorter(const void *a, const void *b)
|
||||
{
|
||||
RGBA_Vertex *p, *q;
|
||||
|
||||
p = (RGBA_Vertex *)a;
|
||||
q = (RGBA_Vertex *)b;
|
||||
if (p->y <= q->y) return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
polygon_edge_sorter(const void *a, const void *b)
|
||||
{
|
||||
RGBA_Edge *p, *q;
|
||||
|
||||
p = (RGBA_Edge *)a;
|
||||
q = (RGBA_Edge *)b;
|
||||
if (p->x <= q->x) return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef USE_SPAN_RECTS
|
||||
typedef DFBSpan span_t;
|
||||
|
||||
static void
|
||||
polygon_span_add(span_t *span, int y EINA_UNUSED, int x, int w)
|
||||
{
|
||||
span->x = x;
|
||||
span->w = w;
|
||||
}
|
||||
|
||||
static void
|
||||
polygon_spans_fill(IDirectFBSurface *surface, int y, const span_t *spans, int n_spans)
|
||||
{
|
||||
/* directfb automatically increments y for each span */
|
||||
for (; n_spans > 0; n_spans--, spans++)
|
||||
surface->FillSpans(surface, y, spans, 1);
|
||||
}
|
||||
#else /* USE_SPAN_RECTS */
|
||||
typedef DFBRectangle span_t;
|
||||
|
||||
static void
|
||||
polygon_span_add(span_t *span, int y, int x, int w)
|
||||
{
|
||||
span->x = x;
|
||||
span->y = y;
|
||||
span->w = w;
|
||||
span->h = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
polygon_spans_fill(IDirectFBSurface *surface, int y, const span_t *spans, int n_spans)
|
||||
{
|
||||
surface->FillRectangles(surface, spans, n_spans);
|
||||
}
|
||||
#endif /* USE_SPAN_RECTS */
|
||||
|
||||
|
||||
void
|
||||
_dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist *points, int px, int py)
|
||||
{
|
||||
RGBA_Polygon_Point *pt;
|
||||
RGBA_Vertex *point;
|
||||
RGBA_Edge *edges;
|
||||
int num_active_edges;
|
||||
int n;
|
||||
int i, j, k;
|
||||
int y0, y1, y;
|
||||
int ext_x, ext_y, ext_w, ext_h;
|
||||
int *sorted_index;
|
||||
|
||||
ext_x = 0;
|
||||
ext_y = 0;
|
||||
surface->GetSize(surface, &ext_w, &ext_h);
|
||||
if (dc->clip.use)
|
||||
{
|
||||
if (dc->clip.x > ext_x)
|
||||
{
|
||||
ext_w += ext_x - dc->clip.x;
|
||||
ext_x = dc->clip.x;
|
||||
}
|
||||
if ((ext_x + ext_w) > (dc->clip.x + dc->clip.w))
|
||||
{
|
||||
ext_w = (dc->clip.x + dc->clip.w) - ext_x;
|
||||
}
|
||||
if (dc->clip.y > ext_y)
|
||||
{
|
||||
ext_h += ext_y - dc->clip.y;
|
||||
ext_y = dc->clip.y;
|
||||
}
|
||||
if ((ext_y + ext_h) > (dc->clip.y + dc->clip.h))
|
||||
{
|
||||
ext_h = (dc->clip.y + dc->clip.h) - ext_y;
|
||||
}
|
||||
}
|
||||
if ((ext_w <= 0) || (ext_h <= 0)) return;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
|
||||
if (!_dfb_surface_set_color_from_context(surface, dc))
|
||||
return;
|
||||
|
||||
n = 0; EINA_INLIST_FOREACH(points, pt) n++;
|
||||
if (n < 3) return;
|
||||
edges = malloc(sizeof(RGBA_Edge) * n);
|
||||
if (!edges) return;
|
||||
point = malloc(sizeof(RGBA_Vertex) * n);
|
||||
if (!point)
|
||||
{
|
||||
free(edges);
|
||||
return;
|
||||
}
|
||||
sorted_index = malloc(sizeof(int) * n);
|
||||
if (!sorted_index)
|
||||
{
|
||||
free(edges);
|
||||
free(point);
|
||||
return;
|
||||
}
|
||||
|
||||
k = 0;
|
||||
EINA_INLIST_FOREACH(points, pt)
|
||||
{
|
||||
point[k].x = pt->x + px;
|
||||
point[k].y = pt->y + py;
|
||||
point[k].i = k;
|
||||
k++;
|
||||
}
|
||||
qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
|
||||
for (k = 0; k < n; k++) sorted_index[k] = point[k].i;
|
||||
k = 0;
|
||||
EINA_INLIST_FOREACH(points, pt)
|
||||
{
|
||||
point[k].x = pt->x + px;
|
||||
point[k].y = pt->y + py;
|
||||
point[k].i = k;
|
||||
k++;
|
||||
}
|
||||
|
||||
y0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5));
|
||||
y1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5));
|
||||
|
||||
k = 0;
|
||||
num_active_edges = 0;
|
||||
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
span_t spans[MAX_SPANS];
|
||||
unsigned int n_spans = 0;
|
||||
|
||||
for (; (k < n) && (point[sorted_index[k]].y <= ((double)y + 0.5)); k++)
|
||||
{
|
||||
i = sorted_index[k];
|
||||
|
||||
if (i > 0) j = i - 1;
|
||||
else j = n - 1;
|
||||
if (point[j].y <= ((double)y - 0.5))
|
||||
{
|
||||
POLY_EDGE_DEL(j)
|
||||
}
|
||||
else if (point[j].y > ((double)y + 0.5))
|
||||
{
|
||||
POLY_EDGE_ADD(j, y)
|
||||
}
|
||||
if (i < (n - 1)) j = i + 1;
|
||||
else j = 0;
|
||||
if (point[j].y <= ((double)y - 0.5))
|
||||
{
|
||||
POLY_EDGE_DEL(i)
|
||||
}
|
||||
else if (point[j].y > ((double)y + 0.5))
|
||||
{
|
||||
POLY_EDGE_ADD(i, y)
|
||||
}
|
||||
}
|
||||
|
||||
qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
|
||||
|
||||
for (j = 0; j < num_active_edges; j += 2)
|
||||
{
|
||||
int x0, x1;
|
||||
|
||||
x0 = ceil(edges[j].x - 0.5);
|
||||
if (j < (num_active_edges - 1))
|
||||
x1 = floor(edges[j + 1].x - 0.5);
|
||||
else
|
||||
x1 = x0;
|
||||
if ((x1 >= ext_x) && (x0 < (ext_x + ext_w)) && (x0 <= x1))
|
||||
{
|
||||
if (n_spans == MAX_SPANS)
|
||||
{
|
||||
polygon_spans_fill(surface, y, spans, n_spans);
|
||||
n_spans = 0;
|
||||
}
|
||||
|
||||
polygon_span_add(spans + n_spans, y, x0, (x1 - x0) + 1);
|
||||
n_spans++;
|
||||
}
|
||||
edges[j].x += edges[j].dx;
|
||||
edges[j + 1].x += edges[j + 1].dx;
|
||||
}
|
||||
|
||||
if (n_spans)
|
||||
polygon_spans_fill(surface, y, spans, n_spans);
|
||||
}
|
||||
|
||||
free(edges);
|
||||
free(point);
|
||||
free(sorted_index);
|
||||
}
|
Loading…
Reference in New Issue