]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/dc.h
90a77078b517bdc7d3880dec22e2c2f1265665f3
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "dc.h"
23 #include "wx/gdicmn.h"
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
31 #define MM_ISOTROPIC 1
32 #define MM_ANISOTROPIC 2
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
44 extern int wxPageNumber
;
46 //-----------------------------------------------------------------------------
48 //-----------------------------------------------------------------------------
50 class WXDLLEXPORT wxDC
: public wxDCBase
52 DECLARE_ABSTRACT_CLASS(wxDC
)
59 virtual void BeginDrawing(void) { };
60 virtual void EndDrawing(void) { };
62 //-----------------------------------------------------------------------------
63 // Pure virtuals from wxDCBase that need defining
64 //-----------------------------------------------------------------------------
65 virtual bool CanDrawBitmap(void) const { return TRUE
; };
66 virtual bool CanGetTextExtent(void) const { return TRUE
; };
67 virtual int GetDepth(void) const;
68 virtual wxSize
GetPPI(void) const;
69 virtual void GetTextExtent( const wxString
& string
73 ,long* externalLeading
= NULL
74 ,wxFont
* theFont
= NULL
76 virtual long GetCharWidth(void) const;
77 virtual long GetCharHeight(void) const;
78 virtual void Clear(void);
79 virtual void SetFont(const wxFont
& font
);
80 virtual void SetPen(const wxPen
& pen
);
81 virtual void SetBrush(const wxBrush
& brush
);
82 virtual void SetBackground(const wxBrush
& brush
);
83 virtual void SetLogicalFunction(int function
);
84 virtual void SetBackgroundMode(int mode
);
85 virtual void SetPalette(const wxPalette
& palette
);
86 virtual void SetMapMode(int mode
);
87 virtual void DestroyClippingRegion(void);
88 virtual void SetUserScale(double x
, double y
);
89 virtual void SetLogicalOrigin(long x
, long y
);
90 virtual void SetDeviceOrigin(long x
, long y
);
91 virtual void SetAxisOrientation(bool xLeftRight
, bool yBottomUp
);
93 virtual void DoFloodFill( long x
96 ,int style
= wxFLOOD_SURFACE
98 virtual bool DoGetPixel(long x
, long y
, wxColour
*col
) const;
99 virtual void DoDrawPoint(long x
, long y
);
100 virtual void DoDrawLine(long x1
, long y1
, long x2
, long y2
);
101 virtual void DoDrawArc(long x1
, long y1
,
105 virtual void DoDrawEllipticArc( long x
, long y
107 ,double sa
, double ea
109 virtual void DoDrawRectangle(long x
, long y
, long width
, long height
);
110 virtual void DoDrawRoundedRectangle( long x
, long y
111 ,long width
, long height
114 virtual void DoDrawEllipse(long x
, long y
, long width
, long height
);
115 virtual void DoCrossHair(long x
, long y
);
116 virtual void DoDrawIcon(const wxIcon
& icon
, long x
, long y
);
117 virtual void DoDrawBitmap( const wxBitmap
&bmp
119 ,bool useMask
= FALSE
121 virtual void DoDrawText(const wxString
& text
, long x
, long y
);
122 virtual bool DoBlit( long xdest
, long ydest
123 ,long width
, long height
125 ,long xsrc
, long ysrc
126 ,int rop
= wxCOPY
, bool useMask
= FALSE
128 virtual void DoGetSize(int *width
, int *height
) const;
129 virtual void DoGetSizeMM(int* width
, int* height
) const;
130 virtual void DoDrawLines( int n
, wxPoint points
[]
131 ,long xoffset
, long yoffset
133 virtual void DoDrawPolygon( int n
, wxPoint points
[]
134 ,long xoffset
, long yoffset
135 ,int fillStyle
= wxODDEVEN_RULE
137 virtual void DoSetClippingRegionAsRegion(const wxRegion
& region
);
138 virtual void DoSetClippingRegion( long x
, long y
139 ,long width
, long height
142 virtual void DoDrawSpline(wxList
*points
);
145 //-----------------------------------------------------------------------------
146 // Other virtuals from wxDCBase that are overridden here
147 //-----------------------------------------------------------------------------
149 virtual void SetLogicalScale( double x
, double y
);
151 //-----------------------------------------------------------------------------
153 //-----------------------------------------------------------------------------
154 virtual void SetInternalDeviceOrigin( long x
, long y
);
155 virtual void GetInternalDeviceOrigin( long *x
, long *y
);
159 void ComputeScaleAndOrigin(void);
160 long XDEV2LOG(long x
) const;
161 long XDEV2LOGREL(long x
) const;
162 long YDEV2LOG(long y
) const;
163 long YDEV2LOGREL(long y
) const;
164 long XLOG2DEV(long x
) const;
165 long XLOG2DEVREL(long x
) const;
166 long YLOG2DEV(long y
) const;
167 long YLOG2DEVREL(long y
) const;
169 #if WXWIN_COMPATIBILITY
170 // function hiding warning supression
171 virtual void GetTextExtent( const wxString
& string
174 ,long* descent
= NULL
175 ,long* externalLeading
= NULL
176 ,wxFont
* theFont
= NULL
179 { wxDCBase::GetTextExtent(string
, width
, height
, descent
, externalLeading
, theFont
, use16
); };
184 // ------------------------------------------------------------------------
185 // Some additional data we need
186 // ------------------------------------------------------------------------
188 // Owner canvas and selected in bitmap (if bitmap is GDI object selected)
192 // our HDC and its usage count: we only free it when the usage count drops
197 // Store all old GDI objects when do a SelectObject, so we can select them
198 // back in (this unselecting user's objects) so we can safely delete the
200 WXHBITMAP m_oldBitmap
;
204 WXHPALETTE m_oldPalette
;