diff --git a/client/include/app.h b/client/include/app.h index ac4d69ea..c683b4f4 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -58,9 +58,12 @@ void app_setFullscreen(bool fs); bool app_getFullscreen(void); bool app_getProp(LG_DSProperty prop, void * ret); +#ifdef ENABLE_EGL EGLDisplay app_getEGLDisplay(void); EGLNativeWindowType app_getEGLNativeWindow(void); void app_eglSwapBuffers(EGLDisplay display, EGLSurface surface); +#endif + void app_glSwapBuffers(void); void app_clipboardRelease(void); diff --git a/client/include/interface/displayserver.h b/client/include/interface/displayserver.h index 8d734b4d..7d4f0e10 100644 --- a/client/include/interface/displayserver.h +++ b/client/include/interface/displayserver.h @@ -136,35 +136,42 @@ struct LG_DisplayServerOps bool (*getFullscreen)(void); void (*setFullscreen)(bool fs); - /* clipboard support */ + /* clipboard support, optional, if not supported set to NULL */ bool (*cbInit)(void); void (*cbNotice)(LG_ClipboardData type); void (*cbRelease)(void); void (*cbRequest)(LG_ClipboardData type); }; -#define IS_LG_DS_VALID(x) \ - ((x)->probe && \ - (x)->earlyInit && \ - (x)->init && \ - (x)->startup && \ - (x)->shutdown && \ - (x)->free && \ - (x)->getProp && \ - (x)->getEGLDisplay && \ - (x)->getEGLNativeWindow && \ - (x)->eglSwapBuffers && \ - (x)->glSwapBuffers && \ - (x)->showPointer && \ - (x)->grabPointer && \ - (x)->ungrabPointer && \ - (x)->warpPointer && \ - (x)->realignPointer && \ - (x)->isValidPointerPos && \ - (x)->inhibitIdle && \ - (x)->uninhibitIdle && \ - (x)->wait && \ - (x)->setWindowSize && \ - (x)->setFullscreen && \ - (x)->getFullscreen) +#ifdef ENABLE_EGL + #define ASSERT_EGL_FN(x) assert(x); +#else + #define ASSERT_EGL_FN(x) +#endif + +#define ASSERT_LG_DS_VALID(x) \ + assert((x)->probe ); \ + assert((x)->earlyInit ); \ + assert((x)->init ); \ + assert((x)->startup ); \ + assert((x)->shutdown ); \ + assert((x)->free ); \ + assert((x)->getProp ); \ + ASSERT_EGL_FN((x)->getEGLDisplay ); \ + ASSERT_EGL_FN((x)->getEGLNativeWindow ); \ + ASSERT_EGL_FN((x)->eglSwapBuffers ); \ + assert((x)->glSwapBuffers ); \ + assert((x)->showPointer ); \ + assert((x)->grabPointer ); \ + assert((x)->ungrabPointer ); \ + assert((x)->warpPointer ); \ + assert((x)->realignPointer ); \ + assert((x)->isValidPointerPos ); \ + assert((x)->inhibitIdle ); \ + assert((x)->uninhibitIdle ); \ + assert((x)->wait ); \ + assert((x)->setWindowSize ); \ + assert((x)->setFullscreen ); \ + assert((x)->getFullscreen ); + #endif diff --git a/client/src/app.c b/client/src/app.c index 64018376..42f7dc88 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -566,6 +566,7 @@ bool app_getProp(LG_DSProperty prop, void * ret) return g_state.ds->getProp(prop, ret); } +#ifdef ENABLE_EGL EGLDisplay app_getEGLDisplay(void) { return g_state.ds->getEGLDisplay(); @@ -580,6 +581,7 @@ void app_eglSwapBuffers(EGLDisplay display, EGLSurface surface) { g_state.ds->eglSwapBuffers(display, surface); } +#endif void app_glSwapBuffers(void) { diff --git a/client/src/main.c b/client/src/main.c index c88f05ae..80797897 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -633,7 +633,7 @@ static int lg_run(void) } assert(g_state.ds); - assert(IS_LG_DS_VALID(g_state.ds)); + ASSERT_LG_DS_VALID(g_state.ds); // init the subsystem if (!g_state.ds->earlyInit())