您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DisposeRgn函数代码示例

51自学网 2021-06-01 20:28:31
  C++
这篇教程C++ DisposeRgn函数代码示例写得很实用,希望能帮到您。

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

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

示例1: renderspu_SystemWindowVisibleRegion

void renderspu_SystemWindowVisibleRegion(WindowInfo *window, GLint cRects, const GLint* pRects){    CRASSERT(window);    CRASSERT(window->window);    /* Remember any additional clipping stuff e.g. seamless regions */    if (window->hVisibleRegion)    {        DisposeRgn(window->hVisibleRegion);        window->hVisibleRegion = 0;    }    if (cRects>0)    {        int i;        /* Create some temporary regions */        RgnHandle rgn = NewRgn();        SetEmptyRgn (rgn);        RgnHandle tmpRgn = NewRgn();        for (i=0; i<cRects; ++i)        {            SetRectRgn (tmpRgn,                        pRects[4*i]  , pRects[4*i+1],                        pRects[4*i+2], pRects[4*i+3]);            //DEBUG_MSG_POETZSCH (("visible rect %d %d %d %d/n", pRects[4*i]  , pRects[4*i+1],            //                     pRects[4*i+2], pRects[4*i+3]));            UnionRgn (rgn, tmpRgn, rgn);        }        DisposeRgn (tmpRgn);        window->hVisibleRegion = rgn;    }    renderspu_SystemWindowApplyVisibleRegion(window);}
开发者ID:gvsurenderreddy,项目名称:virtualbox,代码行数:34,


示例2: setWindowTrackingRgn

void setWindowTrackingRgn(int windowIndex) {			Rect rgnRect;	RgnHandle rgn = NewRgn();	MouseTrackingRegionID id;	windowDescriptorBlock *windowBlock = windowBlockFromIndex(windowIndex);		if (!windowBlock) 		return;			if (windowBlock->windowTrackingRef) {		GetWindowBounds(windowBlock->handle, kWindowContentRgn, &rgnRect);			SetRectRgn( rgn, rgnRect.left, rgnRect.top, rgnRect.right, rgnRect.bottom );		ChangeMouseTrackingRegion(windowBlock->windowTrackingRef,rgn, NULL);		DisposeRgn( rgn );			return;	}	GetWindowBounds(windowBlock->handle, kWindowContentRgn, &rgnRect);		SetRectRgn( rgn, rgnRect.left, rgnRect.top, rgnRect.right, rgnRect.bottom );			id.signature = 'FAST';	id.id = windowIndex;			OSStatus err = CreateMouseTrackingRegion(windowBlock->handle, rgn, NULL, kMouseTrackingOptionsGlobalClip,						id, NULL, NULL, &windowBlock->windowTrackingRef);	if ( noErr == err ) {		RetainMouseTrackingRegion( windowBlock->windowTrackingRef);		err = SetMouseTrackingRegionEnabled( windowBlock->windowTrackingRef, TRUE );	}			DisposeRgn( rgn );	}
开发者ID:Geal,项目名称:Squeak-VM,代码行数:33,


示例3: TkRectInRegion

int TkRectInRegion(    TkRegion region,    int x,    int y,    unsigned int width,    unsigned int height){    RgnHandle rgn = (RgnHandle) region;    RgnHandle rectRgn, destRgn;    int result;        rectRgn = NewRgn();    destRgn = NewRgn();    SetRectRgn(rectRgn, x,  y, x + width, y + height);    SectRgn(rgn, rectRgn, destRgn);    if (EmptyRgn(destRgn)) {	result = RectangleOut;    } else if (EqualRgn(rgn, destRgn)) {	result = RectangleIn;    } else {	result = RectanglePart;    }    DisposeRgn(rectRgn);    DisposeRgn(destRgn);    return result;}
开发者ID:SASfit,项目名称:SASfit,代码行数:27,


示例4: renderspu_SystemSetRootVisibleRegion

static void renderspu_SystemSetRootVisibleRegion(GLint cRects, GLint *pRects){    /* Remember the visible region of the root window if there is one */    if (render_spu.hRootVisibleRegion)    {        DisposeRgn(render_spu.hRootVisibleRegion);        render_spu.hRootVisibleRegion = 0;    }    if (cRects>0)    {        int i;        render_spu.hRootVisibleRegion = NewRgn();        SetEmptyRgn (render_spu.hRootVisibleRegion);        RgnHandle tmpRgn = NewRgn();        for (i=0; i<cRects; ++i)        {            SetRectRgn (tmpRgn,                        pRects[4*i]  , pRects[4*i+1],                        pRects[4*i+2], pRects[4*i+3]);            UnionRgn (render_spu.hRootVisibleRegion, tmpRgn, render_spu.hRootVisibleRegion);        }        DisposeRgn (tmpRgn);    }}
开发者ID:gvsurenderreddy,项目名称:virtualbox,代码行数:25,


示例5: wxASSERT

/* restores former dialog size and (on Mac) position */bool CDlgItemProperties::RestoreState() {    wxConfigBase*   pConfig = wxConfigBase::Get(FALSE);    int                iWidth, iHeight;    wxASSERT(pConfig);    if (!pConfig) return false;    pConfig->SetPath(m_strBaseConfigLocation);    pConfig->Read(wxT("Width"), &iWidth, wxDefaultCoord);    pConfig->Read(wxT("Height"), &iHeight, wxDefaultCoord);#ifndef __WXMAC__    // Set size to saved values or defaults if no saved values    SetSize(iWidth, iHeight);    #else    int                iTop, iLeft;        pConfig->Read(wxT("YPos"), &iTop, wxDefaultCoord);    pConfig->Read(wxT("XPos"), &iLeft, wxDefaultCoord);        // If either co-ordinate is less then 0 then set it equal to 0 to ensure    // it displays on the screen.    if ((iLeft < 0) && (iLeft != wxDefaultCoord)) iLeft = 30;    if ((iTop < 0) && (iTop != wxDefaultCoord)) iTop = 30;    // Set size and position to saved values or defaults if no saved values    SetSize(iLeft, iTop, iWidth, iHeight, wxSIZE_USE_EXISTING);    // Now make sure window is on screen    GetScreenPosition(&iLeft, &iTop);    GetSize(&iWidth, &iHeight);        Rect titleRect = {iTop, iLeft, iTop+22, iLeft+iWidth };    InsetRect(&titleRect, 5, 5);                // Make sure at least a 5X5 piece visible    RgnHandle displayRgn = NewRgn();    CopyRgn(GetGrayRgn(), displayRgn);          // Region encompassing all displays    Rect menuRect = ((**GetMainDevice())).gdRect;    menuRect.bottom = GetMBarHeight() + menuRect.top;    RgnHandle menuRgn = NewRgn();    RectRgn(menuRgn, &menuRect);                // Region hidden by menu bar    DiffRgn(displayRgn, menuRgn, displayRgn);   // Subtract menu bar region    if (!RectInRgn(&titleRect, displayRgn)) {        iTop = iLeft = 30;        SetSize(iLeft, iTop, iWidth, iHeight, wxSIZE_USE_EXISTING);    }    DisposeRgn(menuRgn);    DisposeRgn(displayRgn);#endif    return true;}
开发者ID:abergstr,项目名称:BOINC,代码行数:53,


示例6: wxString

void CDlgMessages::RestoreWindowDimensions() {    wxString        strBaseConfigLocation = wxString(wxT("/Simple/Messages"));    wxConfigBase*   pConfig = wxConfigBase::Get(FALSE);    bool            bWindowIconized = false;    bool            bWindowMaximized = false;    int             iHeight = 0;    int             iWidth = 0;    int             iTop = 0;    int             iLeft = 0;    wxASSERT(pConfig);    pConfig->SetPath(strBaseConfigLocation);    pConfig->Read(wxT("YPos"), &iTop, 30);    pConfig->Read(wxT("XPos"), &iLeft, 30);    pConfig->Read(wxT("Width"), &iWidth, 640);    pConfig->Read(wxT("Height"), &iHeight, 480);    pConfig->Read(wxT("WindowIconized"), &bWindowIconized, false);    pConfig->Read(wxT("WindowMaximized"), &bWindowMaximized, false);#ifndef __WXMAC__    Iconize(bWindowIconized);    Maximize(bWindowMaximized);    if (!IsIconized() && !IsMaximized()) {        SetSize(-1, -1, iWidth, iHeight);    }#else   // ! __WXMAC__    // If the user has changed the arrangement of multiple     // displays, make sure the window title bar is still on-screen.    Rect titleRect = {iTop, iLeft, iTop+22, iLeft+iWidth };    InsetRect(&titleRect, 5, 5);    // Make sure at least a 5X5 piece visible    RgnHandle displayRgn = NewRgn();    CopyRgn(GetGrayRgn(), displayRgn);  // Region encompassing all displays    Rect menuRect = ((**GetMainDevice())).gdRect;    menuRect.bottom = GetMBarHeight() + menuRect.top;    RgnHandle menuRgn = NewRgn();    RectRgn(menuRgn, &menuRect);                // Region hidden by menu bar    DiffRgn(displayRgn, menuRgn, displayRgn);   // Subtract menu bar retion    if (!RectInRgn(&titleRect, displayRgn))        iTop = iLeft = 30;    DisposeRgn(menuRgn);    DisposeRgn(displayRgn);    SetSize(iLeft, iTop, iWidth, iHeight);#endif  // ! __WXMAC__}
开发者ID:Rytiss,项目名称:native-boinc-for-android,代码行数:51,


示例7: GetPort

void wxTopLevelWindowMac::MacInvalidate( const WXRECTPTR rect, bool eraseBackground ){    GrafPtr formerPort ;    GetPort( &formerPort ) ;    SetPortWindowPort( (WindowRef)m_macWindow ) ;    m_macNeedsErasing |= eraseBackground ;    // if we already know that we will have to erase, there's no need to track the rest    if ( !m_macNeedsErasing)    {        // we end only here if eraseBackground is false        // if we already have a difference between m_macNoEraseUpdateRgn and UpdateRgn        // we will have to erase anyway        RgnHandle       updateRgn = NewRgn();        RgnHandle       diffRgn = NewRgn() ;        if ( updateRgn && diffRgn )        {            GetWindowUpdateRgn( (WindowRef)m_macWindow , updateRgn );            Point pt = {0,0} ;            LocalToGlobal( &pt ) ;            OffsetRgn( updateRgn , -pt.h , -pt.v ) ;            DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;            if ( !EmptyRgn( diffRgn ) )            {                m_macNeedsErasing = true ;            }        }        if ( updateRgn )            DisposeRgn( updateRgn );        if ( diffRgn )            DisposeRgn( diffRgn );        if ( !m_macNeedsErasing )        {            RgnHandle rectRgn = NewRgn() ;            SetRectRgn( rectRgn , ((Rect*)rect)->left , ((Rect*)rect)->top , ((Rect*)rect)->right , ((Rect*)rect)->bottom ) ;            UnionRgn( (RgnHandle) m_macNoEraseUpdateRgn , rectRgn , (RgnHandle) m_macNoEraseUpdateRgn ) ;            DisposeRgn( rectRgn ) ;        }    }    InvalWindowRect( (WindowRef)m_macWindow , (Rect*)rect ) ;    // turn this on to debug the refreshing cycle#if wxMAC_DEBUG_REDRAW    PaintRect( rect ) ;#endif    SetPort( formerPort ) ;}
开发者ID:Duion,项目名称:Torsion,代码行数:49,


示例8: HandleDrawContent

// --------------------------------------------------------------------------------------void HandleDrawContent(WindowRef prefsWindow){    RgnHandle visibleRegion;    ListHandle iconList;    GetWindowProperty(prefsWindow, kAppSignature, kIconListTag, sizeof(ListHandle), NULL,                      &iconList);    visibleRegion = NewRgn();    GetPortVisibleRegion(GetWindowPort(prefsWindow), visibleRegion);    if (visibleRegion != NULL)    {        Boolean active = IsWindowHilited(prefsWindow);        SInt16 pixelDepth;        Boolean isColorDevice;        if (active)            SetThemeWindowBackground(prefsWindow, kThemeBrushModelessDialogBackgroundActive,                                     false);        else            SetThemeWindowBackground(prefsWindow,                                     kThemeBrushModelessDialogBackgroundInactive, false);        EraseRgn(visibleRegion);        UpdateControls(prefsWindow, visibleRegion);        GetWindowDeviceDepthAndColor(prefsWindow, &pixelDepth, &isColorDevice);        SetThemeBackground(kThemeBrushWhite, pixelDepth, isColorDevice);        LUpdate(visibleRegion, iconList);        drawFrameAndFocus(iconList, active, prefsWindow);        DisposeRgn(visibleRegion);    }}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:35,


示例9: handleMenuSelection

void handleMenuSelection(long result){	int menuID, menuItem;	RgnHandle rgnHandle = NewRgn();		menuID = HiWord(result);	menuItem = LoWord(result);		if (menuID == FILE_MENU) {		if (menuItem == FILE_SAVE)			saveToPICTFile();		else if (menuItem == FILE_QUIT)			gDone = true;		else if (menuItem == FILE_CLOSE) {			DisposeWindow(FrontWindow());			if (FrontWindow() == NULL)				gDone = true;		}		else if (menuItem == FILE_NEW) {				}		else if (menuItem == FILE_REFRESH) {			createImage();			drawImage(FrontWindow());			QDFlushPortBuffer(GetWindowPort(FrontWindow()), GetPortVisibleRegion(GetWindowPort(FrontWindow()), rgnHandle));		}	}	HiliteMenu(0);	DisposeRgn(rgnHandle);}
开发者ID:fruitsamples,项目名称:Snapshot,代码行数:30,


示例10: shellupdatenow

boolean shellupdatenow (WindowPtr wupdate) {		/*	can be called from within one of the callbacks to force an update	to happen immediately, without waiting for the OS to generate an	update event.		dmb 8/14/90:  can't we just call the normal update routine?  this	should be fine from the toolbox's point of view, but will not limit 	the update to contentrect.	*/#ifdef MACVERSION	hdlregion rgn;	rgn = getupdateregion (wupdate);	if (!EmptyRgn (rgn))		shellupdatewindow (wupdate);	#if ACCESSOR_CALLS_ARE_FUNCTIONS == 1	//Code change by Timothy Paustian Thursday, May 18, 2000 10:24:57 PM	//Changed because calling getupdateregion returns a copy of the region	//we have to dispose of it to prevent a memory leak	DisposeRgn(rgn);	#endif#endif#ifdef WIN95VERSION	releasethreadglobals ();	UpdateWindow ((HWND) wupdate);	grabthreadglobals ();#endif	return (true);	} /*shellupdatenow*/
开发者ID:dvincent,项目名称:frontier,代码行数:35,


示例11: TkDestroyRegion

void TkDestroyRegion(    TkRegion r){    RgnHandle rgn = (RgnHandle) r;    DisposeRgn(rgn);}
开发者ID:SASfit,项目名称:SASfit,代码行数:7,


示例12: wxCHECK_MSG

bool wxTopLevelWindowMac::SetShape(const wxRegion& region){    wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,                 _T("Shaped windows must be created with the wxFRAME_SHAPED style."));#if TARGET_CARBON    // The empty region signifies that the shape should be removed from the    // window.    if ( region.IsEmpty() )    {        wxSize sz = GetClientSize();        wxRegion rgn(0, 0, sz.x, sz.y);        return SetShape(rgn);    }    // Make a copy of the region    RgnHandle  shapeRegion = NewRgn();    CopyRgn( (RgnHandle)region.GetWXHRGN(), shapeRegion );    // Dispose of any shape region we may already have    RgnHandle oldRgn = (RgnHandle)GetWRefCon( (WindowRef)MacGetWindowRef() );    if ( oldRgn )        DisposeRgn(oldRgn);    // Save the region so we can use it later    SetWRefCon((WindowRef)MacGetWindowRef(), (SInt32)shapeRegion);    // Tell the window manager that the window has changed shape    ReshapeCustomWindow((WindowRef)MacGetWindowRef());    return TRUE;#else    return FALSE;#endif}
开发者ID:Duion,项目名称:Torsion,代码行数:34,


示例13: QTCode_ForceMovieRedraw

void QTCode_ForceMovieRedraw(Movie theMovie) {	OSErr 		err = noErr;	Rect		movieRect;	RgnHandle	clipRegion = NULL;			if (theMovie == NULL) goto bail;			clipRegion = NewRgn();		if (clipRegion == NULL) goto bail;				GetClip(clipRegion);		GetMovieBox(theMovie, &movieRect); 		ClipRect(&movieRect);			UpdateMovie(theMovie);		MoviesTask(theMovie, 0);			SetClip(clipRegion);				/* Closure. Clean up if we have handles. */	bail:				if	(clipRegion != NULL)		{			DisposeRgn(clipRegion);		}}
开发者ID:fruitsamples,项目名称:offscreen.win,代码行数:29,


示例14: wxMacSetupControlBackground

pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor ){    OSStatus status = noErr ;    switch( iMessage )    {        case kControlMsgSetUpBackground :            {                wxControl*  wx = (wxControl*) GetControlReference( iControl ) ;                if ( wx != NULL && wx->IsKindOf( CLASSINFO( wxControl ) ) )                {                    wxDC::MacSetupBackgroundForCurrentPort( wx->MacGetBackgroundBrush() ) ;#if TARGET_CARBON                    // under classic this would lead to partial redraws                    RgnHandle clip = NewRgn() ;                    int x = 0 , y = 0;                    wx->MacWindowToRootWindow( &x,&y ) ;                    CopyRgn( (RgnHandle) wx->MacGetVisibleRegion(false).GetWXHRGN() , clip ) ;                    OffsetRgn( clip , x , y ) ;                    SetClip( clip ) ;                    DisposeRgn( clip ) ;#endif                }                else                {                    status = paramErr ;                }            }            break ;        default :            status = paramErr ;            break ;    }    return status ;}
开发者ID:Duion,项目名称:Torsion,代码行数:35,


示例15: LCD_resize

void LCD_resize(Lcd *x){	Rect	r;	short		hor,ver;#ifdef debug	post("LCD_Resize");#endif	r = x->lcd_box.b_rect;		hor = x->cols = FixRound(FixRatio(((r.right-r.left-(2*BORDER_WIDTH))),x->f_width));	ver = x->rows = FixRound(FixRatio(((r.bottom-r.top-(2*BORDER_HEIGHT))),x->f_height));#ifdef FORCEDResize	x->lcd_box.b_rect.right = r.left + (2*BORDER_WIDTH) + hor*x->f_width;	x->lcd_box.b_rect.bottom = r.top + (2*BORDER_HEIGHT) + ver*x->f_height;#endif	if (x->lcd_region)		DisposeRgn(x->lcd_region);	x->lcd_oldRect = r = x->lcd_box.b_rect;	InsetRect(&r,1,1);	x->lcd_region = NewRgn();	RectRgn(x->lcd_region,&r);  /* DDZ simpler way to make a rectangular region */}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:26,


示例16: help

void wxTopLevelWindowMac::MacUpdate( long timestamp){    wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;    RgnHandle       visRgn = NewRgn() ;    GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), visRgn );    BeginUpdate( (WindowRef)m_macWindow ) ;    RgnHandle       updateRgn = NewRgn();    RgnHandle       diffRgn = NewRgn() ;    if ( updateRgn && diffRgn )    {#if 1        // macos internal control redraws clean up areas we'd like to redraw ourselves        // therefore we pick the boundary rect and make sure we can redraw it        // this has to be intersected by the visRgn in order to avoid drawing over its own        // boundaries        RgnHandle trueUpdateRgn = NewRgn() ;        Rect trueUpdateRgnBoundary ;        GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), trueUpdateRgn );        GetRegionBounds( trueUpdateRgn , &trueUpdateRgnBoundary ) ;        RectRgn( updateRgn , &trueUpdateRgnBoundary ) ;        SectRgn( updateRgn , visRgn , updateRgn ) ;        if ( trueUpdateRgn )            DisposeRgn( trueUpdateRgn ) ;        SetPortVisibleRegion(  GetWindowPort( (WindowRef)m_macWindow ), updateRgn ) ;#else        GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn );#endif        DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;        if ( !EmptyRgn( updateRgn ) )        {            MacRedraw( updateRgn , timestamp , m_macNeedsErasing || !EmptyRgn( diffRgn )  ) ;        }    }    if ( updateRgn )        DisposeRgn( updateRgn );    if ( diffRgn )        DisposeRgn( diffRgn );    if ( visRgn )        DisposeRgn( visRgn ) ;    EndUpdate( (WindowRef)m_macWindow ) ;    SetEmptyRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ;    m_macNeedsErasing = false ;}
开发者ID:Duion,项目名称:Torsion,代码行数:47,


示例17: doEventLoop

void doEventLoop(){	EventRecord event;	WindowPtr   window;	short       clickArea;	Rect        screenRect;	RgnHandle	rgnHandle = NewRgn();	for (;;)	{		if (WaitNextEvent( everyEvent, &event, 0, nil ))		{			if (event.what == mouseDown)			{				clickArea = FindWindow( event.where, &window );								if (clickArea == inDrag)				{					//screenRect = (**GetGrayRgn ()).rgnBBox;					GetRegionBounds(GetGrayRgn(), &screenRect);					DragWindow( window, event.where, &screenRect );				}				else if (clickArea == inContent)				{					if (window != FrontWindow())						SelectWindow( window );				}				else if (clickArea == inGoAway)					if (TrackGoAway( window, event.where ))						return;			}			else if (event.what == updateEvt)			{				window = (WindowPtr)event.message;					//SetPort( window );				SetPortWindowPort( window );								BeginUpdate( window );				drawPixelImageData();				EndUpdate( window );				QDFlushPortBuffer(GetWindowPort(window), GetPortVisibleRegion(GetWindowPort(window), rgnHandle));			}			else if (event.what == activateEvt) 			{				/*if (event.modifiers & activeFlag) {					window = (WindowPtr)event.message;					SetPortWindowPort(window);					drawPixelImageData();					QDFlushPortBuffer(GetWindowPort(window), GetPortVisibleRegion(GetWindowPort(window), rgnHandle));				}*/				/*if (event.modifiers & activeFlag)					PostEvent(updateEvt, (unsigned long)gWindow);*/			}		}	}		DisposeRgn(rgnHandle);}
开发者ID:fruitsamples,项目名称:Direct_Pixel_Access,代码行数:58,


示例18: NewRgn

//__________________________________________________________________void _HYPlatformGraphicPane::_SlidePane  (int dv, int dh){	_HYGraphicPane* theParent = (_HYGraphicPane*)this;	Rect r = {0,0,theParent->h,theParent->w};	RgnHandle dummy = NewRgn();	checkPointer (dummy);	ScrollRect(&r,dh,dv,dummy);	DisposeRgn (dummy);}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:10,


示例19: myShowMenuBar

void myShowMenuBar(void){	if (!savedgray)		return;	CopyRgn(savedgray,GetGrayRgn());	LMSetMBarHeight(savedmbh);	DisposeRgn(savedgray);	savedgray=NULL;}
开发者ID:Aleph-One-Marathon,项目名称:alephone-dingoo,代码行数:9,


示例20: LCD_free

void LCD_free(Lcd *x){	EnterCallback();		if (x->screen) freebytes(x->screen,(short)sizeof(char)*(x->cols*x->rows));		if (x->lcd_region)		DisposeRgn(x->lcd_region);	box_free((void *)x);	ExitCallback();}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:11,


示例21: qt_mac_cleanup_rgncache

static void qt_mac_cleanup_rgncache(){    rgncache_init = false;    for(int i = 0; i < RGN_CACHE_SIZE; ++i) {        if(rgncache[i]) {            --rgncache_used;            DisposeRgn(rgncache[i]);            rgncache[i] = 0;        }    }}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:11,


示例22: LCD_dolinesegment

void LCD_dolinesegment(Lcd *x, Symbol *s, short argc, Atom *argv){	PaletteHandle pH;	RGBColor fColor;	GrafPort *gp;	RgnHandle cur;	long fromx,fromy,tox,toy,color;	short save;		EnterCallback();		fromx = argv->a_w.w_long;	fromy = (argv+1)->a_w.w_long;	tox = (argv+2)->a_w.w_long;	toy = (argv+3)->a_w.w_long;	color = (argv+4)->a_w.w_long;	#ifdef debug	post("Segment");#endif	gp = patcher_setport(x->lcd_box.b_patcher);	if (gp) {		if (!box_nodraw((void *)x)) {			// save=lockout_set(1);			MoveTo(x->lcd_box.b_rect.left+1+(short)fromx,x->lcd_box.b_rect.top+1+(short)fromy);			x->lcd_where.h = (short)fromx;			x->lcd_where.v = (short)fromy;						if (color)				x->lcd_pIndex = (short)color & (numPaletteColors-1);			cur = NewRgn();			GetClip(cur);			SetClip(x->lcd_region);			setUpPalette(x,&fColor,&pH);		//	LCD_MoveTo(x,(long)(x->lcd_where.h),(long)(x->lcd_where.v));						LineTo(x->lcd_box.b_rect.left+1+(short)tox,x->lcd_box.b_rect.top+1+(short)toy);			x->lcd_where.h = (short)tox;			x->lcd_where.v = (short)toy;			restorePalette(x,&fColor,&pH);			SetClip(cur);			DisposeRgn(cur);			// lockout_set(save);		}		SetPort(gp);	}	ExitCallback();}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:54,


示例23: MCRegionExcludeRect

bool MCRegionExcludeRect(MCRegionRef self, const MCRectangle& rect){	Rect t_rect;	SetRect(&t_rect, rect . x, rect . y, rect . x + rect . width, rect . y + rect . height);	RgnHandle t_rect_rgn;	t_rect_rgn = NewRgn();	RectRgn(t_rect_rgn, &t_rect);	DiffRgn((RgnHandle)self, t_rect_rgn, (RgnHandle)self);	DisposeRgn(t_rect_rgn);	return true;}
开发者ID:Bjoernke,项目名称:livecode,代码行数:11,


示例24: getWindowDragRegion

RgnHandle getWindowDragRegion(WindowRef window, RgnHandle dragRegion){    /*------------------------------------------------------        Define the drag region of our window.    --------------------------------------------------------*/    RgnHandle structureRegion=NewRgn();    RgnHandle contentRegion=NewRgn();        SetEmptyRgn(dragRegion);        getWindowStructureRegion(window,structureRegion);    getWindowContentRegion(window,contentRegion);    //our drag region is the difference between the structural and content regions    DiffRgn(structureRegion,contentRegion,dragRegion);     DisposeRgn(structureRegion);    DisposeRgn(contentRegion);        return dragRegion;}
开发者ID:fruitsamples,项目名称:CustomWindow,代码行数:20,


示例25: MyLUpdateVisRgn

void MyLUpdateVisRgn(DialogRef theDialog, ListHandle listHdl){	#if TARGET_API_MAC_CARBON		RgnHandle   visRgn = NewRgn();		if(visRgn) GetPortVisibleRegion(GetDialogPort(theDialog), visRgn);		LUpdate(visRgn,listHdl);		if(visRgn) DisposeRgn(visRgn);		#else		LUpdate(theDialog->visRgn,listHdl);	#endif}
开发者ID:JamesMakela-NOAA,项目名称:PyGnome,代码行数:11,


示例26: DrawMapBoundsPoly

void DrawMapBoundsPoly (CMap* theMap, PolyObjectHdl MapPolyHdl, DrawSpecRecPtr drawSettings, Boolean erasePolygon){	long numPts = (**MapPolyHdl).pointCount;	POINT **pointsH = (POINT**)_NewHandle(numPts *sizeof(POINT));	POINT *pointsPtr = (POINT*)_NewPtr(numPts *sizeof(POINT));	LongPoint** thisPointsHdl=nil;	Point pt;	LongPoint wPt;	long i;	Boolean offQuickDrawPlane = false;	RGBColor saveColor; // JLM ?? wouldn't compile without this	if(!pointsH || !pointsPtr) {SysBeep(5); return;}		thisPointsHdl = (LongPoint**) (**MapPolyHdl).objectDataHdl;	for(i = 0; i< numPts;i++)	{		wPt = INDEXH(thisPointsHdl,i);		pt = GetQuickDrawPt(wPt.h,wPt.v,&gRect,&offQuickDrawPlane);		INDEXH(pointsH,i) = MakePOINT(pt.h,pt.v);		(pointsPtr)[i] = MakePOINT(pt.h,pt.v);		// code goes here, make sure this point does not equal previous point JLM	}	GetForeColor (&saveColor);		/* save original forecolor */		if (erasePolygon)		{			RgnHandle newClip=0;			HBRUSH whiteBrush;			newClip = CreatePolygonRgn((const POINT*)pointsPtr,numPts,ALTERNATE);			whiteBrush = (HBRUSH)GetStockObject(WHITE_BRUSH);			//err = SelectClipRgn(currentHDC,savedClip);			FillRgn(currentHDC, newClip, whiteBrush);			//DeleteObject(newClip);			DisposeRgn(newClip);			//SelectClipRgn(currentHDC,0);		}		else		{			POINT p[2];			p[0] = INDEXH(pointsH,numPts-1);			p[1] = INDEXH(pointsH,0);			RGBForeColor(&colors[BLACK]);			if(numPts >= 2) 			{				Polyline(currentHDC,*pointsH,numPts);				Polyline(currentHDC,p,2);	// close the polygon			}		}	RGBForeColor (&saveColor);	DisposeHandle((Handle)pointsH);	if(pointsPtr) {_DisposePtr((Ptr)pointsPtr); pointsPtr = 0;}}
开发者ID:JamesMakela-NOAA,项目名称:PyGnome,代码行数:53,


示例27: renderspu_SystemWindowApplyVisibleRegion

/*Assumes that all regions are in the guest coordinates system*/static void renderspu_SystemWindowApplyVisibleRegion(WindowInfo *window){    ContextInfo *c = renderspuGetWindowContext(window);    RgnHandle rgn;    GLboolean result = true;    DEBUG_MSG_POETZSCH (("ApplyVisibleRegion %x/n", window));    if (!c || !c->context) return;    rgn = NewRgn();    SetEmptyRgn(rgn);    if (render_spu.hRootVisibleRegion)    {        /* The render_spu.hRootVisibleRegion has coordinates from the root         * window. We intersect it with the rect of the OpenGL window we         * currently process. */        SetRectRgn(rgn,                   window->x, window->y,                   window->x + window->BltInfo.width,                   window->y + window->BltInfo.height);        SectRgn(render_spu.hRootVisibleRegion, rgn, rgn);        /* Because the clipping is done in the coordinate space of the OpenGL         * window we have to remove the x/y position from the newly created         * region. */        OffsetRgn (rgn, -window->x, -window->y);    }    else    {        /* If there is not root clipping region is available, create a base         * region with the size of the target window. This covers all         * needed/possible space. */        SetRectRgn(rgn, 0, 0, window->BltInfo.width, window->BltInfo.height);    }    /* Now intersect the window clipping region with a additional region e.g.     * for the seamless mode. */    if (window->hVisibleRegion)        SectRgn(rgn, window->hVisibleRegion, rgn);    if (rgn && !EmptyRgn(rgn))    {        /* Set the clip region to the context */        result = render_spu.ws.aglSetInteger(c->context, AGL_CLIP_REGION, (const GLint*)rgn);        CHECK_AGL_RC (result, "Render SPU (renderspu_SystemWindowVisibleRegion): SetInteger Failed");        result = render_spu.ws.aglEnable(c->context, AGL_CLIP_REGION);        CHECK_AGL_RC (result, "Render SPU (renderspu_SystemWindowVisibleRegion): Enable Failed");    }    /* Clear the region structure */    DisposeRgn (rgn);}
开发者ID:gvsurenderreddy,项目名称:virtualbox,代码行数:53,


示例28: GetRect

void GetRect(Rect *zoomFrom, Rect *zoomTo){	static short numRects = 0;	Rect theRect,drawRect;	Point firstPt,curPt,oldPt;	RgnHandle rgnHandle = NewRgn();	GrafPtr	oldPort;		GetPort(&oldPort);	SetPort(GetWindowPort(gWindow));		PenMode(patXor);		GetMouse(&firstPt);	oldPt = firstPt;	SetRect(&theRect,firstPt.h,firstPt.v,firstPt.h,firstPt.v);		while (Button()) {		GetMouse(&curPt);		if (!EqualPt(curPt,oldPt)) {			FixRect(&theRect,&drawRect);			FrameRect(&drawRect);			oldPt = curPt;			theRect.right = curPt.h;			theRect.bottom = curPt.v;			FixRect(&theRect,&drawRect);			FrameRect(&drawRect);			QDFlushPortBuffer(GetWindowPort(gWindow), GetPortVisibleRegion(GetWindowPort(gWindow), rgnHandle));		}	}			FixRect(&theRect,&drawRect);	if (numRects==0)		*zoomFrom = drawRect;	else		*zoomTo = drawRect;				numRects++;			QDFlushPortBuffer(GetWindowPort(gWindow), GetPortVisibleRegion(GetWindowPort(gWindow), rgnHandle));		if (numRects >= 2) {		ZoomRect(kZoomLarger, zoomFrom, zoomTo);		numRects = 0;	}		PenNormal();	DisposeRgn(rgnHandle);	SetPort(oldPort);}
开发者ID:fruitsamples,项目名称:ZoomRecter,代码行数:51,


示例29: bounds

/*  call-seq: bounds() -> bounds_hash    Returns a hash of boundaries. The hash contains four keys: :left, :top,   :right, :bottom. Each holds an integer representing the pixel value.*/static VALUE track_bounds(VALUE obj){  VALUE bounds_hash = rb_hash_new();  RgnHandle region;  Rect bounds;  region = GetTrackDisplayBoundsRgn(TRACK(obj));  GetRegionBounds(region, &bounds);  DisposeRgn(region);  rb_hash_aset(bounds_hash, ID2SYM(rb_intern("left")), INT2NUM(bounds.left));  rb_hash_aset(bounds_hash, ID2SYM(rb_intern("top")), INT2NUM(bounds.top));  rb_hash_aset(bounds_hash, ID2SYM(rb_intern("right")), INT2NUM(bounds.right));  rb_hash_aset(bounds_hash, ID2SYM(rb_intern("bottom")), INT2NUM(bounds.bottom));  return bounds_hash;}
开发者ID:one-k,项目名称:rmov,代码行数:20,



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


C++ DisposeWindow函数代码示例
C++ DisposePtr函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。