static int rdpup_send_msg(struct stream* s) { int len; int rv; rv = 1; if (s != 0) { len = s->end - s->data; if (len > s->size) { rdpLog("overrun error len %d count %d\n", len, g_count); } s_pop_layer(s, iso_hdr); out_uint16_le(s, 1); out_uint16_le(s, g_count); out_uint32_le(s, len - 8); rv = rdpup_send(s->data, len); } if (rv != 0) { rdpLog("error in rdpup_send_msg\n"); } return rv; }
static int rdpup_recv_msg(struct stream* s) { int len; int rv; rv = 1; if (s != 0) { init_stream(s, 4); rv = rdpup_recv(s->data, 4); if (rv == 0) { in_uint32_le(s, len); if (len > 3) { init_stream(s, len); rv = rdpup_recv(s->data, len - 4); } } } if (rv != 0) { rdpLog("error in rdpup_recv_msg\n"); } return rv; }
Bool rdpCreateGC(GCPtr pGC) { rdpGCRec *priv; Bool rv; LLOGLN(10, ("in rdpCreateGC\n")); priv = GETGCPRIV(pGC); g_pScreen->CreateGC = g_rdpScreen.CreateGC; rv = g_pScreen->CreateGC(pGC); if (rv) { priv->funcs = pGC->funcs; priv->ops = 0; pGC->funcs = &g_rdpGCFuncs; } else { rdpLog("error in rdpCreateGC, CreateGC failed\n"); } g_pScreen->CreateGC = rdpCreateGC; return rv; }
/* return 2, draw using clip */ int rdp_get_clip(RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) { WindowPtr pWindow; RegionPtr temp; BoxRec box; int rv; rv = 0; if (pDrawable->type == DRAWABLE_PIXMAP) { switch (pGC->clientClipType) { case CT_NONE: rv = 1; break; case CT_REGION: rv = 2; RegionCopy(pRegion, pGC->clientClip); break; default: rdpLog("unimp clip type %d\n", pGC->clientClipType); break; } if (rv == 2) /* check if the clip is the entire pixmap */ { box.x1 = 0; box.y1 = 0; box.x2 = pDrawable->width; box.y2 = pDrawable->height; if (RegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } } } else if (pDrawable->type == DRAWABLE_WINDOW) { pWindow = (WindowPtr)pDrawable; if (pWindow->viewable) { if (pGC->subWindowMode == IncludeInferiors) { temp = &pWindow->borderClip; } else { temp = &pWindow->clipList; } if (RegionNotEmpty(temp)) { switch (pGC->clientClipType) { case CT_NONE: rv = 2; RegionCopy(pRegion, temp); break; case CT_REGION: rv = 2; RegionCopy(pRegion, pGC->clientClip); RegionTranslate(pRegion, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); RegionIntersect(pRegion, pRegion, temp); break; default: rdpLog("unimp clip type %d\n", pGC->clientClipType); break; } if (rv == 2) /* check if the clip is the entire screen */ { box.x1 = 0; box.y1 = 0; box.x2 = g_rdpScreen.width; box.y2 = g_rdpScreen.height; if (RegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } } } } } return rv; }