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$
|
|
|
|
// Copyright: (c) Julian Smart and Markus Holzem
|
1999-06-09 07:32:32 -04:00
|
|
|
// Licence: wxWindows license
|
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
|
|
|
#ifdef __GNUG__
|
1999-06-09 07:32:32 -04:00
|
|
|
#pragma interface "dcclient.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/dc.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
|
|
|
|
struct WXDLLEXPORT 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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxWindowDC : public wxDC
|
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
|
1999-06-09 07:32:32 -04:00
|
|
|
wxWindowDC();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
// Create a DC corresponding to the whole window
|
|
|
|
wxWindowDC(wxWindow *win);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2001-04-08 21:22:48 -04:00
|
|
|
protected:
|
|
|
|
// intiialize the newly created DC
|
|
|
|
void InitDC();
|
|
|
|
|
2002-02-23 16:32:45 -05:00
|
|
|
// override some base class virtuals
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-04-08 21:22:48 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
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
|
1999-06-09 07:32:32 -04:00
|
|
|
wxClientDC();
|
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
|
|
|
|
wxClientDC(wxWindow *win);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
virtual ~wxClientDC();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void InitDC();
|
|
|
|
|
2002-02-23 16:32:45 -05:00
|
|
|
// override some base class virtuals
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
|
2001-04-08 21:22:48 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
class WXDLLEXPORT wxPaintDC : public wxClientDC
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-06-09 07:32:32 -04:00
|
|
|
public:
|
|
|
|
wxPaintDC();
|
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()
|
|
|
|
wxPaintDC(wxWindow *win);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-06-09 07:32:32 -04:00
|
|
|
virtual ~wxPaintDC();
|
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
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_DCCLIENT_H_
|