• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetReq函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetReq函数的典型用法代码示例。如果您正苦于以下问题:C++ GetReq函数的具体用法?C++ GetReq怎么用?C++ GetReq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetReq函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: __glXQueryServerString

static char *
__glXQueryServerString(Display * dpy, int opcode, CARD32 screen, CARD32 name)
{
   xGLXGenericGetStringReq *req;
   xGLXSingleReply reply;
   int length;
   int numbytes;
   char *buf;
   CARD32 for_whom = screen;
   CARD32 glxCode = X_GLXQueryServerString;


   LockDisplay(dpy);


   /* All of the GLX protocol requests for getting a string from the server
    * look the same.  The exact meaning of the for_whom field is usually
    * either the screen number (for glXQueryServerString) or the context tag
    * (for GLXSingle).
    */

   GetReq(GLXGenericGetString, req);
   req->reqType = opcode;
   req->glxCode = glxCode;
   req->for_whom = for_whom;
   req->name = name;

   _XReply(dpy, (xReply *) & reply, 0, False);

   length = reply.length * 4;
   numbytes = reply.size;

   buf = malloc(numbytes);
   if (buf != NULL) {
      _XRead(dpy, buf, numbytes);
      length -= numbytes;
   }

   _XEatData(dpy, length);

   UnlockDisplay(dpy);
   SyncHandle();

   return buf;
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:45,代码来源:glxinit.c


示例2: _xiQueryVersion

_X_HIDDEN Status
_xiQueryVersion(Display * dpy, int *major, int *minor, XExtDisplayInfo *info)
{
    xXIQueryVersionReq *req;
    xXIQueryVersionReply rep;

    LockDisplay(dpy);

    /* This could mean either a malloc problem, or supported
        version < XInput_2_0 */
    if (_XiCheckExtInit(dpy, XInput_2_0, info) == -1)
    {
        XExtensionVersion *ext;
        XExtDisplayInfo *extinfo = XInput_find_display(dpy);

        if (!extinfo || !extinfo->data) {
            *major = 0;
            *minor = 0;
            return BadRequest;
        }

        ext = ((XInputData*)extinfo->data)->vers;

        *major = ext->major_version;
        *minor = ext->minor_version;
	return BadRequest;
    }

    GetReq(XIQueryVersion, req);
    req->reqType = info->codes->major_opcode;
    req->ReqType = X_XIQueryVersion;
    req->major_version = *major;
    req->minor_version = *minor;

    if (!_XReply(dpy, (xReply*)&rep, 0, xTrue)) {
        UnlockDisplay(dpy);
	return BadImplementation;
    }

    *major = rep.major_version;
    *minor = rep.minor_version;

    UnlockDisplay(dpy);
    return Success;
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xorg__lib__libXi,代码行数:45,代码来源:XIQueryVersion.c


示例3: XRRListProviderProperties

Atom *
XRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop)
{
    XExtDisplayInfo		*info = XRRFindDisplay(dpy);
    xRRListProviderPropertiesReply rep;
    xRRListProviderPropertiesReq	*req;
    int				nbytes, rbytes;
    Atom			*props = NULL;

    RRCheckExtension (dpy, info, NULL);

    LockDisplay (dpy);
    GetReq (RRListProviderProperties, req);
    req->reqType = info->codes->major_opcode;
    req->randrReqType = X_RRListProviderProperties;
    req->provider = provider;

    if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
	UnlockDisplay (dpy);
	SyncHandle ();
	*nprop = 0;
	return NULL;
    }

    if (rep.nAtoms) {
	rbytes = rep.nAtoms * sizeof (Atom);
	nbytes = rep.nAtoms << 2;

	props = (Atom *) Xmalloc (rbytes);
	if (props == NULL) {
	    _XEatDataWords (dpy, rep.length);
	    UnlockDisplay (dpy);
	    SyncHandle ();
	    *nprop = 0;
	    return NULL;
	}

	_XRead32 (dpy, (long *) props, nbytes);
    }

    *nprop = rep.nAtoms;
    UnlockDisplay (dpy);
    SyncHandle ();
    return props;
}
开发者ID:SvenDowideit,项目名称:clearlinux,代码行数:45,代码来源:XrrProviderProperty.c


示例4: DestroyPbuffer

/**
 * Destroy a pbuffer.
 *
 * This function is used to implement \c glXDestroyPbuffer and
 * \c glXDestroyGLXPbufferSGIX.
 *
 * \note
 * This function dynamically determines whether to use the SGIX_pbuffer
 * version of the protocol or the GLX 1.3 version of the protocol.
 */
static void
DestroyPbuffer(Display * dpy, GLXDrawable drawable)
{
   struct glx_display *priv = __glXInitialize(dpy);
   CARD8 opcode;

   if ((priv == NULL) || (dpy == NULL) || (drawable == 0)) {
      return;
   }

   opcode = __glXSetupForCommand(dpy);
   if (!opcode)
      return;

   LockDisplay(dpy);

   if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
      xGLXDestroyPbufferReq *req;

      GetReq(GLXDestroyPbuffer, req);
      req->reqType = opcode;
      req->glxCode = X_GLXDestroyPbuffer;
      req->pbuffer = (GLXPbuffer) drawable;
   }
   else {
      xGLXVendorPrivateWithReplyReq *vpreq;
      CARD32 *data;

      GetReqExtra(GLXVendorPrivateWithReply, 4, vpreq);
      data = (CARD32 *) (vpreq + 1);

      data[0] = (CARD32) drawable;

      vpreq->reqType = opcode;
      vpreq->glxCode = X_GLXVendorPrivateWithReply;
      vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX;
   }

   UnlockDisplay(dpy);
   SyncHandle();

   DestroyDRIDrawable(dpy, drawable, GL_TRUE);

   return;
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:55,代码来源:glx_pbuffer.c


示例5: XRenderReferenceGlyphSet

GlyphSet
XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing)
{
    XRenderExtDisplayInfo             *info = XRenderFindDisplay (dpy);
    GlyphSet                    gsid;
    xRenderReferenceGlyphSetReq	*req;

    RenderCheckExtension (dpy, info, 0);
    LockDisplay(dpy);
    GetReq(RenderReferenceGlyphSet, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderReferenceGlyphSet;
    req->gsid = gsid = XAllocID(dpy);
    req->existing = existing;
    UnlockDisplay(dpy);
    SyncHandle();
    return gsid;
}
开发者ID:geekmaster,项目名称:buildroot-kindle,代码行数:18,代码来源:Glyph.c


示例6: XRenderCreateGlyphSet

GlyphSet
XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format)
{
    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    GlyphSet			gsid;
    xRenderCreateGlyphSetReq	*req;

    RenderCheckExtension (dpy, info, 0);
    LockDisplay(dpy);
    GetReq(RenderCreateGlyphSet, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderCreateGlyphSet;
    req->gsid = gsid = XAllocID(dpy);
    req->format = format->id;
    UnlockDisplay(dpy);
    SyncHandle();
    return gsid;
}
开发者ID:geekmaster,项目名称:buildroot-kindle,代码行数:18,代码来源:Glyph.c


示例7: XDamageSubtract

void
XDamageSubtract (Display *dpy, Damage damage,
		 XserverRegion repair, XserverRegion parts)
{
    XDamageExtDisplayInfo	*info = XDamageFindDisplay (dpy);
    xDamageSubtractReq		*req;

    XDamageSimpleCheckExtension (dpy, info);
    LockDisplay (dpy);
    GetReq (DamageSubtract, req);
    req->reqType = info->codes->major_opcode;
    req->damageReqType = X_DamageSubtract;
    req->damage = damage;
    req->repair = repair;
    req->parts = parts;
    UnlockDisplay (dpy);
    SyncHandle ();
}
开发者ID:izaackgerard,项目名称:Sintetizador_Voz,代码行数:18,代码来源:Xdamage.c


示例8: XCompositeNameWindowPixmap

Pixmap
XCompositeNameWindowPixmap (Display *dpy, Window window)
{
    XCompositeExtDisplayInfo	    *info = XCompositeFindDisplay (dpy);
    xCompositeNameWindowPixmapReq   *req;
    Pixmap			    pixmap;

    XCompositeCheckExtension (dpy, info, 0);
    LockDisplay (dpy);
    GetReq (CompositeNameWindowPixmap, req);
    req->reqType = info->codes->major_opcode;
    req->compositeReqType = X_CompositeNameWindowPixmap;
    req->window = window;
    pixmap = req->pixmap = XAllocID (dpy);
    UnlockDisplay (dpy);
    SyncHandle ();
    return pixmap;
}
开发者ID:izaackgerard,项目名称:Sintetizador_Voz,代码行数:18,代码来源:Xcomposite.c


示例9: DRI2DestroyDrawable

void
DRI2DestroyDrawable(Display * dpy, XID drawable)
{
   XExtDisplayInfo *info = DRI2FindDisplay(dpy);
   xDRI2DestroyDrawableReq *req;

   XextSimpleCheckExtension(dpy, info, dri2ExtensionName);

   XSync(dpy, False);

   LockDisplay(dpy);
   GetReq(DRI2DestroyDrawable, req);
   req->reqType = info->codes->major_opcode;
   req->dri2ReqType = X_DRI2DestroyDrawable;
   req->drawable = drawable;
   UnlockDisplay(dpy);
   SyncHandle();
}
开发者ID:Distrotech,项目名称:Mesa,代码行数:18,代码来源:dri2.c


示例10: XDGASetClientVersion

Bool XDGASetClientVersion(
    Display	*dpy
){
    XExtDisplayInfo *info = xdga_find_display (dpy);
    xXDGASetClientVersionReq *req;

    XDGACheckExtension (dpy, info, False);

    LockDisplay(dpy);
    GetReq(XDGASetClientVersion, req);
    req->reqType = info->codes->major_opcode;
    req->dgaReqType = X_XDGASetClientVersion;
    req->major = XDGA_MAJOR_VERSION;
    req->minor = XDGA_MINOR_VERSION;
    UnlockDisplay(dpy);
    SyncHandle();
    return True;
}
开发者ID:dikerex,项目名称:theqvd,代码行数:18,代码来源:XF86DGA2.c


示例11: XFixesChangeCursor

void
XFixesChangeCursor (Display *dpy, Cursor source, Cursor destination)
{
    XFixesExtDisplayInfo	*info = XFixesFindDisplay (dpy);
    xXFixesChangeCursorReq	*req;

    XFixesSimpleCheckExtension (dpy, info);
    if (info->major_version < 2)
	return;
    LockDisplay (dpy);
    GetReq (XFixesChangeCursor, req);
    req->reqType = info->codes->major_opcode;
    req->xfixesReqType = X_XFixesChangeCursor;
    req->source = source;
    req->destination = destination;
    UnlockDisplay(dpy);
    SyncHandle();
}
开发者ID:aosm,项目名称:X11libs,代码行数:18,代码来源:Cursor.c


示例12: XFixesDestroyPointerBarrier

void
XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b)
{
    XFixesExtDisplayInfo *info = XFixesFindDisplay (dpy);
    xXFixesDestroyPointerBarrierReq *req;

    XFixesSimpleCheckExtension (dpy, info);
    if (info->major_version < 5)
	return;

    LockDisplay (dpy);
    GetReq (XFixesDestroyPointerBarrier, req);
    req->reqType = info->codes->major_opcode;
    req->xfixesReqType = X_XFixesDestroyPointerBarrier;
    req->barrier = b;
    UnlockDisplay (dpy);
    SyncHandle();
}
开发者ID:aosm,项目名称:X11libs,代码行数:18,代码来源:Cursor.c


示例13: XSetInputFocus

int
XSetInputFocus(
    register Display *dpy,
    Window focus,
    int revert_to,
    Time time)
{
    register xSetInputFocusReq *req;

    LockDisplay(dpy);
    GetReq(SetInputFocus, req);
    req->focus = focus;
    req->revertTo = revert_to;
    req->time = time;
    UnlockDisplay(dpy);
    SyncHandle();
    return 1;
}
开发者ID:AKatti,项目名称:androix-lib-libX11,代码行数:18,代码来源:SetIFocus.c


示例14: XSetSelectionOwner

int
XSetSelectionOwner(
    register Display *dpy,
    Atom selection,
    Window owner,
    Time time)
{
    register xSetSelectionOwnerReq *req;

    LockDisplay(dpy);
    GetReq(SetSelectionOwner,req);
    req->selection = selection;
    req->window = owner;
    req->time = time;
    UnlockDisplay(dpy);
    SyncHandle();
    return 1;
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:18,代码来源:SetSOwner.c


示例15: XCompositeCreateRegionFromBorderClip

XserverRegion
XCompositeCreateRegionFromBorderClip (Display *dpy, Window window)
{
    XCompositeExtDisplayInfo		    *info = XCompositeFindDisplay (dpy);
    xCompositeCreateRegionFromBorderClipReq *req;
    XserverRegion			    region;

    XCompositeCheckExtension (dpy, info, 0);
    LockDisplay (dpy);
    GetReq (CompositeCreateRegionFromBorderClip, req);
    req->reqType = info->codes->major_opcode;
    req->compositeReqType = X_CompositeCreateRegionFromBorderClip;
    req->window = window;
    region = req->region = XAllocID (dpy);
    UnlockDisplay (dpy);
    SyncHandle ();
    return region;
}
开发者ID:izaackgerard,项目名称:Sintetizador_Voz,代码行数:18,代码来源:Xcomposite.c


示例16: XNVCTRLSetTargetStringAttribute

Bool XNVCTRLSetTargetStringAttribute (
    Display *dpy,
    int target_type,
    int target_id,
    unsigned int display_mask,
    unsigned int attribute,
    char *ptr
) {
    XExtDisplayInfo *info = find_display (dpy);
    xnvCtrlSetStringAttributeReq *req;
    xnvCtrlSetStringAttributeReply rep;
    int size;
    Bool success;

    if(!XextHasExtension(info))
        return False;

    XNVCTRLCheckExtension (dpy, info, False);

    size = strlen(ptr)+1;

    LockDisplay (dpy);
    GetReq (nvCtrlSetStringAttribute, req);
    req->reqType = info->codes->major_opcode;
    req->nvReqType = X_nvCtrlSetStringAttribute;
    req->target_type = target_type;
    req->target_id = target_id;
    req->display_mask = display_mask;
    req->attribute = attribute;
    req->length += ((size + 3) & ~3) >> 2;
    req->num_bytes = size;
    Data(dpy, ptr, size);

    if (!_XReply (dpy, (xReply *) &rep, 0, False)) {
        UnlockDisplay (dpy);
        SyncHandle ();
        return False;
    }
    UnlockDisplay (dpy);
    SyncHandle ();

    success = rep.flags;
    return success;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:44,代码来源:NVCtrl.c


示例17: XNVCTRLQueryValidTargetAttributeValues64

static Bool XNVCTRLQueryValidTargetAttributeValues64 (
    Display *dpy,
    XExtDisplayInfo *info,
    int target_type,
    int target_id,
    unsigned int display_mask,
    unsigned int attribute,
    NVCTRLAttributeValidValuesRec *values
) {
    xnvCtrlQueryValidAttributeValues64Reply rep;
    xnvCtrlQueryValidAttributeValuesReq *req;
    Bool exists;

    LockDisplay(dpy);
    GetReq(nvCtrlQueryValidAttributeValues, req);
    req->reqType = info->codes->major_opcode;
    req->nvReqType = X_nvCtrlQueryValidAttributeValues64;
    req->target_type = target_type;
    req->target_id = target_id;
    req->display_mask = display_mask;
    req->attribute = attribute;
    if (!_XReply(dpy, (xReply *)&rep,
                 sz_xnvCtrlQueryValidAttributeValues64Reply_extra,
                 xTrue)) {
        UnlockDisplay(dpy);
        SyncHandle();
        return False;
    }
    exists = rep.flags;
    if (exists) {
        values->type = rep.attr_type;
        if (rep.attr_type == ATTRIBUTE_TYPE_RANGE) {
            values->u.range.min = rep.min_64;
            values->u.range.max = rep.max_64;
        }
        if (rep.attr_type == ATTRIBUTE_TYPE_INT_BITS) {
            values->u.bits.ints = rep.bits_64;
        }
        values->permissions = rep.perms;
    }
    UnlockDisplay(dpy);
    SyncHandle();
    return exists;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:44,代码来源:NVCtrl.c


示例18: XSetFontPath

int
XSetFontPath (
    register Display *dpy,
    char **directories,
    int ndirs)
{
	register int n = 0;
	register int i;
	register int nbytes;
	char *p;
	register xSetFontPathReq *req;
	int retCode;

        LockDisplay(dpy);
	GetReq (SetFontPath, req);
	req->nFonts = ndirs;
	for (i = 0; i < ndirs; i++) {
		n += safestrlen (directories[i]) + 1;
	}
	nbytes = (n + 3) & ~3;
	req->length += nbytes >> 2;
	if ((p = Xmalloc (nbytes))) {
		/*
	 	 * pack into counted strings.
	 	 */
		char	*tmp = p;

		for (i = 0; i < ndirs; i++) {
			register int length = safestrlen (directories[i]);
			*p = length;
			memcpy (p + 1, directories[i], length);
			p += length + 1;
		}
		Data (dpy, tmp, nbytes);
		Xfree ((char *) tmp);
		retCode = 1;
	}
	else
		retCode = 0;

        UnlockDisplay(dpy);
	SyncHandle();
	return (retCode);
}
开发者ID:KuroyTatakai,项目名称:libX11,代码行数:44,代码来源:SetFPath.c


示例19: XkbSetIndicatorMap

Bool
XkbSetIndicatorMap(Display *dpy,unsigned long which,XkbDescPtr xkb)
{
    register xkbSetIndicatorMapReq	*req;
    register int i,bit;
    int nMaps;
    xkbIndicatorMapWireDesc *wire;
    XkbInfoPtr xkbi;

    if ((dpy->flags & XlibDisplayNoXkb) ||
	(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
	return False;
    if ((!xkb)||(!which)||(!xkb->indicators))
	return False;
    LockDisplay(dpy);
    xkbi = dpy->xkb_info;
    GetReq(kbSetIndicatorMap, req);
    req->reqType = xkbi->codes->major_opcode;
    req->xkbReqType = X_kbSetIndicatorMap;
    req->deviceSpec = xkb->device_spec;
    req->which = (CARD32)which;
    for (i=nMaps=0,bit=1;i<32;i++,bit<<=1) {
	if (which&bit)
	    nMaps++;
    }
    req->length+= (nMaps*sizeof(XkbIndicatorMapRec))/4;
    BufAlloc(xkbIndicatorMapWireDesc *,wire,
				       (nMaps*SIZEOF(xkbIndicatorMapWireDesc)));
    for (i=0,bit=1;i<32;i++,bit<<=1) {
	if (which&bit) {
	    wire->flags= xkb->indicators->maps[i].flags;
	    wire->whichGroups= xkb->indicators->maps[i].which_groups;
	    wire->groups= xkb->indicators->maps[i].groups;
	    wire->whichMods= xkb->indicators->maps[i].which_mods;
	    wire->mods= xkb->indicators->maps[i].mods.real_mods;
	    wire->virtualMods= xkb->indicators->maps[i].mods.vmods;
	    wire->ctrls= xkb->indicators->maps[i].ctrls;
	    wire++;
	}
    }
    UnlockDisplay(dpy);
    SyncHandle();
    return True;
}
开发者ID:AKatti,项目名称:androix-lib-libX11,代码行数:44,代码来源:XKBleds.c


示例20: XChangeWindowAttributes

int
XChangeWindowAttributes (
    register Display *dpy,
    Window w,
    unsigned long valuemask,
    XSetWindowAttributes *attributes)
{
    register xChangeWindowAttributesReq *req;

    LockDisplay(dpy);
    GetReq(ChangeWindowAttributes,req);
    req->window = w;
    valuemask &= AllMaskBits;
    if ((req->valueMask = valuemask))
        _XProcessWindowAttributes (dpy, req, valuemask, attributes);
    UnlockDisplay(dpy);
    SyncHandle();
    return 1;
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:19,代码来源:ChWAttrs.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetRequest函数代码示例发布时间:2022-05-30
下一篇:
C++ GetReputation函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap