1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dcclient.h
|
|
|
|
// Purpose: wxClientDC class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_DCCLIENT_H_
|
|
|
|
#define _WX_DCCLIENT_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#include "wx/dc.h"
|
2007-11-30 08:48:22 -05:00
|
|
|
#include "wx/msw/dc.h"
|
|
|
|
#include "wx/dcclient.h"
|
1999-06-09 14:09:47 -04:00
|
|
|
#include "wx/dynarray.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// array types
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// this one if used by wxPaintDC only
|
2007-07-09 06:09:52 -04:00
|
|
|
struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
|
1999-06-10 19:00:03 -04:00
|
|
|
|
1999-10-12 19:57:40 -04:00
|
|
|
WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
1999-06-09 07:32:32 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// DC classes
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
2001-04-08 21:22:48 -04:00
|
|
|
// default ctor
|
2007-11-30 08:48:22 -05:00
|
|
|
wxWindowDCImpl( wxDC *owner );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding to the whole window
|
2007-11-30 08:48:22 -05:00
|
|
|
wxWindowDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-12-06 11:22:00 -05:00
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-04-08 21:22:48 -04:00
|
|
|
protected:
|
2005-05-31 05:20:43 -04:00
|
|
|
// initialize the newly created DC
|
2001-04-08 21:22:48 -04:00
|
|
|
void InitDC();
|
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
DECLARE_CLASS(wxWindowDCImpl)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
2001-04-08 21:22:48 -04:00
|
|
|
// default ctor
|
2007-11-30 08:48:22 -05:00
|
|
|
wxClientDCImpl( wxDC *owner );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding to the client area of the window
|
2007-11-30 08:48:22 -05:00
|
|
|
wxClientDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
virtual ~wxClientDCImpl();
|
2001-06-26 16:59:19 -04:00
|
|
|
|
2007-12-06 11:22:00 -05:00
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
protected:
|
|
|
|
void InitDC();
|
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
DECLARE_CLASS(wxClientDCImpl)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
2007-11-30 08:48:22 -05:00
|
|
|
wxPaintDCImpl( wxDC *owner );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding for painting the window in OnPaint()
|
2007-11-30 08:48:22 -05:00
|
|
|
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
virtual ~wxPaintDCImpl();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2000-08-03 12:11:51 -04:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
|
|
|
static WXHDC FindDCInCache(wxWindow* win);
|
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
protected:
|
|
|
|
static wxArrayDCInfo ms_cache;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
|
|
|
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
2001-04-08 21:22:48 -04:00
|
|
|
|
2007-11-30 08:48:22 -05:00
|
|
|
DECLARE_CLASS(wxPaintDCImpl)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2003-07-29 10:27:18 -04:00
|
|
|
/*
|
|
|
|
* wxPaintDCEx
|
|
|
|
* This class is used when an application sends an HDC with the WM_PAINT
|
|
|
|
* message. It is used in HandlePaint and need not be used by an application.
|
|
|
|
*/
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
|
2003-07-29 10:27:18 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2003-07-29 10:27:18 -04:00
|
|
|
DECLARE_CLASS(wxPaintDCEx)
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCEx);
|
2003-07-29 10:27:18 -04:00
|
|
|
};
|
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_DCCLIENT_H_
|