move to use Ecore and Ecore_Evas.

This commit is contained in:
Cedric BAIL 2014-08-22 00:47:19 +02:00
parent ec0863e6ed
commit 281bbd90fd
64 changed files with 786 additions and 5093 deletions

View File

@ -16,86 +16,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
PKG_PROG_PKG_CONFIG
### Additional options to configure
## Simple X11 build/link
## Evas engines
AC_ARG_ENABLE(simple-x11,
[AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking])],
[want_evas_simple_x11=$enableval]
)
# Software X11
have_software_xlib="no"
have_software_xcb="no"
EXPEDITE_CHECK_ENGINE([software-x11], [Software X11], "yes")
if test "x${have_software_x11}" = "xyes" ; then
have_software_xlib=`${PKG_CONFIG} --variable=Xlib evas-software-x11`
if test "x${have_software_xlib}" = "xstatic" ; then
have_software_xlib="yes"
fi
if test "x${have_software_xlib}" = "xyes" ; then
AC_DEFINE(HAVE_EVAS_SOFTWARE_XLIB, 1, [Evas Software Xlib Engine Support])
fi
have_software_xcb=`${PKG_CONFIG} --variable=XCB evas-software-x11`
if test "x${have_software_xcb}" = "xstatic" ; then
have_software_xcb="yes"
fi
if test "x${have_software_xcb}" = "xyes" ; then
AC_DEFINE(HAVE_EVAS_SOFTWARE_XCB, 1, [Evas Software XCB Engine Support])
fi
fi
AM_CONDITIONAL([BUILD_SOFTWARE_XLIB], [test "x${have_software_xlib}" = "xyes"])
AM_CONDITIONAL([BUILD_SOFTWARE_XCB], [test "x${have_software_xcb}" = "xyes"])
# XRender X11
EXPEDITE_CHECK_ENGINE([xrender-x11], [XRender X11], "yes")
# OpenGL X11
EXPEDITE_CHECK_ENGINE([opengl-x11], [OpenGL X11], "yes")
# XRender XCB
EXPEDITE_CHECK_ENGINE([xrender-xcb], [XRender XCB], "yes")
# GDI
EXPEDITE_CHECK_ENGINE([software-gdi], [Software GDI], "yes", [gdi_libs="-lgdi32"])
AC_SUBST(gdi_libs)
# DirectDraw
EXPEDITE_CHECK_ENGINE([software-ddraw], [Software DirectDraw], "yes", [ddraw_libs="-lddraw -ldxguid -lgdi32"])
AC_SUBST(ddraw_libs)
# Direct3D
EXPEDITE_CHECK_ENGINE([direct3d], [Direct3D], "yes", [d3d_libs="-ld3d9 -ld3dx9d -lgdi32"])
AC_SUBST(d3d_libs)
# PSL1GHT
EXPEDITE_CHECK_ENGINE([psl1ght], [PSL1GHT], "yes")
# GL SDL
EXPEDITE_CHECK_ENGINE([opengl-sdl], [OpenGL SDL], "yes")
# FB
EXPEDITE_CHECK_ENGINE([fb], [Framebuffer], "yes")
# DIRECTFB
EXPEDITE_CHECK_ENGINE([directfb], [DirectFB], "yes")
# GL Cocoa
EXPEDITE_CHECK_ENGINE([opengl-cocoa], [OpenGL Cocoa], "yes", [gl_cocoa_libs="-framework Cocoa"])
AC_SUBST(gl_cocoa_libs)
# 16bit WinCE
EXPEDITE_CHECK_ENGINE([software-16-wince], [Software 16 bits WinCE], "yes", [wince_16_libs="-laygshell"])
AC_SUBST(wince_16_libs)
# DRM
EXPEDITE_CHECK_ENGINE([drm], [Drm], "no")
### Checks for programs
AC_ISC_POSIX
@ -128,74 +48,13 @@ case "$host_os" in
;;
esac
# Eina
# EFL dependencies
PKG_CHECK_MODULES([EINA], eina >= 1.7.99 eo >= 1.7.99)
PKG_CHECK_MODULES([EFL], eina >= 1.7.99 eo >= 1.7.99 evas >= 1.7.99 eet >= 1.7.99 ecore-evas >= 1.7.99 ecore >= 1.7.99)
EFL_ENABLE_EO_API_SUPPORT
EFL_ENABLE_BETA_API_SUPPORT
# Evas
PKG_CHECK_MODULES([EVAS], evas >= 1.7.99 eet >= 1.7.99)
# Xlib
if test "x$have_software_xlib" = "xyes" -o "x$have_xrender_x11" = "xyes" -o "x$have_opengl_x11" = "xyes"; then
AC_PATH_XTRA
AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],
[have_xlib="yes"],
[have_xlib="no"])
if test "x$want_evas_simple_x11" = "xyes"; then
x_libs="${x_libs} -lX11"
else
x_dir=${x_dir:-/usr/X11R6}
x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11"
fi
fi
AM_CONDITIONAL(BUILD_X11, [test "x$have_xlib" = "xyes"])
AC_SUBST(x_cflags)
AC_SUBST(x_libs)
# XCB
if test "x$have_software_xcb" = "xyes"; then
PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms], [have_xcb="yes"], [have_xcb="no"])
fi
AM_CONDITIONAL(BUILD_XCB, test "x$have_xcb" = "xyes")
if test "x$have_xcb" = "xyes"; then
AC_DEFINE(BUILD_XCB, 1, [build xcb support])
fi
# SDL
PKG_CHECK_MODULES([SDL], [sdl], [have_sdl="yes"], [have_sdl="no"])
AM_CONDITIONAL(BUILD_SDL, test "x$have_sdl" = "xyes")
if test "x$have_sdl" = "xyes"; then
AC_DEFINE(BUILD_SDL, 1, [build sdl support])
fi
# PSL1GHT
AM_CONDITIONAL(BUILD_PSL1GHT, test "x$have_psl1ght" = "xyes")
# DirectFB
if test "x$have_directfb" = "xyes"; then
PKG_CHECK_MODULES([DIRECTFB], [directfb], [have_directfb="yes"], [have_directfb="no"])
fi
AM_CONDITIONAL(BUILD_DIRECTFB, test "x$have_directfb" = "xyes")
# Wayland
EXPEDITE_CHECK_ENGINE([wayland-shm], [Wayland SHM], "no")
EXPEDITE_CHECK_ENGINE([wayland-egl], [Wayland EGL], "no")
have_wl="no"
if test "x$have_wayland_shm" = "xyes" -o "x$have_wayland_egl" = "xyes"; then
PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client], [have_wl="yes"], [have_wl="no"])
fi
AM_CONDITIONAL(BUILD_WAYLAND, test "x$have_wl" = "xyes")
### Checks for header files
@ -266,25 +125,6 @@ data/Makefile
echo
echo " $PACKAGE $VERSION"
echo
echo " Engines:"
echo " Software X11.................: ${have_software_x11} (Xlib: ${have_software_xlib}) (XCB: ${have_software_xcb})"
echo " X Render X11.................: ${have_xrender_x11}"
echo " Open GL X11..................: ${have_opengl_x11}"
echo " X Render XCB.................: ${have_xrender_xcb}"
echo " Software GDI.................: ${have_software_gdi}"
echo " Software DirectDraw..........: ${have_software_ddraw}"
echo " Direct3D.....................: ${have_direct3d}"
echo " Software SDL.................: ${have_software_sdl}"
echo " Open GL SDL..................: ${have_opengl_sdl}"
echo " Open GL Cocoa................: ${have_opengl_cocoa}"
echo " FB...........................: ${have_fb}"
echo " DirectFB.....................: ${have_directfb}"
echo " PSL1GHT......................: ${have_psl1ght}"
echo " Software WinCE 16 bits.......: ${have_software_16_wince}"
echo " Wayland EGL..................: ${have_wayland_egl}"
echo " Wayland SHM..................: ${have_wayland_shm}"
echo " DRM..........................: ${have_drm}"
echo
echo " Installation:"
echo " prefix.......................: ${prefix}"
echo

View File

@ -6,12 +6,7 @@ AM_CPPFLAGS = \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EINA_CFLAGS@ \
@EVAS_CFLAGS@ \
@x_cflags@ \
@SDL_CFLAGS@ \
@DIRECTFB_CFLAGS@ \
@XCB_CFLAGS@ \
@EFL_CFLAGS@ \
@EVIL_CFLAGS@
bin_PROGRAMS = expedite
@ -134,106 +129,11 @@ font_effect_blur_color.c
# image_mask_14.c \
# image_mask_15.c
expedite_CFLAGS = @WIN32_CFLAGS@ @WAYLAND_CLIENT_CFLAGS@
expedite_CFLAGS = @WIN32_CFLAGS@
expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @d3d_libs@ @wince_16_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ @gl_cocoa_libs@ @WAYLAND_CLIENT_LIBS@ -lm
expedite_LDADD = @EFL_LIBS@ @EVIL_LIBS@ -lm
expedite_LDFLAGS = @lt_enable_auto_import@
if BUILD_SOFTWARE_XLIB
expedite_SOURCES += \
engine_software_xlib.c engine_software_xlib.h
endif
if BUILD_XRENDER_X11
expedite_SOURCES += \
engine_xrender_x11.c engine_xrender_x11.h
endif
if BUILD_OPENGL_X11
expedite_SOURCES += \
engine_gl_x11.c engine_gl_x11.h
endif
if BUILD_SOFTWARE_XCB
expedite_SOURCES += \
engine_software_xcb.c engine_software_xcb.h
endif
if BUILD_XRENDER_XCB
expedite_SOURCES += \
engine_xrender_xcb.c engine_xrender_xcb.h
endif
if BUILD_SOFTWARE_GDI
expedite_SOURCES += \
engine_software_gdi.c engine_software_gdi.h
endif
if BUILD_SOFTWARE_DDRAW
expedite_SOURCES += \
engine_software_ddraw.cpp engine_software_ddraw.h
endif
if BUILD_DIRECT3D
expedite_SOURCES += \
engine_direct3d.cpp engine_direct3d.h
endif
if BUILD_SDL
expedite_SOURCES += \
engine_software_sdl.c engine_software_sdl.h
endif
if BUILD_OPENGL_SDL
expedite_SOURCES += \
engine_gl_sdl.c engine_gl_sdl.h
endif
if BUILD_PSL1GHT
expedite_SOURCES += \
engine_psl1ght.c
endif
if BUILD_FB
expedite_SOURCES += \
engine_fb.c engine_fb.h
endif
if BUILD_DIRECTFB
expedite_SOURCES += \
engine_directfb.c engine_directfb.h
endif
if BUILD_OPENGL_COCOA
expedite_SOURCES += \
engine_gl_cocoa.m engine_gl_cocoa.h
endif
if BUILD_SOFTWARE_16_WINCE
expedite_SOURCES += \
engine_software_16_wince.c engine_software_16_wince.h engine_software_16_wince.rc
endif
if BUILD_WAYLAND
expedite_SOURCES += \
engine_wayland_common.c engine_wayland_common.h
endif
if BUILD_WAYLAND_EGL
expedite_SOURCES += \
engine_wayland_egl.c engine_wayland_egl.h
endif
if BUILD_WAYLAND_SHM
expedite_SOURCES += \
engine_wayland_shm.c engine_wayland_shm.h
endif
if BUILD_DRM
expedite_SOURCES += \
engine_drm.c engine_drm.h
endif
.rc.lo:
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@

View File

@ -1,20 +0,0 @@
#ifndef __ENGINE_DIRECT3D_H__
#define __ENGINE_DIRECT3D_H__
#ifdef __cplusplus
extern "C" {
#endif
Eina_Bool engine_direct3d_args(const char *engine, int width, int height);
void engine_direct3d_loop(void);
void engine_direct3d_shutdown(void);
#ifdef __cplusplus
}
#endif
#endif /* __ENGINE_DIRECT3D_H__ */

View File

@ -1,277 +0,0 @@
#include "main.h"
#include <Evas_Engine_DirectFB.h>
static IDirectFB *_dfb;
static IDirectFBEventBuffer *_window_event;
static IDirectFBEventBuffer *_input_event;
static IDirectFBDisplayLayer *_layer;
static DFBResult _err;
static IDirectFBWindow *_dfb_window;
static IDirectFBSurface *_dfb_surface;
#define DBG(...) do {} while (0)
//#define DBG(...) fprintf(stderr, __VA_ARGS__)
#define DFBCHECK(x...) \
{ \
_err = x; \
if (_err != DFB_OK) { \
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
DirectFBErrorFatal( #x, _err ); \
} \
}
Eina_Bool
engine_directfb_args(const char *engine, int width, int height)
{
Evas_Engine_Info_DirectFB *einfo;
DFBWindowDescription desc;
int i;
evas_output_method_set(evas, evas_render_method_lookup("directfb"));
einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the DirectFB Engine\n");
return EINA_FALSE;
}
DFBCHECK(DirectFBInit(NULL, NULL));
DFBCHECK(DirectFBCreate(&_dfb));
DFBCHECK(_dfb->GetDisplayLayer(_dfb, DLID_PRIMARY, &_layer));
DFBCHECK(_dfb->CreateEventBuffer(_dfb, &_window_event));
DFBCHECK(_dfb->CreateInputEventBuffer(_dfb, DICAPS_ALL, DFB_FALSE, &_input_event));
memset(&desc, 0, sizeof(DFBWindowDescription));
desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT);
desc.posx = 0;
desc.posy = 0;
desc.width = width;
desc.height = height;
desc.pixelformat = DSPF_ARGB;
DFBCHECK(_layer->CreateWindow(_layer, &desc, &_dfb_window));
DFBCHECK(_dfb_window->AttachEventBuffer(_dfb_window, _window_event));
DFBCHECK(_dfb_window->SetOptions(_dfb_window, DWOP_NONE));
DFBCHECK(_dfb_window->SetOpacity(_dfb_window, 0xFF));
DFBCHECK(_dfb_window->GetSurface(_dfb_window, &_dfb_surface));
DFBCHECK(_dfb_surface->SetPorterDuff(_dfb_surface, DSPD_SRC_OVER));
einfo->info.dfb = _dfb;
einfo->info.surface = _dfb_surface;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the DirectFB Engine\n");
return EINA_FALSE;
}
return EINA_TRUE;
}
static void
engine_directfb_quit(void)
{
DFBCHECK(_input_event->Release(_input_event));
DFBCHECK(_window_event->Release(_window_event));
DFBCHECK(_dfb_surface->Release(_dfb_surface));
DFBCHECK(_dfb_window->Release(_dfb_window));
DFBCHECK(_layer->Release(_layer));
DFBCHECK(_dfb->Release(_dfb));
evas_engine_info_set(evas, NULL);
engine_abort();
}
static const char *
key_string(DFBInputDeviceKeySymbol sym)
{
switch (sym)
{
case DIKS_ESCAPE:
{
static const char k[] = "Escape";
return k;
}
case DIKS_RETURN:
{
static const char k[] = "Return";
return k;
}
case DIKS_CURSOR_LEFT:
{
static const char k[] = "Left";
return k;
}
case DIKS_CURSOR_RIGHT:
{
static const char k[] = "Right";
return k;
}
default:
{
static char k[2];
k[0] = (char)sym;
k[1] = 0;
return k;
}
}
}
static void
engine_directfb_event_window(const DFBWindowEvent *ev)
{
DBG("===> Window Event (type=%#10x, window=%d) <===\n",
ev->type, ev->window_id);
if (ev->type & DWET_POSITION)
{
DBG("\tDWET_POSITION %d, %d\n", ev->x, ev->y);
}
if (ev->type & DWET_SIZE)
{
DBG("\tDWET_SIZE %dx%d\n", ev->w, ev->h);
evas_output_viewport_set(evas, 0, 0,
ev->w, ev->h);
evas_output_size_set(evas, ev->w, ev->h);
win_w = ev->w;
win_h = ev->h;
}
if (ev->type & DWET_CLOSE)
{
DBG("\tDWET_CLOSE\n");
engine_directfb_quit();
}
if (ev->type & DWET_DESTROYED)
{
DBG("\tDWET_DESTROYED\n");
engine_directfb_quit();
}
if (ev->type & DWET_GOTFOCUS)
{
DBG("\tDWET_GOTFOCUS\n");
}
if (ev->type & DWET_LOSTFOCUS)
{
DBG("\tDWET_LOSTFOCUS\n");
}
if (ev->type & DWET_KEYDOWN)
{
const char *k;
k = key_string(ev->key_symbol);
DBG("\tDWET_KEYDOWN key_symbol=%s\n", k);
if (k)
evas_event_feed_key_down(evas, k, k, NULL, NULL, 0, NULL);
}
if (ev->type & DWET_KEYUP)
{
const char *k;
k = key_string(ev->key_symbol);
DBG("\tDWET_KEYUP key_symbol=%s\n", k);
if (k)
evas_event_feed_key_up(evas, k, k, NULL, NULL, 0, NULL);
}
if (ev->type & DWET_BUTTONDOWN)
{
DBG("\tDWET_BUTTONDOWN pos=(%d, %d) cur_pos=(%d, %d) "
"button=%#x buttons=%#x\n",
ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons);
evas_event_feed_mouse_move(evas, ev->cx, ev->cy, 0, NULL);
evas_event_feed_mouse_down(evas, ev->button, EVAS_BUTTON_NONE, 0, NULL);
}
if (ev->type & DWET_BUTTONUP)
{
DBG("\tDWET_BUTTONUP pos=(%d, %d) cur_pos=(%d, %d) "
"button=%#x buttons=%#x\n",
ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons);
evas_event_feed_mouse_move(evas, ev->cx, ev->cy, 0, NULL);
evas_event_feed_mouse_up(evas, ev->button, EVAS_BUTTON_NONE, 0, NULL);
}
if (ev->type & DWET_MOTION)
{
DBG("\tDWET_MOTION pos=(%d, %d) cur_pos=(%d, %d) buttons=%#x\n",
ev->x, ev->y, ev->cx, ev->cy, ev->buttons);
/* Mouse Motion Compression [tm] */
_layer->GetCursorPosition( _layer, (int*)&ev->x, (int*)&ev->y );
evas_event_feed_mouse_move(evas, ev->x, ev->y, 0, NULL);
}
if (ev->type & DWET_LEAVE)
{
DBG("\tDWET_LEAVE pos=(%d, %d) cur_pos=(%d, %d)\n",
ev->x, ev->y, ev->cx, ev->cy);
evas_event_feed_mouse_out(evas, 0, NULL);
}
if (ev->type & DWET_ENTER)
{
DBG("\tDWET_ENTER pos=(%d, %d) cur_pos=(%d, %d)\n",
ev->x, ev->y, ev->cx, ev->cy);
evas_event_feed_mouse_in(evas, 0, NULL);
}
if (ev->type & DWET_WHEEL)
{
DBG("\tDWET_WHEEL step=%d\n", ev->step);
}
DBG("\n");
}
void
engine_directfb_loop(void)
{
DFBEvent ev;
while ((_input_event->GetEvent(_input_event, &ev) == DFB_OK) ||
(_window_event->GetEvent(_window_event, &ev) == DFB_OK))
{
DBG("got dfb input event %d\n", ev.clazz);
switch (ev.clazz)
{
case DFEC_NONE:
DBG("No event?\n");
break;
case DFEC_INPUT:
DBG("Input\n");
break;
case DFEC_WINDOW:
engine_directfb_event_window((const DFBWindowEvent *)&ev);
break;
case DFEC_USER:
DBG("User\n");
break;
case DFEC_UNIVERSAL:
DBG("Universal\n");
break;
}
}
}
void
engine_directfb_shutdown(void)
{
DFBCHECK(_input_event->Release(_input_event));
DFBCHECK(_window_event->Release(_window_event));
DFBCHECK(_dfb_surface->Release(_dfb_surface));
DFBCHECK(_dfb_window->Release(_dfb_window));
DFBCHECK(_layer->Release(_layer));
DFBCHECK(_dfb->Release(_dfb));
}

View File

@ -1,8 +0,0 @@
#ifndef ENGINE_DIRECTFB_H
#define ENGINE_DIRECTFB_H
Eina_Bool engine_directfb_args(const char *engine, int width, int height);
void engine_directfb_loop(void);
void engine_directfb_shutdown(void);
#endif

View File

@ -1,49 +0,0 @@
#include "main.h"
#include <Evas_Engine_Drm.h>
Eina_Bool
engine_drm_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__)
{
Evas_Engine_Info_Drm *einfo;
evas_output_method_set(evas, evas_render_method_lookup("drm"));
einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the Drm Engine\n");
return EINA_FALSE;
}
/* setup drm props in such a way so that evas itself will handle doing
* the drm card init, etc, etc because we are not using ecore_evas here */
einfo->info.fd = -1;
einfo->info.tty = -1;
einfo->info.output = -1;
einfo->info.plane = -1;
einfo->info.rotation = 0;
einfo->info.depth = 32;
einfo->info.destination_alpha = EINA_FALSE;
einfo->info.vsync = EINA_FALSE;
einfo->info.use_hw_accel = EINA_TRUE;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo))
{
printf("Evas could not setup the information for the Drm Engine\n");
return EINA_FALSE;
}
return EINA_TRUE;
}
void
engine_drm_loop(void)
{
}
void
engine_drm_shutdown(void)
{
}

View File

@ -1,8 +0,0 @@
#ifndef ENGINE_DRM_H
#define ENGINE_DRM_H
Eina_Bool engine_drm_args(const char *engine, int width, int height);
void engine_drm_loop(void);
void engine_drm_shutdown(void);
#endif

View File

@ -1,42 +0,0 @@
#include "main.h"
#include <Evas_Engine_FB.h>
Eina_Bool
engine_fb_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__)
{
Evas_Engine_Info_FB *einfo;
evas_output_method_set(evas, evas_render_method_lookup("fb"));
einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the FB Engine\n");
return EINA_FALSE;
}
einfo->info.virtual_terminal = 0;
einfo->info.device_number = 0;
einfo->info.device_number = 0;
einfo->info.refresh = 0;
einfo->info.rotation = 0;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the FB Engine\n");
return EINA_FALSE;
}
return EINA_TRUE;
}
void
engine_fb_loop(void)
{
return;
}
void
engine_fb_shutdown(void)
{
return;
}

View File

@ -1,8 +0,0 @@
#ifndef ENGINE_FB_H
#define ENGINE_FB_H
Eina_Bool engine_fb_args(const char *engine, int width, int height);
void engine_fb_loop(void);
void engine_fb_shutdown(void);
#endif

View File

@ -1,8 +0,0 @@
#ifndef ENGINE_GL_COCOA_H
#define ENGINE_GL_COCOA_H
int engine_gl_cocoa_args(int argc, char **argv);
void engine_gl_cocoa_loop(void);
void engine_gl_cocoa_shutdown(void);
#endif

View File

@ -1,174 +0,0 @@
#include <assert.h>
#include "main.h"
#include <Evas_Engine_GL_SDL.h>
Eina_Bool
engine_gl_sdl_args(const char *engine, int width, int height)
{
Evas_Engine_Info_GL_SDL *einfo;
int i;
evas_output_method_set(evas, evas_render_method_lookup("gl_sdl"));
einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas wasn't build with GL SDL backend.\n");
return EINA_FALSE;
}
/* the following is specific to the engine */
einfo->flags.fullscreen = fullscreen;
einfo->flags.noframe = 0;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas could not initialize the GL SDL Engine\n");
return EINA_FALSE;
}
return EINA_TRUE;
}
void
engine_gl_sdl_loop(void)
{
SDL_Event event;
while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_MOUSEMOTION:
evas_event_feed_mouse_move(evas, event.motion.x, event.motion.y, 0, NULL);
break;
case SDL_MOUSEBUTTONDOWN:
evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL);
evas_event_feed_mouse_down(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case SDL_MOUSEBUTTONUP:
evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL);
evas_event_feed_mouse_up(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case SDL_VIDEORESIZE:
evas_output_viewport_set(evas, 0, 0,
event.resize.w, event.resize.w);
evas_output_size_set(evas, event.resize.w, event.resize.w);
evas_output_size_get(evas, &win_w, &win_h);
break;
case SDL_VIDEOEXPOSE:
evas_output_size_get(evas, &win_w, &win_h);
evas_damage_rectangle_add(evas, 0, 0, win_w, win_h);
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym)
{
case SDLK_LSHIFT:
case SDLK_RSHIFT:
evas_key_modifier_on(evas, "Shift");
break;
case SDLK_RCTRL:
case SDLK_LCTRL:
evas_key_modifier_on(evas, "Control");
break;
case SDLK_MENU:
case SDLK_RALT:
case SDLK_LALT:
evas_key_modifier_on(evas, "Alt");
break;
case SDLK_LSUPER:
case SDLK_RSUPER:
evas_key_modifier_on(evas, "Super");
break;
case SDLK_CAPSLOCK:
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_key_lock_off(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
break;
case SDLK_NUMLOCK:
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
evas_key_lock_off(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
break;
case SDLK_SCROLLOCK:
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
evas_key_lock_off(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
break;
case SDLK_s:
case SDLK_ESCAPE:
evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
break;
case SDLK_KP_ENTER:
case SDLK_RETURN:
evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL);
break;
case SDLK_LEFT: evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
case SDLK_RIGHT: evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
case SDLK_q:
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
else
evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
break;
default:
break;
}
break;
case SDL_KEYUP:
switch (event.key.keysym.sym)
{
case SDLK_LSHIFT:
case SDLK_RSHIFT:
evas_key_modifier_off(evas, "Shift");
break;
case SDLK_RCTRL:
case SDLK_LCTRL:
evas_key_modifier_off(evas, "Control");
break;
case SDLK_MENU:
case SDLK_RALT:
case SDLK_LALT:
evas_key_modifier_off(evas, "Alt");
break;
case SDLK_LSUPER:
case SDLK_RSUPER:
evas_key_modifier_off(evas, "Super");
break;
case SDLK_ESCAPE: evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); break;
case SDLK_RETURN: evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); break;
case SDLK_LEFT: evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); break;
case SDLK_RIGHT: evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); break;
case SDLK_q:
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
else
evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
break;
default:
break;
}
break;
case SDL_QUIT:
case SDL_SYSWMEVENT:
case SDL_USEREVENT:
case SDL_ACTIVEEVENT:
case SDL_JOYAXISMOTION:
case SDL_JOYBALLMOTION:
case SDL_JOYHATMOTION:
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
default:
break;
}
}
}
void
engine_gl_sdl_shutdown(void)
{
}

View File

@ -1,8 +0,0 @@
#ifndef ENGINE_GL_SDL_H
#define ENGINE_GL_SDL_H
Eina_Bool engine_gl_sdl_args(const char *engine, int width, int height);
void engine_gl_sdl_loop(void);
void engine_gl_sdl_shutdown(void);
#endif

View File

@ -1,223 +0,0 @@
#include "main.h"
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <Evas_Engine_GL_X11.h>
static Display *disp = NULL;
static Window win = 0;
static int first_expose = 0;
Eina_Bool
engine_gl_x11_args(const char *engine __UNUSED__, int width, int height)
{
XSetWindowAttributes attr;
XClassHint chint;
XSizeHints szhints;
Evas_Engine_Info_GL_X11 *einfo;
disp = XOpenDisplay(NULL);
if (!disp) return EINA_FALSE;
evas_output_method_set(evas, evas_render_method_lookup("gl_x11"));
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the OpenGL X11 Engine\n");
goto close_display;
}
einfo->info.display = disp;
einfo->info.screen = DefaultScreen(einfo->info.display);
einfo->info.visual = einfo->func.best_visual_get(einfo);
einfo->info.colormap = einfo->func.best_colormap_get(einfo);
einfo->info.depth = einfo->func.best_depth_get(einfo);
attr.backing_store = NotUseful;
attr.colormap = einfo->info.colormap;
attr.border_pixel = 0;
attr.background_pixmap = None;
attr.event_mask =
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
KeyPressMask | KeyReleaseMask;
attr.bit_gravity = ForgetGravity;
win = XCreateWindow(disp, DefaultRootWindow(disp),
0, 0, width, height, 0,
einfo->info.depth, InputOutput,
einfo->info.visual,
CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
if (!win)
goto close_display;
einfo->info.drawable = win;
if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo))
{
printf("Evas can not setup the informations of the OpenGL X11 Engine\n");
goto destroy_window;
}
if (fullscreen)
{
Atom prop = XInternAtom(disp, "_NET_WM_STATE", False);
Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
unsigned long data = state;
XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace,
(unsigned char*) &data, 1);
}
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";
chint.res_class = "Expedite";
XSetClassHint(disp, win, &chint);
szhints.flags = PMinSize | PMaxSize | PSize | USSize;
szhints.min_width = szhints.max_width = width;
szhints.min_height = szhints.max_height = height;
XSetWMNormalHints(disp, win, &szhints);
XMapWindow(disp, win);
XSync(disp, False);
while (!first_expose)
engine_gl_x11_loop();
return EINA_TRUE;
destroy_window:
XDestroyWindow(disp, win);
close_display:
XCloseDisplay(disp);
return EINA_FALSE;
}
void
engine_gl_x11_loop(void)
{
XEvent ev;
KeySym ks;
char *kstr;
again:
if (!XCheckMaskEvent(disp,
ExposureMask |
StructureNotifyMask |
KeyPressMask |
KeyReleaseMask |
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask |
EnterWindowMask |
LeaveWindowMask, &ev))
return;
switch (ev.type)
{
case ButtonPress:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case ButtonRelease:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case MotionNotify:
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
break;
case Expose:
first_expose = 1;
evas_damage_rectangle_add(evas,
ev.xexpose.x,
ev.xexpose.y,
ev.xexpose.width,
ev.xexpose.height);
break;
case ConfigureNotify:
evas_output_viewport_set(evas, 0, 0,
ev.xconfigure.width,
ev.xconfigure.height);
evas_output_size_set(evas,
ev.xconfigure.width,
ev.xconfigure.height);
win_w = ev.xconfigure.width;
win_h = ev.xconfigure.height;
break;
case EnterNotify:
evas_event_feed_mouse_in(evas, 0, NULL);
break;
case LeaveNotify:
evas_event_feed_mouse_out(evas, 0, NULL);
break;
case KeyPress:
ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_on(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_on(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_on(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_on(evas, "Super");
if (!strcmp(kstr, "Caps_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_key_lock_off(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
}
if (!strcmp(kstr, "Num_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
evas_key_lock_off(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
}
if (!strcmp(kstr, "Scroll_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
evas_key_lock_off(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
}
if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
case KeyRelease:
ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_off(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_off(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_off(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_off(evas, "Super");
evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
default:
break;
}
goto again;
}
void
engine_gl_x11_shutdown(void)
{
XDestroyWindow(disp, win);
XCloseDisplay(disp);
}

View File

@ -1,8 +0,0 @@
#ifndef ENGINE_GL_X11_H
#define ENGINE_GL_X11_H
Eina_Bool engine_gl_x11_args(const char *engine, int width, int height);
void engine_gl_x11_loop(void);
void engine_gl_x11_shutdown(void);
#endif

View File

@ -1,284 +0,0 @@
#include "main.h"
#include <Evas_Engine_PSL1GHT.h>
#include <io/mouse.h>
#include <io/kb.h>
static int window_width = 0;
static int window_height = 0;
Eina_Bool
engine_psl1ght_args(const char *engine, int width, int height)
{
Evas_Engine_Info_PSL1GHT *einfo;
evas_output_method_set(evas, evas_render_method_lookup("psl1ght"));
einfo = (Evas_Engine_Info_PSL1GHT *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the PSL1GHT Engine\n");
return EINA_FALSE;
}
if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo))
{
printf("Evas can not setup the informations of the PSL1GHT Engine\n");
return EINA_FALSE;
}
window_width = width;
window_height = height;
ioMouseInit(1);
ioKbInit(1);
return EINA_TRUE;
}
void
engine_psl1ght_loop(void)
{
mouseInfo mouseinfo;
static int mouse_connected = FALSE;
static u8 mouse_buttons = 0;
static int mouse_x = 0;
static int mouse_y = 0;
KbInfo kbInfo;
static int keyboard_connected = FALSE;
static KbLed keyboard_leds = {{0}};
static KbMkey keyboard_mods = {{0}};
static u16 keyboard_old_key = 0;
int i;
/* Check mouse events */
ioMouseGetInfo(&mouseinfo);
if (mouseinfo.status[0] == 1 && !mouse_connected) // Connected
{
mouse_connected = TRUE;
mouse_buttons = 0;
// Old events in the queue are discarded
ioMouseClearBuf(0);
}
else if (mouseinfo.status[0] != 1 && mouse_connected) // Disconnected
{
mouse_connected = FALSE;
mouse_buttons = 0;
}
if (mouse_connected)
{
mouseDataList datalist;
ioMouseGetDataList(0, &datalist);
for (i = 0; i < datalist.count; i++) {
u8 old_left = mouse_buttons & 1;
u8 new_left = datalist.list[i].buttons & 1;
u8 old_right = mouse_buttons & 2;
u8 new_right = datalist.list[i].buttons & 2;
u8 old_middle = mouse_buttons & 4;
u8 new_middle = datalist.list[i].buttons & 4;
mouse_x += datalist.list[i].x_axis;
mouse_y += datalist.list[i].y_axis;
if (mouse_x < 0) mouse_x = 0;
if (mouse_y < 0) mouse_y = 0;
if (mouse_x > window_width) mouse_x = window_width;
if (mouse_y > window_height) mouse_x = window_height;
evas_event_feed_mouse_move(evas, mouse_x, mouse_y, 0, NULL);
if (old_left != new_left)
{
if (new_left)
evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
else
evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
}
if (old_right != new_right)
{
if (new_right)
evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
else
evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL);
}
if (old_middle != new_middle)
{
if (new_middle)
evas_event_feed_mouse_down(evas, 2, EVAS_BUTTON_NONE, 0, NULL);
else
evas_event_feed_mouse_up(evas, 2, EVAS_BUTTON_NONE, 0, NULL);
}
mouse_buttons = datalist.list[i].buttons;
}
}
/* Check keyboard events */
ioKbGetInfo(&kbInfo);
if (kbInfo.status[0] == 1 && !keyboard_connected)
{
/* Connected */
keyboard_connected = true;
// Old events in the queue are discarded
ioKbClearBuf(0);
keyboard_leds._KbLedU.leds = 0;
keyboard_mods._KbMkeyU.mkeys = 0;
keyboard_old_key = 0;
// Set raw keyboard code types to get scan codes
ioKbSetCodeType(0, KB_CODETYPE_ASCII);
ioKbSetReadMode(0, KB_RMODE_INPUTCHAR);
}
else if (kbInfo.status[0] != 1 && keyboard_connected)
{
/* Disconnected keyboard */
keyboard_connected = FALSE;
}
if (keyboard_connected)
{
KbData Keys;
// Read data from the keyboard buffer
if (ioKbRead(0, &Keys) == 0 && Keys.nb_keycode > 0)
{
if (Keys.mkey._KbMkeyU._KbMkeyS.l_shift !=
keyboard_mods._KbMkeyU._KbMkeyS.l_shift ||
Keys.mkey._KbMkeyU._KbMkeyS.r_shift !=
keyboard_mods._KbMkeyU._KbMkeyS.r_shift)
{
if (Keys.mkey._KbMkeyU._KbMkeyS.r_shift ||
Keys.mkey._KbMkeyU._KbMkeyS.l_shift)
evas_key_modifier_on(evas, "Shift");
else
evas_key_modifier_off(evas, "Shift");
}
if (Keys.mkey._KbMkeyU._KbMkeyS.l_ctrl !=
keyboard_mods._KbMkeyU._KbMkeyS.l_ctrl ||
Keys.mkey._KbMkeyU._KbMkeyS.r_ctrl !=
keyboard_mods._KbMkeyU._KbMkeyS.r_ctrl)
{
if (Keys.mkey._KbMkeyU._KbMkeyS.r_ctrl ||
Keys.mkey._KbMkeyU._KbMkeyS.l_ctrl)
evas_key_modifier_on(evas, "Control");
else
evas_key_modifier_off(evas, "Control");
}
if (Keys.mkey._KbMkeyU._KbMkeyS.l_alt !=
keyboard_mods._KbMkeyU._KbMkeyS.l_alt ||
Keys.mkey._KbMkeyU._KbMkeyS.r_alt !=
keyboard_mods._KbMkeyU._KbMkeyS.r_alt)
{
if (Keys.mkey._KbMkeyU._KbMkeyS.r_alt ||
Keys.mkey._KbMkeyU._KbMkeyS.l_alt)
evas_key_modifier_on(evas, "Alt");
else
evas_key_modifier_off(evas, "Alt");
}
if (Keys.mkey._KbMkeyU._KbMkeyS.l_win !=
keyboard_mods._KbMkeyU._KbMkeyS.l_win ||
Keys.mkey._KbMkeyU._KbMkeyS.r_win !=
keyboard_mods._KbMkeyU._KbMkeyS.r_win)
{
if (Keys.mkey._KbMkeyU._KbMkeyS.r_win ||
Keys.mkey._KbMkeyU._KbMkeyS.l_win)
evas_key_modifier_on(evas, "Super");
else
evas_key_modifier_off(evas, "Super");
}
keyboard_mods = Keys.mkey;
if (Keys.led._KbLedU._KbLedS.num_lock !=
keyboard_leds._KbLedU._KbLedS.num_lock)
{
if (Keys.led._KbLedU._KbLedS.num_lock)
evas_key_lock_on(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
}
if (Keys.led._KbLedU._KbLedS.caps_lock !=
keyboard_leds._KbLedU._KbLedS.caps_lock)
{
if (Keys.led._KbLedU._KbLedS.caps_lock)
evas_key_lock_on(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
}
if (Keys.led._KbLedU._KbLedS.scroll_lock !=
keyboard_leds._KbLedU._KbLedS.scroll_lock)
{
if (Keys.led._KbLedU._KbLedS.scroll_lock)
evas_key_lock_on(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
}
keyboard_leds = Keys.led;
for (i = 0; i < Keys.nb_keycode; i++) {
if (Keys.keycode[i] != keyboard_old_key)
{
u16 key = Keys.keycode[i];
char *key_str = NULL;
if (key == 0)
key = keyboard_old_key;
key_str = (char *)&key;
printf ("Key %d is %X\n", i, key);
key &= ~KB_KEYPAD;
if (key & KB_RAWDAT)
{
key &= 0xFF;
if (key == KB_RAWKEY_ESCAPE)
key_str = "Escape";
else if (key == KB_RAWKEY_ENTER)
key_str = "Return";
else if (key == KB_RAWKEY_UP_ARROW)
key_str = "Up";
else if (key == KB_RAWKEY_DOWN_ARROW)
key_str = "Down";
else if (key == KB_RAWKEY_LEFT_ARROW)
key_str = "Left";
else if (key == KB_RAWKEY_RIGHT_ARROW)
key_str = "Right";
else
key_str = NULL;
}
else {
if (key == 0x0A)
key_str = "Return";
else {
key_str[0] = key_str[1];
key_str[1] = 0;
}
}
if (key_str)
{
if (Keys.keycode[i] != 0)
{
printf ("Key %s pressed\n", key_str);
evas_event_feed_key_up(evas, key_str, key_str, NULL, NULL, 0, NULL);
}
else {
evas_event_feed_key_down(evas, key_str, key_str, NULL, NULL, 0, NULL);
printf ("Key %s released\n", key_str);
}
}
keyboard_old_key = Keys