// get the number of formats we support
virtual size_t GetFormatCount(Direction dir = Get) const;
- // returns TRUE if this format is supported
+ // returns True if this format is supported
bool IsSupported(const wxDataFormat& format, Direction dir = Get) const;
// get the (total) size of data for the given format
Direction dir = Get) const;
// copy raw data (in the specified format) to the provided buffer, return
- // TRUE if data copied successfully, FALSE otherwise
+ // True if data copied successfully, False otherwise
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
// get data from the buffer of specified length (in the given format),
- // return TRUE if the data was read successfully, FALSE otherwise
+ // return True if the data was read successfully, False otherwise
virtual bool SetData(const wxDataFormat& format,
size_t len, const void * buf);
};
// wxDataObjectSimple is a wxDataObject which only supports one format (in
-// both Get and Set directions, but you may return FALSE from GetDataHere() or
+// both Get and Set directions, but you may return False from GetDataHere() or
// SetData() if one of them is not supported). This is the simplest possible
// wxDataObject implementation.
//
// return either a string or None and then act appropriately with the
// C++ version.
- bool rval = FALSE;
+ bool rval = False;
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "GetDataHere")) {
PyObject* ro;
bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) const{
// For this one we simply need to make a string from buf and len
// and send it to the Python method.
- bool rval = FALSE;
+ bool rval = False;
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "SetData")) {
PyObject* data = PyString_FromStringAndSize((char*)buf, len);
// Now define it for SWIG
class wxPyDataObjectSimple : public wxDataObjectSimple {
public:
- %addtofunc wxPyDataObjectSimple "self._setCallbackInfo(self, PyDataObjectSimple)"
+ %pythonAppend wxPyDataObjectSimple "self._setCallbackInfo(self, PyDataObjectSimple)"
wxPyDataObjectSimple(const wxDataFormat& format = wxFormatInvalid);
void _setCallbackInfo(PyObject* self, PyObject* _class);
public:
wxDataObjectComposite();
- %addtofunc Add "args[1].thisown = 0"
- void Add(wxDataObjectSimple *dataObject, int preferred = FALSE);
+ %apply SWIGTYPE *DISOWN { wxDataObjectSimple *dataObject };
+ void Add(wxDataObjectSimple *dataObject, int preferred = False);
+ %clear wxDataObjectSimple *dataObject;
};
//---------------------------------------------------------------------------
// Now define it for SWIG
class wxPyTextDataObject : public wxTextDataObject {
public:
- %addtofunc wxPyTextDataObject "self._setCallbackInfo(self, PyTextDataObject)"
+ %pythonAppend wxPyTextDataObject "self._setCallbackInfo(self, PyTextDataObject)"
wxPyTextDataObject(const wxString& text = wxPyEmptyString);
void _setCallbackInfo(PyObject* self, PyObject* _class);
void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
wxPyBeginBlockThreads();
if (wxPyCBH_findCallback(m_myInst, "SetBitmap")) {
- PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"), false);
+ PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"), False);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", bo));
Py_DECREF(bo);
}
// Now define it for SWIG
class wxPyBitmapDataObject : public wxBitmapDataObject {
public:
- %addtofunc wxPyBitmapDataObject "self._setCallbackInfo(self, PyBitmapDataObject)"
+ %pythonAppend wxPyBitmapDataObject "self._setCallbackInfo(self, PyBitmapDataObject)"
wxPyBitmapDataObject(const wxBitmap& bitmap = wxNullBitmap);
void _setCallbackInfo(PyObject* self, PyObject* _class);
wxFileDataObject();
const wxArrayString& GetFilenames();
-#ifdef __WXMSW__
void AddFile(const wxString &filename);
-#endif
};
else {
// raise a TypeError if not a string
PyErr_SetString(PyExc_TypeError, "String expected.");
- return FALSE;
+ return False;
}
}
}
//---------------------------------------------------------------------------
-#ifndef __WXGTK__
+#if defined(__WXMSW__) || defined(__WXMAC__)
%{
#include <wx/metafile.h>
class wxMetafileDataObject : public wxDataObjectSimple
{
public:
- wxMetafileDataObject() { PyErr_SetNone(PyExc_NotImplementedError); }
+ wxMetafileDataObject() { wxPyRaiseNotImplemented(); }
};
%}