X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d37f9642887a5602d7c0b59527f213c32dd501a..9e392a09f1d058c5d46e686cea418724e2476f87:/wxPython/src/gdi.i diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 41e9a47f33..48cbbb569b 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -15,11 +15,7 @@ %{ #include "helpers.h" -#include #include -#ifndef __WXMSW__ -#include -#endif #include #include #include @@ -58,13 +54,13 @@ public: class wxBitmap : public wxGDIObject { public: - wxBitmap(const wxString& name, wxBitmapType type); + wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_BMP); ~wxBitmap(); wxPalette* GetPalette(); wxMask* GetMask(); - bool LoadFile(const wxString& name, long flags); - bool SaveFile(const wxString& name, int type, wxPalette* palette = NULL); + bool LoadFile(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_BMP); + bool SaveFile(const wxString& name, wxBitmapType type, wxPalette* palette = NULL); void SetMask(wxMask* mask); #ifdef __WXMSW__ void SetPalette(wxPalette& palette); @@ -829,6 +825,10 @@ public: %addmethods { + // NOTE: These methods are VERY SIMILAR in implentation. It would be + // nice to factor out common code and or turn them into a set of + // template-like macros. + // Draw a point for every set of coordinants in pyPoints, optionally // setting a new pen for each PyObject* _DrawPointList(PyObject* pyPoints, PyObject* pyPens) { @@ -860,6 +860,8 @@ public: obj = PySequence_GetItem(pyPens, i); } if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) { + if (!isFastPens) + Py_DECREF(obj); goto err1; } @@ -876,7 +878,8 @@ public: obj = PySequence_GetItem(pyPoints, i); } if (! _2int_seq_helper(obj, &x1, &y1)) { - Py_DECREF(obj); + if (!isFastPens) + Py_DECREF(obj); goto err0; } @@ -930,6 +933,8 @@ public: obj = PySequence_GetItem(pyPens, i); } if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) { + if (!isFastPens) + Py_DECREF(obj); goto err1; } @@ -946,7 +951,8 @@ public: obj = PySequence_GetItem(pyLines, i); } if (! _4int_seq_helper(obj, &x1, &y1, &x2, &y2)) { - Py_DECREF(obj); + if (!isFastPens) + Py_DECREF(obj); goto err0; } @@ -1055,22 +1061,41 @@ public: //--------------------------------------------------------------------------- -#ifndef __WXMSW__ -class wxPostScriptDC : public wxDC { + +#ifdef __WXMSW__ + +%{ +#include +%} + +class wxMetaFile : public wxObject { public: - wxPostScriptDC(const wxString& output, bool interactive = TRUE, wxWindow* win = NULL); + wxMetaFile(const wxString& filename = wxPyEmptyStr); + ~wxMetaFile(); + + bool Ok(); + bool SetClipboard(int width = 0, int height = 0); + + wxSize GetSize(); + int GetWidth(); + int GetHeight(); + + const wxString& GetFileName() const { return m_filename; } + }; -#endif -//--------------------------------------------------------------------------- +// bool wxMakeMetaFilePlaceable(const wxString& filename, +// int minX, int minY, int maxX, int maxY, float scale=1.0); -#ifdef __WXMSW__ class wxMetaFileDC : public wxDC { public: - wxMetaFileDC(const wxString& filename = wxPyEmptyStr); + wxMetaFileDC(const wxString& filename = wxPyEmptyStr, + int width = 0, int height = 0, + const wxString& description = wxPyEmptyStr); wxMetaFile* Close(); }; + #endif //---------------------------------------------------------------------------