Dennis Kasprzyk
2007-Jun-12 17:19 UTC
[PATCH] Added a wrapabble paintInside function to allow plugins to render something inside of the transparent cube.
--- include/cube.h | 7 +++++++ plugins/cube.c | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/include/cube.h b/include/cube.h index 74cb360..0a87626 100644 --- a/include/cube.h +++ b/include/cube.h @@ -81,6 +81,12 @@ typedef void (*CubePaintBottomProc) (CompScreen *s, CompOutput *output, int size); +typedef void (*CubePaintInsideProc) (CompScreen *s, + const ScreenPaintAttrib *sAttrib, + const CompTransform *transform, + CompOutput *output, + int size); + typedef Bool (*CubeCheckFTBProc) (CompScreen *s, const ScreenPaintAttrib *sAttrib, const CompTransform *transform, @@ -121,6 +127,7 @@ typedef struct _CubeScreen { CubeClearTargetOutputProc clearTargetOutput; CubePaintTopProc paintTop; CubePaintBottomProc paintBottom; + CubePaintInsideProc paintInside; CubeCheckFTBProc checkFTB; CubeCapDirectionProc capDirection; diff --git a/plugins/cube.c b/plugins/cube.c index 5e3e8c5..dda6ea8 100644 --- a/plugins/cube.c +++ b/plugins/cube.c @@ -1367,6 +1367,13 @@ cubePaintBottom (CompScreen *s, } static void +cubePaintInside (CompScreen *s, + const ScreenPaintAttrib *sAttrib, + const CompTransform *transform, + CompOutput *output, + int size) {} + +static void cubePaintTransformedOutput (CompScreen *s, const ScreenPaintAttrib *sAttrib, const CompTransform *transform, @@ -1508,14 +1515,24 @@ cubePaintTransformedOutput (CompScreen *s, { glNormal3f (0.0f, -1.0f, 0.0f); if (cs->desktopOpacity != OPAQUE) + { (*cs->paintBottom) (s, &sa, transform, outputPtr, hsize); + glNormal3f (0.0f, 0.0f, -1.0f); + (*cs->paintInside) (s, &sa, transform, outputPtr, hsize); + glNormal3f (0.0f, -1.0f, 0.0f); + } (*cs->paintTop) (s, &sa, transform, outputPtr, hsize); } else if (!topDir && !bottomDir) { glNormal3f (0.0f, 1.0f, 0.0f); if (cs->desktopOpacity != OPAQUE) + { (*cs->paintTop) (s, &sa, transform, outputPtr, hsize); + glNormal3f (0.0f, 0.0f, -1.0f); + (*cs->paintInside) (s, &sa, transform, outputPtr, hsize); + glNormal3f (0.0f, 1.0f, 0.0f); + } (*cs->paintBottom) (s, &sa, transform, outputPtr, hsize); } else if (cs->desktopOpacity != OPAQUE) @@ -1524,6 +1541,8 @@ cubePaintTransformedOutput (CompScreen *s, (*cs->paintTop) (s, &sa, transform, outputPtr, hsize); glNormal3f (0.0f, -1.0f, 0.0f); (*cs->paintBottom) (s, &sa, transform, outputPtr, hsize); + glNormal3f (0.0f, 0.0f, -1.0f); + (*cs->paintInside) (s, &sa, transform, outputPtr, hsize); } glNormal3f (0.0f, 0.0f, -1.0f); } @@ -2108,6 +2127,7 @@ cubeInitScreen (CompPlugin *p, cs->clearTargetOutput = cubeClearTargetOutput; cs->paintTop = cubePaintTop; cs->paintBottom = cubePaintBottom; + cs->paintInside = cubePaintInside; cs->checkFTB = cubeCheckFTB; cs->capDirection = cubeCapDirection; -- 1.5.0.5-dirty --Boundary_(ID_Nqj58tVM3+zjT3js1Mf8TQ) Content-type: text/x-diff; charset=windows-1252; name=0006-Made-checkFTB-wrapable-needed-by-cubereflex-plugin.patch Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=0006-Made-checkFTB-wrapable-needed-by-cubereflex-plugin.patch