2003-03-21 21:56:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2003-04-06 21:44:11 -04:00
|
|
|
// Name: wx/cocoa/dc.h
|
|
|
|
// Purpose: wxDC
|
|
|
|
// Author: David Elliott
|
2003-03-21 21:56:04 -05:00
|
|
|
// Modified by:
|
2003-04-06 21:44:11 -04:00
|
|
|
// Created: 2003/04/01
|
2003-03-21 21:56:04 -05:00
|
|
|
// RCS-ID: $Id$
|
2003-04-06 21:44:11 -04:00
|
|
|
// Copyright: (c) 2003 David Elliott
|
|
|
|
// Licence: wxWindows license
|
2003-03-21 21:56:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2003-04-06 21:44:11 -04:00
|
|
|
#ifndef __WX_COCOA_DC_H__
|
|
|
|
#define __WX_COCOA_DC_H__
|
2003-03-21 21:56:04 -05:00
|
|
|
|
2003-04-06 21:44:11 -04:00
|
|
|
//=========================================================================
|
|
|
|
// wxDC
|
|
|
|
//=========================================================================
|
2003-03-21 21:56:04 -05:00
|
|
|
class WXDLLEXPORT wxDC: public wxDCBase
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxDC)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxDC)
|
2003-04-06 21:44:11 -04:00
|
|
|
public:
|
2003-03-21 21:56:04 -05:00
|
|
|
wxDC();
|
|
|
|
~wxDC();
|
|
|
|
|
2003-04-06 21:44:11 -04:00
|
|
|
static void CocoaInitializeTextSystem();
|
|
|
|
static void CocoaShutdownTextSystem();
|
|
|
|
static wxDC *sm_focusedDC;
|
|
|
|
static WX_NSTextStorage sm_cocoaNSTextStorage;
|
|
|
|
static WX_NSLayoutManager sm_cocoaNSLayoutManager;
|
|
|
|
static WX_NSTextContainer sm_cocoaNSTextContainer;
|
2003-03-21 21:56:04 -05:00
|
|
|
|
|
|
|
// implement base class pure virtuals
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
virtual void Clear();
|
|
|
|
|
|
|
|
virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; }
|
|
|
|
virtual void EndDoc(void) {};
|
|
|
|
|
|
|
|
virtual void StartPage(void) {};
|
|
|
|
virtual void EndPage(void) {};
|
|
|
|
|
|
|
|
virtual void SetFont(const wxFont& font) {}
|
|
|
|
virtual void SetPen(const wxPen& pen);
|
|
|
|
virtual void SetBrush(const wxBrush& brush);
|
|
|
|
virtual void SetBackground(const wxBrush& brush);
|
2003-07-10 16:59:27 -04:00
|
|
|
virtual void SetBackgroundMode(int mode) { m_backgroundMode = mode; }
|
2003-03-21 21:56:04 -05:00
|
|
|
virtual void SetPalette(const wxPalette& palette);
|
|
|
|
|
|
|
|
virtual void DestroyClippingRegion();
|
|
|
|
|
|
|
|
virtual wxCoord GetCharHeight() const;
|
|
|
|
virtual wxCoord GetCharWidth() const;
|
|
|
|
virtual void DoGetTextExtent(const wxString& string,
|
|
|
|
wxCoord *x, wxCoord *y,
|
|
|
|
wxCoord *descent = NULL,
|
|
|
|
wxCoord *externalLeading = NULL,
|
|
|
|
wxFont *theFont = NULL) const;
|
|
|
|
|
|
|
|
virtual bool CanDrawBitmap() const;
|
|
|
|
virtual bool CanGetTextExtent() const;
|
|
|
|
virtual int GetDepth() const;
|
|
|
|
virtual wxSize GetPPI() const;
|
|
|
|
|
|
|
|
virtual void SetMapMode(int mode);
|
|
|
|
virtual void SetUserScale(double x, double y);
|
|
|
|
|
|
|
|
virtual void SetLogicalScale(double x, double y);
|
|
|
|
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
|
|
|
|
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
|
|
|
|
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
|
|
|
|
virtual void SetLogicalFunction(int function);
|
|
|
|
|
|
|
|
virtual void SetTextForeground(const wxColour& colour) ;
|
|
|
|
virtual void SetTextBackground(const wxColour& colour) ;
|
|
|
|
|
|
|
|
void ComputeScaleAndOrigin(void);
|
|
|
|
protected:
|
|
|
|
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
|
|
|
int style = wxFLOOD_SURFACE);
|
|
|
|
|
|
|
|
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
|
|
|
|
|
|
|
|
virtual void DoDrawPoint(wxCoord x, wxCoord y);
|
|
|
|
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
|
|
|
|
|
|
|
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
|
|
|
|
wxCoord x2, wxCoord y2,
|
|
|
|
wxCoord xc, wxCoord yc);
|
|
|
|
|
|
|
|
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
|
|
|
double sa, double ea);
|
|
|
|
|
|
|
|
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
|
|
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
|
|
|
wxCoord width, wxCoord height,
|
|
|
|
double radius);
|
|
|
|
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
|
|
|
|
|
|
virtual void DoCrossHair(wxCoord x, wxCoord y);
|
|
|
|
|
|
|
|
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
|
|
|
|
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
|
|
|
bool useMask = FALSE);
|
|
|
|
|
|
|
|
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
|
|
|
|
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
|
|
|
|
double angle);
|
|
|
|
|
|
|
|
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
|
|
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
|
|
|
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
|
|
|
|
|
|
|
|
// this is gnarly - we can't even call this function DoSetClippingRegion()
|
|
|
|
// because of virtual function hiding
|
|
|
|
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
|
|
|
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
|
|
|
wxCoord width, wxCoord height);
|
|
|
|
|
|
|
|
virtual void DoGetSize(int *width, int *height) const;
|
|
|
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
|
|
|
|
|
|
|
virtual void DoDrawLines(int n, wxPoint points[],
|
|
|
|
wxCoord xoffset, wxCoord yoffset);
|
|
|
|
virtual void DoDrawPolygon(int n, wxPoint points[],
|
|
|
|
wxCoord xoffset, wxCoord yoffset,
|
|
|
|
int fillStyle = wxODDEVEN_RULE);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2003-04-06 21:44:11 -04:00
|
|
|
#endif // __WX_COCOA_DC_H__
|