CLIPOBJ* FASTCALL IntEngCreateClipRegion(ULONG count, PRECTL pRect, PRECTL rcBounds) { CLIPGDI *Clip; if(count > 1) { RECTL *dest; Clip = EngAllocMem(0, sizeof(CLIPGDI) + ((count - 1) * sizeof(RECTL)), GDITAG_CLIPOBJ); if(Clip != NULL) { Clip->EnumRects.c = count; Clip->EnumOrder = CD_ANY; for(dest = Clip->EnumRects.arcl;count > 0; count--, dest++, pRect++) { *dest = *pRect; } Clip->ClipObj.iDComplexity = DC_COMPLEX; Clip->ClipObj.iFComplexity = ((Clip->EnumRects.c <= 4) ? FC_RECT4 : FC_COMPLEX); Clip->ClipObj.iMode = TC_RECTANGLES; Clip->ClipObj.rclBounds = *rcBounds; return GDIToObj(Clip, CLIP); } } else { Clip = EngAllocMem(0, sizeof(CLIPGDI), GDITAG_CLIPOBJ); if(Clip != NULL) { Clip->EnumRects.c = 1; Clip->EnumOrder = CD_ANY; Clip->EnumRects.arcl[0] = *rcBounds; Clip->ClipObj.iDComplexity = (((rcBounds->top == rcBounds->bottom) && (rcBounds->left == rcBounds->right)) ? DC_TRIVIAL : DC_RECT); Clip->ClipObj.iFComplexity = FC_RECT; Clip->ClipObj.iMode = TC_RECTANGLES; Clip->ClipObj.rclBounds = *rcBounds; return GDIToObj(Clip, CLIP); } } return NULL; }
/* * @implemented */ CLIPOBJ * APIENTRY EngCreateClip(VOID) { CLIPGDI *Clip = EngAllocMem(FL_ZERO_MEMORY, sizeof(CLIPGDI), GDITAG_CLIPOBJ); if(Clip != NULL) { return GDIToObj(Clip, CLIP); } return NULL; }
APIENTRY EngCreateWnd( SURFOBJ *pso, HWND hWnd, WNDOBJCHANGEPROC pfn, FLONG fl, int iPixelFormat) { WNDGDI *WndObjInt = NULL; WNDOBJ *WndObjUser = NULL; PWND Window; BOOL calledFromUser; DECLARE_RETURN(WNDOBJ*); DPRINT("EngCreateWnd: pso = 0x%p, hwnd = 0x%p, pfn = 0x%p, fl = 0x%lx, pixfmt = %d\n", pso, hWnd, pfn, fl, iPixelFormat); calledFromUser = UserIsEntered(); if (!calledFromUser){ UserEnterShared(); } /* Get window object */ Window = UserGetWindowObject(hWnd); if (Window == NULL) { RETURN( NULL); } /* Create WNDOBJ */ WndObjInt = EngAllocMem(0, sizeof (WNDGDI), GDITAG_WNDOBJ); if (WndObjInt == NULL) { DPRINT1("Failed to allocate memory for a WND structure!\n"); RETURN( NULL); } /* Fill the clipobj */ WndObjInt->ClientClipObj = NULL; if (!IntEngWndUpdateClipObj(WndObjInt, Window)) { EngFreeMem(WndObjInt); RETURN( NULL); } /* Fill user object */ WndObjUser = GDIToObj(WndObjInt, WND); WndObjUser->psoOwner = pso; WndObjUser->pvConsumer = NULL; /* Fill internal object */ WndObjInt->Hwnd = hWnd; WndObjInt->ChangeProc = pfn; WndObjInt->Flags = fl; WndObjInt->PixelFormat = iPixelFormat; /* associate object with window */ IntSetProp(Window, AtomWndObj, WndObjInt); ++gcountPWO; DPRINT("EngCreateWnd: SUCCESS!\n"); RETURN( WndObjUser); CLEANUP: if (!calledFromUser){ UserLeave(); } END_CLEANUP; }