//----------------------------------------------------------------------------- bool PluginGUIEditor::onWheel (float distance) { if (frame) { CDrawContext context (frame, NULL, systemWindow); CPoint where; context.getMouseLocation (where); return frame->onWheel (&context, where, distance); } return false; }
//----------------------------------------------------------------------------- long AEffGUIEditor::mouse (long x, long y) { #if VSTGUI_ENABLE_DEPRECATED_METHODS if (frame) { CDrawContext* context = frame->createDrawContext(); CPoint where (x, y); frame->mouse (context, where); context->forget (); return 1; } #endif // #if VSTGUI_ENABLE_DEPRECATED_METHODS return 0; }
//----------------------------------------------------------------------------- void AEffGUIEditor::draw (ERect* ppErect) { if (frame) { CRect r; if (ppErect) r (ppErect->left, ppErect->top, ppErect->right, ppErect->bottom); else r = frame->getViewSize (); CDrawContext* context = frame->createDrawContext(); frame->drawRect (context, r); context->forget(); } }
//----------------------------------------------------------------------------- bool AEffGUIEditor::onWheel (float distance) { #if VSTGUI_ENABLE_DEPRECATED_METHODS if (frame) { CDrawContext* context = frame->createDrawContext (); CPoint where; context->getMouseLocation (where); long buttons = context->getMouseButtons (); bool result = frame->onWheel (where, distance, buttons); context->forget (); return result; } #endif return false; }
//----------------------------------------------------------------------------- CDrawContext::Transform::Transform (CDrawContext& context, const CGraphicsTransform& transformation) : context (context) , transformation (transformation) { if (transformation.isInvariant () == false) context.pushTransform (transformation); }
void CHTMLHorizontalRuleSection::OnDraw( CDrawContext &dc ) { #ifdef DRAW_DEBUG CHTMLSectionABC::OnDraw( dc ); #endif // DRAW_DEBUG if( m_bNoShade ) { dc.FillRect( *this, m_crColor ); } else { // REVIEW - russf - bogus bit of OS specific drawing *not* in the right place. if( Height() == 2 ) ::DrawEdge( dc.GetSafeHdc(), *this, BDR_SUNKENOUTER, BF_TOP | BF_BOTTOM ); else ::DrawEdge( dc.GetSafeHdc(), *this, BDR_SUNKENOUTER, BF_RECT ); } }
//----------------------------------------------------------------------------- void PluginGUIEditor::draw (ERect *ppErect) { #if VSTGUI_ENABLE_DEPRECATED_METHODS if (frame) { CRect r; if (ppErect) r (ppErect->left, ppErect->top, ppErect->right, ppErect->bottom); else r = frame->getViewSize (); CDrawContext* context = frame->createDrawContext (); if (context) { frame->drawRect (context, r); context->forget(); } } #endif }
void Caret::show() { if( frame_ ) { CDrawContext* context = frame_->createDrawContext(); context->setFrameColor( kBlackCColor ); context->setLineWidth( 1 ); CPoint p = position_; context->moveTo( p ); p.offset( 0, height_ ); context->lineTo( p ); context->forget(); } }
//----------------------------------------------------------------------------- void Win32Frame::paint (HWND hwnd) { HRGN rgn = CreateRectRgn (0, 0, 0, 0); if (GetUpdateRgn (hwnd, rgn, false) == NULLREGION) { DeleteObject (rgn); return; } inPaint = true; PAINTSTRUCT ps; HDC hdc = BeginPaint (hwnd, &ps); if (hdc) { CRect updateRect ((CCoord)ps.rcPaint.left, (CCoord)ps.rcPaint.top, (CCoord)ps.rcPaint.right, (CCoord)ps.rcPaint.bottom); CRect frameSize; getSize (frameSize); frameSize.offset (-frameSize.left, -frameSize.top); if (deviceContext == 0) deviceContext = createDrawContext (hwnd, hdc, frameSize); if (deviceContext) { deviceContext->setClipRect (updateRect); CDrawContext* drawContext = backBuffer ? backBuffer : deviceContext; drawContext->beginDraw (); DWORD len = GetRegionData (rgn, 0, NULL); if (len) { if (len > updateRegionListSize) { if (updateRegionList) free (updateRegionList); updateRegionListSize = len; updateRegionList = (RGNDATA*) malloc (updateRegionListSize); } GetRegionData (rgn, len, updateRegionList); if (updateRegionList->rdh.nCount > 0) { RECT* rp = (RECT*)updateRegionList->Buffer; for (uint32_t i = 0; i < updateRegionList->rdh.nCount; i++) { CRect ur (rp->left, rp->top, rp->right, rp->bottom); paintRect = ur; drawContext->clearRect (ur); getFrame ()->platformDrawRect (drawContext, ur); rp++; } } else { getFrame ()->platformDrawRect (drawContext, updateRect); } } drawContext->endDraw (); if (backBuffer) { deviceContext->beginDraw (); deviceContext->clearRect (updateRect); backBuffer->copyFrom (deviceContext, updateRect, CPoint (updateRect.left, updateRect.top)); deviceContext->endDraw (); } } } EndPaint (hwnd, &ps); DeleteObject (rgn); inPaint = false; }