+ inline wxPseudoMetaFile& GetMetaFile(int which = 0) const { return (wxPseudoMetaFile&) m_metafiles[which]; }
+
+ void OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
+
+ // Get the perimeter point using the special outline op, if there is one,
+ // otherwise use default wxRectangleShape scheme
+ bool GetPerimeterPoint(double x1, double y1,
+ double x2, double y2,
+ double *x3, double *y3);
+
+ /// Set of functions for drawing into a pseudo metafile.
+ /// They use integers, but doubles are used internally for accuracy
+ /// when scaling.
+
+ virtual void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
+ virtual void DrawRectangle(const wxRect& rect);
+ virtual void DrawRoundedRectangle(const wxRect& rect, double radius);
+ virtual void DrawArc(const wxPoint& centrePt, const wxPoint& startPt, const wxPoint& endPt);
+ virtual void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
+ virtual void DrawEllipse(const wxRect& rect);
+ virtual void DrawPoint(const wxPoint& pt);
+ virtual void DrawText(const wxString& text, const wxPoint& pt);
+ virtual void DrawLines(int n, wxPoint pts[]);
+ virtual void DrawPolygon(int n, wxPoint pts[], int flags = 0);
+ virtual void DrawSpline(int n, wxPoint pts[]);
+
+ virtual void SetClippingRect(const wxRect& rect);
+ virtual void DestroyClippingRect();
+
+ virtual void SetDrawnPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual
+ virtual void SetDrawnBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc.
+ virtual void SetDrawnFont(wxFont* font);
+ virtual void SetDrawnTextColour(const wxColour& colour);
+ virtual void SetDrawnBackgroundColour(const wxColour& colour);
+ virtual void SetDrawnBackgroundMode(int mode);
+
+ // Set the width/height according to the shapes in the metafile.
+ // Call this after drawing into the shape.
+ inline void CalculateSize() { m_metafiles[m_currentAngle].CalculateSize(this); }
+
+ inline void DrawAtAngle(int angle) { m_currentAngle = angle; };
+
+ inline int GetAngle() const { return m_currentAngle; }
+
+// Implementation
+protected:
+ // Which metafile do we use now? Based on current rotation and validity
+ // of metafiles.
+ int DetermineMetaFile(double rotation);