+ void SetTextForeground(const wxColour& colour);
+
+ /**
+ Sets the current layout direction for the device context.
+
+ @param dir
+ May be either @c wxLayout_Default, @c wxLayout_LeftToRight or
+ @c wxLayout_RightToLeft.
+
+ @see GetLayoutDirection()
+ */
+ void SetLayoutDirection(wxLayoutDirection dir);
+
+ //@}
+
+
+ /**
+ @name Bounding box functions
+ */
+ //@{
+
+ /**
+ Adds the specified point to the bounding box which can be retrieved
+ with MinX(), MaxX() and MinY(), MaxY() functions.
+
+ @see ResetBoundingBox()
+ */
+ void CalcBoundingBox(wxCoord x, wxCoord y);
+
+ /**
+ Gets the maximum horizontal extent used in drawing commands so far.
+ */
+ wxCoord MaxX() const;
+
+ /**
+ Gets the maximum vertical extent used in drawing commands so far.
+ */
+ wxCoord MaxY() const;
+
+ /**
+ Gets the minimum horizontal extent used in drawing commands so far.
+ */
+ wxCoord MinX() const;
+
+ /**
+ Gets the minimum vertical extent used in drawing commands so far.
+ */
+ wxCoord MinY() const;
+
+ /**
+ Resets the bounding box: after a call to this function, the bounding
+ box doesn't contain anything.
+
+ @see CalcBoundingBox()
+ */
+ void ResetBoundingBox();
+
+ //@}
+
+
+ /**
+ @name Page and document start/end functions
+ */
+ //@{
+
+ /**
+ Starts a document (only relevant when outputting to a printer).
+ @a message is a message to show while printing.
+ */
+ bool StartDoc(const wxString& message);
+
+ /**
+ Starts a document page (only relevant when outputting to a printer).
+ */
+ void StartPage();
+
+ /**
+ Ends a document (only relevant when outputting to a printer).
+ */
+ void EndDoc();
+
+ /**
+ Ends a document page (only relevant when outputting to a printer).
+ */
+ void EndPage();
+
+ //@}
+
+
+ /**
+ @name Bit-Block Transfer operations (blit)
+ */
+ //@{
+
+ /**
+ Copy from a source DC to this DC, specifying the destination
+ coordinates, size of area to copy, source DC, source coordinates,
+ logical function, whether to use a bitmap mask, and mask source
+ position.
+
+ @param xdest
+ Destination device context x position.
+ @param ydest
+ Destination device context y position.
+ @param width
+ Width of source area to be copied.
+ @param height
+ Height of source area to be copied.
+ @param source
+ Source device context.
+ @param xsrc
+ Source device context x position.
+ @param ysrc
+ Source device context y position.
+ @param logicalFunc
+ Logical function to use, see SetLogicalFunction().
+ @param useMask
+ If @true, Blit does a transparent blit using the mask that is
+ associated with the bitmap selected into the source device context.
+ The Windows implementation does the following if MaskBlt cannot be
+ used:
+ <ol>
+ <li>Creates a temporary bitmap and copies the destination area into
+ it.</li>
+ <li>Copies the source area into the temporary bitmap using the
+ specified logical function.</li>
+ <li>Sets the masked area in the temporary bitmap to BLACK by ANDing
+ the mask bitmap with the temp bitmap with the foreground colour
+ set to WHITE and the bg colour set to BLACK.</li>
+ <li>Sets the unmasked area in the destination area to BLACK by
+ ANDing the mask bitmap with the destination area with the
+ foreground colour set to BLACK and the background colour set to
+ WHITE.</li>
+ <li>ORs the temporary bitmap with the destination area.</li>
+ <li>Deletes the temporary bitmap.</li>
+ </ol>
+ This sequence of operations ensures that the source's transparent
+ area need not be black, and logical functions are supported.
+ @n @b Note: on Windows, blitting with masks can be speeded up
+ considerably by compiling wxWidgets with the wxUSE_DC_CACHEING option
+ enabled. You can also influence whether MaskBlt or the explicit
+ mask blitting code above is used, by using wxSystemOptions and
+ setting the @c no-maskblt option to 1.
+ @param xsrcMask
+ Source x position on the mask. If both xsrcMask and ysrcMask are
+ @c -1, xsrc and ysrc will be assumed for the mask source position.
+ Currently only implemented on Windows.
+ @param ysrcMask
+ Source y position on the mask. If both xsrcMask and ysrcMask are
+ @c -1, xsrc and ysrc will be assumed for the mask source position.
+ Currently only implemented on Windows.
+
+ @remarks There is partial support for Blit() in wxPostScriptDC, under X.
+
+ @see StretchBlit(), wxMemoryDC, wxBitmap, wxMask
+ */
+ bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width,
+ wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc,
+ wxRasterOperationMode logicalFunc = wxCOPY, bool useMask = false,
+ wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
+
+ /**
+ Copy from a source DC to this DC, specifying the destination
+ coordinates, destination size, source DC, source coordinates, size of
+ source area to copy, logical function, whether to use a bitmap mask,
+ and mask source position.
+
+ @param xdest
+ Destination device context x position.
+ @param ydest
+ Destination device context y position.
+ @param dstWidth
+ Width of destination area.
+ @param dstHeight
+ Height of destination area.
+ @param source
+ Source device context.
+ @param xsrc
+ Source device context x position.
+ @param ysrc
+ Source device context y position.
+ @param srcWidth
+ Width of source area to be copied.
+ @param srcHeight
+ Height of source area to be copied.
+ @param logicalFunc
+ Logical function to use, see SetLogicalFunction().
+ @param useMask
+ If @true, Blit does a transparent blit using the mask that is
+ associated with the bitmap selected into the source device context.
+ The Windows implementation does the following if MaskBlt cannot be
+ used:
+ <ol>
+ <li>Creates a temporary bitmap and copies the destination area into
+ it.</li>
+ <li>Copies the source area into the temporary bitmap using the
+ specified logical function.</li>
+ <li>Sets the masked area in the temporary bitmap to BLACK by ANDing
+ the mask bitmap with the temp bitmap with the foreground colour
+ set to WHITE and the bg colour set to BLACK.</li>
+ <li>Sets the unmasked area in the destination area to BLACK by
+ ANDing the mask bitmap with the destination area with the
+ foreground colour set to BLACK and the background colour set to
+ WHITE.</li>
+ <li>ORs the temporary bitmap with the destination area.</li>
+ <li>Deletes the temporary bitmap.</li>
+ </ol>
+ This sequence of operations ensures that the source's transparent
+ area need not be black, and logical functions are supported.
+ @n @b Note: on Windows, blitting with masks can be speeded up
+ considerably by compiling wxWidgets with the wxUSE_DC_CACHEING option
+ enabled. You can also influence whether MaskBlt or the explicit
+ mask blitting code above is used, by using wxSystemOptions and
+ setting the @c no-maskblt option to 1.
+ @param xsrcMask
+ Source x position on the mask. If both xsrcMask and ysrcMask are
+ wxDefaultCoord, @a xsrc and @a ysrc will be assumed for the mask
+ source position. Currently only implemented on Windows.
+ @param ysrcMask
+ Source y position on the mask. If both xsrcMask and ysrcMask are
+ wxDefaultCoord, @a xsrc and @a ysrc will be assumed for the mask
+ source position. Currently only implemented on Windows.
+
+ There is partial support for Blit() in wxPostScriptDC, under X.
+
+ StretchBlit() is only implemented under wxMAC and wxMSW.
+
+ See wxMemoryDC for typical usage.
+
+ @since 2.9.0
+
+ @see Blit(), wxMemoryDC, wxBitmap, wxMask
+ */
+ bool StretchBlit(wxCoord xdest, wxCoord ydest,
+ wxCoord dstWidth, wxCoord dstHeight,
+ wxDC* source, wxCoord xsrc, wxCoord ysrc,
+ wxCoord srcWidth, wxCoord srcHeight,
+ wxRasterOperationMode logicalFunc = wxCOPY,
+ bool useMask = false,
+ wxCoord xsrcMask = wxDefaultCoord,
+ wxCoord ysrcMask = wxDefaultCoord);
+ //@}
+
+
+ /**
+ @name Background/foreground brush and pen
+ */
+ //@{
+
+ /**
+ Gets the brush used for painting the background.
+
+ @see wxDC::SetBackground()
+ */
+ const wxBrush& GetBackground() const;
+
+ /**
+ Gets the current brush.
+
+ @see wxDC::SetBrush()
+ */
+ const wxBrush& GetBrush() const;
+
+ /**
+ Gets the current pen.
+
+ @see SetPen()
+ */
+ const wxPen& GetPen() const;
+
+ /**
+ Sets the current background brush for the DC.
+ */
+ void SetBackground(const wxBrush& brush);
+
+ /**
+ Sets the current brush for the DC.
+
+ If the argument is ::wxNullBrush (or another invalid brush; see wxBrush::IsOk),
+ the current brush is selected out of the device context (leaving wxDC without
+ any valid brush), allowing the current brush to be destroyed safely.
+
+ @see wxBrush, wxMemoryDC (for the interpretation of colours when
+ drawing into a monochrome bitmap)
+ */
+ void SetBrush(const wxBrush& brush);
+
+ /**
+ Sets the current pen for the DC.
+
+ If the argument is ::wxNullPen (or another invalid pen; see wxPen::IsOk),
+ the current pen is selected out of the device context (leaving wxDC without any
+ valid pen), allowing the current pen to be destroyed safely.
+
+ @see wxMemoryDC for the interpretation of colours when drawing into a
+ monochrome bitmap.
+ */
+ void SetPen(const wxPen& pen);
+
+ //@}
+
+
+ /**
+ Copy attributes from another DC.
+
+ The copied attributes currently are:
+ - Font
+ - Text foreground and background colours
+ - Background brush
+ - Layout direction
+
+ @param dc
+ A valid (i.e. its IsOk() must return @true) source device context.
+ */
+ void CopyAttributes(const wxDC& dc);