X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d9b33d7001af25479a63df96ca2f130b2cbc21aa..1d8acb7d4d9bd0a8343ee811f98f22388e08e2df:/wxPython/src/_dc.i?ds=sidebyside diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index 2a590d547f..6215187fcf 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -354,6 +354,57 @@ position.", " BlitPointSize); + DocDeclStr( + bool , StretchBlit(wxCoord dstX, wxCoord dstY, + wxCoord dstWidth, wxCoord dstHeight, + wxDC *source, + wxCoord srcX, wxCoord srcY, + wxCoord srcWidth, wxCoord srcHeight, + int rop = wxCOPY, bool useMask = false, + wxCoord srcMaskX = wxDefaultCoord, + wxCoord srcMaskY = 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, StretchBlit does a transparent blit using + the mask that is associated with the bitmap selected + into the source device context. + :param xsrcMask: Source x position on the mask. If both xsrcMask and + ysrcMask are -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. +"); + + + + DocDeclStrName( + bool , StretchBlit(const wxPoint& dstPt, const wxSize& dstSize, + wxDC *source, const wxPoint& srcPt, const wxSize& srcSize, + int rop = wxCOPY, bool useMask = false, + const wxPoint& srcMaskPt = wxDefaultPosition), + "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. This version is the same as `StretchBlit` +except `wx.Point` and `wx.Size` objects are used instead of individual +position and size components.", "", + StretchBlitPointSize); + + + DocDeclStr( wxBitmap , GetAsBitmap(const wxRect *subrect = NULL) const, "", ""); @@ -1299,65 +1350,6 @@ public: -//--------------------------------------------------------------------------- -%newgroup - -MustHaveApp(wxMemoryDC); - -DocStr(wxMemoryDC, -"A memory device context provides a means to draw graphics onto a -bitmap. A bitmap must be selected into the new memory DC before it may -be used for anything. Typical usage is as follows:: - - dc = wx.MemoryDC() - dc.SelectObject(bitmap) - # draw on the dc using any of the Draw methods - dc.SelectObject(wx.NullBitmap) - # the bitmap now contains wahtever was drawn upon it - -Note that the memory DC *must* be deleted (or the bitmap selected out -of it) before a bitmap can be reselected into another memory DC. -", ""); - -class wxMemoryDC : public wxDC { -public: - DocCtorStr( - wxMemoryDC(wxBitmap& bitmap = wxNullBitmap), - "Constructs a new memory device context. - -Use the Ok member to test whether the constructor was successful in -creating a usable device context. If a bitmap is not given to this -constructor then don't forget to select a bitmap into the DC before -drawing on it.", " - -:see: `MemoryDCFromDC`"); - - DocCtorStrName( - wxMemoryDC(wxDC* oldDC), - "Creates a DC that is compatible with the oldDC.", "", - MemoryDCFromDC); - - - DocDeclStr( - void , SelectObject(wxBitmap& bitmap), - "Selects the bitmap into the device context, to use as the memory -bitmap. Selecting the bitmap into a memory DC allows you to draw into -the DC, and therefore the bitmap, and also to use Blit to copy the -bitmap to a window. - -If the argument is wx.NullBitmap (or some other uninitialised -`wx.Bitmap`) the current bitmap is selected out of the device context, -and the original bitmap restored, allowing the current bitmap to be -destroyed safely.", ""); - - - DocDeclStr( - void , SelectObjectAsSource(const wxBitmap& bmp), - "", ""); - - -}; - //--------------------------------------------------------------------------- %newgroup @@ -1476,6 +1468,66 @@ public: +//--------------------------------------------------------------------------- +%newgroup + +MustHaveApp(wxMemoryDC); + +DocStr(wxMemoryDC, +"A memory device context provides a means to draw graphics onto a +bitmap. A bitmap must be selected into the new memory DC before it may +be used for anything. Typical usage is as follows:: + + dc = wx.MemoryDC() + dc.SelectObject(bitmap) + # draw on the dc using any of the Draw methods + dc.SelectObject(wx.NullBitmap) + # the bitmap now contains wahtever was drawn upon it + +Note that the memory DC *must* be deleted (or the bitmap selected out +of it) before a bitmap can be reselected into another memory DC. +", ""); + +class wxMemoryDC : public wxWindowDC { +public: + DocCtorStr( + wxMemoryDC(wxBitmap& bitmap = wxNullBitmap), + "Constructs a new memory device context. + +Use the Ok member to test whether the constructor was successful in +creating a usable device context. If a bitmap is not given to this +constructor then don't forget to select a bitmap into the DC before +drawing on it.", " + +:see: `MemoryDCFromDC`"); + + DocCtorStrName( + wxMemoryDC(wxDC* oldDC), + "Creates a DC that is compatible with the oldDC.", "", + MemoryDCFromDC); + + + DocDeclStr( + void , SelectObject(wxBitmap& bitmap), + "Selects the bitmap into the device context, to use as the memory +bitmap. Selecting the bitmap into a memory DC allows you to draw into +the DC, and therefore the bitmap, and also to use Blit to copy the +bitmap to a window. + +If the argument is wx.NullBitmap (or some other uninitialised +`wx.Bitmap`) the current bitmap is selected out of the device context, +and the original bitmap restored, allowing the current bitmap to be +destroyed safely.", ""); + + + DocDeclStr( + void , SelectObjectAsSource(const wxBitmap& bmp), + "", ""); + + +}; + + //--------------------------------------------------------------------------- %newgroup @@ -1486,7 +1538,8 @@ public: enum { wxBUFFER_VIRTUAL_AREA, - wxBUFFER_CLIENT_AREA + wxBUFFER_CLIENT_AREA, + wxBUFFER_USES_SHARED_BUFFER }; MustHaveApp(wxBufferedDC); @@ -1520,10 +1573,6 @@ that already do it automatically. class wxBufferedDC : public wxMemoryDC { public: - %pythonAppend wxBufferedDC - "self.__dc = args[0] # save a ref so the other dc will not be deleted before self"; - - %nokwargs wxBufferedDC; DocStr( wxBufferedDC, @@ -1549,8 +1598,16 @@ public: intended to cover the entire virtual size of a `wx.ScrolledWindow` or if it only covers the client area. Acceptable values are ``wx.BUFFER_VIRTUAL_AREA`` and ``wx.BUFFER_CLIENT_AREA``. - "); + + %nokwargs wxBufferedDC; + %pythonAppend wxBufferedDC +"# save a ref so the other dc will not be deleted before self + self.__dc = args[0] + # also save a ref to the bitmap + if len(args) > 1: self.__bmp = args[1] +"; + wxBufferedDC( wxDC* dc, wxBitmap& buffer=wxNullBitmap, int style = wxBUFFER_CLIENT_AREA ); @@ -1609,6 +1666,8 @@ class wxBufferedPaintDC : public wxBufferedDC { public: + %pythonAppend wxBufferedPaintDC "if len(args) > 1: self.__bmp = args[1]"; + DocCtorStr( wxBufferedPaintDC( wxWindow *window, wxBitmap &buffer = wxNullBitmap, @@ -1831,5 +1890,23 @@ public: }; #endif +//--------------------------------------------------------------------------- + +%{ +#include +%} + +class wxSVGFileDC : public wxDC +{ + %nokwargs wxSVGFileDC; + + wxSVGFileDC(wxString f); + wxSVGFileDC(wxString f, int Width, int Height); + wxSVGFileDC(wxString f, int Width, int Height, float dpi); + + ~wxSVGFileDC(); + +}; + //--------------------------------------------------------------------------- //---------------------------------------------------------------------------