コード例 #1
0
ファイル: srvnet.c プロジェクト: koujinogaku/helloos
static void
GrSubtractRegionWrapper(void *r)
{
	nxSubtractRegionReq *req = r;

	GrSubtractRegion(req->regionid, req->srcregionid1, req->srcregionid2);
}
コード例 #2
0
ファイル: Region.c プロジェクト: ghaerr/microwindows
int
XSubtractRegion(Region regM, Region regS, Region regD)
{
	GrSubtractRegion(regD->rid, regM->rid, regS->rid);

#if CLIENTREGIONS
	GR_RECT extents;
	GrGetRegionBox(regD->rid, &extents);
	rectToBox(&extents, &regD->extents);
#endif
	return 1;
}
コード例 #3
0
ファイル: nxroach.c プロジェクト: EPiCS/reconos_v2
/*
   Calculate Visible region of root window.
*/
int
CalcRootVisible(void)
{
    GR_REGION_ID covered;
    GR_REGION_ID visible;
    GR_WINDOW_ID parent;
    GR_WINDOW_ID *children;
    GR_COUNT nChildren;
    GR_COUNT wx;
    GR_RECT rect;
    GR_WINDOW_INFO info;
    
    /*
       Get children of root.
    */
    GrQueryTree(GR_ROOT_WINDOW_ID, &parent, &children, &nChildren);
    
    /*
       For each mapped child, add the window rectangle to the covered
       region.
    */
    covered = GrNewRegion();
    for (wx=0; wx<nChildren; wx++) {
	GrGetWindowInfo(children[wx], &info);
	if (info.unmapcount == 0) {
	    rect.x = info.x;
	    rect.y = info.y;
	    rect.width = info.width;
	    rect.height = info.height;
	    GrUnionRectWithRegion(covered, &rect);
	}
    }
    free(children);

    /*
       Subtract the covered region from the root window region.
    */
    visible = GrNewRegion();
    rect.x = 0;
    rect.y = 0;
    rect.width = display_width;
    rect.height = display_height;
    GrUnionRectWithRegion(visible, &rect);
    GrSubtractRegion(visible, visible, covered);
    GrDestroyRegion(covered);
    
    /*
       Save visible region globally.
    */
    if (rootVisible)
	GrDestroyRegion(rootVisible);
    rootVisible = visible;

    /*
       Mark all roaches visible.
    */
    for (wx=0; wx<curRoaches; wx++) 
	roaches[wx].hidden = 0;

    return 0;
}