本文整理汇总了C++中UNWRAP函数的典型用法代码示例。如果您正苦于以下问题:C++ UNWRAP函数的具体用法?C++ UNWRAP怎么用?C++ UNWRAP使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UNWRAP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fadeFiniDisplay
static void
fadeFiniDisplay (CompPlugin *p,
CompDisplay *d)
{
FADE_DISPLAY (d);
freeScreenPrivateIndex (d, fd->screenPrivateIndex);
UNWRAP (fd, d, handleEvent);
free (fd);
}
示例2: colorFilterFiniScreen
static void
colorFilterFiniScreen (CompPlugin * p, CompScreen * s)
{
FILTER_SCREEN (s);
freeWindowPrivateIndex (s, cfs->windowPrivateIndex);
UNWRAP (cfs, s, drawWindowTexture);
unloadFilters (s);
free (cfs);
}
示例3: colorFilterFiniCore
static void
colorFilterFiniCore (CompPlugin *p,
CompCore *c)
{
FILTER_CORE (c);
freeDisplayPrivateIndex (displayPrivateIndex);
UNWRAP (fc, c, objectAdd);
free (fc);
}
示例4: groupPreparePaintScreen
/*
* groupPreparePaintScreen
*
*/
void
groupPreparePaintScreen (CompScreen *s,
int msSinceLastPaint)
{
GroupSelection *group, *next;
GROUP_SCREEN (s);
UNWRAP (gs, s, preparePaintScreen);
(*s->preparePaintScreen)(s, msSinceLastPaint);
WRAP (gs, s, preparePaintScreen, groupPreparePaintScreen);
group = gs->groups;
while (group)
{
GroupTabBar *bar = group->tabBar;
if (bar)
{
groupApplyForces (s, bar, (gs->dragged) ? gs->draggedSlot : NULL);
groupApplySpeeds (s, group, msSinceLastPaint);
if ((bar->state != PaintOff) && HAS_TOP_WIN (group))
groupHandleHoverDetection (group);
if (bar->state == PaintFadeIn || bar->state == PaintFadeOut)
groupHandleTabBarFade (group, msSinceLastPaint);
if (bar->textLayer)
groupHandleTextFade (group, msSinceLastPaint);
if (bar->bgAnimation)
groupHandleTabBarAnimation (group, msSinceLastPaint);
}
if (group->changeState != NoTabChange)
{
group->changeAnimationTime -= msSinceLastPaint;
if (group->changeAnimationTime <= 0)
groupHandleAnimation (group);
}
/* groupDrawTabAnimation may delete the group, so better
save the pointer to the next chain element */
next = group->next;
if (group->tabbingState != NoTabbing)
groupDrawTabAnimation (group, msSinceLastPaint);
group = next;
}
}
示例5: zoomPreparePaintScreen
static void
zoomPreparePaintScreen(CompScreen *s,
int msSinceLastPaint)
{
ZOOM_SCREEN(s);
if (zs->adjust)
{
int steps;
float amount;
amount = msSinceLastPaint * 0.35f *
zs->opt[ZOOM_SCREEN_OPTION_SPEED].value.f;
steps = amount / (0.5f * zs->opt[ZOOM_SCREEN_OPTION_TIMESTEP].value.f);
if (!steps) steps = 1;
while (steps--)
{
if (adjustZoomVelocity(zs))
{
BoxPtr pBox = &s->outputDev[zs->zoomOutput].region.extents;
zs->scale = 1.0f;
zs->velocity = 0.0f;
zs->adjust = FALSE;
if (zs->current[zs->zoomOutput].x1 == pBox->x1 &&
zs->current[zs->zoomOutput].y1 == pBox->y1 &&
zs->current[zs->zoomOutput].x2 == pBox->x2 &&
zs->current[zs->zoomOutput].y2 == pBox->y2)
{
zs->zoomed &= ~(1 << zs->zoomOutput);
zoomOutEvent(s);
}
else
{
zoomInEvent(s);
}
break;
}
else
{
zs->scale += (zs->velocity * msSinceLastPaint) / s->redrawTime;
}
}
}
UNWRAP(zs, s, preparePaintScreen);
(*s->preparePaintScreen)(s, msSinceLastPaint);
WRAP(zs, s, preparePaintScreen, zoomPreparePaintScreen);
}
示例6: notifyFiniCore
static void
notifyFiniCore (CompPlugin *p,
CompCore *c)
{
NOTIFY_CORE (c);
UNWRAP (nc, c, logMessage);
if (notify_is_initted ())
notify_uninit ();
free (nc);
}
示例7: wsnamesDonePaintScreen
static void
wsnamesDonePaintScreen (CompScreen *s)
{
WSNAMES_SCREEN (s);
/* FIXME: better only damage paint region */
if (ws->timer)
damageScreen (s);
UNWRAP (ws, s, donePaintScreen);
(*s->donePaintScreen) (s);
WRAP (ws, s, donePaintScreen, wsnamesDonePaintScreen);
}
示例8: screenSaverFiniDisplay
static void
screenSaverFiniDisplay (CompPlugin *p,
CompDisplay *d)
{
SCREENSAVER_DISPLAY (d);
screenSaverSetXScreenSaver(d,FALSE);
UNWRAP (sd, d, handleEvent);
delete sd->effect;
freeScreenPrivateIndex (d, sd->screenPrivateIndex);
free (sd);
}
示例9: elementsPreparePaintScreen
static void
elementsPreparePaintScreen (CompScreen *s,
int elapsed)
{
E_SCREEN (s);
if (elementActive(s))
stepPositions (s, elapsed);
UNWRAP (eScreen, s, preparePaintScreen);
(*s->preparePaintScreen) (s, elapsed);
WRAP (eScreen, s, preparePaintScreen, elementsPreparePaintScreen);
}
示例10: JPEGFileToImage
static Bool
JPEGFileToImage (CompDisplay *d,
const char *path,
const char *name,
int *width,
int *height,
int *stride,
void **data)
{
Bool status = FALSE;
char *fileName, *extension;
JPEG_DISPLAY (d);
fileName = createFilename (path, name);
if (!fileName)
return FALSE;
/* Do some testing here to see if it's got a .jpg or .jpeg extension */
extension = strrchr (fileName, '.');
if (extension)
{
if (strcasecmp (extension, ".jpeg") == 0 ||
strcasecmp (extension, ".jpg") == 0)
{
FILE *file;
file = fopen (fileName, "rb");
if (file)
{
status = readJPEGFileToImage (file, width, height, data);
fclose (file);
if (status) /* Success! */
{
free (fileName);
*stride = *width * 4;
return TRUE;
}
}
}
}
free (fileName);
/* Isn't a JPEG - pass to the next in the chain. */
UNWRAP (jd, d, fileToImage);
status = (*d->fileToImage) (d, path, name, width, height, stride, data);
WRAP (jd, d, fileToImage, JPEGFileToImage);
return status;
}
示例11: shotPaintOutput
static Bool
shotPaintOutput (CompScreen *s,
const ScreenPaintAttrib *sAttrib,
const CompTransform *transform,
Region region,
CompOutput *output,
unsigned int mask)
{
Bool status;
SHOT_SCREEN (s);
UNWRAP (ss, s, paintOutput);
status = (*s->paintOutput) (s, sAttrib, transform, region, output, mask);
WRAP (ss, s, paintOutput, shotPaintOutput);
if (status && ss->grab)
{
int x1, x2, y1, y2;
x1 = MIN (ss->x1, ss->x2);
y1 = MIN (ss->y1, ss->y2);
x2 = MAX (ss->x1, ss->x2);
y2 = MAX (ss->y1, ss->y2);
if (ss->grabIndex)
{
glPushMatrix ();
prepareXCoords (s, output, -DEFAULT_Z_CAMERA);
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
glEnable (GL_BLEND);
glColor4us (0x2fff, 0x2fff, 0x4fff, 0x4fff);
glRecti (x1, y2, x2, y1);
glColor4us (0x2fff, 0x2fff, 0x4fff, 0x9fff);
glBegin (GL_LINE_LOOP);
glVertex2i (x1, y1);
glVertex2i (x2, y1);
glVertex2i (x2, y2);
glVertex2i (x1, y2);
glEnd ();
glColor4usv (defaultColor);
glDisable (GL_BLEND);
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
glPopMatrix ();
}
}
return status;
}
示例12: thumbPaintTransformedOutput
static void
thumbPaintTransformedOutput (CompScreen *s,
const ScreenPaintAttrib *sAttrib,
const CompTransform *transform,
Region region,
CompOutput *output,
unsigned int mask)
{
THUMB_SCREEN (s);
UNWRAP (ts, s, paintTransformedOutput);
(*s->paintTransformedOutput)(s, sAttrib, transform, region, output, mask);
WRAP (ts, s, paintTransformedOutput, thumbPaintTransformedOutput);
const BananaValue *
option_always_on_top = bananaGetOption (bananaIndex,
"always_on_top",
s->screenNum);
if (option_always_on_top->b && ts->x == s->x && ts->y == s->y)
{
ts->painted = TRUE;
if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
{
CompTransform sTransform = *transform;
(*s->applyScreenTransform)(s, sAttrib, output, &sTransform);
transformToScreenSpace (s, output, -sAttrib->zTranslate,
&sTransform);
glPushMatrix ();
glLoadMatrixf (sTransform.m);
thumbPaintThumb (s, &ts->oldThumb, &sTransform);
glPopMatrix ();
}
if (ts->thumb.opacity > 0.0 && ts->thumb.win)
{
CompTransform sTransform = *transform;
(*s->applyScreenTransform)(s, sAttrib, output, &sTransform);
transformToScreenSpace (s, output, -sAttrib->zTranslate,
&sTransform);
glPushMatrix ();
glLoadMatrixf (sTransform.m);
thumbPaintThumb (s, &ts->thumb, &sTransform);
glPopMatrix ();
}
}
}
示例13: ringPaintOutput
static Bool
ringPaintOutput (CompScreen *s,
const ScreenPaintAttrib *sAttrib,
const CompTransform *transform,
Region region,
CompOutput *output,
unsigned int mask)
{
Bool status;
RING_SCREEN (s);
if (rs->state != RingStateNone)
mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
UNWRAP (rs, s, paintOutput);
status = (*s->paintOutput) (s, sAttrib, transform, region, output, mask);
WRAP (rs, s, paintOutput, ringPaintOutput);
if (rs->state != RingStateNone)
{
int i;
CompTransform sTransform = *transform;
transformToScreenSpace (s, output, -DEFAULT_Z_CAMERA, &sTransform);
glPushMatrix ();
glLoadMatrixf (sTransform.m);
rs->paintingSwitcher = TRUE;
for (i = 0; i < rs->nWindows; i++)
{
if (rs->drawSlots[i].slot && *(rs->drawSlots[i].slot))
{
CompWindow *w = rs->drawSlots[i].w;
(*s->paintWindow) (w, &w->paint, &sTransform,
&infiniteRegion, 0);
}
}
rs->paintingSwitcher = FALSE;
if (rs->textData && rs->state != RingStateIn)
ringDrawWindowTitle (s);
glPopMatrix ();
}
return status;
}
示例14: fadePreparePaintScreen
static void
fadePreparePaintScreen(CompScreen *s,
int msSinceLastPaint)
{
CompWindow *w;
int steps;
FADE_SCREEN(s);
switch (fs->opt[FADE_SCREEN_OPTION_FADE_MODE].value.i)
{
case FADE_MODE_CONSTANTSPEED:
steps = (msSinceLastPaint * OPAQUE) / fs->fadeTime;
if (steps < 12)
steps = 12;
for (w = s->windows; w; w = w->next)
{
FadeWindow *fw = GET_FADE_WINDOW(w, fs);
fw->steps = steps;
fw->fadeTime = 0;
}
break;
case FADE_MODE_CONSTANTTIME:
for (w = s->windows; w; w = w->next)
{
FadeWindow *fw = GET_FADE_WINDOW(w, fs);
if (fw->fadeTime)
{
fw->steps = 1;
fw->fadeTime -= msSinceLastPaint;
if (fw->fadeTime < 0)
fw->fadeTime = 0;
}
else
{
fw->steps = 0;
}
}
break;
}
UNWRAP(fs, s, preparePaintScreen);
(*s->preparePaintScreen)(s, msSinceLastPaint);
WRAP(fs, s, preparePaintScreen, fadePreparePaintScreen);
}
示例15: cubemodelClearTargetOutput
static void
cubemodelClearTargetOutput (CompScreen *s,
float xRotate,
float vRotate)
{
CUBEMODEL_SCREEN (s);
CUBE_SCREEN (s);
UNWRAP (cms, cs, clearTargetOutput);
(*cs->clearTargetOutput) (s, xRotate, vRotate);
WRAP (cms, cs, clearTargetOutput, cubemodelClearTargetOutput);
glClear (GL_DEPTH_BUFFER_BIT);
}