From fcb76327807d3f40754fd4da9b034244cfd48ccf Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Fri, 7 Feb 2020 12:08:20 +0800 Subject: [PATCH] define DO_COMPSOR_OP and DO_COMPSOR_OP_ARGS --- src/include/server.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/include/server.h b/src/include/server.h index c7671609..465564ff 100644 --- a/src/include/server.h +++ b/src/include/server.h @@ -54,6 +54,36 @@ #include "constants.h" +#ifdef _MGSCHEMA_COMPOSITING + +#define DO_COMPSOR_OP(op) \ +do { \ + CompositorCtxt* ctxt; \ + const CompositorOps* ops = ServerSelectCompositor (NULL, &ctxt); \ + if (ops && ops->op) { \ + ops->op(ctxt); \ + } \ +} while (0) + +#define DO_COMPSOR_OP_ARGS(op, ...) \ +do { \ + CompositorCtxt* ctxt; \ + const CompositorOps* ops = ServerSelectCompositor (NULL, &ctxt); \ + if (ops && ops->op) { \ + ops->op(ctxt, __VA_ARGS__); \ + } \ +} while (0) + +#else /* defined _MGSCHEMA_COMPOSITING */ + +#define DO_COMPSOR_OP(op) \ + do { } while (0) + +#define DO_COMPSOR_OP_ARGS(op, ...) \ + do { } while (0) + +#endif /* not defined _MGSCHEMA_COMPOSITING */ + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */