]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/dc.h
made wxUSE_UNICODE=1 the default
[wxWidgets.git] / include / wx / motif / dc.h
CommitLineData
9b6dbb09 1/////////////////////////////////////////////////////////////////////////////
925f7740 2// Name: wx/motif/dc.h
9b6dbb09
JS
3// Purpose: wxDC class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
9b6dbb09
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DC_H_
13#define _WX_DC_H_
14
9b6dbb09
JS
15#include "wx/pen.h"
16#include "wx/brush.h"
17#include "wx/icon.h"
18#include "wx/font.h"
19#include "wx/gdicmn.h"
20
21//-----------------------------------------------------------------------------
22// constants
23//-----------------------------------------------------------------------------
24
25#ifndef MM_TEXT
83df96d6
JS
26#define MM_TEXT 0
27#define MM_ISOTROPIC 1
28#define MM_ANISOTROPIC 2
29#define MM_LOMETRIC 3
30#define MM_HIMETRIC 4
31#define MM_TWIPS 5
32#define MM_POINTS 6
33#define MM_METRIC 7
9b6dbb09
JS
34#endif
35
9b6dbb09
JS
36//-----------------------------------------------------------------------------
37// wxDC
38//-----------------------------------------------------------------------------
39
af0bb3b1 40class WXDLLEXPORT wxDC : public wxDCBase
9b6dbb09 41{
af0bb3b1 42 DECLARE_DYNAMIC_CLASS(wxDC)
d16b634f 43
af0bb3b1
VZ
44public:
45 wxDC();
d3c7fc99 46 virtual ~wxDC() { }
d16b634f 47
af0bb3b1 48 virtual wxSize GetPPI() const;
d16b634f 49
af0bb3b1 50protected:
7b65ea1a
MB
51 virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
52 virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
b1263dcf 53 bool useMask = false);
d16b634f 54
7b65ea1a 55 virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
83df96d6 56 wxCoord width, wxCoord height);
af0bb3b1
VZ
57 virtual void DoGetSize(int *width, int *height) const;
58 virtual void DoGetSizeMM(int* width, int* height) const;
d16b634f 59
af0bb3b1 60public:
04ab8b6d
RR
61 // implementation
62 wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); }
63 wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); }
64 wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); }
65 wxCoord YDEV2LOGREL(wxCoord y) const { return DeviceToLogicalYRel(y); }
66 wxCoord XLOG2DEV(wxCoord x) const { return LogicalToDeviceX(x); }
67 wxCoord XLOG2DEVREL(wxCoord x) const { return LogicalToDeviceXRel(x); }
68 wxCoord YLOG2DEV(wxCoord y) const { return LogicalToDeviceY(y); }
69 wxCoord YLOG2DEVREL(wxCoord y) const { return LogicalToDeviceYRel(y); }
70
af0bb3b1 71 // Without device translation, for backing pixmap purposes
7b65ea1a 72 wxCoord XLOG2DEV_2(wxCoord x) const
9b6dbb09 73 {
04ab8b6d 74 return wxRound((double)(x - m_logicalOriginX) * m_scaleX) * m_signX;
9b6dbb09 75 }
7b65ea1a 76 wxCoord YLOG2DEV_2(wxCoord y) const
9b6dbb09 77 {
04ab8b6d 78 return wxRound((double)(y - m_logicalOriginY) * m_scaleY) * m_signY;
9b6dbb09 79 }
d16b634f 80
9b6dbb09
JS
81};
82
83#endif
83df96d6 84// _WX_DC_H_