ecore_evas: Make the engines loadable modules
Implementing support for loadables modules. It makes the engines been loaded when they are needed. It not breakes the api, so each engine still has its own api. The implementation basically is: * Functions that creates Ecore_Evas, for example ecore_evas_software_x11_new, request to load its module and then get the module's function to create the Ecore_Evas. * The other functions such as \(.*\)_window_get from the Ecore_Evas its interface and then call the appropriate method. * As there is no unified interface to communicate with the engines (not break api problem), all interfaces were declared in ecore_evas_private.h * Now the data necessary for each module is not declared in the Ecore_Evas_Engine structure, instead of this, the struct has a void pointer that is used by the modules. * In this first moment engines as software_x11 and gl_x11 were put together in the same module, but obviously exporting all the things necessary. SVN revision: 80280
This commit is contained in:
parent
8783eb70bb
commit
ad7579c129
|
@ -5,30 +5,17 @@ lib_LTLIBRARIES += lib/ecore_evas/libecore_evas.la
|
||||||
|
|
||||||
installed_ecoreevasmainheadersdir = $(includedir)/ecore-@VMAJ@
|
installed_ecoreevasmainheadersdir = $(includedir)/ecore-@VMAJ@
|
||||||
dist_installed_ecoreevasmainheaders_DATA = \
|
dist_installed_ecoreevasmainheaders_DATA = \
|
||||||
|
lib/ecore_evas/Ecore_Evas_Types.h \
|
||||||
lib/ecore_evas/Ecore_Evas.h
|
lib/ecore_evas/Ecore_Evas.h
|
||||||
|
|
||||||
lib_ecore_evas_libecore_evas_la_SOURCES = \
|
lib_ecore_evas_libecore_evas_la_SOURCES = \
|
||||||
lib/ecore_evas/ecore_evas.c \
|
lib/ecore_evas/ecore_evas.c \
|
||||||
lib/ecore_evas/ecore_evas_util.c \
|
|
||||||
lib/ecore_evas/ecore_evas_x.c \
|
|
||||||
lib/ecore_evas/ecore_evas_fb.c \
|
|
||||||
lib/ecore_evas/ecore_evas_buffer.c \
|
|
||||||
lib/ecore_evas/ecore_evas_deprecated.c \
|
lib/ecore_evas/ecore_evas_deprecated.c \
|
||||||
lib/ecore_evas/ecore_evas_win32.c \
|
|
||||||
lib/ecore_evas/ecore_evas_sdl.c \
|
|
||||||
lib/ecore_evas/ecore_evas_cocoa.c \
|
|
||||||
lib/ecore_evas/ecore_evas_ews.c \
|
lib/ecore_evas/ecore_evas_ews.c \
|
||||||
lib/ecore_evas/ecore_evas_psl1ght.c \
|
lib/ecore_evas/ecore_evas_util.c \
|
||||||
lib/ecore_evas/ecore_evas_wayland_shm.c \
|
lib/ecore_evas/ecore_evas_module.c \
|
||||||
lib/ecore_evas/ecore_evas_wayland_egl.c \
|
|
||||||
lib/ecore_evas/ecore_evas_extn.c \
|
|
||||||
lib/ecore_evas/ecore_evas_private.h
|
lib/ecore_evas/ecore_evas_private.h
|
||||||
|
|
||||||
if HAVE_ECORE_WAYLAND
|
|
||||||
lib_ecore_evas_libecore_evas_la_SOURCES += \
|
|
||||||
lib/ecore_evas/ecore_evas_wayland_common.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS = \
|
lib_ecore_evas_libecore_evas_la_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/src/lib/eina \
|
-I$(top_srcdir)/src/lib/eina \
|
||||||
-I$(top_srcdir)/src/lib/eo \
|
-I$(top_srcdir)/src/lib/eo \
|
||||||
|
@ -48,76 +35,15 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS = \
|
||||||
-I$(top_builddir)/src/lib/ecore_input_evas \
|
-I$(top_builddir)/src/lib/ecore_input_evas \
|
||||||
-I$(top_builddir)/src/lib/ecore_evas \
|
-I$(top_builddir)/src/lib/ecore_evas \
|
||||||
-I$(top_builddir)/src/modules/evas/engines/buffer \
|
-I$(top_builddir)/src/modules/evas/engines/buffer \
|
||||||
|
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
|
||||||
-DEFL_ECORE_EVAS_BUILD \
|
-DEFL_ECORE_EVAS_BUILD \
|
||||||
@EFL_CFLAGS@ \
|
@EFL_CFLAGS@ \
|
||||||
@EFL_COV_CFLAGS@
|
@EFL_COV_CFLAGS@
|
||||||
|
|
||||||
if HAVE_ECORE_COCOA
|
if HAVE_WINDOWS
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
||||||
-I$(top_srcdir)/src/lib/ecore_cocoa \
|
-I$(top_srcdir)/src/lib/evil \
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/gl_cocoa \
|
-I$(top_builddir)/src/lib/evil
|
||||||
-I$(top_builddir)/src/lib/ecore_cocoa \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/gl_cocoa
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_ECORE_FB
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_fb \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/fb \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_fb \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/fb
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_PS3
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_psl1ght \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/psl1ght \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_psl1ght \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/psl1ght
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_ECORE_SDL
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_sdl \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/gl_sdl \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_sdl \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/gl_sdl
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_ECORE_WAYLAND
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_wayland \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/wayland_shm \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/wayland_egl \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_wayland \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/wayland_shm \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/wayland_egl
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_WIN32
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_win32 \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/software_ddraw \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/software_gdi \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_win32 \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/software_ddraw \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/software_gdi
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_WINCE
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_wince \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_wince
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_ECORE_X
|
|
||||||
lib_ecore_evas_libecore_evas_la_CPPFLAGS += \
|
|
||||||
-I$(top_srcdir)/src/lib/ecore_x \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/software_x11 \
|
|
||||||
-I$(top_srcdir)/src/modules/evas/engines/gl_x11 \
|
|
||||||
-I$(top_builddir)/src/lib/ecore_x \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/software_x11 \
|
|
||||||
-I$(top_builddir)/src/modules/evas/engines/gl_x11
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD = \
|
lib_ecore_evas_libecore_evas_la_LIBADD = \
|
||||||
|
@ -130,44 +56,159 @@ lib/eo/libeo.la \
|
||||||
lib/eina/libeina.la \
|
lib/eina/libeina.la \
|
||||||
@ECORE_EVAS_LIBS@
|
@ECORE_EVAS_LIBS@
|
||||||
|
|
||||||
if HAVE_ECORE_COCOA
|
lib_ecore_evas_libecore_evas_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
|
||||||
lib/ecore_cocoa/libecore_cocoa.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_ECORE_FB
|
# Engines
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
|
||||||
lib/ecore_fb/libecore_fb.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_PS3
|
if BUILD_ENGINE_BUFFER
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
BUFFERSOURCES = \
|
||||||
lib/ecore_psl1ght/libecore_psl1ght.la
|
modules/ecore_evas/engines/buffer/ecore_evas_buffer.c \
|
||||||
endif
|
modules/ecore_evas/engines/buffer/ecore_evas_extn.c \
|
||||||
|
modules/ecore_evas/engines/buffer/ecore_evas_buffer_private.h
|
||||||
if HAVE_ECORE_SDL
|
ecoreevasenginebufferpkgdir = $(libdir)/ecore_evas/engines/buffer/$(MODULE_ARCH)
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
ecoreevasenginebufferpkg_LTLIBRARIES = modules/ecore_evas/engines/buffer/module.la
|
||||||
lib/ecore_sdl/libecore_sdl.la
|
modules_ecore_evas_engines_buffer_module_la_SOURCES = $(BUFFERSOURCES)
|
||||||
endif
|
modules_ecore_evas_engines_buffer_module_la_CPPFLAGS = $(lib_ecore_evas_libecore_evas_la_CPPFLAGS)
|
||||||
|
modules_ecore_evas_engines_buffer_module_la_LIBADD = lib/ecore_evas/libecore_evas.la @EFL_LIBS@
|
||||||
if HAVE_ECORE_WAYLAND
|
modules_ecore_evas_engines_buffer_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
modules_ecore_evas_engines_buffer_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
lib/ecore_wayland/libecore_wayland.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_WIN32
|
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
|
||||||
lib/ecore_win32/libecore_win32.la
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_WINCE
|
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
|
||||||
lib/ecore_wince/libecore_wince.la
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if HAVE_ECORE_X
|
if HAVE_ECORE_X
|
||||||
lib_ecore_evas_libecore_evas_la_LIBADD += \
|
XSOURCES = modules/ecore_evas/engines/x/ecore_evas_x.c
|
||||||
|
ecoreevasenginexpkgdir = $(libdir)/ecore_evas/engines/x/$(MODULE_ARCH)
|
||||||
|
ecoreevasenginexpkg_LTLIBRARIES = modules/ecore_evas/engines/x/module.la
|
||||||
|
modules_ecore_evas_engines_x_module_la_SOURCES = $(XSOURCES)
|
||||||
|
modules_ecore_evas_engines_x_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_x \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/software_x11 \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/gl_x11 \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_x \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/software_x11 \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/gl_x11
|
||||||
|
modules_ecore_evas_engines_x_module_la_LIBADD = \
|
||||||
|
lib/ecore_evas/libecore_evas.la @EFL_LIBS@ \
|
||||||
lib/ecore_x/libecore_x.la
|
lib/ecore_x/libecore_x.la
|
||||||
|
modules_ecore_evas_engines_x_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_x_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
endif
|
endif
|
||||||
|
|
||||||
lib_ecore_evas_libecore_evas_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@
|
if HAVE_ECORE_COCOA
|
||||||
|
COCOASOURCES = modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
|
||||||
|
ecoreevasenginecocoapkgdir = $(libdir)/ecore_evas/engines/cocoa/$(MODULE_ARCH)
|
||||||
|
ecoreevasenginecocoapkg_LTLIBRARIES = modules/ecore_evas/engines/cocoa/module.la
|
||||||
|
modules_ecore_evas_engines_cocoa_module_la_SOURCES = $(COCOASOURCES)
|
||||||
|
modules_ecore_evas_engines_cocoa_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_cocoa \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/gl_cocoa \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_cocoa \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/gl_cocoa
|
||||||
|
modules_ecore_evas_engines_cocoa_module_la_LIBADD = \
|
||||||
|
lib/ecore_evas/libecore_evas.la @EFL_LIBS@ \
|
||||||
|
lib/ecore_cocoa/libecore_cocoa.la
|
||||||
|
modules_ecore_evas_engines_cocoa_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_cocoa_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_ECORE_FB
|
||||||
|
FBSOURCES = modules/ecore_evas/engines/fb/ecore_evas_fb.c
|
||||||
|
ecoreevasenginefbpkgdir = $(libdir)/ecore_evas/engines/fb/$(MODULE_ARCH)
|
||||||
|
ecoreevasenginefbpkg_LTLIBRARIES = modules/ecore_evas/engines/fb/module.la
|
||||||
|
modules_ecore_evas_engines_fb_module_la_SOURCES = $(FBSOURCES)
|
||||||
|
modules_ecore_evas_engines_fb_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_fb \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/fb \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_fb \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/fb
|
||||||
|
modules_ecore_evas_engines_fb_module_la_LIBADD = \
|
||||||
|
lib/ecore_evas/libecore_evas.la @EFL_LIBS@ \
|
||||||
|
lib/ecore_fb/libecore_fb.la
|
||||||
|
modules_ecore_evas_engines_fb_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_fb_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_PS3
|
||||||
|
PSL1GHTSOURCES = modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c
|
||||||
|
ecoreevasenginepsl1ghtpkgdir = $(libdir)/ecore_evas/engines/psl1ght/$(MODULE_ARCH)
|
||||||
|
ecoreevasenginepsl1ghtpkg_LTLIBRARIES = modules/ecore_evas/engines/psl1ght/module.la
|
||||||
|
modules_ecore_evas_engines_psl1ght_module_la_SOURCES = $(PSL1GHTSOURCES)
|
||||||
|
modules_ecore_evas_engines_psl1ght_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_psl1ght \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/psl1ght \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_psl1ght \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/psl1ght
|
||||||
|
modules_ecore_evas_engines_psl1ght_module_la_LIBADD = \
|
||||||
|
lib/ecore_evas/libecore_evas.la @EFL_LIBS@ \
|
||||||
|
lib/ecore_psl1ght/libecore_psl1ght.la
|
||||||
|
modules_ecore_evas_engines_psl1ght_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_psl1ght_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_ECORE_WAYLAND
|
||||||
|
WAYLANDSOURCES = \
|
||||||
|
modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c \
|
||||||
|
modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c \
|
||||||
|
modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c \
|
||||||
|
modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h
|
||||||
|
ecoreevasenginewaylandpkgdir = $(libdir)/ecore_evas/engines/wayland/$(MODULE_ARCH)
|
||||||
|
ecoreevasenginewaylandpkg_LTLIBRARIES = modules/ecore_evas/engines/wayland/module.la
|
||||||
|
modules_ecore_evas_engines_wayland_module_la_SOURCES = $(WAYLANDSOURCES)
|
||||||
|
modules_ecore_evas_engines_wayland_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_wayland \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/wayland_shm \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/wayland_egl \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_wayland \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/wayland_shm \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/wayland_egl \
|
||||||
|
@ECORE_WAYLAND_CFLAGS@
|
||||||
|
modules_ecore_evas_engines_wayland_module_la_LIBADD = \
|
||||||
|
lib/ecore_evas/libecore_evas.la @EFL_LIBS@ \
|
||||||
|
lib/ecore_wayland/libecore_wayland.la
|
||||||
|
modules_ecore_evas_engines_wayland_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_wayland_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_ECORE_SDL
|
||||||
|
SDLSOURCES = \
|
||||||
|
modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
|
||||||
|
ecoreevasenginesdlpkgdir = $(libdir)/ecore_evas/engines/sdl/$(MODULE_ARCH)
|
||||||
|
ecoreevasenginesdlpkg_LTLIBRARIES = modules/ecore_evas/engines/sdl/module.la
|
||||||
|
modules_ecore_evas_engines_sdl_module_la_SOURCES = $(SDLSOURCES)
|
||||||
|
modules_ecore_evas_engines_sdl_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_sdl \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/gl_sdl \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_sdl \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/gl_sdl
|
||||||
|
modules_ecore_evas_engines_sdl_module_la_LIBADD = \
|
||||||
|
lib/ecore_evas/libecore_evas.la @EFL_LIBS@ \
|
||||||
|
lib/ecore_sdl/libecore_sdl.la
|
||||||
|
modules_ecore_evas_engines_sdl_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_sdl_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_WIN32
|
||||||
|
WIN32SOURCES = \
|
||||||
|
modules/ecore_evas/engines/win32/ecore_evas_win32.c
|
||||||
|
ecoreevasengineswin32pkgdir = $(libdir)/ecore_evas/engines/win32/$(MODULE_ARCH)
|
||||||
|
ecoreevasengineswin32pkg_LTLIBRARIES = modules/ecore_evas/engines/win32/module.la
|
||||||
|
modules_ecore_evas_engines_win32_module_la_SOURCES = $(WIN32SOURCES)
|
||||||
|
modules_ecore_evas_engines_win32_module_la_CPPFLAGS = \
|
||||||
|
$(lib_ecore_evas_libecore_evas_la_CPPFLAGS) \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore_win32 \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/software_ddraw \
|
||||||
|
-I$(top_srcdir)/src/modules/evas/engines/software_gdi \
|
||||||
|
-I$(top_builddir)/src/lib/ecore_win32 \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/software_ddraw \
|
||||||
|
-I$(top_builddir)/src/modules/evas/engines/software_gdi
|
||||||
|
modules_ecore_evas_engines_win32_module_la_LIBADD = \
|
||||||
|
lib/ecore/libeecore_evas.la @EFL_LIBS@ \
|
||||||
|
lib/ecore_win32/libecore_win32.la
|
||||||
|
modules_ecore_evas_engines_win32_module_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
|
modules_ecore_evas_engines_win32_module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
endif
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _ECORE_EVAS_H
|
#ifndef _ECORE_EVAS_H
|
||||||
#define _ECORE_EVAS_H
|
#define _ECORE_EVAS_H
|
||||||
|
|
||||||
|
#include "Ecore_Evas_Types.h"
|
||||||
|
|
||||||
#include <Evas.h>
|
#include <Evas.h>
|
||||||
#include <Ecore_Getopt.h>
|
#include <Ecore_Getopt.h>
|
||||||
#include <Ecore_Input.h>
|
#include <Ecore_Input.h>
|
||||||
|
@ -145,39 +147,6 @@ typedef enum _Ecore_Evas_Object_Associate_Flags
|
||||||
ECORE_EVAS_OBJECT_ASSOCIATE_DEL = 1 << 2
|
ECORE_EVAS_OBJECT_ASSOCIATE_DEL = 1 << 2
|
||||||
} Ecore_Evas_Object_Associate_Flags;
|
} Ecore_Evas_Object_Associate_Flags;
|
||||||
|
|
||||||
#ifndef _ECORE_X_H
|
|
||||||
#define _ECORE_X_WINDOW_PREDEF
|
|
||||||
typedef unsigned int Ecore_X_Window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ECORE_DIRECTFB_H
|
|
||||||
#define _ECORE_DIRECTFB_WINDOW_PREDEF
|
|
||||||
typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ECORE_WIN32_H__
|
|
||||||
typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ECORE_WINCE_H__
|
|
||||||
typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ECORE_COCOA_H__
|
|
||||||
typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ECORE_EVAS_PRIVATE_H
|
|
||||||
/* basic data types */
|
|
||||||
typedef struct _Ecore_Evas Ecore_Evas;
|
|
||||||
typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ECORE_WAYLAND_H_
|
|
||||||
#define _ECORE_WAYLAND_WINDOW_PREDEF
|
|
||||||
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* module setup/shutdown calls */
|
/* module setup/shutdown calls */
|
||||||
|
|
||||||
EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
|
EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
#ifndef _ECORE_EVAS_TYPES_H_
|
||||||
|
#define _ECORE_EVAS_TYPES_H_
|
||||||
|
|
||||||
|
#ifndef _ECORE_X_H
|
||||||
|
#define _ECORE_X_WINDOW_PREDEF
|
||||||
|
typedef unsigned int Ecore_X_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ECORE_DIRECTFB_H
|
||||||
|
#define _ECORE_DIRECTFB_WINDOW_PREDEF
|
||||||
|
typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ECORE_WIN32_H__
|
||||||
|
typedef struct _Ecore_Win32_Window Ecore_Win32_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ECORE_WINCE_H__
|
||||||
|
typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ECORE_COCOA_H__
|
||||||
|
typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ECORE_EVAS_PRIVATE_H
|
||||||
|
/* basic data types */
|
||||||
|
typedef struct _Ecore_Evas Ecore_Evas;
|
||||||
|
typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ECORE_WAYLAND_H_
|
||||||
|
#define _ECORE_WAYLAND_WINDOW_PREDEF
|
||||||
|
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _ECORE_EVAS_TYPES_H_ */
|
|
@ -68,6 +68,23 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ecore_Evas_Interface *
|
||||||
|
_ecore_evas_interface_get(const Ecore_Evas *ee, const char *iname)
|
||||||
|
{
|
||||||
|
Eina_List *l;
|
||||||
|
Ecore_Evas_Interface *i;
|
||||||
|
|
||||||
|
if (!ee || !iname) return NULL;
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(ee->engine.ifaces, l, i)
|
||||||
|
{
|
||||||
|
if (!strcmp(i->name, iname))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query if a particular rendering engine target has support
|
* Query if a particular rendering engine target has support
|
||||||
* @param engine The engine to check support for
|
* @param engine The engine to check support for
|
||||||
|
@ -79,6 +96,8 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
|
||||||
EAPI int
|
EAPI int
|
||||||
ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
|
ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
|
||||||
{
|
{
|
||||||
|
/* It should be done reading the availables engines */
|
||||||
|
|
||||||
switch (engine)
|
switch (engine)
|
||||||
{
|
{
|
||||||
case ECORE_EVAS_ENGINE_SOFTWARE_BUFFER:
|
case ECORE_EVAS_ENGINE_SOFTWARE_BUFFER:
|
||||||
|
@ -252,7 +271,7 @@ ecore_evas_init(void)
|
||||||
_ecore_evas_ews_events_init();
|
_ecore_evas_ews_events_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_ecore_evas_extn_init();
|
_ecore_evas_engine_init();
|
||||||
|
|
||||||
if (getenv("ECORE_EVAS_COMP_NOSYNC"))
|
if (getenv("ECORE_EVAS_COMP_NOSYNC"))
|
||||||
_ecore_evas_app_comp_sync = 0;
|
_ecore_evas_app_comp_sync = 0;
|
||||||
|
@ -274,28 +293,14 @@ ecore_evas_shutdown(void)
|
||||||
|
|
||||||
while (ecore_evases) _ecore_evas_free(ecore_evases);
|
while (ecore_evases) _ecore_evas_free(ecore_evases);
|
||||||
|
|
||||||
_ecore_evas_extn_shutdown();
|
|
||||||
|
|
||||||
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
|
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
|
||||||
ecore_idle_enterer_del(ecore_evas_idle_enterer);
|
ecore_idle_enterer_del(ecore_evas_idle_enterer);
|
||||||
ecore_evas_idle_enterer = NULL;
|
ecore_evas_idle_enterer = NULL;
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_X11
|
|
||||||
while (_ecore_evas_x_shutdown());
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
|
||||||
while (_ecore_evas_win32_shutdown());
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
while (_ecore_evas_fb_shutdown());
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EWS
|
#ifdef BUILD_ECORE_EVAS_EWS
|
||||||
while (_ecore_evas_ews_shutdown());
|
while (_ecore_evas_ews_shutdown());
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
_ecore_evas_engine_shutdown();
|
||||||
while (_ecore_evas_buffer_shutdown());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_ecore_evas_async_events_fd)
|
if (_ecore_evas_async_events_fd)
|
||||||
ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
|
ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
|
||||||
|
|
||||||
|
@ -490,7 +495,6 @@ _ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
|
||||||
{
|
{
|
||||||
|
@ -506,10 +510,8 @@ _ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, c
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_PSL1GHT
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
|
||||||
{
|
{
|
||||||
|
@ -523,9 +525,7 @@ _ecore_evas_constructor_psl1ght(int x EINA_UNUSED, int y EINA_UNUSED, int w, int
|
||||||
if (ee) ecore_evas_move(ee, x, y);
|
if (ee) ecore_evas_move(ee, x, y);
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
|
||||||
{
|
{
|
||||||
|
@ -541,9 +541,7 @@ _ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extr
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
|
||||||
{
|
{
|
||||||
|
@ -559,47 +557,40 @@ _ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extr
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_software_gdi(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_software_gdi(int x, int y, int w, int h,
|
||||||
|
const char *extra_options EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return ecore_evas_software_gdi_new(NULL, x, y, w, h);
|
return ecore_evas_software_gdi_new(NULL, x, y, w, h);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_software_ddraw(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_software_ddraw(int x, int y, int w, int h,
|
||||||
|
const char *extra_options EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
|
return ecore_evas_software_ddraw_new(NULL, x, y, w, h);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_DIRECT3D
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_direct3d(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_direct3d(int x, int y, int w, int h,
|
||||||
|
const char *extra_options EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return ecore_evas_direct3d_new(NULL, x, y, w, h);
|
return ecore_evas_direct3d_new(NULL, x, y, w, h);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_opengl_glew(int x, int y, int w, int h, const char *extra_options)
|
_ecore_evas_constructor_opengl_glew(int x, int y, int w, int h,
|
||||||
|
const char *extra_options EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return ecore_evas_gl_glew_new(NULL, x, y, w, h);
|
return ecore_evas_gl_glew_new(NULL, x, y, w, h);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_constructor_buffer(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options EINA_UNUSED)
|
_ecore_evas_constructor_buffer(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options EINA_UNUSED)
|
||||||
{
|
{
|
||||||
return ecore_evas_buffer_new(w, h);
|
return ecore_evas_buffer_new(w, h);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EWS
|
#ifdef BUILD_ECORE_EVAS_EWS
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
|
@ -813,6 +804,23 @@ ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI Evas *
|
||||||
|
ecore_evas_object_evas_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
|
ee = evas_object_data_get(obj, "Ecore_Evas");
|
||||||
|
if (!ee) return NULL;
|
||||||
|
|
||||||
|
return ecore_evas_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_object_ecore_evas_get(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return evas_object_data_get(obj, "Ecore_Evas");
|
||||||
|
}
|
||||||
|
|
||||||
#define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
|
#define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
|
||||||
#define IFE return;}
|
#define IFE return;}
|
||||||
|
|
||||||
|
@ -2434,6 +2442,8 @@ _ecore_evas_unref(Ecore_Evas *ee)
|
||||||
void
|
void
|
||||||
_ecore_evas_free(Ecore_Evas *ee)
|
_ecore_evas_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Interface *iface;
|
||||||
|
|
||||||
ee->deleted = EINA_TRUE;
|
ee->deleted = EINA_TRUE;
|
||||||
if (ee->refcount > 0) return;
|
if (ee->refcount > 0) return;
|
||||||
|
|
||||||
|
@ -2470,6 +2480,11 @@ _ecore_evas_free(Ecore_Evas *ee)
|
||||||
ecore_evases = (Ecore_Evas *)eina_inlist_remove
|
ecore_evases = (Ecore_Evas *)eina_inlist_remove
|
||||||
(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
|
(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EINA_LIST_FREE(ee->engine.ifaces, iface)
|
||||||
|
free(iface);
|
||||||
|
|
||||||
|
ee->engine.ifaces = NULL;
|
||||||
free(ee);
|
free(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2752,90 +2767,684 @@ ecore_evas_input_event_unregister(Ecore_Evas *ee)
|
||||||
ecore_event_window_unregister((Ecore_Window)ee);
|
ecore_event_window_unregister((Ecore_Window)ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined (BUILD_ECORE_EVAS_WAYLAND_EGL)
|
/**
|
||||||
|
* @brief Create Ecore_Evas using fb backend.
|
||||||
|
* @param disp_name The name of the display to be used.
|
||||||
|
* @param rotation The rotation to be used.
|
||||||
|
* @param w The width of the Ecore_Evas to be created.
|
||||||
|
* @param h The height of the Ecore_Evas to be created.
|
||||||
|
* @return The new Ecore_Evas.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("fb");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_fb_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(disp_name, rotation, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Create Ecore_Evas using software x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done and NULL is returned.
|
||||||
|
* @param disp_name The name of the Ecore_Evas to be created.
|
||||||
|
* @param parent The parent of the Ecore_Evas to be created.
|
||||||
|
* @param x The X coordinate to be used.
|
||||||
|
* @param y The Y coordinate to be used.
|
||||||
|
* @param w The width of the Ecore_Evas to be created.
|
||||||
|
* @param h The height of the Ecore_Evas to be created.
|
||||||
|
* @return A handle to the created Ecore_Evas.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("x");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_software_x11_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(disp_name, parent, x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the window from Ecore_Evas using software x11.
|
||||||
|
* @note If ecore is not compiled with support for x11 or if @p ee was not
|
||||||
|
* created with ecore_evas_software_x11_new() then nothing is done and
|
||||||
|
* 0 is returned.
|
||||||
|
* @param ee The Ecore_Evas from which to get the window.
|
||||||
|
* @return The window of type Ecore_X_Window.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_X_Window
|
||||||
|
ecore_evas_software_x11_window_get(const Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Software_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Software_X11 *)_ecore_evas_interface_get(ee, "software_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, 0);
|
||||||
|
|
||||||
|
return iface->window_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the direct_resize of Ecore_Evas using software x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done.
|
||||||
|
* @param ee The Ecore_Evas in which to set direct resize.
|
||||||
|
* @param on Enables the resize of Ecore_Evas if equals EINA_TRUE, disables if equals EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Software_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Software_X11 *)_ecore_evas_interface_get(ee, "software_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->resize_set(ee, on);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets if the Ecore_Evas is being directly resized using software x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done and EINA_FALSE is returned.
|
||||||
|
* @param ee The Ecore_Evas from which to get direct resize.
|
||||||
|
* @return EINA_TRUE if the resize was managed directly, otherwise return EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool
|
||||||
|
ecore_evas_software_x11_direct_resize_get(const Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Software_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Software_X11 *)_ecore_evas_interface_get(ee, "software_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
|
||||||
|
|
||||||
|
return iface->resize_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Add extra window on Ecore_Evas using software x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done.
|
||||||
|
* @param ee The Ecore_Evas on which to add the window.
|
||||||
|
* @param win The window to be added at the Ecore_Evas.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Software_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Software_X11 *)_ecore_evas_interface_get(ee, "software_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->extra_event_window_add(ee, win);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Create Ecore_Evas using opengl x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done and NULL is returned.
|
||||||
|
* @param disp_name The name of the display of the Ecore_Evas to be created.
|
||||||
|
* @param parent The parent of the Ecore_Evas to be created.
|
||||||
|
* @param x The X coordinate to be used.
|
||||||
|
* @param y The Y coordinate to be used.
|
||||||
|
* @param w The width of the Ecore_Evas to be created.
|
||||||
|
* @param h The height of the Ecore_Evas to be created.
|
||||||
|
* @return The new Ecore_Evas.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("x");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_gl_x11_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(disp_name, parent, x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h, const int *opt)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, Ecore_X_Window, int, int, int, int, const int*);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("x");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_gl_x11_options_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(disp_name, parent, x, y, w, h, opt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the window from Ecore_Evas using opengl x11.
|
||||||
|
* @note If ecore is not compiled with support for x11 or if @p ee was not
|
||||||
|
* created with ecore_evas_gl_x11_new() then nothing is done and
|
||||||
|
* 0 is returned.
|
||||||
|
* @param ee The Ecore_Evas from which to get the window.
|
||||||
|
* @return The window of type Ecore_X_Window of Ecore_Evas.
|
||||||
|
*/
|
||||||
|
EAPI Ecore_X_Window
|
||||||
|
ecore_evas_gl_x11_window_get(const Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Gl_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Gl_X11 *)_ecore_evas_interface_get(ee, "gl_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, 0);
|
||||||
|
|
||||||
|
return iface->window_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set direct_resize for Ecore_Evas using opengl x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done.
|
||||||
|
* @param ee The Ecore_Evas in which to set direct resize.
|
||||||
|
* @param on Enables the resize of Ecore_Evas if equals EINA_TRUE, disables if equals EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Gl_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Gl_X11 *)_ecore_evas_interface_get(ee, "gl_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->resize_set(ee, on);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets if the Ecore_Evas is being directly resized using opengl x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done and EINA_FALSE is returned.
|
||||||
|
* @param ee The Ecore_Evas from which to get direct resize.
|
||||||
|
* @return EINA_TRUE if the resize was managed directly, otherwise return EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool
|
||||||
|
ecore_evas_gl_x11_direct_resize_get(const Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Gl_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Gl_X11 *)_ecore_evas_interface_get(ee, "gl_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
|
||||||
|
|
||||||
|
return iface->resize_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Add extra window on Ecore_Evas using opengl x11.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done.
|
||||||
|
* @param ee The Ecore_Evas for which to add the window.
|
||||||
|
* @param win The window to be added at the Ecore_Evas.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_gl_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Gl_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Gl_X11 *)_ecore_evas_interface_get(ee, "gl_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->extra_event_window_add(ee, win);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the functions to be used before and after the swap callback.
|
||||||
|
* @note If ecore is not compiled with support to x11 then nothing is done and the function is returned.
|
||||||
|
* @param ee The Ecore_Evas for which to set the swap callback.
|
||||||
|
* @param data The data for which to set the swap callback.
|
||||||
|
* @param pre_cb The function to be called before the callback.
|
||||||
|
* @param post_cb The function to be called after the callback.
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_gl_x11_pre_post_swap_callback_set(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e))
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Gl_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Gl_X11 *)_ecore_evas_interface_get(ee, "gl_x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->pre_post_swap_callback_set(ee, data, pre_cb, post_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->leader_set(ee, win);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_X_Window
|
||||||
|
ecore_evas_x11_leader_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, 0);
|
||||||
|
|
||||||
|
return iface->leader_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_leader_default_set(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->leader_default_set(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_shape_input_rectangle_set(Ecore_Evas *ee, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->shape_input_rectangle_set(ee, x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_shape_input_rectangle_add(Ecore_Evas *ee, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->shape_input_rectangle_add(ee, x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_shape_input_rectangle_subtract(Ecore_Evas *ee, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->shape_input_rectangle_subtract(ee, x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_shape_input_empty(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->shape_input_empty(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_shape_input_reset(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->shape_input_reset(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_x11_shape_input_apply(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_X11 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_X11 *)_ecore_evas_interface_get(ee, "x11");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->shape_input_apply(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_buffer_new(int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_buffer_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI const void *
|
||||||
|
ecore_evas_buffer_pixels_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Buffer *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Buffer *)_ecore_evas_interface_get(ee, "buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
|
||||||
|
|
||||||
|
return iface->pixels_get(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_buffer_allocfunc_new(int w, int h,
|
||||||
|
void *(*alloc_func) (void *data, int size),
|
||||||
|
void (*free_func) (void *data, void *pix),
|
||||||
|
const void *data)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(int, int, void*(*)(void *, int), void(*)(void *, void *), const void *);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_buffer_allocfunc_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(w, h, alloc_func, free_func, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ecore_evas_buffer_render(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Buffer *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Buffer *)_ecore_evas_interface_get(ee, "buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, 0);
|
||||||
|
|
||||||
|
return iface->render(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_extn_socket_new(int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_extn_socket_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Bool
|
||||||
|
ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Extn *)_ecore_evas_interface_get(ee, "extn");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
|
||||||
|
|
||||||
|
return iface->listen(ee, svcname, svcnum, svcsys);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_extn_plug_object_data_lock(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
|
ee = ecore_evas_object_ecore_evas_get(obj);
|
||||||
|
iface = (Ecore_Evas_Interface_Extn *)_ecore_evas_interface_get(ee, "extn");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->data_lock(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
|
ee = ecore_evas_object_ecore_evas_get(obj);
|
||||||
|
iface = (Ecore_Evas_Interface_Extn *)_ecore_evas_interface_get(ee, "extn");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->data_unlock(ee);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Evas_Object *
|
||||||
|
ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
|
||||||
|
{
|
||||||
|
Evas_Object *(*new)(Ecore_Evas *);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_extn_plug_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(ee_target);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Bool
|
||||||
|
ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
|
ee = ecore_evas_object_ecore_evas_get(obj);
|
||||||
|
iface = (Ecore_Evas_Interface_Extn *)_ecore_evas_interface_get(ee, "extn");
|
||||||
|
|
||||||
|
if (!iface) return EINA_FALSE;
|
||||||
|
return iface->connect(ee, svcname, svcnum, svcsys);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Evas_Object *
|
||||||
|
ecore_evas_object_image_new(Ecore_Evas *ee_target)
|
||||||
|
{
|
||||||
|
Evas_Object *(*new)(Ecore_Evas *ee_target);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("buffer");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_object_image_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(ee_target);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen,
|
||||||
|
int hwsurface, int noframe, int alpha)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, int, int, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("sdl");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_sdl_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(name, w, h, fullscreen, hwsurface, noframe, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen,
|
||||||
|
int hwsurface, int noframe, int alpha)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, int, int, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("sdl");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_sdl16_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(name, w, h, fullscreen, hwsurface, noframe, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("sdl");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_gl_sdl_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(name, w, h, fullscreen, noframe);
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("wayland");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_wayland_shm_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(disp_name, parent, x, y, w, h, frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
|
||||||
|
int x, int y, int w, int h, Eina_Bool frame)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("wayland");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(disp_name, parent, x, y, w, h, frame);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
|
ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
|
||||||
{
|
{
|
||||||
if (!ee) return;
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
if (!strcmp(ee->driver, "wayland_shm"))
|
iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
|
||||||
{
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
_ecore_evas_wayland_shm_resize(ee, location);
|
iface->resize(ee, location);
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else if (!strcmp(ee->driver, "wayland_egl"))
|
|
||||||
{
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
_ecore_evas_wayland_egl_resize(ee, location);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
|
ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
|
||||||
{
|
{
|
||||||
if (!ee) return;
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
if (!strncmp(ee->driver, "wayland", 7))
|
iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
|
||||||
{
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
if (ee->engine.wl.win)
|
|
||||||
{
|
iface->move(ee, x, y);
|
||||||
ee->engine.wl.win->moving = EINA_TRUE;
|
}
|
||||||
ecore_wl_window_move(ee->engine.wl.win, x, y);
|
|
||||||
}
|
EAPI void
|
||||||
}
|
ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->pointer_set(ee, hot_x, hot_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
|
ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
|
||||||
{
|
{
|
||||||
if (!ee) return;
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
ecore_wl_window_type_set(ee->engine.wl.win, type);
|
iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(iface);
|
||||||
|
|
||||||
|
iface->type_set(ee, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Ecore_Wl_Window *
|
EAPI Ecore_Wl_Window *
|
||||||
ecore_evas_wayland_window_get(const Ecore_Evas *ee)
|
ecore_evas_wayland_window_get(const Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
if (!(!strncmp(ee->driver, "wayland", 7)))
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
return NULL;
|
iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
|
||||||
|
|
||||||
return ee->engine.wl.win;
|
return iface->window_get(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_pointer_set(Ecore_Evas *ee EINA_UNUSED, int hot_x EINA_UNUSED, int hot_y EINA_UNUSED)
|
ecore_evas_software_gdi_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("win32");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_software_gdi_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(parent, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
EAPI Ecore_Evas *
|
||||||
EAPI void
|
ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
|
||||||
ecore_evas_wayland_resize(Ecore_Evas *ee EINA_UNUSED, int location EINA_UNUSED)
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("win32");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_software_ddraw_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(parent, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_move(Ecore_Evas *ee EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED)
|
ecore_evas_direct3d_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("win32");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_direct3d_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(parent, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_type_set(Ecore_Evas *ee EINA_UNUSED, int type EINA_UNUSED)
|
ecore_evas_gl_glew_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas *(*new)(Ecore_Win32_Window *, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("win32");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_gl_glew_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(parent, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Ecore_Wl_Window *
|
EAPI Ecore_Win32_Window *
|
||||||
ecore_evas_wayland_window_get(const Ecore_Evas *ee EINA_UNUSED)
|
ecore_evas_win32_window_get(const Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
return NULL;
|
Ecore_Evas_Interface_Win32 *iface;
|
||||||
|
iface = (Ecore_Evas_Interface_Win32 *)_ecore_evas_interface_get(ee, "win32");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
|
||||||
|
|
||||||
|
return iface->window_get(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_pointer_set(Ecore_Evas *ee EINA_UNUSED, int hot_x EINA_UNUSED, int hot_y EINA_UNUSED)
|
ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas *(*new)(Ecore_Cocoa_Window *, int, int, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("cocoa");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_cocoa_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(parent, x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
EAPI Ecore_Evas *
|
||||||
|
ecore_evas_psl1ght_new(const char* name, int w, int h)
|
||||||
|
{
|
||||||
|
Ecore_Evas *(*new)(const char*, int, int);
|
||||||
|
Eina_Module *m = _ecore_evas_engine_load("psl1ght");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
|
||||||
|
|
||||||
|
new = eina_module_symbol_get(m, "ecore_evas_psl1ght_new_internal");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
|
||||||
|
|
||||||
|
return new(name, w, h);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "Ecore_Evas.h"
|
||||||
|
#include "ecore_evas_private.h"
|
||||||
|
|
||||||
|
Eina_Hash *_registered_engines = NULL;
|
||||||
|
Eina_List *_engines_paths = NULL;
|
||||||
|
|
||||||
|
#if defined(__CEGCC__) || defined(__MINGW32CE__) || defined(_WIN32)
|
||||||
|
# define ECORE_EVAS_ENGINE_NAME "module.dll"
|
||||||
|
#else
|
||||||
|
# define ECORE_EVAS_ENGINE_NAME "module.so"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Eina_Module *
|
||||||
|
_ecore_evas_engine_load(const char *engine)
|
||||||
|
{
|
||||||
|
const char *path;
|
||||||
|
Eina_List *l;
|
||||||
|
Eina_Module *em = NULL;
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
|
||||||
|
|
||||||
|
em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
|
||||||
|
if (em) return em;
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(_engines_paths, l, path)
|
||||||
|
{
|
||||||
|
char tmp[PATH_MAX];
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof (tmp), "%s/%s/%s/"ECORE_EVAS_ENGINE_NAME, path, engine, MODULE_ARCH);
|
||||||
|
em = eina_module_new(tmp);
|
||||||
|
if (!em) continue;
|
||||||
|
|
||||||
|
if (!eina_module_load(em))
|
||||||
|
{
|
||||||
|
eina_module_free(em);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (eina_hash_add(_registered_engines, engine, em))
|
||||||
|
return em;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_evas_engine_init(void)
|
||||||
|
{
|
||||||
|
char *paths[4] = { NULL, NULL, NULL, NULL };
|
||||||
|
unsigned int i;
|
||||||
|
unsigned int j;
|
||||||
|
|
||||||
|
_registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
|
||||||
|
|
||||||
|
/* 1. ~/.ecore_evas/modules/ */
|
||||||
|
paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines");
|
||||||
|
/* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */
|
||||||
|
paths[1] = eina_module_environment_path_get("ECORE_EVAS_ENGINES_DIR", "/ecore_evas/engines");
|
||||||
|
/* 3. libecore_evas.so/../ecore_evas/engines/ */
|
||||||
|
paths[2] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines");
|
||||||
|
/* 4. PREFIX/ecore_evas/engines/ */
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
paths[3] = strdup(PACKAGE_LIB_DIR "/ecore_evas/engines");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (j = 0; j < ((sizeof (paths) / sizeof (char*)) - 1); ++j)
|
||||||
|
for (i = j + 1; i < sizeof (paths) / sizeof (char*); ++i)
|
||||||
|
if (paths[i] && paths[j] && !strcmp(paths[i], paths[j]))
|
||||||
|
{
|
||||||
|
free(paths[i]);
|
||||||
|
paths[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof (paths) / sizeof (char*); ++i)
|
||||||
|
if (paths[i])
|
||||||
|
_engines_paths = eina_list_append(_engines_paths, paths[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_evas_engine_shutdown(void)
|
||||||
|
{
|
||||||
|
char *path;
|
||||||
|
|
||||||
|
if (_registered_engines)
|
||||||
|
{
|
||||||
|
eina_hash_free(_registered_engines);
|
||||||
|
_registered_engines = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
EINA_LIST_FREE(_engines_paths, path)
|
||||||
|
free(path);
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _ECORE_EVAS_PRIVATE_H
|
#ifndef _ECORE_EVAS_PRIVATE_H
|
||||||
#define _ECORE_EVAS_PRIVATE_H
|
#define _ECORE_EVAS_PRIVATE_H
|
||||||
|
|
||||||
|
#include "Ecore_Evas_Types.h"
|
||||||
|
|
||||||
#include <Evas.h>
|
#include <Evas.h>
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include <ecore_private.h>
|
#include <ecore_private.h>
|
||||||
|
@ -9,67 +11,10 @@
|
||||||
|
|
||||||
#define ECORE_MAGIC_EVAS 0x76543211
|
#define ECORE_MAGIC_EVAS 0x76543211
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_X11
|
|
||||||
# include <Ecore_X.h>
|
|
||||||
# include <Ecore_X_Atoms.h>
|
|
||||||
# ifdef HAVE_ECORE_X_XCB
|
|
||||||
# include <xcb/xcb.h>
|
|
||||||
# endif
|
|
||||||
# ifdef HAVE_ECORE_X_XLIB
|
|
||||||
# include <X11/Xlib.h>
|
|
||||||
# include <X11/Xutil.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
||||||
# include <Evas_Engine_Software_X11.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
|
||||||
# include <Evas_Engine_GL_X11.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
# include <Evas_Engine_FB.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
|
#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
|
||||||
# include <Evas_Engine_Buffer.h>
|
# include <Evas_Engine_Buffer.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
|
||||||
# include "Ecore_Win32.h"
|
|
||||||
# ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
|
||||||
# include <Evas_Engine_Software_Gdi.h>
|
|
||||||
# endif
|
|
||||||
# ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
|
|
||||||
# include <Evas_Engine_Software_DDraw.h>
|
|
||||||
# endif
|
|
||||||
# ifdef BUILD_ECORE_EVAS_DIRECT3D
|
|
||||||
# include <Evas_Engine_Direct3D.h>
|
|
||||||
# endif
|
|
||||||
# ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
|
|
||||||
# include <Evas_Engine_GL_Glew.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_GL_COCOA
|
|
||||||
# include "Ecore_Cocoa.h"
|
|
||||||
# include <Evas_Engine_Gl_Cocoa.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
|
|
||||||
# include "Ecore_Wayland.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
# include <Evas_Engine_Wayland_Shm.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
# include <Evas_Engine_Wayland_Egl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Log domain macros and variables **/
|
/** Log domain macros and variables **/
|
||||||
|
|
||||||
extern int _ecore_evas_log_dom;
|
extern int _ecore_evas_log_dom;
|
||||||
|
@ -109,6 +54,17 @@ typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
|
||||||
|
|
||||||
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
|
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
|
||||||
typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
|
typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
|
||||||
|
typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface;
|
||||||
|
|
||||||
|
/* Engines interfaces */
|
||||||
|
typedef struct _Ecore_Evas_Interface_Buffer Ecore_Evas_Interface_Buffer;
|
||||||
|
typedef struct _Ecore_Evas_Interface_Extn Ecore_Evas_Interface_Extn;
|
||||||
|
typedef struct _Ecore_Evas_Interface_X11 Ecore_Evas_Interface_X11;
|
||||||
|
typedef struct _Ecore_Evas_Interface_Software_X11 Ecore_Evas_Interface_Software_X11;
|
||||||
|
typedef struct _Ecore_Evas_Interface_Gl_X11 Ecore_Evas_Interface_Gl_X11;
|
||||||
|
typedef struct _Ecore_Evas_Interface_Wayland Ecore_Evas_Interface_Wayland;
|
||||||
|
typedef struct _Ecore_Evas_Interface_Win32 Ecore_Evas_Interface_Win32;
|
||||||
|
|
||||||
|
|
||||||
struct _Ecore_Evas_Engine_Func
|
struct _Ecore_Evas_Engine_Func
|
||||||
{
|
{
|
||||||
|
@ -173,102 +129,89 @@ struct _Ecore_Evas_Engine_Func
|
||||||
void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
|
void (*fn_screen_dpi_get) (const Ecore_Evas *ee, int *xdpi, int *ydpi);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface
|
||||||
|
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
unsigned int version;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_Buffer {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
const void* (*pixels_get)(Ecore_Evas *ee);
|
||||||
|
int (*render)(Ecore_Evas *ee);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_X11 {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
void (*leader_set)(Ecore_Evas *ee, Ecore_X_Window win);
|
||||||
|
Ecore_X_Window (*leader_get)(Ecore_Evas *ee);
|
||||||
|
void (*leader_default_set)(Ecore_Evas *ee);
|
||||||
|
void (*shape_input_rectangle_set)(Ecore_Evas *ee, int x, int y, int w, int h);
|
||||||
|
void (*shape_input_rectangle_add)(Ecore_Evas *ee, int x, int y, int w, int h);
|
||||||
|
void (*shape_input_rectangle_subtract)(Ecore_Evas *ee, int x, int y, int w, int h);
|
||||||
|
void (*shape_input_empty)(Ecore_Evas *ee);
|
||||||
|
void (*shape_input_reset)(Ecore_Evas *ee);
|
||||||
|
void (*shape_input_apply)(Ecore_Evas *ee);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_Software_X11 {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
Ecore_X_Window (*window_get)(const Ecore_Evas *ee);
|
||||||
|
void (*resize_set)(Ecore_Evas *ee, Eina_Bool on);
|
||||||
|
Eina_Bool (*resize_get)(const Ecore_Evas *ee);
|
||||||
|
void (*extra_event_window_add)(Ecore_Evas *ee, Ecore_X_Window win);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_Gl_X11 {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
Ecore_X_Window (*window_get)(const Ecore_Evas *ee);
|
||||||
|
void (*resize_set)(Ecore_Evas *ee, Eina_Bool on);
|
||||||
|
Eina_Bool (*resize_get)(const Ecore_Evas *ee);
|
||||||
|
void (*extra_event_window_add)(Ecore_Evas *ee, Ecore_X_Window win);
|
||||||
|
void (*pre_post_swap_callback_set)(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e));
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_Extn {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
void (*data_lock)(Ecore_Evas *ee);
|
||||||
|
void (*data_unlock)(Ecore_Evas *ee);
|
||||||
|
Eina_Bool (*connect)(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
|
||||||
|
Eina_Bool (*listen)(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_Wayland {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
void (*resize)(Ecore_Evas *ee, int location);
|
||||||
|
void (*move)(Ecore_Evas *ee, int x, int y);
|
||||||
|
void (*pointer_set)(Ecore_Evas *ee, int hot_x, int hot_y);
|
||||||
|
void (*type_set)(Ecore_Evas *ee, int type);
|
||||||
|
Ecore_Wl_Window* (*window_get)(const Ecore_Evas *ee);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Interface_Win32 {
|
||||||
|
Ecore_Evas_Interface base;
|
||||||
|
|
||||||
|
Ecore_Win32_Window* (*window_get)(const Ecore_Evas *ee);
|
||||||
|
};
|
||||||
|
|
||||||
struct _Ecore_Evas_Engine
|
struct _Ecore_Evas_Engine
|
||||||
{
|
{
|
||||||
Ecore_Evas_Engine_Func *func;
|
Ecore_Evas_Engine_Func *func;
|
||||||
|
void *data;
|
||||||
/* TODO: UGLY! This should be an union or inheritance! */
|
Eina_List *ifaces;
|
||||||
#ifdef BUILD_ECORE_EVAS_X11
|
Ecore_Timer *idle_flush_timer;
|
||||||
struct
|
|
||||||
{
|
|
||||||
Ecore_X_Window win_root;
|
|
||||||
Eina_List *win_extra;
|
|
||||||
Ecore_X_Pixmap pmap;
|
|
||||||
Ecore_X_Pixmap mask;
|
|
||||||
Ecore_X_GC gc;
|
|
||||||
Ecore_X_XRegion *damages;
|
|
||||||
Ecore_X_Sync_Counter sync_counter;
|
|
||||||
Ecore_X_Window leader;
|
|
||||||
Ecore_X_Sync_Counter netwm_sync_counter;
|
|
||||||
int netwm_sync_val_hi;
|
|
||||||
unsigned int netwm_sync_val_lo;
|
|
||||||
int sync_val; // bigger! this will screw up at 2 billion frames (414 days of continual rendering @ 60fps)
|
|
||||||
int screen_num;
|
|
||||||
int px, py, pw, ph;
|
|
||||||
unsigned char direct_resize : 1;
|
|
||||||
unsigned char using_bg_pixmap : 1;
|
|
||||||
unsigned char managed : 1;
|
|
||||||
unsigned char sync_began : 1;
|
|
||||||
unsigned char sync_cancel : 1;
|
|
||||||
unsigned char netwm_sync_set : 1;
|
|
||||||
unsigned char configure_coming : 1;
|
|
||||||
struct {
|
|
||||||
unsigned char modal : 1;
|
|
||||||
unsigned char sticky : 1;
|
|
||||||
unsigned char maximized_v : 1;
|
|
||||||
unsigned char maximized_h : 1;
|
|
||||||
unsigned char shaded : 1;
|
|
||||||
unsigned char skip_taskbar : 1;
|
|
||||||
unsigned char skip_pager : 1;
|
|
||||||
unsigned char fullscreen : 1;
|
|
||||||
unsigned char above : 1;
|
|
||||||
unsigned char below : 1;
|
|
||||||
} state;
|
|
||||||
struct {
|
|
||||||
unsigned char available : 1; // need to setup available profiles in a window
|
|
||||||
unsigned char change : 1; // need to send change event to the WM
|
|
||||||
unsigned char done : 1; // need to send change done event to the WM
|
|
||||||
} profile;
|
|
||||||
Ecore_X_Window win_shaped_input;
|
|
||||||
} x;
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
struct {
|
|
||||||
int real_w;
|
|
||||||
int real_h;
|
|
||||||
} fb;
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
struct {
|
|
||||||
void *pixels;
|
|
||||||
Evas_Object *image;
|
|
||||||
void (*free_func) (void *data, void *pix);
|
|
||||||
void *(*alloc_func) (void *data, int size);
|
|
||||||
void *data;
|
|
||||||
} buffer;
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
|
||||||
struct {
|
|
||||||
Ecore_Win32_Window *parent;
|
|
||||||
struct {
|
|
||||||
unsigned char region : 1;
|
|
||||||
unsigned char fullscreen : 1;
|
|
||||||
} state;
|
|
||||||
} win32;
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EWS
|
#ifdef BUILD_ECORE_EVAS_EWS
|
||||||
struct {
|
struct {
|
||||||
Evas_Object *image;
|
Evas_Object *image;
|
||||||
} ews;
|
} ews;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Ecore_Wl_Window *parent, *win;
|
|
||||||
Evas_Object *frame;
|
|
||||||
|
|
||||||
# if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
|
|
||||||
struct wl_shm_pool *pool;
|
|
||||||
size_t pool_size;
|
|
||||||
void *pool_data;
|
|
||||||
struct wl_buffer *buffer;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
} wl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Ecore_Timer *idle_flush_timer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Ecore_Evas
|
struct _Ecore_Evas
|
||||||
|
@ -383,69 +326,13 @@ struct _Ecore_Evas
|
||||||
|
|
||||||
void _ecore_evas_ref(Ecore_Evas *ee);
|
void _ecore_evas_ref(Ecore_Evas *ee);
|
||||||
void _ecore_evas_unref(Ecore_Evas *ee);
|
void _ecore_evas_unref(Ecore_Evas *ee);
|
||||||
|
int ecore_evas_buffer_render(Ecore_Evas *ee);
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_X11
|
|
||||||
int _ecore_evas_x_shutdown(void);
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
int _ecore_evas_fb_shutdown(void);
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
int _ecore_evas_buffer_shutdown(void);
|
|
||||||
int _ecore_evas_buffer_render(Ecore_Evas *ee);
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
|
||||||
int _ecore_evas_win32_shutdown(void);
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EWS
|
#ifdef BUILD_ECORE_EVAS_EWS
|
||||||
void _ecore_evas_ews_events_init(void);
|
void _ecore_evas_ews_events_init(void);
|
||||||
int _ecore_evas_ews_shutdown(void);
|
int _ecore_evas_ews_shutdown(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
|
|
||||||
int _ecore_evas_wl_common_init(void);
|
|
||||||
int _ecore_evas_wl_common_shutdown(void);
|
|
||||||
void _ecore_evas_wl_common_pre_free(Ecore_Evas *ee);
|
|
||||||
void _ecore_evas_wl_common_free(Ecore_Evas *ee);
|
|
||||||
void _ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
|
||||||
void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y);
|
|
||||||
void _ecore_evas_wl_common_raise(Ecore_Evas *ee);
|
|
||||||
void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title);
|
|
||||||
void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
|
|
||||||
void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
|
|
||||||
void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
|
|
||||||
void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
|
|
||||||
void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
|
|
||||||
void _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
|
|
||||||
void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
|
|
||||||
void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
|
|
||||||
void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
|
|
||||||
void _ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full);
|
|
||||||
void _ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore);
|
|
||||||
int _ecore_evas_wl_common_pre_render(Ecore_Evas *ee);
|
|
||||||
int _ecore_evas_wl_common_render_updates(Ecore_Evas *ee);
|
|
||||||
void _ecore_evas_wl_common_post_render(Ecore_Evas *ee);
|
|
||||||
int _ecore_evas_wl_common_render(Ecore_Evas *ee);
|
|
||||||
void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
|
|
||||||
void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
|
|
||||||
|
|
||||||
Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void _ecore_evas_fps_debug_init(void);
|
void _ecore_evas_fps_debug_init(void);
|
||||||
void _ecore_evas_fps_debug_shutdown(void);
|
void _ecore_evas_fps_debug_shutdown(void);
|
||||||
void _ecore_evas_fps_debug_rendertime_add(double t);
|
void _ecore_evas_fps_debug_rendertime_add(double t);
|
||||||
|
@ -482,8 +369,12 @@ void _ecore_evas_mouse_multi_up_process(Ecore_Evas *ee, int device,
|
||||||
|
|
||||||
extern Eina_Bool _ecore_evas_app_comp_sync;
|
extern Eina_Bool _ecore_evas_app_comp_sync;
|
||||||
|
|
||||||
void _ecore_evas_extn_init(void);
|
|
||||||
void _ecore_evas_extn_shutdown(void);
|
Eina_Module *_ecore_evas_engine_load(const char *engine);
|
||||||
|
void _ecore_evas_engine_init();
|
||||||
|
void _ecore_evas_engine_shutdown();
|
||||||
|
|
||||||
|
Ecore_Evas_Interface *_ecore_evas_interface_get(const Ecore_Evas *ee, const char *iname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Free the string of the window profile.
|
* @brief Free the string of the window profile.
|
||||||
|
@ -500,3 +391,4 @@ void _ecore_evas_window_profile_free(Ecore_Evas *ee);
|
||||||
void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee);
|
void _ecore_evas_window_available_profiles_free(Ecore_Evas *ee);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,16 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
|
#include "ecore_evas_buffer_private.h"
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <Ecore.h>
|
|
||||||
#include "ecore_private.h"
|
|
||||||
#include <Ecore_Input.h>
|
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
|
||||||
#include "Ecore_Evas.h"
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
static int _ecore_evas_init_count = 0;
|
static int _ecore_evas_init_count = 0;
|
||||||
|
|
||||||
|
static const char *interface_buffer_name = "buffer";
|
||||||
|
static const int interface_buffer_version = 1;
|
||||||
|
|
||||||
|
|
||||||
|
static Ecore_Evas_Interface_Buffer *_ecore_evas_buffer_interface_new(void);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_ecore_evas_buffer_init(void)
|
_ecore_evas_buffer_init(void)
|
||||||
{
|
{
|
||||||
|
@ -22,22 +19,34 @@ _ecore_evas_buffer_init(void)
|
||||||
return _ecore_evas_init_count;
|
return _ecore_evas_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_ecore_evas_buffer_shutdown(void)
|
||||||
|
{
|
||||||
|
_ecore_evas_init_count--;
|
||||||
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
||||||
|
return _ecore_evas_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_buffer_free(Ecore_Evas *ee)
|
_ecore_evas_buffer_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
if (ee->engine.buffer.image)
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
|
if (bdata->image)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee2;
|
Ecore_Evas *ee2;
|
||||||
|
|
||||||
ee2 = evas_object_data_get(ee->engine.buffer.image, "Ecore_Evas_Parent");
|
ee2 = evas_object_data_get(bdata->image, "Ecore_Evas_Parent");
|
||||||
evas_object_del(ee->engine.buffer.image);
|
evas_object_del(bdata->image);
|
||||||
ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee);
|
ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ee->engine.buffer.free_func(ee->engine.buffer.data,
|
bdata->free_func(bdata->data,
|
||||||
ee->engine.buffer.pixels);
|
bdata->pixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(bdata);
|
||||||
_ecore_evas_buffer_shutdown();
|
_ecore_evas_buffer_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +54,7 @@ static void
|
||||||
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
int stride = 0;
|
int stride = 0;
|
||||||
|
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
|
@ -58,19 +68,18 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
|
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
{
|
{
|
||||||
ee->engine.buffer.pixels = evas_object_image_data_get(ee->engine.buffer.image, 1);
|
bdata->pixels = evas_object_image_data_get(bdata->image, 1);
|
||||||
stride = evas_object_image_stride_get(ee->engine.buffer.image);
|
stride = evas_object_image_stride_get(bdata->image);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ee->engine.buffer.pixels)
|
if (bdata->pixels)
|
||||||
ee->engine.buffer.free_func(ee->engine.buffer.data,
|
bdata->free_func(bdata->data,
|
||||||
ee->engine.buffer.pixels);
|
bdata->pixels);
|
||||||
ee->engine.buffer.pixels =
|
bdata->pixels = bdata->alloc_func(bdata->data,
|
||||||
ee->engine.buffer.alloc_func(ee->engine.buffer.data,
|
ee->w * ee->h * sizeof(int));
|
||||||
ee->w * ee->h * sizeof(int));
|
|
||||||
stride = ee->w * sizeof(int);
|
stride = ee->w * sizeof(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +90,7 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
||||||
else
|
else
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
||||||
einfo->info.dest_buffer = ee->engine.buffer.pixels;
|
einfo->info.dest_buffer = bdata->pixels;
|
||||||
einfo->info.dest_buffer_row_bytes = stride;
|
einfo->info.dest_buffer_row_bytes = stride;
|
||||||
einfo->info.use_color_key = 0;
|
einfo->info.use_color_key = 0;
|
||||||
einfo->info.alpha_threshold = 0;
|
einfo->info.alpha_threshold = 0;
|
||||||
|
@ -92,8 +101,8 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
evas_object_image_data_set(ee->engine.buffer.image, ee->engine.buffer.pixels);
|
evas_object_image_data_set(bdata->image, bdata->pixels);
|
||||||
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,28 +112,23 @@ _ecore_evas_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNUSED, in
|
||||||
_ecore_evas_resize(ee, w, h);
|
_ecore_evas_resize(ee, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
_ecore_evas_buffer_shutdown(void)
|
|
||||||
{
|
|
||||||
_ecore_evas_init_count--;
|
|
||||||
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
|
||||||
return _ecore_evas_init_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_show(Ecore_Evas *ee)
|
_ecore_evas_show(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
if (ee->engine.buffer.image) return;
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
|
if (bdata->image) return;
|
||||||
if (ee->prop.focused) return;
|
if (ee->prop.focused) return;
|
||||||
ee->prop.focused = 1;
|
ee->prop.focused = 1;
|
||||||
evas_focus_in(ee->evas);
|
evas_focus_in(ee->evas);
|
||||||
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
_ecore_evas_buffer_render(Ecore_Evas *ee)
|
_ecore_evas_buffer_render(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Eina_List *updates = NULL, *l, *ll;
|
Eina_List *updates = NULL, *l, *ll;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Ecore_Evas *ee2;
|
Ecore_Evas *ee2;
|
||||||
int rend = 0;
|
int rend = 0;
|
||||||
|
|
||||||
|
@ -135,26 +139,26 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
|
||||||
rend |= ee2->engine.func->fn_render(ee2);
|
rend |= ee2->engine.func->fn_render(ee2);
|
||||||
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
||||||
}
|
}
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
evas_object_image_size_get(ee->engine.buffer.image, &w, &h);
|
evas_object_image_size_get(bdata->image, &w, &h);
|
||||||
if ((w != ee->w) || (h != ee->h))
|
if ((w != ee->w) || (h != ee->h))
|
||||||
_ecore_evas_resize(ee, w, h);
|
_ecore_evas_resize(ee, w, h);
|
||||||
ee->engine.buffer.pixels = evas_object_image_data_get(ee->engine.buffer.image, 1);
|
bdata->pixels = evas_object_image_data_get(bdata->image, 1);
|
||||||
}
|
}
|
||||||
if (ee->engine.buffer.pixels)
|
if (bdata->pixels)
|
||||||
{
|
{
|
||||||
updates = evas_render_updates(ee->evas);
|
updates = evas_render_updates(ee->evas);
|
||||||
}
|
}
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
{
|
{
|
||||||
Eina_Rectangle *r;
|
Eina_Rectangle *r;
|
||||||
|
|
||||||
evas_object_image_data_set(ee->engine.buffer.image, ee->engine.buffer.pixels);
|
evas_object_image_data_set(bdata->image, bdata->pixels);
|
||||||
EINA_LIST_FOREACH(updates, l, r)
|
EINA_LIST_FOREACH(updates, l, r)
|
||||||
evas_object_image_data_update_add(ee->engine.buffer.image,
|
evas_object_image_data_update_add(bdata->image,
|
||||||
r->x, r->y, r->w, r->h);
|
r->x, r->y, r->w, r->h);
|
||||||
}
|
}
|
||||||
if (updates)
|
if (updates)
|
||||||
|
@ -170,16 +174,17 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
|
_ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Coord xx, yy, ww, hh, fx, fy, fw, fh;
|
Evas_Coord xx, yy, ww, hh, fx, fy, fw, fh;
|
||||||
|
|
||||||
evas_object_geometry_get(ee->engine.buffer.image, &xx, &yy, &ww, &hh);
|
evas_object_geometry_get(bdata->image, &xx, &yy, &ww, &hh);
|
||||||
evas_object_image_fill_get(ee->engine.buffer.image, &fx, &fy, &fw, &fh);
|
evas_object_image_fill_get(bdata->image, &fx, &fy, &fw, &fh);
|
||||||
|
|
||||||
if (fw < 1) fw = 1;
|
if (fw < 1) fw = 1;
|
||||||
if (fh < 1) fh = 1;
|
if (fh < 1) fh = 1;
|
||||||
|
|
||||||
if (evas_object_map_get(ee->engine.buffer.image) &&
|
if (evas_object_map_get(bdata->image) &&
|
||||||
evas_object_map_enable_get(ee->engine.buffer.image))
|
evas_object_map_enable_get(bdata->image))
|
||||||
{
|
{
|
||||||
fx = 0; fy = 0;
|
fx = 0; fy = 0;
|
||||||
fw = ee->w; fh = ee->h;
|
fw = ee->w; fh = ee->h;
|
||||||
|
@ -447,10 +452,11 @@ _ecore_evas_buffer_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
|
||||||
static void
|
static void
|
||||||
_ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha)
|
_ecore_evas_buffer_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha))) return;
|
if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha))) return;
|
||||||
ee->alpha = alpha;
|
ee->alpha = alpha;
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
evas_object_image_alpha_set(ee->engine.buffer.image, ee->alpha);
|
evas_object_image_alpha_set(bdata->image, ee->alpha);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
@ -545,7 +551,6 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
|
||||||
NULL, // screen_geometry_get
|
NULL, // screen_geometry_get
|
||||||
NULL // screen_dpi_get
|
NULL // screen_dpi_get
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
_ecore_evas_buffer_pix_alloc(void *data EINA_UNUSED, int size)
|
_ecore_evas_buffer_pix_alloc(void *data EINA_UNUSED, int size)
|
||||||
|
@ -560,18 +565,11 @@ _ecore_evas_buffer_pix_free(void *data EINA_UNUSED, void *pix)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_buffer_new(int w, int h)
|
ecore_evas_buffer_allocfunc_new_internal(int w, int h, void *(*alloc_func) (void *data, int size), void (*free_func) (void *data, void *pix), const void *data)
|
||||||
{
|
{
|
||||||
return ecore_evas_buffer_allocfunc_new
|
|
||||||
(w, h, _ecore_evas_buffer_pix_alloc, _ecore_evas_buffer_pix_free, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, int size), void (*free_func) (void *data, void *pix), const void *data)
|
|
||||||
{
|
|
||||||
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata;
|
||||||
|
Ecore_Evas_Interface_Buffer *iface;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
|
||||||
|
@ -580,15 +578,25 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
|
||||||
if (!rmethod) return NULL;
|
if (!rmethod) return NULL;
|
||||||
ee = calloc(1, sizeof(Ecore_Evas));
|
ee = calloc(1, sizeof(Ecore_Evas));
|
||||||
if (!ee) return NULL;
|
if (!ee) return NULL;
|
||||||
|
bdata = calloc(1, sizeof(Ecore_Evas_Engine_Buffer_Data));
|
||||||
|
if (!bdata)
|
||||||
|
{
|
||||||
|
free(ee);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||||
|
|
||||||
_ecore_evas_buffer_init();
|
_ecore_evas_buffer_init();
|
||||||
|
|
||||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_buffer_engine_func;
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_buffer_engine_func;
|
||||||
ee->engine.buffer.alloc_func = alloc_func;
|
ee->engine.data = bdata;
|
||||||
ee->engine.buffer.free_func = free_func;
|
bdata->alloc_func = alloc_func;
|
||||||
ee->engine.buffer.data = (void *)data;
|
bdata->free_func = free_func;
|
||||||
|
bdata->data = (void *)data;
|
||||||
|
|
||||||
|
iface = _ecore_evas_buffer_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
ee->driver = "buffer";
|
ee->driver = "buffer";
|
||||||
|
|
||||||
|
@ -620,15 +628,13 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
|
||||||
evas_output_size_set(ee->evas, w, h);
|
evas_output_size_set(ee->evas, w, h);
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
||||||
|
|
||||||
ee->engine.buffer.pixels =
|
bdata->pixels = bdata->alloc_func(bdata->data, w * h * sizeof(int));
|
||||||
ee->engine.buffer.alloc_func
|
|
||||||
(ee->engine.buffer.data, w * h * sizeof(int));
|
|
||||||
|
|
||||||
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
|
||||||
if (einfo)
|
if (einfo)
|
||||||
{
|
{
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
||||||
einfo->info.dest_buffer = ee->engine.buffer.pixels;
|
einfo->info.dest_buffer = bdata->pixels;
|
||||||
einfo->info.dest_buffer_row_bytes = ee->w * sizeof(int);
|
einfo->info.dest_buffer_row_bytes = ee->w * sizeof(int);
|
||||||
einfo->info.use_color_key = 0;
|
einfo->info.use_color_key = 0;
|
||||||
einfo->info.alpha_threshold = 0;
|
einfo->info.alpha_threshold = 0;
|
||||||
|
@ -664,51 +670,36 @@ ecore_evas_buffer_allocfunc_new(int w, int h, void *(*alloc_func) (void *data, i
|
||||||
evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
|
evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const void *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_buffer_pixels_get(Ecore_Evas *ee)
|
ecore_evas_buffer_new_internal(int w, int h)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
return ecore_evas_buffer_allocfunc_new_internal
|
||||||
|
(w, h, _ecore_evas_buffer_pix_alloc, _ecore_evas_buffer_pix_free, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
const void *
|
||||||
|
_ecore_evas_buffer_pixels_get(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
if (!ee)
|
if (!ee)
|
||||||
{
|
{
|
||||||
CRIT("Ecore_Evas is missing");
|
CRIT("Ecore_Evas is missing");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
_ecore_evas_buffer_render(ee);
|
_ecore_evas_buffer_render(ee);
|
||||||
return ee->engine.buffer.pixels;
|
return bdata->pixels;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI Evas *
|
|
||||||
ecore_evas_object_evas_get(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
Ecore_Evas *ee;
|
|
||||||
|
|
||||||
ee = evas_object_data_get(obj, "Ecore_Evas");
|
|
||||||
if (!ee) return NULL;
|
|
||||||
|
|
||||||
return ecore_evas_get(ee);
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_object_ecore_evas_get(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
return evas_object_data_get(obj, "Ecore_Evas");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
ecore_evas_object_image_new(Ecore_Evas *ee_target)
|
ecore_evas_object_image_new_internal(Ecore_Evas *ee_target)
|
||||||
{
|
{
|
||||||
// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata;
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
Ecore_Evas_Interface_Buffer *iface;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
int w = 1, h = 1;
|
int w = 1, h = 1;
|
||||||
|
@ -719,6 +710,16 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
|
||||||
if (!rmethod) return NULL;
|
if (!rmethod) return NULL;
|
||||||
ee = calloc(1, sizeof(Ecore_Evas));
|
ee = calloc(1, sizeof(Ecore_Evas));
|
||||||
if (!ee) return NULL;
|
if (!ee) return NULL;
|
||||||
|
bdata = calloc(1, sizeof(Ecore_Evas_Engine_Buffer_Data));
|
||||||
|
if (!bdata)
|
||||||
|
{
|
||||||
|
free(ee);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ee->engine.data = bdata;
|
||||||
|
iface = _ecore_evas_buffer_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
o = evas_object_image_add(ee_target->evas);
|
o = evas_object_image_add(ee_target->evas);
|
||||||
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
|
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
|
||||||
|
@ -760,69 +761,69 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
|
||||||
evas_output_size_set(ee->evas, w, h);
|
evas_output_size_set(ee->evas, w, h);
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
||||||
|
|
||||||
ee->engine.buffer.image = o;
|
bdata->image = o;
|
||||||
evas_object_data_set(ee->engine.buffer.image, "Ecore_Evas", ee);
|
evas_object_data_set(bdata->image, "Ecore_Evas", ee);
|
||||||
evas_object_data_set(ee->engine.buffer.image, "Ecore_Evas_Parent", ee_target);
|
evas_object_data_set(bdata->image, "Ecore_Evas_Parent", ee_target);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_IN,
|
EVAS_CALLBACK_MOUSE_IN,
|
||||||
_ecore_evas_buffer_cb_mouse_in, ee);
|
_ecore_evas_buffer_cb_mouse_in, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_OUT,
|
EVAS_CALLBACK_MOUSE_OUT,
|
||||||
_ecore_evas_buffer_cb_mouse_out, ee);
|
_ecore_evas_buffer_cb_mouse_out, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_DOWN,
|
EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_ecore_evas_buffer_cb_mouse_down, ee);
|
_ecore_evas_buffer_cb_mouse_down, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_UP,
|
EVAS_CALLBACK_MOUSE_UP,
|
||||||
_ecore_evas_buffer_cb_mouse_up, ee);
|
_ecore_evas_buffer_cb_mouse_up, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_MOVE,
|
EVAS_CALLBACK_MOUSE_MOVE,
|
||||||
_ecore_evas_buffer_cb_mouse_move, ee);
|
_ecore_evas_buffer_cb_mouse_move, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_WHEEL,
|
EVAS_CALLBACK_MOUSE_WHEEL,
|
||||||
_ecore_evas_buffer_cb_mouse_wheel, ee);
|
_ecore_evas_buffer_cb_mouse_wheel, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MULTI_DOWN,
|
EVAS_CALLBACK_MULTI_DOWN,
|
||||||
_ecore_evas_buffer_cb_multi_down, ee);
|
_ecore_evas_buffer_cb_multi_down, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MULTI_UP,
|
EVAS_CALLBACK_MULTI_UP,
|
||||||
_ecore_evas_buffer_cb_multi_up, ee);
|
_ecore_evas_buffer_cb_multi_up, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MULTI_MOVE,
|
EVAS_CALLBACK_MULTI_MOVE,
|
||||||
_ecore_evas_buffer_cb_multi_move, ee);
|
_ecore_evas_buffer_cb_multi_move, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_FREE,
|
EVAS_CALLBACK_FREE,
|
||||||
_ecore_evas_buffer_cb_free, ee);
|
_ecore_evas_buffer_cb_free, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_KEY_DOWN,
|
EVAS_CALLBACK_KEY_DOWN,
|
||||||
_ecore_evas_buffer_cb_key_down, ee);
|
_ecore_evas_buffer_cb_key_down, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_KEY_UP,
|
EVAS_CALLBACK_KEY_UP,
|
||||||
_ecore_evas_buffer_cb_key_up, ee);
|
_ecore_evas_buffer_cb_key_up, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_FOCUS_IN,
|
EVAS_CALLBACK_FOCUS_IN,
|
||||||
_ecore_evas_buffer_cb_focus_in, ee);
|
_ecore_evas_buffer_cb_focus_in, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_FOCUS_OUT,
|
EVAS_CALLBACK_FOCUS_OUT,
|
||||||
_ecore_evas_buffer_cb_focus_out, ee);
|
_ecore_evas_buffer_cb_focus_out, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_SHOW,
|
EVAS_CALLBACK_SHOW,
|
||||||
_ecore_evas_buffer_cb_show, ee);
|
_ecore_evas_buffer_cb_show, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_HIDE,
|
EVAS_CALLBACK_HIDE,
|
||||||
_ecore_evas_buffer_cb_hide, ee);
|
_ecore_evas_buffer_cb_hide, ee);
|
||||||
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
|
||||||
if (einfo)
|
if (einfo)
|
||||||
{
|
{
|
||||||
ee->engine.buffer.pixels = evas_object_image_data_get(o, 1);
|
bdata->pixels = evas_object_image_data_get(o, 1);
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
||||||
einfo->info.dest_buffer = ee->engine.buffer.pixels;
|
einfo->info.dest_buffer = bdata->pixels;
|
||||||
einfo->info.dest_buffer_row_bytes = evas_object_image_stride_get(o);
|
einfo->info.dest_buffer_row_bytes = evas_object_image_stride_get(o);
|
||||||
einfo->info.use_color_key = 0;
|
einfo->info.use_color_key = 0;
|
||||||
einfo->info.alpha_threshold = 0;
|
einfo->info.alpha_threshold = 0;
|
||||||
einfo->info.func.new_update_region = NULL;
|
einfo->info.func.new_update_region = NULL;
|
||||||
einfo->info.func.free_update_region = NULL;
|
einfo->info.func.free_update_region = NULL;
|
||||||
evas_object_image_data_set(o, ee->engine.buffer.pixels);
|
evas_object_image_data_set(o, bdata->pixels);
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
{
|
{
|
||||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||||
|
@ -849,7 +850,21 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
|
||||||
ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);
|
ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
#else
|
}
|
||||||
return NULL;
|
|
||||||
#endif
|
static Ecore_Evas_Interface_Buffer *
|
||||||
|
_ecore_evas_buffer_interface_new(void)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Buffer *iface;
|
||||||
|
|
||||||
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Buffer));
|
||||||
|
if (!iface) return NULL;
|
||||||
|
|
||||||
|
iface->base.name = interface_buffer_name;
|
||||||
|
iface->base.version = interface_buffer_version;
|
||||||
|
|
||||||
|
iface->pixels_get = _ecore_evas_buffer_pixels_get;
|
||||||
|
iface->render = _ecore_evas_buffer_render;
|
||||||
|
|
||||||
|
return iface;
|
||||||
}
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
#ifndef _ECORE_EVAS_BUFFER_PRIVATE_H_
|
||||||
|
#define _ECORE_EVAS_BUFFER_PRIVATE_H_
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <Ecore.h>
|
||||||
|
#include "ecore_private.h"
|
||||||
|
#include <Ecore_Input.h>
|
||||||
|
|
||||||
|
#include "ecore_evas_private.h"
|
||||||
|
#include "Ecore_Evas.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _Ecore_Evas_Engine_Buffer_Data Ecore_Evas_Engine_Buffer_Data;
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Engine_Buffer_Data {
|
||||||
|
void *pixels;
|
||||||
|
Evas_Object *image;
|
||||||
|
void (*free_func) (void *data, void *pix);
|
||||||
|
void *(*alloc_func) (void *data, int size);
|
||||||
|
void *data;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _ECORE_EVAS_BUFFER_PRIVATE_H_ */
|
|
@ -29,7 +29,6 @@ void *alloca (size_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -43,22 +42,13 @@ void *alloca (size_t);
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <Ecore.h>
|
|
||||||
#include "ecore_private.h"
|
|
||||||
#include <Ecore_Input.h>
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
|
|
||||||
#include <Ecore_Ipc.h>
|
#include <Ecore_Ipc.h>
|
||||||
|
|
||||||
#endif
|
#include "ecore_evas_buffer_private.h"
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
|
||||||
#include "Ecore_Evas.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
static const char *interface_extn_name = "extn";
|
||||||
|
static const int interface_extn_version = 1;
|
||||||
|
|
||||||
typedef struct _Shmfile Shmfile;
|
typedef struct _Shmfile Shmfile;
|
||||||
|
|
||||||
|
@ -72,6 +62,8 @@ struct _Shmfile
|
||||||
|
|
||||||
static int blank = 0x00000000;
|
static int blank = 0x00000000;
|
||||||
|
|
||||||
|
static Ecore_Evas_Interface_Extn *_ecore_evas_extn_interface_new(void);
|
||||||
|
|
||||||
static Shmfile *
|
static Shmfile *
|
||||||
shmfile_new(const char *base, int id, int size, Eina_Bool sys)
|
shmfile_new(const char *base, int id, int size, Eina_Bool sys)
|
||||||
{
|
{
|
||||||
|
@ -386,12 +378,16 @@ static Eina_List *extn_ee_list = NULL;
|
||||||
EAPI int ECORE_EVAS_EXTN_CLIENT_ADD = 0;
|
EAPI int ECORE_EVAS_EXTN_CLIENT_ADD = 0;
|
||||||
EAPI int ECORE_EVAS_EXTN_CLIENT_DEL = 0;
|
EAPI int ECORE_EVAS_EXTN_CLIENT_DEL = 0;
|
||||||
|
|
||||||
void
|
Eina_Bool
|
||||||
_ecore_evas_extn_init(void)
|
_ecore_evas_extn_init(void)
|
||||||
{
|
{
|
||||||
if (ECORE_EVAS_EXTN_CLIENT_ADD) return;
|
if (!ECORE_EVAS_EXTN_CLIENT_ADD)
|
||||||
ECORE_EVAS_EXTN_CLIENT_ADD = ecore_event_type_new();
|
{
|
||||||
ECORE_EVAS_EXTN_CLIENT_DEL = ecore_event_type_new();
|
ECORE_EVAS_EXTN_CLIENT_ADD = ecore_event_type_new();
|
||||||
|
ECORE_EVAS_EXTN_CLIENT_DEL = ecore_event_type_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -403,18 +399,22 @@ static void
|
||||||
_ecore_evas_extn_event_free(void *data, void *ev EINA_UNUSED)
|
_ecore_evas_extn_event_free(void *data, void *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
if (ee->engine.buffer.image)
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
evas_object_unref(ee->engine.buffer.image);
|
|
||||||
|
if (bdata->image)
|
||||||
|
evas_object_unref(bdata->image);
|
||||||
_ecore_evas_unref(ee);
|
_ecore_evas_unref(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_extn_event(Ecore_Evas *ee, int event)
|
_ecore_evas_extn_event(Ecore_Evas *ee, int event)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
_ecore_evas_ref(ee);
|
_ecore_evas_ref(ee);
|
||||||
if (ee->engine.buffer.image)
|
|
||||||
evas_object_ref(ee->engine.buffer.image);
|
if (bdata->image)
|
||||||
ecore_event_add(event, ee->engine.buffer.image,
|
evas_object_ref(bdata->image);
|
||||||
|
ecore_event_add(event, bdata->image,
|
||||||
_ecore_evas_extn_event_free, ee);
|
_ecore_evas_extn_event_free, ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,15 +424,18 @@ _ecore_evas_lock_other_have(Ecore_Evas *ee)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Ecore_Evas *ee2;
|
Ecore_Evas *ee2;
|
||||||
Extn *extn, *extn2;
|
Extn *extn, *extn2;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
extn = ee->engine.buffer.data;
|
Ecore_Evas_Engine_Buffer_Data *bdata2;
|
||||||
|
|
||||||
|
extn = bdata->data;
|
||||||
if (!extn) return EINA_FALSE;
|
if (!extn) return EINA_FALSE;
|
||||||
// brute force - i know. i expect extn_ee_list to be fairly short. could
|
// brute force - i know. i expect extn_ee_list to be fairly short. could
|
||||||
// be improved with a hash of lockfiles
|
// be improved with a hash of lockfiles
|
||||||
EINA_LIST_FOREACH(extn_ee_list, l, ee2)
|
EINA_LIST_FOREACH(extn_ee_list, l, ee2)
|
||||||
{
|
{
|
||||||
if (ee == ee2) continue;
|
if (ee == ee2) continue;
|
||||||
extn2 = ee2->engine.buffer.data;
|
bdata2 = ee2->engine.data;
|
||||||
|
extn2 = bdata2->data;
|
||||||
if (!extn2) continue;
|
if (!extn2) continue;
|
||||||
if ((extn->file.lock) && (extn2->file.lock) &&
|
if ((extn->file.lock) && (extn2->file.lock) &&
|
||||||
(!strcmp(extn->file.lock, extn2->file.lock)) &&
|
(!strcmp(extn->file.lock, extn2->file.lock)) &&
|
||||||
|
@ -446,8 +449,9 @@ static void
|
||||||
_ecore_evas_socket_lock(Ecore_Evas *ee)
|
_ecore_evas_socket_lock(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->file.lockfd < 0) return;
|
if (extn->file.lockfd < 0) return;
|
||||||
if (extn->file.have_lock) return;
|
if (extn->file.have_lock) return;
|
||||||
|
@ -461,8 +465,9 @@ static void
|
||||||
_ecore_evas_socket_unlock(Ecore_Evas *ee)
|
_ecore_evas_socket_unlock(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->file.lockfd < 0) return;
|
if (extn->file.lockfd < 0) return;
|
||||||
if (!extn->file.have_lock) return;
|
if (!extn->file.have_lock) return;
|
||||||
|
@ -496,15 +501,16 @@ static void
|
||||||
_ecore_evas_extn_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
|
_ecore_evas_extn_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
|
||||||
{
|
{
|
||||||
Evas_Coord xx, yy, ww, hh, fx, fy, fw, fh;
|
Evas_Coord xx, yy, ww, hh, fx, fy, fw, fh;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
evas_object_geometry_get(ee->engine.buffer.image, &xx, &yy, &ww, &hh);
|
evas_object_geometry_get(bdata->image, &xx, &yy, &ww, &hh);
|
||||||
evas_object_image_fill_get(ee->engine.buffer.image, &fx, &fy, &fw, &fh);
|
evas_object_image_fill_get(bdata->image, &fx, &fy, &fw, &fh);
|
||||||
|
|
||||||
if (fw < 1) fw = 1;
|
if (fw < 1) fw = 1;
|
||||||
if (fh < 1) fh = 1;
|
if (fh < 1) fh = 1;
|
||||||
|
|
||||||
if (evas_object_map_get(ee->engine.buffer.image) &&
|
if (evas_object_map_get(bdata->image) &&
|
||||||
evas_object_map_enable_get(ee->engine.buffer.image))
|
evas_object_map_enable_get(bdata->image))
|
||||||
{
|
{
|
||||||
fx = 0; fy = 0;
|
fx = 0; fy = 0;
|
||||||
fw = ee->w; fh = ee->h;
|
fw = ee->w; fh = ee->h;
|
||||||
|
@ -535,8 +541,9 @@ _ecore_evas_extn_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
Ecore_Ipc_Client *client;
|
Ecore_Ipc_Client *client;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (extn)
|
if (extn)
|
||||||
{
|
{
|
||||||
Ecore_Event_Handler *hdl;
|
Ecore_Event_Handler *hdl;
|
||||||
|
@ -572,26 +579,26 @@ _ecore_evas_extn_free(Ecore_Evas *ee)
|
||||||
ecore_event_handler_del(hdl);
|
ecore_event_handler_del(hdl);
|
||||||
free(extn);
|
free(extn);
|
||||||
ecore_ipc_shutdown();
|
ecore_ipc_shutdown();
|
||||||
ee->engine.buffer.data = NULL;
|
bdata->data = NULL;
|
||||||
}
|
}
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee2;
|
Ecore_Evas *ee2;
|
||||||
|
|
||||||
evas_object_event_callback_del_full(ee->engine.buffer.image,
|
evas_object_event_callback_del_full(bdata->image,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_ecore_evas_extn_plug_image_obj_del,
|
_ecore_evas_extn_plug_image_obj_del,
|
||||||
ee);
|
ee);
|
||||||
evas_event_callback_del_full(evas_object_evas_get(ee->engine.buffer.image),
|
evas_event_callback_del_full(evas_object_evas_get(bdata->image),
|
||||||
EVAS_CALLBACK_RENDER_PRE,
|
EVAS_CALLBACK_RENDER_PRE,
|
||||||
_ecore_evas_extn_plug_targer_render_pre,
|
_ecore_evas_extn_plug_targer_render_pre,
|
||||||
ee);
|
ee);
|
||||||
evas_event_callback_del_full(evas_object_evas_get(ee->engine.buffer.image),
|
evas_event_callback_del_full(evas_object_evas_get(bdata->image),
|
||||||
EVAS_CALLBACK_RENDER_POST,
|
EVAS_CALLBACK_RENDER_POST,
|
||||||
_ecore_evas_extn_plug_targer_render_post,
|
_ecore_evas_extn_plug_targer_render_post,
|
||||||
ee);
|
ee);
|
||||||
evas_object_del(ee->engine.buffer.image);
|
evas_object_del(bdata->image);
|
||||||
ee2 = evas_object_data_get(ee->engine.buffer.image, "Ecore_Evas_Parent");
|
ee2 = evas_object_data_get(bdata->image, "Ecore_Evas_Parent");
|
||||||
if (ee2)
|
if (ee2)
|
||||||
{
|
{
|
||||||
ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee);
|
ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee);
|
||||||
|
@ -603,6 +610,8 @@ _ecore_evas_extn_free(Ecore_Evas *ee)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
if (h < 1) h = 1;
|
if (h < 1) h = 1;
|
||||||
ee->req.w = w;
|
ee->req.w = w;
|
||||||
|
@ -615,10 +624,10 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
||||||
* No need for it if not used later.
|
* No need for it if not used later.
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
*/
|
*/
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
evas_object_image_size_set(ee->engine.buffer.image, ee->w, ee->h);
|
evas_object_image_size_set(bdata->image, ee->w, ee->h);
|
||||||
/* Server can have many plugs, so I block resize comand from client to server *
|
/* Server can have many plugs, so I block resize comand from client to server *
|
||||||
if ((extn) && (extn->ipc.server))
|
if ((extn) && (extn->ipc.server))
|
||||||
{
|
{
|
||||||
|
@ -690,10 +699,11 @@ static void
|
||||||
_ecore_evas_extn_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_ecore_evas_extn_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Mouse_In *ev = event_info;
|
Evas_Event_Mouse_In *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -711,10 +721,11 @@ static void
|
||||||
_ecore_evas_extn_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_ecore_evas_extn_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Mouse_Out *ev = event_info;
|
Evas_Event_Mouse_Out *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -733,9 +744,10 @@ _ecore_evas_extn_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
Evas_Event_Mouse_Down *ev = event_info;
|
Evas_Event_Mouse_Down *ev = event_info;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -772,10 +784,11 @@ static void
|
||||||
_ecore_evas_extn_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Mouse_Up *ev = event_info;
|
Evas_Event_Mouse_Up *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -795,10 +808,11 @@ static void
|
||||||
_ecore_evas_extn_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Mouse_Move *ev = event_info;
|
Evas_Event_Mouse_Move *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -822,10 +836,11 @@ static void
|
||||||
_ecore_evas_extn_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Mouse_Wheel *ev = event_info;
|
Evas_Event_Mouse_Wheel *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -845,10 +860,11 @@ static void
|
||||||
_ecore_evas_extn_cb_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Multi_Down *ev = event_info;
|
Evas_Event_Multi_Down *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -882,10 +898,11 @@ static void
|
||||||
_ecore_evas_extn_cb_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Multi_Up *ev = event_info;
|
Evas_Event_Multi_Up *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -918,10 +935,11 @@ static void
|
||||||
_ecore_evas_extn_cb_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Multi_Move *ev = event_info;
|
Evas_Event_Multi_Move *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -962,10 +980,11 @@ static void
|
||||||
_ecore_evas_extn_cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Key_Down *ev = event_info;
|
Evas_Event_Key_Down *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -1018,10 +1037,11 @@ static void
|
||||||
_ecore_evas_extn_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Key_Up *ev = event_info;
|
Evas_Event_Key_Up *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -1074,10 +1094,11 @@ static void
|
||||||
_ecore_evas_extn_cb_hold(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
_ecore_evas_extn_cb_hold(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Evas_Event_Hold *ev = event_info;
|
Evas_Event_Hold *ev = event_info;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (extn->ipc.server)
|
if (extn->ipc.server)
|
||||||
{
|
{
|
||||||
|
@ -1094,12 +1115,12 @@ _ecore_evas_extn_cb_hold(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
|
||||||
static void
|
static void
|
||||||
_ecore_evas_extn_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_ecore_evas_extn_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
ee = data;
|
|
||||||
ee->prop.focused = 1;
|
ee->prop.focused = 1;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (!extn->ipc.server) return;
|
if (!extn->ipc.server) return;
|
||||||
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_FOCUS, 0, 0, 0, NULL, 0);
|
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_FOCUS, 0, 0, 0, NULL, 0);
|
||||||
|
@ -1108,12 +1129,12 @@ _ecore_evas_extn_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj E
|
||||||
static void
|
static void
|
||||||
_ecore_evas_extn_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_ecore_evas_extn_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
ee = data;
|
|
||||||
ee->prop.focused = 0;
|
ee->prop.focused = 0;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (!extn->ipc.server) return;
|
if (!extn->ipc.server) return;
|
||||||
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_UNFOCUS, 0, 0, 0, NULL, 0);
|
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_UNFOCUS, 0, 0, 0, NULL, 0);
|
||||||
|
@ -1122,12 +1143,12 @@ _ecore_evas_extn_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
|
||||||
static void
|
static void
|
||||||
_ecore_evas_extn_cb_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_ecore_evas_extn_cb_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
ee = data;
|
|
||||||
ee->visible = 1;
|
ee->visible = 1;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (!extn->ipc.server) return;
|
if (!extn->ipc.server) return;
|
||||||
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_SHOW, 0, 0, 0, NULL, 0);
|
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_SHOW, 0, 0, 0, NULL, 0);
|
||||||
|
@ -1136,12 +1157,12 @@ _ecore_evas_extn_cb_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
|
||||||
static void
|
static void
|
||||||
_ecore_evas_extn_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_ecore_evas_extn_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
ee = data;
|
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
if (!extn->ipc.server) return;
|
if (!extn->ipc.server) return;
|
||||||
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0);
|
ecore_ipc_server_send(extn->ipc.server, MAJOR, OP_HIDE, 0, 0, 0, NULL, 0);
|
||||||
|
@ -1151,11 +1172,12 @@ static void
|
||||||
_ecore_evas_extn_plug_profile_set(Ecore_Evas *ee, const char *profile)
|
_ecore_evas_extn_plug_profile_set(Ecore_Evas *ee, const char *profile)
|
||||||
{
|
{
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
_ecore_evas_window_profile_free(ee);
|
_ecore_evas_window_profile_free(ee);
|
||||||
ee->prop.profile.name = NULL;
|
ee->prop.profile.name = NULL;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
|
|
||||||
if (profile)
|
if (profile)
|
||||||
|
@ -1257,13 +1279,14 @@ _ipc_server_add(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Event_Server_Add *e = event;
|
Ecore_Ipc_Event_Server_Add *e = event;
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
if (ee != ecore_ipc_server_data_get(e->server))
|
if (ee != ecore_ipc_server_data_get(e->server))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
if (!eina_list_data_find(extn_ee_list, ee))
|
if (!eina_list_data_find(extn_ee_list, ee))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
||||||
//FIXME: find a way to let app know server there
|
//FIXME: find a way to let app know server there
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -1274,13 +1297,14 @@ _ipc_server_del(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Event_Server_Del *e = event;
|
Ecore_Ipc_Event_Server_Del *e = event;
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (extn->ipc.server != e->server) return ECORE_CALLBACK_PASS_ON;
|
if (extn->ipc.server != e->server) return ECORE_CALLBACK_PASS_ON;
|
||||||
evas_object_image_data_set(ee->engine.buffer.image, NULL);
|
evas_object_image_data_set(bdata->image, NULL);
|
||||||
ee->engine.buffer.pixels = NULL;
|
bdata->pixels = NULL;
|
||||||
if (extn->file.shmfile)
|
if (extn->file.shmfile)
|
||||||
{
|
{
|
||||||
shmfile_close(extn->file.shmfile);
|
shmfile_close(extn->file.shmfile);
|
||||||
|
@ -1301,13 +1325,14 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Event_Server_Data *e = event;
|
Ecore_Ipc_Event_Server_Data *e = event;
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
if (ee != ecore_ipc_server_data_get(e->server))
|
if (ee != ecore_ipc_server_data_get(e->server))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
if (!eina_list_data_find(extn_ee_list, ee))
|
if (!eina_list_data_find(extn_ee_list, ee))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (e->major != MAJOR)
|
if (e->major != MAJOR)
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -1332,8 +1357,8 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
|
|
||||||
EINA_LIST_FREE(extn->file.updates, ipc)
|
EINA_LIST_FREE(extn->file.updates, ipc)
|
||||||
{
|
{
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
evas_object_image_data_update_add(ee->engine.buffer.image,
|
evas_object_image_data_update_add(bdata->image,
|
||||||
ipc->x, ipc->y,
|
ipc->x, ipc->y,
|
||||||
ipc->w, ipc->h);
|
ipc->w, ipc->h);
|
||||||
}
|
}
|
||||||
|
@ -1357,7 +1382,7 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
// e->data = shm ref string + nul byte
|
// e->data = shm ref string + nul byte
|
||||||
if ((e->data) && ((unsigned char *)e->data)[e->size - 1] == 0)
|
if ((e->data) && ((unsigned char *)e->data)[e->size - 1] == 0)
|
||||||
{
|
{
|
||||||
ee->engine.buffer.pixels = NULL;
|
bdata->pixels = NULL;
|
||||||
if (extn->file.shmfile)
|
if (extn->file.shmfile)
|
||||||
{
|
{
|
||||||
shmfile_close(extn->file.shmfile);
|
shmfile_close(extn->file.shmfile);
|
||||||
|
@ -1379,21 +1404,21 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
EINA_TRUE);
|
EINA_TRUE);
|
||||||
if (extn->file.shmfile)
|
if (extn->file.shmfile)
|
||||||
{
|
{
|
||||||
ee->engine.buffer.pixels = extn->file.shmfile->addr;
|
bdata->pixels = extn->file.shmfile->addr;
|
||||||
if (ee->engine.buffer.image)
|
if (bdata->image)
|
||||||
{
|
{
|
||||||
if (e->response)
|
if (e->response)
|
||||||
evas_object_image_alpha_set(ee->engine.buffer.image,
|
evas_object_image_alpha_set(bdata->image,
|
||||||
EINA_TRUE);
|
EINA_TRUE);
|
||||||
else
|
else
|
||||||
evas_object_image_alpha_set(ee->engine.buffer.image,
|
evas_object_image_alpha_set(bdata->image,
|
||||||
EINA_FALSE);
|
EINA_FALSE);
|
||||||
evas_object_image_size_set(ee->engine.buffer.image,
|
evas_object_image_size_set(bdata->image,
|
||||||
extn->file.w,
|
extn->file.w,
|
||||||
extn->file.h);
|
extn->file.h);
|
||||||
evas_object_image_data_set(ee->engine.buffer.image,
|
evas_object_image_data_set(bdata->image,
|
||||||
ee->engine.buffer.pixels);
|
bdata->pixels);
|
||||||
evas_object_image_data_update_add(ee->engine.buffer.image,
|
evas_object_image_data_update_add(bdata->image,
|
||||||
0, 0,
|
0, 0,
|
||||||
extn->file.w,
|
extn->file.w,
|
||||||
extn->file.h);
|
extn->file.h);
|
||||||
|
@ -1402,13 +1427,13 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
extn->file.h);
|
extn->file.h);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evas_object_image_data_set(ee->engine.buffer.image, NULL);
|
evas_object_image_data_set(bdata->image, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evas_object_image_data_set(ee->engine.buffer.image, NULL);
|
evas_object_image_data_set(bdata->image, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
evas_object_image_data_set(ee->engine.buffer.image, NULL);
|
evas_object_image_data_set(bdata->image, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OP_RESIZE:
|
case OP_RESIZE:
|
||||||
|
@ -1427,32 +1452,28 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
}
|
}
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
void
|
|
||||||
_ecore_evas_extn_init(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_ecore_evas_extn_shutdown(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* BUILD_ECORE_EVAS_EXTN */
|
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
|
ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata;
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
int w = 1, h = 1;
|
int w = 1, h = 1;
|
||||||
|
|
||||||
if (!ee_target) return NULL;
|
if (!ee_target) return NULL;
|
||||||
|
|
||||||
ee = calloc(1, sizeof(Ecore_Evas));
|
ee = calloc(1, sizeof(Ecore_Evas));
|
||||||
if (!ee) return NULL;
|
if (!ee) return NULL;
|
||||||
|
bdata = calloc(1, sizeof(Ecore_Evas_Engine_Buffer_Data));
|
||||||
|
if (!bdata)
|
||||||
|
{
|
||||||
|
free(ee);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ee->engine.data = bdata;
|
||||||
o = evas_object_image_filled_add(ee_target->evas);
|
o = evas_object_image_filled_add(ee_target->evas);
|
||||||
/* this make problem in gl engine, so I'll block this until solve problem
|
/* this make problem in gl engine, so I'll block this until solve problem
|
||||||
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);*/
|
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);*/
|
||||||
|
@ -1467,6 +1488,9 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
|
||||||
|
|
||||||
ee->driver = "extn_plug";
|
ee->driver = "extn_plug";
|
||||||
|
|
||||||
|
iface = _ecore_evas_extn_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
ee->rotation = 0;
|
ee->rotation = 0;
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
ee->w = w;
|
ee->w = w;
|
||||||
|
@ -1486,62 +1510,62 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
|
||||||
ee->prop.withdrawn = 0;
|
ee->prop.withdrawn = 0;
|
||||||
ee->prop.sticky = 0;
|
ee->prop.sticky = 0;
|
||||||
|
|
||||||
ee->engine.buffer.image = o;
|
bdata->image = o;
|
||||||
evas_object_data_set(ee->engine.buffer.image, "Ecore_Evas", ee);
|
evas_object_data_set(bdata->image, "Ecore_Evas", ee);
|
||||||
evas_object_data_set(ee->engine.buffer.image, "Ecore_Evas_Parent", ee_target);
|
evas_object_data_set(bdata->image, "Ecore_Evas_Parent", ee_target);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_IN,
|
EVAS_CALLBACK_MOUSE_IN,
|
||||||
_ecore_evas_extn_cb_mouse_in, ee);
|
_ecore_evas_extn_cb_mouse_in, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_OUT,
|
EVAS_CALLBACK_MOUSE_OUT,
|
||||||
_ecore_evas_extn_cb_mouse_out, ee);
|
_ecore_evas_extn_cb_mouse_out, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_DOWN,
|
EVAS_CALLBACK_MOUSE_DOWN,
|
||||||
_ecore_evas_extn_cb_mouse_down, ee);
|
_ecore_evas_extn_cb_mouse_down, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_UP,
|
EVAS_CALLBACK_MOUSE_UP,
|
||||||
_ecore_evas_extn_cb_mouse_up, ee);
|
_ecore_evas_extn_cb_mouse_up, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_MOVE,
|
EVAS_CALLBACK_MOUSE_MOVE,
|
||||||
_ecore_evas_extn_cb_mouse_move, ee);
|
_ecore_evas_extn_cb_mouse_move, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MOUSE_WHEEL,
|
EVAS_CALLBACK_MOUSE_WHEEL,
|
||||||
_ecore_evas_extn_cb_mouse_wheel, ee);
|
_ecore_evas_extn_cb_mouse_wheel, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MULTI_DOWN,
|
EVAS_CALLBACK_MULTI_DOWN,
|
||||||
_ecore_evas_extn_cb_multi_down, ee);
|
_ecore_evas_extn_cb_multi_down, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MULTI_UP,
|
EVAS_CALLBACK_MULTI_UP,
|
||||||
_ecore_evas_extn_cb_multi_up, ee);
|
_ecore_evas_extn_cb_multi_up, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_MULTI_MOVE,
|
EVAS_CALLBACK_MULTI_MOVE,
|
||||||
_ecore_evas_extn_cb_multi_move, ee);
|
_ecore_evas_extn_cb_multi_move, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_FREE,
|
EVAS_CALLBACK_FREE,
|
||||||
_ecore_evas_extn_cb_free, ee);
|
_ecore_evas_extn_cb_free, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_KEY_DOWN,
|
EVAS_CALLBACK_KEY_DOWN,
|
||||||
_ecore_evas_extn_cb_key_down, ee);
|
_ecore_evas_extn_cb_key_down, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_KEY_UP,
|
EVAS_CALLBACK_KEY_UP,
|
||||||
_ecore_evas_extn_cb_key_up, ee);
|
_ecore_evas_extn_cb_key_up, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_HOLD,
|
EVAS_CALLBACK_HOLD,
|
||||||
_ecore_evas_extn_cb_hold, ee);
|
_ecore_evas_extn_cb_hold, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_FOCUS_IN,
|
EVAS_CALLBACK_FOCUS_IN,
|
||||||
_ecore_evas_extn_cb_focus_in, ee);
|
_ecore_evas_extn_cb_focus_in, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_FOCUS_OUT,
|
EVAS_CALLBACK_FOCUS_OUT,
|
||||||
_ecore_evas_extn_cb_focus_out, ee);
|
_ecore_evas_extn_cb_focus_out, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_SHOW,
|
EVAS_CALLBACK_SHOW,
|
||||||
_ecore_evas_extn_cb_show, ee);
|
_ecore_evas_extn_cb_show, ee);
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_HIDE,
|
EVAS_CALLBACK_HIDE,
|
||||||
_ecore_evas_extn_cb_hide, ee);
|
_ecore_evas_extn_cb_hide, ee);
|
||||||
|
|
||||||
evas_object_event_callback_add(ee->engine.buffer.image,
|
evas_object_event_callback_add(bdata->image,
|
||||||
EVAS_CALLBACK_DEL,
|
EVAS_CALLBACK_DEL,
|
||||||
_ecore_evas_extn_plug_image_obj_del, ee);
|
_ecore_evas_extn_plug_image_obj_del, ee);
|
||||||
|
|
||||||
|
@ -1554,32 +1578,28 @@ ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
|
||||||
evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_POST,
|
evas_event_callback_add(ee_target->evas, EVAS_CALLBACK_RENDER_POST,
|
||||||
_ecore_evas_extn_plug_targer_render_post, ee);
|
_ecore_evas_extn_plug_targer_render_post, ee);
|
||||||
return o;
|
return o;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
static Eina_Bool
|
||||||
ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
|
_ecore_evas_extn_plug_connect(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
Ecore_Evas *ee = NULL;
|
Ecore_Evas_Engine_Buffer_Data *bdata;
|
||||||
|
|
||||||
if (!obj) return EINA_FALSE;
|
|
||||||
|
|
||||||
ee = evas_object_data_get(obj, "Ecore_Evas");
|
|
||||||
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) return EINA_FALSE;
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) return EINA_FALSE;
|
||||||
|
|
||||||
|
bdata = ee->engine.data;
|
||||||
if (!svcname)
|
if (!svcname)
|
||||||
{
|
{
|
||||||
ee->engine.buffer.data = NULL;
|
bdata->data = NULL;
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
extn = calloc(1, sizeof(Extn));
|
extn = calloc(1, sizeof(Extn));
|
||||||
if (!extn) return EINA_FALSE;
|
if (!extn) return EINA_FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER;
|
Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER;
|
||||||
|
|
||||||
ecore_ipc_init();
|
ecore_ipc_init();
|
||||||
|
@ -1592,13 +1612,13 @@ ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum,
|
||||||
extn->svc.num, ee);
|
extn->svc.num, ee);
|
||||||
if (!extn->ipc.server)
|
if (!extn->ipc.server)
|
||||||
{
|
{
|
||||||
ee->engine.buffer.data = NULL;
|
bdata->data = NULL;
|
||||||
eina_stringshare_del(extn->svc.name);
|
eina_stringshare_del(extn->svc.name);
|
||||||
free(extn);
|
free(extn);
|
||||||
ecore_ipc_shutdown();
|
ecore_ipc_shutdown();
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
ee->engine.buffer.data = extn;
|
bdata->data = extn;
|
||||||
extn->ipc.handlers = eina_list_append
|
extn->ipc.handlers = eina_list_append
|
||||||
(extn->ipc.handlers,
|
(extn->ipc.handlers,
|
||||||
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
|
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
|
||||||
|
@ -1612,41 +1632,28 @@ ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum,
|
||||||
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
|
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
|
||||||
_ipc_server_data, ee));
|
_ipc_server_data, ee));
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
#else
|
|
||||||
return EINA_FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
static void
|
||||||
ecore_evas_extn_plug_object_data_lock(Evas_Object *obj)
|
_ecore_evas_extn_plug_object_data_lock(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
Ecore_Evas *ee;
|
|
||||||
|
|
||||||
ee = ecore_evas_object_ecore_evas_get(obj);
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
_ecore_evas_socket_lock(ee);
|
_ecore_evas_socket_lock(ee);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
static void
|
||||||
ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj)
|
_ecore_evas_extn_plug_object_data_unlock(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
Ecore_Evas *ee;
|
|
||||||
|
|
||||||
ee = ecore_evas_object_ecore_evas_get(obj);
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
_ecore_evas_socket_unlock(ee);
|
_ecore_evas_socket_unlock(ee);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
int stride = 0;
|
int stride = 0;
|
||||||
|
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
|
@ -1659,16 +1666,16 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
|
||||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (extn)
|
if (extn)
|
||||||
{
|
{
|
||||||
if (extn->file.shmfile)
|
if (extn->file.shmfile)
|
||||||
shmfile_free(extn->file.shmfile);
|
shmfile_free(extn->file.shmfile);
|
||||||
ee->engine.buffer.pixels = NULL;
|
bdata->pixels = NULL;
|
||||||
extn->file.shmfile = shmfile_new(extn->svc.name, extn->svc.num,
|
extn->file.shmfile = shmfile_new(extn->svc.name, extn->svc.num,
|
||||||
ee->w * ee->h * 4, extn->svc.sys);
|
ee->w * ee->h * 4, extn->svc.sys);
|
||||||
if (extn->file.shmfile)
|
if (extn->file.shmfile)
|
||||||
ee->engine.buffer.pixels = extn->file.shmfile->addr;
|
bdata->pixels = extn->file.shmfile->addr;
|
||||||
|
|
||||||
stride = ee->w * 4;
|
stride = ee->w * 4;
|
||||||
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
|
||||||
|
@ -1678,7 +1685,7 @@ _ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
|
||||||
else
|
else
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
||||||
einfo->info.dest_buffer = ee->engine.buffer.pixels;
|
einfo->info.dest_buffer = bdata->pixels;
|
||||||
einfo->info.dest_buffer_row_bytes = stride;
|
einfo->info.dest_buffer_row_bytes = stride;
|
||||||
einfo->info.use_color_key = 0;
|
einfo->info.use_color_key = 0;
|
||||||
einfo->info.alpha_threshold = 0;
|
einfo->info.alpha_threshold = 0;
|
||||||
|
@ -1721,13 +1728,14 @@ static void
|
||||||
_ecore_evas_extn_socket_window_profile_change_done_send(Ecore_Evas *ee)
|
_ecore_evas_extn_socket_window_profile_change_done_send(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Ecore_Ipc_Client *client;
|
Ecore_Ipc_Client *client;
|
||||||
Eina_List *l = NULL;
|
Eina_List *l = NULL;
|
||||||
Ipc_Data_Profile *ipc;
|
Ipc_Data_Profile *ipc;
|
||||||
char *st, *p;
|
char *st, *p;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return;
|
if (!extn) return;
|
||||||
|
|
||||||
len += sizeof(Ipc_Data_Profile);
|
len += sizeof(Ipc_Data_Profile);
|
||||||
|
@ -1760,8 +1768,9 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
|
||||||
Eina_Rectangle *r;
|
Eina_Rectangle *r;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
Ecore_Ipc_Client *client;
|
Ecore_Ipc_Client *client;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return rend;
|
if (!extn) return rend;
|
||||||
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
||||||
{
|
{
|
||||||
|
@ -1772,7 +1781,7 @@ _ecore_evas_extn_socket_render(Ecore_Evas *ee)
|
||||||
}
|
}
|
||||||
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
||||||
|
|
||||||
if (ee->engine.buffer.pixels)
|
if (bdata->pixels)
|
||||||
{
|
{
|
||||||
_ecore_evas_socket_lock(ee);
|
_ecore_evas_socket_lock(ee);
|
||||||
updates = evas_render_updates(ee->evas);
|
updates = evas_render_updates(ee->evas);
|
||||||
|
@ -1812,13 +1821,14 @@ _ipc_client_add(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Event_Client_Add *e = event;
|
Ecore_Ipc_Event_Client_Add *e = event;
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client)))
|
if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client)))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
if (!eina_list_data_find(extn_ee_list, ee))
|
if (!eina_list_data_find(extn_ee_list, ee))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
||||||
|
|
||||||
extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client);
|
extn->ipc.clients = eina_list_append(extn->ipc.clients, e->client);
|
||||||
|
@ -1847,8 +1857,9 @@ _ipc_client_del(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Event_Client_Del *e = event;
|
Ecore_Ipc_Event_Client_Del *e = event;
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (!eina_list_data_find(extn->ipc.clients, e->client)) return ECORE_CALLBACK_PASS_ON;
|
if (!eina_list_data_find(extn->ipc.clients, e->client)) return ECORE_CALLBACK_PASS_ON;
|
||||||
|
|
||||||
|
@ -1863,13 +1874,14 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Event_Client_Data *e = event;
|
Ecore_Ipc_Event_Client_Data *e = event;
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
|
||||||
if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client)))
|
if (ee != ecore_ipc_server_data_get(ecore_ipc_client_server_get(e->client)))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
if (!eina_list_data_find(extn_ee_list, ee))
|
if (!eina_list_data_find(extn_ee_list, ee))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
if (!extn) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (e->major != MAJOR)
|
if (e->major != MAJOR)
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -2124,6 +2136,7 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void *event)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
|
_ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Ecore_Ipc_Client *client;
|
Ecore_Ipc_Client *client;
|
||||||
|
@ -2131,7 +2144,7 @@ _ecore_evas_extn_socket_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha))) return;
|
if (((ee->alpha) && (alpha)) || ((!ee->alpha) && (!alpha))) return;
|
||||||
ee->alpha = alpha;
|
ee->alpha = alpha;
|
||||||
|
|
||||||
extn = ee->engine.buffer.data;
|
extn = bdata->data;
|
||||||
if (extn)
|
if (extn)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
@ -2254,13 +2267,12 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
|
||||||
NULL, // screen_dpi_get
|
NULL, // screen_dpi_get
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_extn_socket_new(int w, int h)
|
ecore_evas_extn_socket_new_internal(int w, int h)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
Evas_Engine_Info_Buffer *einfo;
|
Evas_Engine_Info_Buffer *einfo;
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
|
||||||
|
@ -2268,13 +2280,23 @@ ecore_evas_extn_socket_new(int w, int h)
|
||||||
if (!rmethod) return NULL;
|
if (!rmethod) return NULL;
|
||||||
ee = calloc(1, sizeof(Ecore_Evas));
|
ee = calloc(1, sizeof(Ecore_Evas));
|
||||||
if (!ee) return NULL;
|
if (!ee) return NULL;
|
||||||
|
bdata = calloc(1, sizeof(Ecore_Evas_Engine_Buffer_Data));
|
||||||
|
if (!bdata)
|
||||||
|
{
|
||||||
|
free(ee);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||||
|
|
||||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_extn_socket_engine_func;
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_extn_socket_engine_func;
|
||||||
|
ee->engine.data = bdata;
|
||||||
|
|
||||||
ee->driver = "extn_socket";
|
ee->driver = "extn_socket";
|
||||||
|
|
||||||
|
iface = _ecore_evas_extn_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
ee->rotation = 0;
|
ee->rotation = 0;
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
ee->w = w;
|
ee->w = w;
|
||||||
|
@ -2342,16 +2364,13 @@ ecore_evas_extn_socket_new(int w, int h)
|
||||||
_ecore_evas_register(ee);
|
_ecore_evas_register(ee);
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
Eina_Bool
|
||||||
ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys)
|
_ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_EXTN
|
|
||||||
Extn *extn;
|
Extn *extn;
|
||||||
|
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
|
||||||
|
|
||||||
extn = calloc(1, sizeof(Extn));
|
extn = calloc(1, sizeof(Extn));
|
||||||
if (!extn)
|
if (!extn)
|
||||||
|
@ -2404,7 +2423,7 @@ ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, E
|
||||||
ecore_ipc_shutdown();
|
ecore_ipc_shutdown();
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
ee->engine.buffer.data = extn;
|
bdata->data = extn;
|
||||||
extn->ipc.handlers = eina_list_append
|
extn->ipc.handlers = eina_list_append
|
||||||
(extn->ipc.handlers,
|
(extn->ipc.handlers,
|
||||||
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
|
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
|
||||||
|
@ -2419,7 +2438,26 @@ ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, E
|
||||||
_ipc_client_data, ee));
|
_ipc_client_data, ee));
|
||||||
}
|
}
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
#else
|
|
||||||
return EINA_FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Ecore_Evas_Interface_Extn *
|
||||||
|
_ecore_evas_extn_interface_new(void)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Extn *iface;
|
||||||
|
|
||||||
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Extn));
|
||||||
|
if (!iface) return NULL;
|
||||||
|
|
||||||
|
iface->base.name = interface_extn_name;
|
||||||
|
iface->base.version = interface_extn_version;
|
||||||
|
|
||||||
|
iface->data_lock = _ecore_evas_extn_plug_object_data_lock;
|
||||||
|
iface->data_unlock = _ecore_evas_extn_plug_object_data_unlock;
|
||||||
|
iface->connect = _ecore_evas_extn_plug_connect;
|
||||||
|
iface->listen = _ecore_evas_extn_socket_listen;
|
||||||
|
|
||||||
|
return iface;
|
||||||
|
}
|
||||||
|
|
||||||
|
EINA_MODULE_INIT(_ecore_evas_extn_init);
|
||||||
|
EINA_MODULE_SHUTDOWN(_ecore_evas_extn_shutdown);
|
|
@ -2,21 +2,17 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "ecore_evas_private.h"
|
||||||
|
#include "Ecore_Evas.h"
|
||||||
|
|
||||||
#include "Ecore.h"
|
#include "Ecore.h"
|
||||||
#include "ecore_private.h"
|
#include "ecore_private.h"
|
||||||
#include "Ecore_Input.h"
|
#include "Ecore_Input.h"
|
||||||
#include "Ecore_Input_Evas.h"
|
#include "Ecore_Input_Evas.h"
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
|
|
||||||
#include <Ecore_Cocoa.h>
|
#include <Ecore_Cocoa.h>
|
||||||
#include <Evas_Engine_GL_Cocoa.h>
|
#include <Evas_Engine_GL_Cocoa.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
|
||||||
#include "Ecore_Evas.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
|
|
||||||
|
|
||||||
// FIXME: this engine has lots of problems. only 1 window at a time, drawRect looks wrong, doesnt handle resizes and more
|
// FIXME: this engine has lots of problems. only 1 window at a time, drawRect looks wrong, doesnt handle resizes and more
|
||||||
|
|
||||||
|
@ -477,12 +473,10 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
|
||||||
NULL,
|
NULL,
|
||||||
NULL // screen_dpi_get
|
NULL // screen_dpi_get
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
|
ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
|
|
||||||
Evas_Engine_Info_GL_Cocoa *einfo;
|
Evas_Engine_Info_GL_Cocoa *einfo;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
@ -576,10 +570,4 @@ ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent, int x, int y, int w, int h)
|
||||||
ecore_cocoa_shutdown();
|
ecore_cocoa_shutdown();
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
|
||||||
ERR("Cocoa support in ecore-evas not enabled");
|
|
||||||
return NULL;
|
|
||||||
(void) parent;
|
|
||||||
(void) x; (void) y; (void) w; (void) h;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
|
@ -7,22 +7,28 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include "ecore_private.h"
|
#include <Ecore_Evas.h>
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
#include <Ecore_Fb.h>
|
#include <Ecore_Fb.h>
|
||||||
|
#include <ecore_evas_private.h>
|
||||||
#include <ecore_fb_private.h>
|
#include <ecore_fb_private.h>
|
||||||
#endif
|
#include <ecore_private.h>
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
#include <Eina.h>
|
||||||
#include "Ecore_Evas.h"
|
#include <Evas_Engine_FB.h>
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
static int _ecore_evas_init_count = 0;
|
static int _ecore_evas_init_count = 0;
|
||||||
|
|
||||||
static char *ecore_evas_default_display = "0";
|
static char *ecore_evas_default_display = "0";
|
||||||
static Eina_List *ecore_evas_input_devices = NULL;
|
static Eina_List *ecore_evas_input_devices = NULL;
|
||||||
static Ecore_Event_Handler *ecore_evas_event_handlers[4] = {NULL, NULL, NULL, NULL};
|
static Ecore_Event_Handler *ecore_evas_event_handlers[4] = {NULL, NULL, NULL, NULL};
|
||||||
|
|
||||||
|
typedef struct _Ecore_Evas_Engine_FB_Data Ecore_Evas_Engine_FB_Data;
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Engine_FB_Data {
|
||||||
|
int real_w;
|
||||||
|
int real_h;
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
|
_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
|
||||||
{
|
{
|
||||||
|
@ -53,37 +59,28 @@ _ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Ecore_Evas *fb_ee = NULL;
|
|
||||||
|
|
||||||
static Ecore_Evas *
|
|
||||||
_ecore_evas_fb_match(void)
|
|
||||||
{
|
|
||||||
return fb_ee;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_fb_lose(void *data EINA_UNUSED)
|
_ecore_evas_fb_lose(void *data)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas *ee = data;
|
||||||
Eina_List *ll;
|
Eina_List *ll;
|
||||||
Ecore_Fb_Input_Device *dev;
|
Ecore_Fb_Input_Device *dev;
|
||||||
|
|
||||||
if (fb_ee) fb_ee->visible = 0;
|
if (ee) ee->visible = 0;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
||||||
ecore_fb_input_device_listen(dev, 0);
|
ecore_fb_input_device_listen(dev, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_fb_gain(void *data EINA_UNUSED)
|
_ecore_evas_fb_gain(void *data)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
Eina_List *ll;
|
Eina_List *ll;
|
||||||
Ecore_Fb_Input_Device *dev;
|
Ecore_Fb_Input_Device *dev;
|
||||||
|
|
||||||
if (fb_ee)
|
if (ee)
|
||||||
{
|
{
|
||||||
ee = fb_ee;
|
|
||||||
|
|
||||||
ee->visible = 1;
|
ee->visible = 1;
|
||||||
if ((ee->rotation == 90) || (ee->rotation == 270))
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
||||||
|
@ -96,52 +93,48 @@ _ecore_evas_fb_gain(void *data EINA_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_event_mouse_button_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_ecore_evas_event_mouse_button_down(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
Ecore_Event_Mouse_Button *e;
|
Ecore_Event_Mouse_Button *e;
|
||||||
|
|
||||||
e = event;
|
e = event;
|
||||||
ee = _ecore_evas_fb_match();
|
|
||||||
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
||||||
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_event_mouse_button_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_ecore_evas_event_mouse_button_up(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
Ecore_Event_Mouse_Button *e;
|
Ecore_Event_Mouse_Button *e;
|
||||||
|
|
||||||
e = event;
|
e = event;
|
||||||
ee = _ecore_evas_fb_match();
|
|
||||||
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
||||||
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_event_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_ecore_evas_event_mouse_move(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
Ecore_Event_Mouse_Move *e;
|
Ecore_Event_Mouse_Move *e;
|
||||||
|
|
||||||
e = event;
|
e = event;
|
||||||
ee = _ecore_evas_fb_match();
|
|
||||||
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
||||||
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_event_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_ecore_evas_event_mouse_wheel(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee = data;
|
||||||
Ecore_Event_Mouse_Wheel *e;
|
Ecore_Event_Mouse_Wheel *e;
|
||||||
|
|
||||||
e = event;
|
e = event;
|
||||||
ee = _ecore_evas_fb_match();
|
|
||||||
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
||||||
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -164,7 +157,7 @@ _ecore_evas_fb_render(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
||||||
if (ee2->engine.func->fn_render)
|
if (ee2->engine.func->fn_render)
|
||||||
rend |= ee2->engine.func->fn_render(ee2);
|
rend |= ee2->engine.func->fn_render(ee2);
|
||||||
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,11 +245,33 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
|
||||||
return _ecore_evas_init_count;
|
return _ecore_evas_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
_ecore_evas_fb_shutdown(void)
|
||||||
|
{
|
||||||
|
_ecore_evas_init_count--;
|
||||||
|
if (_ecore_evas_init_count == 0)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
if (ecore_evas_event_handlers[i])
|
||||||
|
ecore_event_handler_del(ecore_evas_event_handlers[i]);
|
||||||
|
}
|
||||||
|
ecore_fb_ts_shutdown();
|
||||||
|
ecore_event_evas_shutdown();
|
||||||
|
}
|
||||||
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
||||||
|
return _ecore_evas_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_fb_free(Ecore_Evas *ee)
|
_ecore_evas_fb_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_FB_Data *idata = ee->engine.data;
|
||||||
|
|
||||||
ecore_evas_input_event_unregister(ee);
|
ecore_evas_input_event_unregister(ee);
|
||||||
if (fb_ee == ee) fb_ee = NULL;
|
free(idata);
|
||||||
_ecore_evas_fb_shutdown();
|
_ecore_evas_fb_shutdown();
|
||||||
ecore_fb_shutdown();
|
ecore_fb_shutdown();
|
||||||
}
|
}
|
||||||
|
@ -435,6 +450,7 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Ecore_Fb_Input_Device *dev;
|
Ecore_Fb_Input_Device *dev;
|
||||||
|
Ecore_Evas_Engine_FB_Data *idata = ee->engine.data;
|
||||||
int resized = 0;
|
int resized = 0;
|
||||||
|
|
||||||
if (((ee->prop.fullscreen) && (on)) ||
|
if (((ee->prop.fullscreen) && (on)) ||
|
||||||
|
@ -443,8 +459,8 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
ee->engine.fb.real_w = ee->w;
|
idata->real_w = ee->w;
|
||||||
ee->engine.fb.real_h = ee->h;
|
idata->real_h = ee->h;
|
||||||
w = ee->w;
|
w = ee->w;
|
||||||
h = ee->h;
|
h = ee->h;
|
||||||
ecore_fb_size_get(&w, &h);
|
ecore_fb_size_get(&w, &h);
|
||||||
|
@ -464,9 +480,9 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((ee->engine.fb.real_w != ee->w) || (ee->engine.fb.real_h != ee->h)) resized = 1;
|
if ((idata->real_w != ee->w) || (idata->real_h != ee->h)) resized = 1;
|
||||||
ee->w = ee->engine.fb.real_w;
|
ee->w = idata->real_w;
|
||||||
ee->h = ee->engine.fb.real_h;
|
ee->h = idata->real_h;
|
||||||
ee->req.w = ee->w;
|
ee->req.w = ee->w;
|
||||||
ee->req.h = ee->h;
|
ee->req.h = ee->h;
|
||||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||||
|
@ -483,26 +499,6 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
_ecore_evas_fb_shutdown(void)
|
|
||||||
{
|
|
||||||
_ecore_evas_init_count--;
|
|
||||||
if (_ecore_evas_init_count == 0)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
{
|
|
||||||
if (ecore_evas_event_handlers[i])
|
|
||||||
ecore_event_handler_del(ecore_evas_event_handlers[i]);
|
|
||||||
}
|
|
||||||
ecore_fb_ts_shutdown();
|
|
||||||
ecore_event_evas_shutdown();
|
|
||||||
}
|
|
||||||
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
|
||||||
return _ecore_evas_init_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
|
static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
|
||||||
{
|
{
|
||||||
_ecore_evas_fb_free,
|
_ecore_evas_fb_free,
|
||||||
|
@ -564,22 +560,13 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
|
||||||
NULL, // render
|
NULL, // render
|
||||||
NULL, // screen_geometry_get
|
NULL, // screen_geometry_get
|
||||||
NULL // screen_dpi_get
|
NULL // screen_dpi_get
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
Ecore_Evas *
|
||||||
* @brief Create Ecore_Evas using fb backend.
|
ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
|
||||||
* @param disp_name The name of the display to be used.
|
|
||||||
* @param rotation The rotation to be used.
|
|
||||||
* @param w The width of the Ecore_Evas to be created.
|
|
||||||
* @param h The height of the Ecore_Evas to be created.
|
|
||||||
* @return The new Ecore_Evas.
|
|
||||||
*/
|
|
||||||
#ifdef BUILD_ECORE_EVAS_FB
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
|
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_FB *einfo;
|
Evas_Engine_Info_FB *einfo;
|
||||||
|
Ecore_Evas_Engine_FB_Data *idata;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
@ -591,15 +578,19 @@ ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
|
||||||
if (!rmethod) return NULL;
|
if (!rmethod) return NULL;
|
||||||
|
|
||||||
if (!ecore_fb_init(disp_name)) return NULL;
|
if (!ecore_fb_init(disp_name)) return NULL;
|
||||||
ecore_fb_callback_gain_set(_ecore_evas_fb_gain, NULL);
|
|
||||||
ecore_fb_callback_lose_set(_ecore_evas_fb_lose, NULL);
|
|
||||||
ee = calloc(1, sizeof(Ecore_Evas));
|
ee = calloc(1, sizeof(Ecore_Evas));
|
||||||
if (!ee) return NULL;
|
if (!ee) return NULL;
|
||||||
|
idata = calloc(1, sizeof(Ecore_Evas_Engine_FB_Data));
|
||||||
|
|
||||||
|
ee->engine.data = idata;
|
||||||
|
|
||||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||||
|
|
||||||
_ecore_evas_fb_init(ee, w, h);
|
_ecore_evas_fb_init(ee, w, h);
|
||||||
|
|
||||||
|
ecore_fb_callback_gain_set(_ecore_evas_fb_gain, ee);
|
||||||
|
ecore_fb_callback_lose_set(_ecore_evas_fb_lose, ee);
|
||||||
|
|
||||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_fb_engine_func;
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_fb_engine_func;
|
||||||
|
|
||||||
ee->driver = "fb";
|
ee->driver = "fb";
|
||||||
|
@ -666,14 +657,6 @@ ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
|
||||||
|
|
||||||
ee->engine.func->fn_render = _ecore_evas_fb_render;
|
ee->engine.func->fn_render = _ecore_evas_fb_render;
|
||||||
_ecore_evas_register(ee);
|
_ecore_evas_register(ee);
|
||||||
fb_ee = ee;
|
|
||||||
evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
|
evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_fb_new(const char *disp_name EINA_UNUSED, int rotation EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "ecore_evas_private.h"
|
#include "ecore_evas_private.h"
|
||||||
#include "Ecore_Evas.h"
|
#include "Ecore_Evas.h"
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_PSL1GHT
|
|
||||||
#include <Ecore_Psl1ght.h>
|
#include <Ecore_Psl1ght.h>
|
||||||
#include <Evas_Engine_PSL1GHT.h>
|
#include <Evas_Engine_PSL1GHT.h>
|
||||||
|
|
||||||
|
@ -130,17 +129,15 @@ _ecore_evas_psl1ght_render(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
int rend = 0;
|
int rend = 0;
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
|
|
||||||
Eina_List *ll;
|
Eina_List *ll;
|
||||||
Ecore_Evas *ee2;
|
Ecore_Evas *ee2;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
||||||
{
|
{
|
||||||
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
||||||
rend |= _ecore_evas_buffer_render(ee2);
|
rend |= ecore_evas_buffer_render(ee2);
|
||||||
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
||||||
|
|
||||||
|
@ -411,7 +408,7 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
|
||||||
};
|
};
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_psl1ght_new(const char *name, int w, int h)
|
ecore_evas_psl1ght_new_internal(const char *name, int w, int h)
|
||||||
{
|
{
|
||||||
void *einfo;
|
void *einfo;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
@ -503,14 +500,3 @@ ecore_evas_psl1ght_new(const char *name, int w, int h)
|
||||||
|
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* BUILD_ECORE_EVAS_PSL1GHT */
|
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_psl1ght_new(const char *name EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
|
|
||||||
{
|
|
||||||
ERR("OUTCH !");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* BUILD_ECORE_EVAS_PSL1GHT */
|
|
|
@ -2,31 +2,26 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Ecore.h>
|
|
||||||
#include <Ecore_Input.h>
|
|
||||||
#include <Ecore_Input_Evas.h>
|
|
||||||
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
|
|
||||||
# include <Ecore_Sdl.h>
|
|
||||||
# ifdef BUILD_ECORE_EVAS_OPENGL_SDL
|
|
||||||
# include <Evas_Engine_GL_SDL.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
|
|
||||||
#include <SDL/SDL.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
#include "ecore_evas_private.h"
|
||||||
#include "Ecore_Evas.h"
|
#include "Ecore_Evas.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <Ecore.h>
|
||||||
|
#include <Ecore_Input.h>
|
||||||
|
#include <Ecore_Input_Evas.h>
|
||||||
|
#include <Ecore_Sdl.h>
|
||||||
|
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
|
||||||
|
# include <Evas_Engine_GL_SDL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <SDL/SDL.h>
|
||||||
/*
|
/*
|
||||||
* SDL only handle one window at a time. That's by definition, there is nothing wrong here.
|
* SDL only handle one window at a time. That's by definition, there is nothing wrong here.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
|
|
||||||
|
|
||||||
/* static char *ecore_evas_default_display = "0"; */
|
/* static char *ecore_evas_default_display = "0"; */
|
||||||
/* static Ecore_List *ecore_evas_input_devices = NULL; */
|
/* static Ecore_List *ecore_evas_input_devices = NULL; */
|
||||||
|
@ -610,11 +605,10 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
|
||||||
sdl_ee = ee;
|
sdl_ee = ee;
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
|
EAPI Ecore_Evas *
|
||||||
EAPI Ecore_Evas*
|
ecore_evas_sdl_new_internal(const char* name, int w, int h, int fullscreen,
|
||||||
ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
|
int hwsurface, int noframe, int alpha)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
@ -625,25 +619,17 @@ ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface
|
||||||
ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha);
|
ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha);
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
EAPI Ecore_Evas*
|
|
||||||
ecore_evas_sdl_new(const char* name EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, int fullscreen EINA_UNUSED, int hwsurface EINA_UNUSED, int noframe EINA_UNUSED, int alpha EINA_UNUSED)
|
|
||||||
{
|
|
||||||
ERR("OUTCH !");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EAPI Ecore_Evas*
|
EAPI Ecore_Evas*
|
||||||
ecore_evas_sdl16_new(const char* name EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, int fullscreen EINA_UNUSED, int hwsurface EINA_UNUSED, int noframe EINA_UNUSED, int alpha EINA_UNUSED)
|
ecore_evas_sdl16_new_internal(const char* name EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, int fullscreen EINA_UNUSED, int hwsurface EINA_UNUSED, int noframe EINA_UNUSED, int alpha EINA_UNUSED)
|
||||||
{
|
{
|
||||||
ERR("OUTCH !");
|
ERR("OUTCH !");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
|
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
|
||||||
EAPI Ecore_Evas*
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe)
|
ecore_evas_gl_sdl_new_internal(const char* name, int w, int h, int fullscreen, int noframe)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int rmethod;
|
int rmethod;
|
||||||
|
@ -655,12 +641,5 @@ ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int nofram
|
||||||
if (ee) ee->driver = "gl_sdl";
|
if (ee) ee->driver = "gl_sdl";
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
EAPI Ecore_Evas*
|
|
||||||
ecore_evas_gl_sdl_new(const char* name EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, int fullscreen EINA_UNUSED, int noframe EINA_UNUSED)
|
|
||||||
{
|
|
||||||
ERR("OUTCH !");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,18 +2,11 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define LOGFNS 1
|
#include "ecore_evas_wayland_private.h"
|
||||||
|
|
||||||
#ifdef LOGFNS
|
|
||||||
# include <stdio.h>
|
|
||||||
# define LOGFN(fl, ln, fn) \
|
|
||||||
printf("-ECORE_EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
|
|
||||||
#else
|
|
||||||
# define LOGFN(fl, ln, fn)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
static const char *interface_wl_name = "wayland";
|
||||||
#include "Ecore_Evas.h"
|
static const int interface_wl_version = 1;
|
||||||
|
|
||||||
/* local structures */
|
/* local structures */
|
||||||
typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
|
typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
|
||||||
|
@ -31,6 +24,7 @@ static Evas_Smart *_ecore_evas_wl_common_smart = NULL;
|
||||||
static int _ecore_evas_wl_init_count = 0;
|
static int _ecore_evas_wl_init_count = 0;
|
||||||
static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
|
static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
|
||||||
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_ecore_evas_wl_common_cb_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
|
@ -219,19 +213,26 @@ _ecore_evas_wl_common_shutdown(void)
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_pre_free(Ecore_Evas *ee)
|
_ecore_evas_wl_common_pre_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
|
wdata = ee->engine.data;
|
||||||
|
if (wdata->frame) evas_object_del(wdata->frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_free(Ecore_Evas *ee)
|
_ecore_evas_wl_common_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
|
wdata = ee->engine.data;
|
||||||
ee->engine.wl.win = NULL;
|
if (wdata->win) ecore_wl_window_free(wdata->win);
|
||||||
|
wdata->win = NULL;
|
||||||
|
free(wdata);
|
||||||
|
|
||||||
ecore_event_window_unregister(ee->prop.window);
|
ecore_event_window_unregister(ee->prop.window);
|
||||||
ecore_evas_input_event_unregister(ee);
|
ecore_evas_input_event_unregister(ee);
|
||||||
|
@ -243,6 +244,8 @@ _ecore_evas_wl_common_free(Ecore_Evas *ee)
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (w < 1) w = 1;
|
if (w < 1) w = 1;
|
||||||
|
@ -290,8 +293,8 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
||||||
ecore_evas_avoid_damage_set(ee, pdam);
|
ecore_evas_avoid_damage_set(ee, pdam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.frame)
|
if (wdata->frame)
|
||||||
evas_object_resize(ee->engine.wl.frame, w, h);
|
evas_object_resize(wdata->frame, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,10 +350,13 @@ _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y)
|
_ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
|
|
||||||
|
wdata = ee->engine.data;
|
||||||
ee->req.x = x;
|
ee->req.x = x;
|
||||||
ee->req.y = y;
|
ee->req.y = y;
|
||||||
|
|
||||||
|
@ -358,8 +364,8 @@ _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y)
|
||||||
{
|
{
|
||||||
ee->x = x;
|
ee->x = x;
|
||||||
ee->y = y;
|
ee->y = y;
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
ecore_wl_window_update_location(ee->engine.wl.win, x, y);
|
ecore_wl_window_update_location(wdata->win, x, y);
|
||||||
if (ee->func.fn_move) ee->func.fn_move(ee);
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -480,40 +486,49 @@ _ecore_evas_wl_common_frame_add(Evas *evas)
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_raise(Ecore_Evas *ee)
|
_ecore_evas_wl_common_raise(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
if ((!ee) || (!ee->visible)) return;
|
||||||
ecore_wl_window_raise(ee->engine.wl.win);
|
wdata = ee->engine.data;
|
||||||
|
ecore_wl_window_raise(wdata->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
|
_ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->prop.title) free(ee->prop.title);
|
if (ee->prop.title) free(ee->prop.title);
|
||||||
ee->prop.title = NULL;
|
ee->prop.title = NULL;
|
||||||
if (title) ee->prop.title = strdup(title);
|
if (title) ee->prop.title = strdup(title);
|
||||||
if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
|
wdata = ee->engine.data;
|
||||||
|
if ((ee->prop.draw_frame) && (wdata->frame))
|
||||||
{
|
{
|
||||||
EE_Wl_Smart_Data *sd;
|
EE_Wl_Smart_Data *sd;
|
||||||
|
|
||||||
if ((sd = evas_object_smart_data_get(ee->engine.wl.frame)))
|
if ((sd = evas_object_smart_data_get(wdata->frame)))
|
||||||
evas_object_text_text_set(sd->text, ee->prop.title);
|
evas_object_text_text_set(sd->text, ee->prop.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
|
if ((ee->prop.title) && (wdata->win->shell_surface))
|
||||||
wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
|
wl_shell_surface_set_title(wdata->win->shell_surface,
|
||||||
ee->prop.title);
|
ee->prop.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
|
_ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
|
wdata = ee->engine.data;
|
||||||
if (ee->prop.name) free(ee->prop.name);
|
if (ee->prop.name) free(ee->prop.name);
|
||||||
if (ee->prop.clas) free(ee->prop.clas);
|
if (ee->prop.clas) free(ee->prop.clas);
|
||||||
ee->prop.name = NULL;
|
ee->prop.name = NULL;
|
||||||
|
@ -521,8 +536,8 @@ _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *
|
||||||
if (n) ee->prop.name = strdup(n);
|
if (n) ee->prop.name = strdup(n);
|
||||||
if (c) ee->prop.clas = strdup(c);
|
if (c) ee->prop.clas = strdup(c);
|
||||||
|
|
||||||
if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
|
if ((ee->prop.clas) && (wdata->win->shell_surface))
|
||||||
wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
|
wl_shell_surface_set_class(wdata->win->shell_surface,
|
||||||
ee->prop.clas);
|
ee->prop.clas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,6 +606,7 @@ void
|
||||||
_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
||||||
{
|
{
|
||||||
int x, y, fx, fy;
|
int x, y, fx, fy;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
|
|
||||||
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
|
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
|
||||||
|
|
||||||
|
@ -600,7 +616,7 @@ _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int la
|
||||||
ee->prop.cursor.layer = 0;
|
ee->prop.cursor.layer = 0;
|
||||||
ee->prop.cursor.hot.x = 0;
|
ee->prop.cursor.hot.x = 0;
|
||||||
ee->prop.cursor.hot.y = 0;
|
ee->prop.cursor.hot.y = 0;
|
||||||
ecore_wl_window_cursor_default_restore(ee->engine.wl.win);
|
ecore_wl_window_cursor_default_restore(wdata->win);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,7 +625,7 @@ _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int la
|
||||||
ee->prop.cursor.hot.x = hot_x;
|
ee->prop.cursor.hot.x = hot_x;
|
||||||
ee->prop.cursor.hot.y = hot_y;
|
ee->prop.cursor.hot.y = hot_y;
|
||||||
|
|
||||||
ecore_wl_window_pointer_set(ee->engine.wl.win, NULL, 0, 0);
|
ecore_wl_window_pointer_set(wdata->win, NULL, 0, 0);
|
||||||
|
|
||||||
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
||||||
evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
|
evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
|
||||||
|
@ -650,23 +666,29 @@ _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify)
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max)
|
_ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
|
wdata = ee->engine.data;
|
||||||
if (ee->prop.maximized == max) return;
|
if (ee->prop.maximized == max) return;
|
||||||
ee->prop.maximized = max;
|
ee->prop.maximized = max;
|
||||||
ecore_wl_window_maximized_set(ee->engine.wl.win, max);
|
ecore_wl_window_maximized_set(wdata->win, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full)
|
_ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->prop.fullscreen == full) return;
|
if (ee->prop.fullscreen == full) return;
|
||||||
|
wdata = ee->engine.data;
|
||||||
ee->prop.fullscreen = full;
|
ee->prop.fullscreen = full;
|
||||||
ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
|
ecore_wl_window_fullscreen_set(wdata->win, full);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -706,6 +728,7 @@ _ecore_evas_wl_common_render_updates(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
int rend = 0;
|
int rend = 0;
|
||||||
Eina_List *updates = NULL;
|
Eina_List *updates = NULL;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
|
@ -715,7 +738,7 @@ _ecore_evas_wl_common_render_updates(Ecore_Evas *ee)
|
||||||
Eina_Rectangle *r;
|
Eina_Rectangle *r;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(updates, l, r)
|
EINA_LIST_FOREACH(updates, l, r)
|
||||||
ecore_wl_window_damage(ee->engine.wl.win,
|
ecore_wl_window_damage(wdata->win,
|
||||||
r->x, r->y, r->w, r->h);
|
r->x, r->y, r->w, r->h);
|
||||||
|
|
||||||
ecore_wl_flush();
|
ecore_wl_flush();
|
||||||
|
@ -781,3 +804,86 @@ _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee EINA_UNUSED, int *xdpi
|
||||||
if (xdpi) *xdpi = dpi;
|
if (xdpi) *xdpi = dpi;
|
||||||
if (ydpi) *ydpi = dpi;
|
if (ydpi) *ydpi = dpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
|
||||||
|
{
|
||||||
|
if (!ee) return;
|
||||||
|
if (!strcmp(ee->driver, "wayland_shm"))
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
||||||
|
_ecore_evas_wayland_shm_resize(ee, location);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if (!strcmp(ee->driver, "wayland_egl"))
|
||||||
|
{
|
||||||
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
||||||
|
_ecore_evas_wayland_egl_resize(ee, location);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
|
if (!ee) return;
|
||||||
|
if (!strncmp(ee->driver, "wayland", 7))
|
||||||
|
{
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
if (wdata->win)
|
||||||
|
{
|
||||||
|
wdata->win->moving = EINA_TRUE;
|
||||||
|
ecore_wl_window_move(wdata->win, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
|
if (!ee) return;
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
ecore_wl_window_type_set(wdata->win, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Ecore_Wl_Window *
|
||||||
|
_ecore_evas_wayland_window_get(const Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
|
if (!(!strncmp(ee->driver, "wayland", 7)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
return wdata->win;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_evas_wayland_pointer_set(Ecore_Evas *ee EINA_UNUSED, int hot_x EINA_UNUSED, int hot_y EINA_UNUSED)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Ecore_Evas_Interface_Wayland *
|
||||||
|
_ecore_evas_wl_interface_new(void)
|
||||||
|
{
|
||||||
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
|
|
||||||
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Wayland));
|
||||||
|
if (!iface) return NULL;
|
||||||
|
|
||||||
|
iface->base.name = interface_wl_name;
|
||||||
|
iface->base.version = interface_wl_version;
|
||||||
|
|
||||||
|
iface->resize = _ecore_evas_wayland_resize;
|
||||||
|
iface->move = _ecore_evas_wayland_move;
|
||||||
|
iface->pointer_set = _ecore_evas_wayland_pointer_set;
|
||||||
|
iface->type_set = _ecore_evas_wayland_type_set;
|
||||||
|
iface->window_get = _ecore_evas_wayland_window_get;
|
||||||
|
|
||||||
|
return iface;
|
||||||
|
}
|
|
@ -1,16 +1,4 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#include "ecore_evas_wayland_private.h"
|
||||||
# include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#define LOGFNS 1
|
|
||||||
|
|
||||||
#ifdef LOGFNS
|
|
||||||
# include <stdio.h>
|
|
||||||
# define LOGFN(fl, ln, fn) \
|
|
||||||
printf("-ECORE_EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
|
|
||||||
#else
|
|
||||||
# define LOGFN(fl, ln, fn)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
@ -18,16 +6,8 @@
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Eina.h>
|
|
||||||
|
|
||||||
#include "Ecore_Evas.h"
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
|
||||||
# include "ecore_evas_private.h"
|
|
||||||
# include <Evas_Engine_Wayland_Egl.h>
|
# include <Evas_Engine_Wayland_Egl.h>
|
||||||
# include <Ecore_Wayland.h>
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
|
static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
|
||||||
|
@ -101,10 +81,13 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
||||||
|
|
||||||
/* external functions */
|
/* external functions */
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame)
|
ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
|
||||||
|
int x, int y, int w, int h, Eina_Bool frame)
|
||||||
{
|
{
|
||||||
Ecore_Wl_Window *p = NULL;
|
Ecore_Wl_Window *p = NULL;
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int method = 0, count = 0;
|
int method = 0, count = 0;
|
||||||
|
|
||||||
|
@ -131,11 +114,22 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
goto ee_err;
|
goto ee_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(wdata = calloc(1, sizeof(Ecore_Evas_Engine_Wl_Data))))
|
||||||
|
{
|
||||||
|
ERR("Failed to allocate Ecore_Evas_Engine_Wl_Data");
|
||||||
|
free(ee);
|
||||||
|
goto ee_err;
|
||||||
|
}
|
||||||
|
|
||||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||||
|
|
||||||
_ecore_evas_wl_common_init();
|
_ecore_evas_wl_common_init();
|
||||||
|
|
||||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
|
||||||
|
ee->engine.data = wdata;
|
||||||
|
|
||||||
|
iface = _ecore_evas_wl_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
ee->driver = "wayland_egl";
|
ee->driver = "wayland_egl";
|
||||||
if (disp_name) ee->name = strdup(disp_name);
|
if (disp_name) ee->name = strdup(disp_name);
|
||||||
|
@ -175,10 +169,10 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
|
|
||||||
/* FIXME: Get if parent is alpha, and set */
|
/* FIXME: Get if parent is alpha, and set */
|
||||||
|
|
||||||
ee->engine.wl.parent = p;
|
wdata->parent = p;
|
||||||
ee->engine.wl.win =
|
wdata->win =
|
||||||
ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW);
|
ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW);
|
||||||
ee->prop.window = ee->engine.wl.win->id;
|
ee->prop.window = wdata->win->id;
|
||||||
|
|
||||||
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
|
if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
|
||||||
{
|
{
|
||||||
|
@ -202,9 +196,9 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
|
|
||||||
if (ee->prop.draw_frame)
|
if (ee->prop.draw_frame)
|
||||||
{
|
{
|
||||||
ee->engine.wl.frame = _ecore_evas_wl_common_frame_add(ee->evas);
|
wdata->frame = _ecore_evas_wl_common_frame_add(ee->evas);
|
||||||
evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE);
|
evas_object_is_frame_object_set(wdata->frame, EINA_TRUE);
|
||||||
evas_object_move(ee->engine.wl.frame, 0, 0);
|
evas_object_move(wdata->frame, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ecore_evas_register(ee);
|
_ecore_evas_register(ee);
|
||||||
|
@ -230,6 +224,7 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
|
@ -239,6 +234,7 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
ee->req.w = w;
|
ee->req.w = w;
|
||||||
ee->req.h = h;
|
ee->req.h = h;
|
||||||
|
|
||||||
|
wdata = ee->engine.data;
|
||||||
if (!ee->prop.fullscreen)
|
if (!ee->prop.fullscreen)
|
||||||
{
|
{
|
||||||
int fw = 0, fh = 0;
|
int fw = 0, fh = 0;
|
||||||
|
@ -278,14 +274,14 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
ecore_evas_avoid_damage_set(ee, pdam);
|
ecore_evas_avoid_damage_set(ee, pdam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.frame)
|
if (wdata->frame)
|
||||||
evas_object_resize(ee->engine.wl.frame, w, h);
|
evas_object_resize(wdata->frame, w, h);
|
||||||
|
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
ecore_wl_window_update_size(ee->engine.wl.win, w, h);
|
ecore_wl_window_update_size(wdata->win, w, h);
|
||||||
ecore_wl_window_buffer_attach(ee->engine.wl.win, NULL, 0, 0);
|
ecore_wl_window_buffer_attach(wdata->win, NULL, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||||
|
@ -296,32 +292,34 @@ static void
|
||||||
_ecore_evas_wl_show(Ecore_Evas *ee)
|
_ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (ee->visible)) return;
|
if ((!ee) || (ee->visible)) return;
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
wdata = ee->engine.data;
|
||||||
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
ecore_wl_window_show(ee->engine.wl.win);
|
ecore_wl_window_show(wdata->win);
|
||||||
ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
|
ecore_wl_window_update_size(wdata->win, ee->w, ee->h);
|
||||||
ecore_wl_window_buffer_attach(ee->engine.wl.win, NULL, 0, 0);
|
ecore_wl_window_buffer_attach(wdata->win, NULL, 0, 0);
|
||||||
|
|
||||||
if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
|
if ((ee->prop.clas) && (wdata->win->shell_surface))
|
||||||
wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
|
wl_shell_surface_set_class(wdata->win->shell_surface,
|
||||||
ee->prop.clas);
|
ee->prop.clas);
|
||||||
if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
|
if ((ee->prop.title) && (wdata->win->shell_surface))
|
||||||
wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
|
wl_shell_surface_set_title(wdata->win->shell_surface,
|
||||||
ee->prop.title);
|
ee->prop.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.frame)
|
if (wdata->frame)
|
||||||
{
|
{
|
||||||
evas_object_show(ee->engine.wl.frame);
|
evas_object_show(wdata->frame);
|
||||||
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
|
evas_object_resize(wdata->frame, ee->w, ee->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
||||||
if (!einfo)
|
if (!einfo)
|
||||||
|
@ -330,7 +328,7 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
einfo->info.surface = ecore_wl_window_surface_get(ee->engine.wl.win);
|
einfo->info.surface = ecore_wl_window_surface_get(wdata->win);
|
||||||
/* if (einfo->info.surface) */
|
/* if (einfo->info.surface) */
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
/* else */
|
/* else */
|
||||||
|
@ -344,11 +342,13 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_hide(Ecore_Evas *ee)
|
_ecore_evas_wl_hide(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
if ((!ee) || (!ee->visible)) return;
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
|
||||||
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
|
||||||
if (einfo)
|
if (einfo)
|
||||||
|
@ -357,8 +357,8 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
ecore_wl_window_hide(ee->engine.wl.win);
|
ecore_wl_window_hide(wdata->win);
|
||||||
|
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
ee->should_be_visible = 0;
|
ee->should_be_visible = 0;
|
||||||
|
@ -408,10 +408,13 @@ _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
|
||||||
void
|
void
|
||||||
_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
|
_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->engine.wl.win)
|
wdata = ee->engine.data;
|
||||||
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Egl *einfo;
|
Evas_Engine_Info_Wayland_Egl *einfo;
|
||||||
|
|
||||||
|
@ -422,14 +425,8 @@ _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
|
||||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
ee->engine.wl.win->resizing = EINA_TRUE;
|
wdata->win->resizing = EINA_TRUE;
|
||||||
ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
|
ecore_wl_window_resize(wdata->win, ee->w, ee->h, location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_wayland_egl_new(const char *disp_name EINA_UNUSED, unsigned int parent EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, Eina_Bool frame EINA_UNUSED)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
|
@ -0,0 +1,81 @@
|
||||||
|
#ifndef _ECORE_EVAS_WAYLAND_PRIVATE_H_
|
||||||
|
#define _ECORE_EVAS_WAYLAND_PRIVATE_H_
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#define LOGFNS 1
|
||||||
|
#ifdef LOGFNS
|
||||||
|
# include <stdio.h>
|
||||||
|
# define LOGFN(fl, ln, fn) \
|
||||||
|
printf("-ECORE_EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
|
||||||
|
#else
|
||||||
|
# define LOGFN(fl, ln, fn)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <Eina.h>
|
||||||
|
|
||||||
|
#include "ecore_evas_private.h"
|
||||||
|
#include "Ecore_Evas.h"
|
||||||
|
#include <Ecore_Wayland.h>
|
||||||
|
|
||||||
|
typedef struct _Ecore_Evas_Engine_Wl_Data Ecore_Evas_Engine_Wl_Data;
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Engine_Wl_Data {
|
||||||
|
Ecore_Wl_Window *parent, *win;
|
||||||
|
Evas_Object *frame;
|
||||||
|
|
||||||
|
# if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
|
||||||
|
struct wl_shm_pool *pool;
|
||||||
|
size_t pool_size;
|
||||||
|
void *pool_data;
|
||||||
|
struct wl_buffer *buffer;
|
||||||
|
# endif
|
||||||
|
};
|
||||||
|
|
||||||
|
Ecore_Evas_Interface_Wayland *_ecore_evas_wl_interface_new(void);
|
||||||
|
|
||||||
|
int _ecore_evas_wl_common_init(void);
|
||||||
|
int _ecore_evas_wl_common_shutdown(void);
|
||||||
|
void _ecore_evas_wl_common_pre_free(Ecore_Evas *ee);
|
||||||
|
void _ecore_evas_wl_common_free(Ecore_Evas *ee);
|
||||||
|
void _ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
|
||||||
|
void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y);
|
||||||
|
void _ecore_evas_wl_common_raise(Ecore_Evas *ee);
|
||||||
|
void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title);
|
||||||
|
void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
|
||||||
|
void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
|
||||||
|
void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
|
||||||
|
void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
|
||||||
|
void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
|
||||||
|
void _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
|
||||||
|
void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
|
||||||
|
void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
|
||||||
|
void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
|
||||||
|
void _ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full);
|
||||||
|
void _ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore);
|
||||||
|
int _ecore_evas_wl_common_pre_render(Ecore_Evas *ee);
|
||||||
|
int _ecore_evas_wl_common_render_updates(Ecore_Evas *ee);
|
||||||
|
void _ecore_evas_wl_common_post_render(Ecore_Evas *ee);
|
||||||
|
int _ecore_evas_wl_common_render(Ecore_Evas *ee);
|
||||||
|
void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
|
||||||
|
void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
|
||||||
|
|
||||||
|
Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
|
||||||
|
|
||||||
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
||||||
|
void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
|
||||||
|
void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ECORE_EVAS_WAYLAND_PRIVATE_H_ */
|
|
@ -1,33 +1,12 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#include "ecore_evas_wayland_private.h"
|
||||||
# include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#define LOGFNS 1
|
|
||||||
|
|
||||||
#ifdef LOGFNS
|
|
||||||
# include <stdio.h>
|
|
||||||
# define LOGFN(fl, ln, fn) \
|
|
||||||
printf("-ECORE_EVAS-WL: %25s: %5i - %s\n", fl, ln, fn);
|
|
||||||
#else
|
|
||||||
# define LOGFN(fl, ln, fn)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
||||||
|
# include <Evas_Engine_Wayland_Shm.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Eina.h>
|
|
||||||
|
|
||||||
#include "Ecore_Evas.h"
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
|
|
||||||
# include "ecore_evas_private.h"
|
|
||||||
# include <Evas_Engine_Wayland_Shm.h>
|
|
||||||
# include <Ecore_Wayland.h>
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void _ecore_evas_wl_free(Ecore_Evas *ee);
|
static void _ecore_evas_wl_free(Ecore_Evas *ee);
|
||||||
|
@ -117,10 +96,12 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
||||||
|
|
||||||
/* external functions */
|
/* external functions */
|
||||||
EAPI Ecore_Evas *
|
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)
|
ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame)
|
||||||
{
|
{
|
||||||
Ecore_Wl_Window *p = NULL;
|
Ecore_Wl_Window *p = NULL;
|
||||||
Evas_Engine_Info_Wayland_Shm *einfo;
|
Evas_Engine_Info_Wayland_Shm *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
Ecore_Evas_Interface_Wayland *iface;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
int method = 0, count = 0;
|
int method = 0, count = 0;
|
||||||
|
|
||||||
|
@ -146,12 +127,22 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
ERR("Failed to allocate Ecore_Evas");
|
ERR("Failed to allocate Ecore_Evas");
|
||||||
goto ee_err;
|
goto ee_err;
|
||||||
}
|
}
|
||||||
|
if (!(wdata = calloc(1, sizeof(Ecore_Evas_Engine_Wl_Data))))
|
||||||
|
{
|
||||||
|
ERR("Failed to allocate Ecore_Evas_Engine_Wl_Data");
|
||||||
|
free(ee);
|
||||||
|
goto ee_err;
|
||||||
|
}
|
||||||
|
|
||||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||||
|
|
||||||
_ecore_evas_wl_common_init();
|
_ecore_evas_wl_common_init();
|
||||||
|
|
||||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
|
||||||
|
ee->engine.data = wdata;
|
||||||
|
|
||||||
|
iface = _ecore_evas_wl_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
ee->driver = "wayland_shm";
|
ee->driver = "wayland_shm";
|
||||||
if (disp_name) ee->name = strdup(disp_name);
|
if (disp_name) ee->name = strdup(disp_name);
|
||||||
|
@ -191,10 +182,10 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
|
|
||||||
/* FIXME: Get if parent is alpha, and set */
|
/* FIXME: Get if parent is alpha, and set */
|
||||||
|
|
||||||
ee->engine.wl.parent = p;
|
wdata->parent = p;
|
||||||
ee->engine.wl.win =
|
wdata->win =
|
||||||
ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_SHM);
|
ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_SHM);
|
||||||
ee->prop.window = ee->engine.wl.win->id;
|
ee->prop.window = wdata->win->id;
|
||||||
|
|
||||||
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
|
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
|
||||||
{
|
{
|
||||||
|
@ -216,9 +207,9 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
|
|
||||||
if (ee->prop.draw_frame)
|
if (ee->prop.draw_frame)
|
||||||
{
|
{
|
||||||
ee->engine.wl.frame = _ecore_evas_wl_common_frame_add(ee->evas);
|
wdata->frame = _ecore_evas_wl_common_frame_add(ee->evas);
|
||||||
evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE);
|
evas_object_is_frame_object_set(wdata->frame, EINA_TRUE);
|
||||||
evas_object_move(ee->engine.wl.frame, 0, 0);
|
evas_object_move(wdata->frame, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ecore_evas_register(ee);
|
_ecore_evas_register(ee);
|
||||||
|
@ -235,7 +226,6 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
|
||||||
err:
|
err:
|
||||||
ecore_evas_free(ee);
|
ecore_evas_free(ee);
|
||||||
_ecore_evas_wl_common_shutdown();
|
_ecore_evas_wl_common_shutdown();
|
||||||
|
|
||||||
ee_err:
|
ee_err:
|
||||||
ecore_wl_shutdown();
|
ecore_wl_shutdown();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -253,6 +243,7 @@ static void
|
||||||
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Shm *einfo;
|
Evas_Engine_Info_Wayland_Shm *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
|
@ -263,6 +254,8 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
ee->req.w = w;
|
ee->req.w = w;
|
||||||
ee->req.h = h;
|
ee->req.h = h;
|
||||||
|
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
|
||||||
if (!ee->prop.fullscreen)
|
if (!ee->prop.fullscreen)
|
||||||
{
|
{
|
||||||
int fw = 0, fh = 0;
|
int fw = 0, fh = 0;
|
||||||
|
@ -302,8 +295,8 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
ecore_evas_avoid_damage_set(ee, pdam);
|
ecore_evas_avoid_damage_set(ee, pdam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.frame)
|
if (wdata->frame)
|
||||||
evas_object_resize(ee->engine.wl.frame, w, h);
|
evas_object_resize(wdata->frame, w, h);
|
||||||
|
|
||||||
_ecore_evas_wl_buffer_new(ee, w, h);
|
_ecore_evas_wl_buffer_new(ee, w, h);
|
||||||
|
|
||||||
|
@ -314,14 +307,14 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
einfo->info.dest = ee->engine.wl.pool_data;
|
einfo->info.dest = wdata->pool_data;
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
ecore_wl_window_update_size(ee->engine.wl.win, w, h);
|
ecore_wl_window_update_size(wdata->win, w, h);
|
||||||
ecore_wl_window_buffer_attach(ee->engine.wl.win,
|
ecore_wl_window_buffer_attach(wdata->win,
|
||||||
ee->engine.wl.buffer, 0, 0);
|
wdata->buffer, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
||||||
|
@ -344,12 +337,14 @@ static void
|
||||||
_ecore_evas_wl_show(Ecore_Evas *ee)
|
_ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Shm *einfo;
|
Evas_Engine_Info_Wayland_Shm *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (ee->visible)) return;
|
if ((!ee) || (ee->visible)) return;
|
||||||
|
|
||||||
_ecore_evas_wl_buffer_new(ee, ee->w, ee->h);
|
_ecore_evas_wl_buffer_new(ee, ee->w, ee->h);
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
|
||||||
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
|
||||||
if (!einfo)
|
if (!einfo)
|
||||||
|
@ -358,28 +353,28 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
einfo->info.dest = ee->engine.wl.pool_data;
|
einfo->info.dest = wdata->pool_data;
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
ecore_wl_window_show(ee->engine.wl.win);
|
ecore_wl_window_show(wdata->win);
|
||||||
ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
|
ecore_wl_window_update_size(wdata->win, ee->w, ee->h);
|
||||||
ecore_wl_window_buffer_attach(ee->engine.wl.win,
|
ecore_wl_window_buffer_attach(wdata->win,
|
||||||
ee->engine.wl.buffer, 0, 0);
|
wdata->buffer, 0, 0);
|
||||||
|
|
||||||
if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
|
if ((ee->prop.clas) && (wdata->win->shell_surface))
|
||||||
wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
|
wl_shell_surface_set_class(wdata->win->shell_surface,
|
||||||
ee->prop.clas);
|
ee->prop.clas);
|
||||||
if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
|
if ((ee->prop.title) && (wdata->win->shell_surface))
|
||||||
wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
|
wl_shell_surface_set_title(wdata->win->shell_surface,
|
||||||
ee->prop.title);
|
ee->prop.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.frame)
|
if (wdata->frame)
|
||||||
{
|
{
|
||||||
evas_object_show(ee->engine.wl.frame);
|
evas_object_show(wdata->frame);
|
||||||
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
|
evas_object_resize(wdata->frame, ee->w, ee->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
ee->visible = 1;
|
ee->visible = 1;
|
||||||
|
@ -390,14 +385,16 @@ static void
|
||||||
_ecore_evas_wl_hide(Ecore_Evas *ee)
|
_ecore_evas_wl_hide(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Shm *einfo;
|
Evas_Engine_Info_Wayland_Shm *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if ((!ee) || (!ee->visible)) return;
|
if ((!ee) || (!ee->visible)) return;
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
|
||||||
_ecore_evas_wl_buffer_free(ee);
|
_ecore_evas_wl_buffer_free(ee);
|
||||||
|
|
||||||
munmap(ee->engine.wl.pool_data, ee->engine.wl.pool_size);
|
munmap(wdata->pool_data, wdata->pool_size);
|
||||||
|
|
||||||
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
|
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
|
||||||
if ((einfo) && (einfo->info.dest))
|
if ((einfo) && (einfo->info.dest))
|
||||||
|
@ -406,8 +403,8 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
|
||||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
ecore_wl_window_hide(ee->engine.wl.win);
|
ecore_wl_window_hide(wdata->win);
|
||||||
|
|
||||||
ee->visible = 0;
|
ee->visible = 0;
|
||||||
ee->should_be_visible = 0;
|
ee->should_be_visible = 0;
|
||||||
|
@ -419,6 +416,7 @@ static void
|
||||||
_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
|
_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Shm *einfo;
|
Evas_Engine_Info_Wayland_Shm *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
Ecore_Wl_Window *win = NULL;
|
Ecore_Wl_Window *win = NULL;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
@ -426,22 +424,23 @@ _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if ((ee->alpha == alpha)) return;
|
if ((ee->alpha == alpha)) return;
|
||||||
ee->alpha = alpha;
|
ee->alpha = alpha;
|
||||||
|
wdata = ee->engine.data;
|
||||||
|
|
||||||
/* FIXME: NB: We should really add a ecore_wl_window_alpha_set function
|
/* FIXME: NB: We should really add a ecore_wl_window_alpha_set function
|
||||||
* but we are in API freeze, so just hack it in for now and fix when
|
* but we are in API freeze, so just hack it in for now and fix when
|
||||||
* freeze is over */
|
* freeze is over */
|
||||||
if ((win = ee->engine.wl.win))
|
if ((win = wdata->win))
|
||||||
win->alpha = alpha;
|
win->alpha = alpha;
|
||||||
|
|
||||||
/* if (ee->engine.wl.win) */
|
/* if (wdata->win) */
|
||||||
/* ecore_wl_window_transparent_set(ee->engine.wl.win, alpha); */
|
/* ecore_wl_window_transparent_set(wdata->win, alpha); */
|
||||||
|
|
||||||
_ecore_evas_wl_buffer_new(ee, ee->w, ee->h);
|
_ecore_evas_wl_buffer_new(ee, ee->w, ee->h);
|
||||||
|
|
||||||
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
|
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
|
||||||
{
|
{
|
||||||
einfo->info.destination_alpha = alpha;
|
einfo->info.destination_alpha = alpha;
|
||||||
einfo->info.dest = ee->engine.wl.pool_data;
|
einfo->info.dest = wdata->pool_data;
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
|
@ -450,7 +449,7 @@ _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
if (win)
|
if (win)
|
||||||
{
|
{
|
||||||
ecore_wl_window_update_size(win, ee->w, ee->h);
|
ecore_wl_window_update_size(win, ee->w, ee->h);
|
||||||
ecore_wl_window_buffer_attach(win, ee->engine.wl.buffer, 0, 0);
|
ecore_wl_window_buffer_attach(win, wdata->buffer, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,6 +457,7 @@ static void
|
||||||
_ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
|
_ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
|
||||||
{
|
{
|
||||||
Evas_Engine_Info_Wayland_Shm *einfo;
|
Evas_Engine_Info_Wayland_Shm *einfo;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
|
@ -465,25 +465,26 @@ _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
|
||||||
if ((ee->transparent == transparent)) return;
|
if ((ee->transparent == transparent)) return;
|
||||||
ee->transparent = transparent;
|
ee->transparent = transparent;
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
wdata = ee->engine.data;
|
||||||
ecore_wl_window_transparent_set(ee->engine.wl.win, transparent);
|
if (wdata->win)
|
||||||
|
ecore_wl_window_transparent_set(wdata->win, transparent);
|
||||||
|
|
||||||
_ecore_evas_wl_buffer_new(ee, ee->w, ee->h);
|
_ecore_evas_wl_buffer_new(ee, ee->w, ee->h);
|
||||||
|
|
||||||
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
|
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
|
||||||
{
|
{
|
||||||
einfo->info.destination_alpha = transparent;
|
einfo->info.destination_alpha = transparent;
|
||||||
einfo->info.dest = ee->engine.wl.pool_data;
|
einfo->info.dest = wdata->pool_data;
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ee->engine.wl.win)
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
|
ecore_wl_window_update_size(wdata->win, ee->w, ee->h);
|
||||||
ecore_wl_window_buffer_attach(ee->engine.wl.win,
|
ecore_wl_window_buffer_attach(wdata->win,
|
||||||
ee->engine.wl.buffer, 0, 0);
|
wdata->buffer, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,9 +493,11 @@ _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee = data;
|
Ecore_Evas *ee = data;
|
||||||
Ecore_Wl_Window *win = NULL;
|
Ecore_Wl_Window *win = NULL;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (!(win = ee->engine.wl.win)) return;
|
wdata = ee->engine.data;
|
||||||
|
if (!(win = wdata->win)) return;
|
||||||
|
|
||||||
win->frame_callback = NULL;
|
win->frame_callback = NULL;
|
||||||
win->frame_pending = EINA_FALSE;
|
win->frame_pending = EINA_FALSE;
|
||||||
|
@ -512,6 +515,7 @@ _ecore_evas_wl_render(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
int rend = 0;
|
int rend = 0;
|
||||||
Ecore_Wl_Window *win = NULL;
|
Ecore_Wl_Window *win = NULL;
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
if (!ee) return 0;
|
if (!ee) return 0;
|
||||||
if (!ee->visible)
|
if (!ee->visible)
|
||||||
|
@ -520,7 +524,8 @@ _ecore_evas_wl_render(Ecore_Evas *ee)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(win = ee->engine.wl.win)) return 0;
|
wdata = ee->engine.data;
|
||||||
|
if (!(win = wdata->win)) return 0;
|
||||||
|
|
||||||
rend = _ecore_evas_wl_common_pre_render(ee);
|
rend = _ecore_evas_wl_common_pre_render(ee);
|
||||||
if (!(win->frame_pending))
|
if (!(win->frame_pending))
|
||||||
|
@ -547,17 +552,19 @@ _ecore_evas_wl_render(Ecore_Evas *ee)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_shm_pool_free(Ecore_Evas *ee)
|
_ecore_evas_wl_shm_pool_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
if (!ee->engine.wl.pool) return;
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
|
if (!wdata->pool) return;
|
||||||
|
|
||||||
wl_shm_pool_destroy(ee->engine.wl.pool);
|
wl_shm_pool_destroy(wdata->pool);
|
||||||
ee->engine.wl.pool = NULL;
|
wdata->pool = NULL;
|
||||||
ee->engine.wl.pool_size = 0;
|
wdata->pool_size = 0;
|
||||||
ee->engine.wl.pool_data = NULL;
|
wdata->pool_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
|
_ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
struct wl_shm *shm;
|
struct wl_shm *shm;
|
||||||
void *data;
|
void *data;
|
||||||
char tmp[PATH_MAX];
|
char tmp[PATH_MAX];
|
||||||
|
@ -565,7 +572,7 @@ _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (size <= ee->engine.wl.pool_size)
|
if (size <= wdata->pool_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size *= 1.5;
|
size *= 1.5;
|
||||||
|
@ -599,9 +606,9 @@ _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ee->engine.wl.pool_size = size;
|
wdata->pool_size = size;
|
||||||
ee->engine.wl.pool_data = data;
|
wdata->pool_data = data;
|
||||||
ee->engine.wl.pool = wl_shm_create_pool(shm, fd, size);
|
wdata->pool = wl_shm_create_pool(shm, fd, size);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
close(fd);
|
close(fd);
|
||||||
|
@ -610,15 +617,17 @@ _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_buffer_free(Ecore_Evas *ee)
|
_ecore_evas_wl_buffer_free(Ecore_Evas *ee)
|
||||||
{
|
{
|
||||||
if (!ee->engine.wl.buffer) return;
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
|
if (!wdata->buffer) return;
|
||||||
|
|
||||||
wl_buffer_destroy(ee->engine.wl.buffer);
|
wl_buffer_destroy(wdata->buffer);
|
||||||
ee->engine.wl.buffer = NULL;
|
wdata->buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ecore_evas_wl_buffer_new(Ecore_Evas *ee, int w, int h)
|
_ecore_evas_wl_buffer_new(Ecore_Evas *ee, int w, int h)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
|
||||||
unsigned int format;
|
unsigned int format;
|
||||||
int stride = 0;
|
int stride = 0;
|
||||||
|
|
||||||
|
@ -632,26 +641,23 @@ _ecore_evas_wl_buffer_new(Ecore_Evas *ee, int w, int h)
|
||||||
format = WL_SHM_FORMAT_XRGB8888;
|
format = WL_SHM_FORMAT_XRGB8888;
|
||||||
|
|
||||||
_ecore_evas_wl_buffer_free(ee);
|
_ecore_evas_wl_buffer_free(ee);
|
||||||
ee->engine.wl.buffer =
|
wdata->buffer =
|
||||||
wl_shm_pool_create_buffer(ee->engine.wl.pool, 0, w, h, stride, format);
|
wl_shm_pool_create_buffer(wdata->pool, 0, w, h, stride, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
|
_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Wl_Data *wdata;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
if (!ee) return;
|
if (!ee) return;
|
||||||
if (ee->engine.wl.win)
|
wdata = ee->engine.data;
|
||||||
|
if (wdata->win)
|
||||||
{
|
{
|
||||||
ee->engine.wl.win->resizing = EINA_TRUE;
|
wdata->win->resizing = EINA_TRUE;
|
||||||
ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
|
ecore_wl_window_resize(wdata->win, ee->w, ee->h, location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
EAPI Ecore_Evas *
|
|
||||||
ecore_evas_wayland_shm_new(const char *disp_name EINA_UNUSED, unsigned int parent EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED, Eina_Bool frame EINA_UNUSED)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
|
@ -6,17 +6,29 @@
|
||||||
|
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include "ecore_private.h"
|
#include "ecore_private.h"
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# include <windows.h>
|
|
||||||
# undef WIN32_LEAN_AND_MEAN
|
|
||||||
# include <Ecore_Win32.h>
|
|
||||||
# include <ecore_win32_private.h>
|
|
||||||
#endif /* BUILD_ECORE_EVAS_WIN32 */
|
|
||||||
|
|
||||||
#include "ecore_evas_private.h"
|
#include "ecore_evas_private.h"
|
||||||
#include "Ecore_Evas.h"
|
#include "Ecore_Evas.h"
|
||||||
|
|
||||||
|
#include "Ecore_Win32.h"
|
||||||
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
||||||
|
# include <Evas_Engine_Software_Gdi.h>
|
||||||
|
#ndif
|
||||||
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_DDRAW
|
||||||
|
# include <Evas_Engine_Software_DDraw.h>
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ECORE_EVAS_DIRECT3D
|
||||||
|
# include <Evas_Engine_Direct3D.h>
|
||||||
|
#endif
|
||||||
|
#ifdef BUILD_ECORE_EVAS_OPENGL_GLEW
|
||||||
|
# include <Evas_Engine_GL_Glew.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
#ifdef BUILD_ECORE_EVAS_WIN32
|
||||||
|
|
||||||
#define ECORE_EVAS_EVENT_COUNT 10
|
#define ECORE_EVAS_EVENT_COUNT 10
|
||||||
|
@ -25,6 +37,19 @@ static int _ecore_evas_init_count = 0;
|
||||||
|
|
||||||
static Ecore_Event_Handler *ecore_evas_event_handlers[ECORE_EVAS_EVENT_COUNT];
|
static Ecore_Event_Handler *ecore_evas_event_handlers[ECORE_EVAS_EVENT_COUNT];
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _Ecore_Evas_Engine_Data_Win32 Ecore_Evas_Engine_Data_Win32;
|
||||||
|
|
||||||
|
struct _Ecore_Evas_Engine_Data_Win32 {
|
||||||
|
Ecore_Win32_Window *parent;
|
||||||
|
struct {
|
||||||
|
unsigned char region : 1;
|
||||||
|
unsigned char fullscreen : 1;
|
||||||
|
} state;
|
||||||
|
};
|
||||||
|
|
||||||
|
static Ecore_Evas_Interface_Win32 *_ecore_evas_win32_interface_new(void);
|
||||||
|
|
||||||
static Eina_Bool _ecore_evas_win32_event_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
static Eina_Bool _ecore_evas_win32_event_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||||
|
|
||||||
static Eina_Bool _ecore_evas_win32_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
static Eina_Bool _ecore_evas_win32_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||||
|
@ -644,9 +669,11 @@ _ecore_evas_win32_rotation_set(Ecore_Evas *ee, int rotation, int resize)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_win32_shaped_set(Ecore_Evas *ee, int shaped)
|
_ecore_evas_win32_shaped_set(Ecore_Evas *ee, int shaped)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Data_Win32 *wdata;
|
||||||
if (((ee->shaped) && (shaped)) || ((!ee->shaped) && (!shaped)))
|
if (((ee->shaped) && (shaped)) || ((!ee->shaped) && (!shaped)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
wdata = ee->engine.data;
|
||||||
if (!strcmp(ee->driver, "software_ddraw")) return;
|
if (!strcmp(ee->driver, "software_ddraw")) return;
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
||||||
|
@ -658,8 +685,8 @@ _ecore_evas_win32_shaped_set(Ecore_Evas *ee, int shaped)
|
||||||
ee->shaped = shaped;
|
ee->shaped = shaped;
|
||||||
if (einfo)
|
if (einfo)
|
||||||
{
|
{
|
||||||
ee->engine.win32.state.region = ee->shaped;
|
wdata->state.region = ee->shaped;
|
||||||
einfo->info.region = ee->engine.win32.state.region;
|
einfo->info.region = wdata->state.region;
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
{
|
{
|
||||||
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
||||||
|
@ -886,14 +913,15 @@ static void
|
||||||
_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on)
|
_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
{
|
{
|
||||||
struct _Ecore_Win32_Window *window;
|
struct _Ecore_Win32_Window *window;
|
||||||
|
Ecore_Evas_Engine_Data_Win32 *wdata = ee->engine.data;
|
||||||
|
|
||||||
INF("ecore evas fullscreen set");
|
INF("ecore evas fullscreen set");
|
||||||
|
|
||||||
if ((ee->engine.win32.state.fullscreen && on) ||
|
if ((wdata->state.fullscreen && on) ||
|
||||||
(!ee->engine.win32.state.fullscreen && !on))
|
(!wdata->state.fullscreen && !on))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ee->engine.win32.state.fullscreen = on;
|
wdata->state.fullscreen = on;
|
||||||
ee->prop.fullscreen = on;
|
ee->prop.fullscreen = on;
|
||||||
|
|
||||||
window = (struct _Ecore_Win32_Window *)ee->prop.window;
|
window = (struct _Ecore_Win32_Window *)ee->prop.window;
|
||||||
|
@ -948,6 +976,7 @@ _ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, int on)
|
||||||
static void
|
static void
|
||||||
_ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha)
|
_ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
{
|
{
|
||||||
|
Ecore_Evas_Engine_Data_Win32 *wdata = ee->engine.data;
|
||||||
alpha = !!alpha;
|
alpha = !!alpha;
|
||||||
if ((ee->alpha == alpha)) return;
|
if ((ee->alpha == alpha)) return;
|
||||||
|
|
||||||
|
@ -975,19 +1004,19 @@ _ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
/* else */
|
/* else */
|
||||||
/* { */
|
/* { */
|
||||||
/* if (ee->prop.override) */
|
/* if (ee->prop.override) */
|
||||||
/* ee->prop.window = ecore_win32_window_override_new(ee->engine.win32.win_root, */
|
/* ee->prop.window = ecore_win32_window_override_new(wdata->win_root, */
|
||||||
/* ee->req.x, */
|
/* ee->req.x, */
|
||||||
/* ee->req.y, */
|
/* ee->req.y, */
|
||||||
/* ee->req.w, */
|
/* ee->req.w, */
|
||||||
/* ee->req.h); */
|
/* ee->req.h); */
|
||||||
/* else */
|
/* else */
|
||||||
/* ee->prop.window = ecore_win32_window_new(ee->engine.win32.win_root, */
|
/* ee->prop.window = ecore_win32_window_new(wdata->win_root, */
|
||||||
/* ee->req.x, */
|
/* ee->req.x, */
|
||||||
/* ee->req.y, */
|
/* ee->req.y, */
|
||||||
/* ee->req.w, */
|
/* ee->req.w, */
|
||||||
/* ee->req.h); */
|
/* ee->req.h); */
|
||||||
/* if (ee->engine.win32.mask) ecore_x_pixmap_free(ee->engine.x.mask); */
|
/* if (wdata->mask) ecore_x_pixmap_free(ee->engine.x.mask); */
|
||||||
/* ee->engine.win32.mask = 0; */
|
/* wdata->mask = 0; */
|
||||||
/* ecore_win32_window_shape_input_mask_set(ee->prop.window, 0); */
|
/* ecore_win32_window_shape_input_mask_set(ee->prop.window, 0); */
|
||||||
/* } */
|
/* } */
|
||||||
|
|
||||||
|
@ -996,7 +1025,7 @@ _ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha)
|
||||||
|
|
||||||
// if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask);
|
// if (ee->engine.x.mask) ecore_x_pixmap_free(ee->engine.x.mask);
|
||||||
// ee->engine.x.mask = 0;
|
// ee->engine.x.mask = 0;
|
||||||
/* einfo->info.mask = ee->engine.win32.mask; */
|
/* einfo->info.mask = wdata->mask; */
|
||||||
/* einfo->info.drawable = ee->prop.window; */
|
/* einfo->info.drawable = ee->prop.window; */
|
||||||
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
||||||
{
|
{
|
||||||
|
@ -1291,7 +1320,6 @@ _ecore_evas_engine_opengl_glew_init(Ecore_Evas *ee)
|
||||||
}
|
}
|
||||||
#endif /* BUILD_ECORE_EVAS_OPENGL_GLEW */
|
#endif /* BUILD_ECORE_EVAS_OPENGL_GLEW */
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
|
||||||
static Ecore_Evas *
|
static Ecore_Evas *
|
||||||
_ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
_ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
||||||
Ecore_Win32_Window *parent,
|
Ecore_Win32_Window *parent,
|
||||||
|
@ -1301,6 +1329,7 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
Ecore_Evas_Engine_Data_Win32 *wdata;
|
||||||
|
|
||||||
if (!ecore_win32_init())
|
if (!ecore_win32_init())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1308,12 +1337,22 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
||||||
ee = calloc(1, sizeof(Ecore_Evas));
|
ee = calloc(1, sizeof(Ecore_Evas));
|
||||||
if (!ee)
|
if (!ee)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
wdata = calloc(1, sizeof(Ecore_Evas_Engine_Data_Win32));
|
||||||
|
if (!wdata)
|
||||||
|
{
|
||||||
|
free(ee);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
||||||
|
|
||||||
_ecore_evas_win32_init();
|
_ecore_evas_win32_init();
|
||||||
|
|
||||||
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_win32_engine_func;
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_win32_engine_func;
|
||||||
|
ee->engine.data = wdata;
|
||||||
|
|
||||||
|
iface = _ecore_evas_win32_interface_new();
|
||||||
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
||||||
|
|
||||||
if (width < 1) width = 1;
|
if (width < 1) width = 1;
|
||||||
if (height < 1) height = 1;
|
if (height < 1) height = 1;
|
||||||
|
@ -1340,7 +1379,7 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
||||||
evas_output_size_set(ee->evas, width, height);
|
evas_output_size_set(ee->evas, width, height);
|
||||||
evas_output_viewport_set(ee->evas, 0, 0, width, height);
|
evas_output_viewport_set(ee->evas, 0, 0, width, height);
|
||||||
|
|
||||||
ee->engine.win32.parent = parent;
|
wdata->parent = parent;
|
||||||
ee->prop.window = (Ecore_Window)ecore_win32_window_new(parent, x, y, width, height);
|
ee->prop.window = (Ecore_Window)ecore_win32_window_new(parent, x, y, width, height);
|
||||||
if (!ee->prop.window)
|
if (!ee->prop.window)
|
||||||
{
|
{
|
||||||
|
@ -1367,8 +1406,6 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
|
||||||
return ee;
|
return ee;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* BUILD_ECORE_EVAS_WIN32 */
|
|
||||||
|
|
||||||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_GDI
|
||||||
|
|
||||||
EAPI Ecore_Evas *
|
EAPI Ecore_Evas *
|
||||||
|
@ -1505,21 +1542,24 @@ ecore_evas_gl_glew_new(Ecore_Win32_Window *parent EINA_UNUSED,
|
||||||
|
|
||||||
#endif /* BUILD_ECORE_EVAS_OPENGL_GLEW */
|
#endif /* BUILD_ECORE_EVAS_OPENGL_GLEW */
|
||||||
|
|
||||||
|
static Ecore_Win32_Window *
|
||||||
#ifdef BUILD_ECORE_EVAS_WIN32
|
_ecore_evas_win32_window_get(const Ecore_Evas *ee)
|
||||||
|
|
||||||
EAPI Ecore_Win32_Window *
|
|
||||||
ecore_evas_win32_window_get(const Ecore_Evas *ee)
|
|
||||||
{
|
{
|
||||||
return (Ecore_Win32_Window *) ecore_evas_window_get(ee);
|
return (Ecore_Win32_Window *) ecore_evas_window_get(ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
static Ecore_Evas_Interface_Win32 *
|
||||||
|
_ecore_evas_win32_interface_new(void)
|
||||||
EAPI Ecore_Win32_Window *
|
|
||||||
ecore_evas_win32_window_get(const Ecore_Evas *ee EINA_UNUSED)
|
|
||||||
{
|
{
|
||||||
return NULL;
|
Ecore_Evas_Interface_Win32 *iface;
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* BUILD_ECORE_EVAS_WIN32 */
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Win32));
|
||||||
|
if (!iface) return NULL;
|
||||||
|
|
||||||
|
iface->base.name = interface_win32_name;
|
||||||
|
iface->base.version = interface_win32_version;
|
||||||
|
|
||||||
|
iface->window_get = _ecore_evas_win32_window_get;
|
||||||
|
|
||||||
|
return iface;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue