当前位置: 首页>>代码示例>>C++>>正文


C++ UNWRAP函数代码示例

本文整理汇总了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);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xorg__app__glxcompmgr,代码行数:12,代码来源:fade.c

示例2: colorFilterFiniScreen

static void
colorFilterFiniScreen (CompPlugin * p, CompScreen * s)
{
    FILTER_SCREEN (s);

    freeWindowPrivateIndex (s, cfs->windowPrivateIndex);
    UNWRAP (cfs, s, drawWindowTexture);

    unloadFilters (s);

    free (cfs);
}
开发者ID:compiz-reloaded,项目名称:compiz-plugins-main,代码行数:12,代码来源:colorfilter.c

示例3: colorFilterFiniCore

static void
colorFilterFiniCore (CompPlugin *p,
		     CompCore   *c)
{
    FILTER_CORE (c);

    freeDisplayPrivateIndex (displayPrivateIndex);

    UNWRAP (fc, c, objectAdd);

    free (fc);
}
开发者ID:compiz-reloaded,项目名称:compiz-plugins-main,代码行数:12,代码来源:colorfilter.c

示例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;
	}
}
开发者ID:jordigh,项目名称:fusilli,代码行数:56,代码来源:group-paint.c

示例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);
}
开发者ID:zmike,项目名称:compiz,代码行数:52,代码来源:zoom.c

示例6: notifyFiniCore

static void
notifyFiniCore (CompPlugin *p,
                CompCore   *c)
{
    NOTIFY_CORE (c);

    UNWRAP (nc, c, logMessage);

    if (notify_is_initted ())
        notify_uninit ();

    free (nc);
}
开发者ID:bhull2010,项目名称:compizfusion-plugins-extra-packages,代码行数:13,代码来源:notification.c

示例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);
}
开发者ID:noodlylight,项目名称:fusilli,代码行数:13,代码来源:wsnames.c

示例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);
}
开发者ID:JakeSFR,项目名称:compiz-plugins-experimental,代码行数:13,代码来源:screensaver.cpp

示例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);
}
开发者ID:compiz-reloaded,项目名称:compiz-plugins-experimental,代码行数:13,代码来源:elements.c

示例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;
}
开发者ID:bhull2010,项目名称:compizfusion-plugins-main-packages,代码行数:51,代码来源:imgjpeg.c

示例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;
}
开发者ID:jordigh,项目名称:fusilli,代码行数:51,代码来源:screenshot.c

示例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 ();
		}
	}
}
开发者ID:noodlylight,项目名称:fusilli,代码行数:51,代码来源:thumbnail.c

示例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;
}
开发者ID:bhull2010,项目名称:compizfusion-plugins-main-packages,代码行数:51,代码来源:ring.c

示例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);
}
开发者ID:zmike,项目名称:compiz,代码行数:50,代码来源:fade.c

示例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);
}
开发者ID:JakeSFR,项目名称:compiz-plugins-experimental,代码行数:14,代码来源:cubemodel.c


注:本文中的UNWRAP函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。