CCPaintDC Class Reference

#include <ccdc.h>

Inheritance diagram for CCPaintDC:

CCDC ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 CCPaintDC (wxWindow *)
 Similar to a CPaintDC but also gives us the functionality of a CCDC. In particular we can get at the clipping rectangle list. Constructor for CCPaintDC which gets the update rectangle list before doing a BeginPaint.
 ~CCPaintDC ()
 Destructor for CCPaintDC which does an EndPaint.

Private Attributes

wxPaintDC m_DC

Detailed Description

Definition at line 143 of file ccdc.h.


Constructor & Destructor Documentation

CCPaintDC::CCPaintDC wxWindow *  pWnd  ) 
 

Similar to a CPaintDC but also gives us the functionality of a CCDC. In particular we can get at the clipping rectangle list. Constructor for CCPaintDC which gets the update rectangle list before doing a BeginPaint.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/93
Parameters:
Pointer to owner window. [INPUTS]
None [OUTPUTS]
Returns:
None

Errors: - Scope: Public

See also:
CCDC;RenderType

Definition at line 507 of file ccdc.cpp.

00507                                    : CCDC(RENDERTYPE_SCREEN), m_DC(pWnd)
00508 {
00509     // Register this DC with the DC type system and set that it is temporary
00510     CCDC::SetDC(&m_DC, FALSE);
00511 
00512 #ifndef EXCLUDE_FROM_XARALX
00513     // Loose the old region data
00514     CCFree( lpRgnData );
00515     lpRgnData = NULL;
00516 
00517     // Setup the DC
00518 //  m_pDc       = this;
00519     m_clipping  = true;
00520 
00521 #if defined(__WXMSW__)
00522     // before the BeginPaint we must extract
00523     // the update region. This is so we can more efficiently paint the window, especially after
00524     // diagonal scrolls.
00525     HRGN                hRgn = CreateRectRgn(0,0,0,0);
00526     if( hRgn )
00527     {
00528         INT32 result = ::GetUpdateRgn( HWND(pWnd->GetHandle()), hRgn, FALSE );
00529         if (result==COMPLEXREGION)
00530         {
00531             // How many regions are there in there
00532             DWORD res = GetRegionData( hRgn, 0, NULL );
00533 
00534             // If there are some and there are less than our limit then get the info about them
00535             if ((res!=0) && (res<MAX_REGIONS))
00536             {
00537                 // alloc space to put the region data in
00538                 lpRgnData = (LPRGNDATA)CCMalloc( res );
00539                 if (lpRgnData)
00540                 {
00541                     // alloced buffer - use it
00542                     lpRgnData->rdh.dwSize = sizeof(RGNDATAHEADER);
00543                     DWORD newres = GetRegionData( hRgn, res, lpRgnData );
00544 
00545                     // Note GetRegionData is documented wrongly - when it works it returns the size, not 1
00546                     if (newres!=res)
00547                     {
00548                         // error occurred somehow so tidy up heap
00549                         CCFree( lpRgnData );
00550                         lpRgnData = NULL;
00551 
00552                         if (newres!=0)
00553                             TRACE( _T("GetRegionData changed from %lu to %lu\n"), res, newres);
00554                     }
00555                 }
00556             }
00557         }
00558         DeleteObject( hRgn );
00559     }
00560 #endif
00561 #endif
00562 }

CCPaintDC::~CCPaintDC  ) 
 

Destructor for CCPaintDC which does an EndPaint.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None

Errors: - Scope: Public

Definition at line 580 of file ccdc.cpp.

00581 {
00582 }


Member Data Documentation

wxPaintDC CCPaintDC::m_DC [private]
 

Definition at line 151 of file ccdc.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:52:09 2007 for Camelot by  doxygen 1.4.4