//---------------------------------------------------------------------------
+
+// TODO: When the API stabalizes and is available on other platforms, add
+// wrappers for the new wxBitmap, wxRawBitmap, wxDIB stuff...
+
class wxBitmap : public wxGDIObject
{
public:
void SetQuality(int q);
#endif
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
#endif
void CopyFromBitmap(const wxBitmap& bmp);
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
class wxCursor : public wxGDIObject
{
public:
-#ifdef __WXMSW__
- wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0);
+ %addmethods {
+ wxCursor(const wxString* cursorName, long flags, int hotSpotX=0, int hotSpotY=0) {
+#ifdef __WXGTK__
+ wxCHECK_MSG(FALSE, NULL,
+ wxT("wxCursor constructor not implemented for wxGTK, use wxStockCursor, wxCursorFromImage, or wxCursorFromBits instead."));
+#else
+ return new wxCursor(*cursorName, flags, hotSpotX, hotSpotY);
#endif
+ }
+ }
+
~wxCursor();
// wxGDIImage methods
void SetDepth(int d);
void SetSize(const wxSize& size);
#endif
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
%name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id);
-%{ // Alternate 'constructor'
+%new wxCursor* wxCursorFromImage(const wxImage& image);
+%new wxCursor* wxCursorFromBits(PyObject* bits, int width, int height,
+ int hotSpotX=-1, int hotSpotY=-1,
+ PyObject* maskBits=0);
+
+%{
wxCursor* wxPyStockCursor(int id) {
return new wxCursor(id);
}
-%}
-%new wxCursor* wxCursorFromImage(const wxImage& image);
-%{
wxCursor* wxCursorFromImage(const wxImage& image) {
- #ifndef __WXMAC__
return new wxCursor(image);
- #else
- return NULL;
- #endif
+ }
+
+ wxCursor* wxCursorFromBits(PyObject* bits, int width, int height,
+ int hotSpotX=-1, int hotSpotY=-1,
+ PyObject* maskBits=0) {
+ char* bitsbuf;
+ char* maskbuf = NULL;
+ int length;
+ PyString_AsStringAndSize(bits, &bitsbuf, &length);
+ if (maskBits)
+ PyString_AsStringAndSize(maskBits, &maskbuf, &length);
+ return new wxCursor(bitsbuf, width, height, hotSpotX, hotSpotY, maskbuf);
}
%}
wxBitmap* GetStipple();
void SetStipple(wxBitmap& stipple);
#endif
+
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
void SetColour(wxColour &colour);
void SetStipple(wxBitmap& bitmap);
void SetStyle(int style);
+
+#ifdef __WXMAC__
+ short GetMacTheme();
+ void SetMacTheme(short macThemeBrush);
+#endif
+
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
// See below for implementation
}
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
+
#ifdef __WXMSW__
long GetHDC();
#endif
const wxString& GetFileName() const { return m_filename; }
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
// bool wxMakeMetaFilePlaceable(const wxString& filename,
int GetPixel(byte red, byte green, byte blue);
bool GetRGB(int pixel, byte* OUTPUT, byte* OUTPUT, byte* OUTPUT);
bool Ok();
+
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.Ok()"
};
//---------------------------------------------------------------------------
#ifndef __WXMAC__
%name(wxRegionFromPoints)wxRegion(int PCOUNT, wxPoint* points, int fillStyle = wxWINDING_RULE);
#endif
+ %name(wxRegionFromBitmap)wxRegion(const wxBitmap& bmp,
+ const wxColour& transColour = wxNullColour,
+ int tolerance = 0);
~wxRegion();
+
void Clear();
#ifndef __WXMAC__
bool Offset(wxCoord x, wxCoord y);
bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
%name(XorRect)bool Xor(const wxRect& rect);
%name(XorRegion)bool Xor(const wxRegion& region);
+
+ // Convert the region to a B&W bitmap with the white pixels being inside
+ // the region.
+ wxBitmap ConvertToBitmap();
+
+ // Use the non-transparent pixels of a wxBitmap for the region to combine
+ // with this region. If the bitmap has a mask then it will be used,
+ // otherwise the colour to be treated as transparent may be specified,
+ // along with an optional tolerance value.
+ %name(UnionBitmap)bool Union(const wxBitmap& bmp,
+ const wxColour& transColour = wxNullColour,
+ int tolerance = 0);
};
//---------------------------------------------------------------------------
+
%readonly
%{
#if 0