2005-05-04 14:57:50 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/dcmemory.h
|
|
|
|
// Purpose: wxMemoryDC base header
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created:
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows Licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_DCMEMORY_H_BASE_
|
|
|
|
#define _WX_DCMEMORY_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-01-24 19:18:12 -05:00
|
|
|
#include "wx/defs.h"
|
2006-10-30 15:51:19 -05:00
|
|
|
#include "wx/bitmap.h"
|
2006-01-24 19:18:12 -05:00
|
|
|
|
2006-10-30 14:41:46 -05:00
|
|
|
// NOTE: different native implementations of wxMemoryDC will derive from
|
|
|
|
// different wxDC classes (wxPaintDC, wxWindowDC, etc), so that
|
|
|
|
// we cannot derive wxMemoryDCBase from wxDC and then use it as the
|
|
|
|
// only base class for native impl of wxMemoryDC...
|
|
|
|
class wxMemoryDCBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxMemoryDCBase() { }
|
|
|
|
|
|
|
|
// avoid warnings about having virtual functions but non virtual dtor
|
|
|
|
virtual ~wxMemoryDCBase() { }
|
|
|
|
|
|
|
|
// select the given bitmap to draw on it
|
|
|
|
void SelectObject(wxBitmap& bmp)
|
|
|
|
{
|
|
|
|
// make sure that the given wxBitmap is not sharing its data with other
|
|
|
|
// wxBitmap instances as its contents will be modified by any drawing
|
|
|
|
// operation done on this DC
|
|
|
|
if (bmp.IsOk())
|
|
|
|
bmp.UnShare();
|
|
|
|
|
|
|
|
DoSelect(bmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
// select the given bitmap for read-only
|
|
|
|
virtual void SelectObjectAsSource(const wxBitmap& bmp)
|
|
|
|
{
|
|
|
|
DoSelect(bmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void DoSelect(const wxBitmap& bmp) = 0;
|
|
|
|
};
|
|
|
|
|
2004-12-20 07:44:22 -05:00
|
|
|
#if defined(__WXPALMOS__)
|
2004-10-19 09:40:30 -04:00
|
|
|
#include "wx/palmos/dcmemory.h"
|
|
|
|
#elif defined(__WXMSW__)
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/msw/dcmemory.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
1998-08-14 20:23:28 -04:00
|
|
|
#include "wx/motif/dcmemory.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/gtk/dcmemory.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/dcmemory.h"
|
2002-02-05 11:34:33 -05:00
|
|
|
#elif defined(__WXX11__)
|
|
|
|
#include "wx/x11/dcmemory.h"
|
2001-06-26 16:59:19 -04:00
|
|
|
#elif defined(__WXMGL__)
|
|
|
|
#include "wx/mgl/dcmemory.h"
|
2006-08-27 05:42:42 -04:00
|
|
|
#elif defined(__WXDFB__)
|
|
|
|
#include "wx/dfb/dcmemory.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/dcmemory.h"
|
2003-03-22 01:18:36 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/dcmemory.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/dcmemory.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_DCMEMORY_H_BASE_
|