%{
#include "helpers.h"
-#include <wx/metafile.h>
#include <wx/imaglist.h>
-#ifndef __WXMSW__
-#include <wx/dcps.h>
-#endif
#include <wx/fontmap.h>
#include <wx/fontenc.h>
#include <wx/fontmap.h>
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);
wxFONTENCODING_CP866, // and another one
// and for Windows
wxFONTENCODING_CP874, // WinThai
+ wxFONTENCODING_CP932, // Japanese (shift-JIS)
+ wxFONTENCODING_CP936, // Chiniese simplified (GB)
+ wxFONTENCODING_CP949, // Korean (Hangul charset)
+ wxFONTENCODING_CP950, // Chinese (traditional - Big5)
wxFONTENCODING_CP1250, // WinLatin2
wxFONTENCODING_CP1251, // WinCyrillic
wxFONTENCODING_CP1252, // WinLatin1
+
+// The list of ints for the dashes needs to exist for the life of the pen
+// so we make it part of the class to save it. wxPyPen is aliased to wxPen
+// in _extras.py
+
%{
class wxPyPen : public wxPen {
public:
{ m_dash = NULL; }
~wxPyPen() {
if (m_dash)
- delete m_dash;
+ delete [] m_dash;
}
void SetDashes(int nb_dashes, const wxDash *dash) {
+ if (m_dash)
+ delete [] m_dash;
m_dash = new wxDash[nb_dashes];
- for (int i=0; i<nb_dashes; i++)
+ for (int i=0; i<nb_dashes; i++) {
m_dash[i] = dash[i];
+ }
wxPen::SetDashes(nb_dashes, m_dash);
}
%}
-
class wxPyPen : public wxPen {
public:
wxPyPen(wxColour& colour, int width=1, int style=wxSOLID);
+
class wxPenList : public wxObject {
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) {
obj = PySequence_GetItem(pyPens, i);
}
if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) {
+ if (!isFastPens)
+ Py_DECREF(obj);
goto err1;
}
obj = PySequence_GetItem(pyPoints, i);
}
if (! _2int_seq_helper(obj, &x1, &y1)) {
- Py_DECREF(obj);
+ if (!isFastPens)
+ Py_DECREF(obj);
goto err0;
}
obj = PySequence_GetItem(pyPens, i);
}
if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) {
+ if (!isFastPens)
+ Py_DECREF(obj);
goto err1;
}
obj = PySequence_GetItem(pyLines, i);
}
if (! _4int_seq_helper(obj, &x1, &y1, &x2, &y2)) {
- Py_DECREF(obj);
+ if (!isFastPens)
+ Py_DECREF(obj);
goto err0;
}
//---------------------------------------------------------------------------
-#ifndef __WXMSW__
-class wxPostScriptDC : public wxDC {
+
+#ifdef __WXMSW__
+
+%{
+#include <wx/metafile.h>
+%}
+
+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
//---------------------------------------------------------------------------