ID_UNDELETE = _core_.ID_UNDELETE
ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
ID_HIGHEST = _core_.ID_HIGHEST
-ACCEL_ALT = _core_.ACCEL_ALT
-ACCEL_CTRL = _core_.ACCEL_CTRL
-ACCEL_SHIFT = _core_.ACCEL_SHIFT
-ACCEL_NORMAL = _core_.ACCEL_NORMAL
PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
PD_APP_MODAL = _core_.PD_APP_MODAL
PD_CAN_ABORT = _core_.PD_CAN_ABORT
def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGB bytes and be
- width*height*3 bytes long. A buffer object can optionally be supplied for
- the image's alpha channel data, and it is expected to be width*height
- bytes long.
+ parameter must be a Python object that implements the buffer interface,
+ such as a string, array, etc. The dataBuffer object is expected to
+ contain a series of RGB bytes and be width*height*3 bytes long. A buffer
+ object can optionally be supplied for the image's alpha channel data, and
+ it is expected to be width*height bytes long.
The wx.Image will be created with its data and alpha pointers initialized
to the memory address pointed to by the buffer objects, thus saving the
the objects used for the data and alpha buffers in a way that would cause
them to change size.
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
- if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
- alphaBuffer = buffer(alphaBuffer)
image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
image._buffer = dataBuffer
image._alpha = alphaBuffer
#---------------------------------------------------------------------------
+ACCEL_ALT = _core_.ACCEL_ALT
+ACCEL_CTRL = _core_.ACCEL_CTRL
+ACCEL_SHIFT = _core_.ACCEL_SHIFT
+ACCEL_NORMAL = _core_.ACCEL_NORMAL
+ACCEL_CMD = _core_.ACCEL_CMD
class AcceleratorEntry(object):
"""
A class used to define items in an `wx.AcceleratorTable`. wxPython
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
{
}
arg1 = reinterpret_cast< wxImage * >(argp1);
{
- if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
}
arg1 = reinterpret_cast< wxImage * >(argp1);
{
- if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
arg1 = reinterpret_cast< wxImage * >(argp1);
{
if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
}
{
arg1 = reinterpret_cast< wxImage * >(argp1);
{
if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
}
{
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
if (obj3) {
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
}
SWIG_Python_SetConstant(d, "ID_UNDELETE",SWIG_From_int(static_cast< int >(wxID_UNDELETE)));
SWIG_Python_SetConstant(d, "ID_REVERT_TO_SAVED",SWIG_From_int(static_cast< int >(wxID_REVERT_TO_SAVED)));
SWIG_Python_SetConstant(d, "ID_HIGHEST",SWIG_From_int(static_cast< int >(wxID_HIGHEST)));
- SWIG_Python_SetConstant(d, "ACCEL_ALT",SWIG_From_int(static_cast< int >(wxACCEL_ALT)));
- SWIG_Python_SetConstant(d, "ACCEL_CTRL",SWIG_From_int(static_cast< int >(wxACCEL_CTRL)));
- SWIG_Python_SetConstant(d, "ACCEL_SHIFT",SWIG_From_int(static_cast< int >(wxACCEL_SHIFT)));
- SWIG_Python_SetConstant(d, "ACCEL_NORMAL",SWIG_From_int(static_cast< int >(wxACCEL_NORMAL)));
SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE)));
SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL)));
SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT)));
SWIG_Python_SetConstant(d, "PYAPP_ASSERT_LOG",SWIG_From_int(static_cast< int >(wxPYAPP_ASSERT_LOG)));
SWIG_Python_SetConstant(d, "PRINT_WINDOWS",SWIG_From_int(static_cast< int >(wxPRINT_WINDOWS)));
SWIG_Python_SetConstant(d, "PRINT_POSTSCRIPT",SWIG_From_int(static_cast< int >(wxPRINT_POSTSCRIPT)));
+ SWIG_Python_SetConstant(d, "ACCEL_ALT",SWIG_From_int(static_cast< int >(wxACCEL_ALT)));
+ SWIG_Python_SetConstant(d, "ACCEL_CTRL",SWIG_From_int(static_cast< int >(wxACCEL_CTRL)));
+ SWIG_Python_SetConstant(d, "ACCEL_SHIFT",SWIG_From_int(static_cast< int >(wxACCEL_SHIFT)));
+ SWIG_Python_SetConstant(d, "ACCEL_NORMAL",SWIG_From_int(static_cast< int >(wxACCEL_NORMAL)));
+ SWIG_Python_SetConstant(d, "ACCEL_CMD",SWIG_From_int(static_cast< int >(wxACCEL_CMD)));
SWIG_addvarlink(SWIG_globals(),(char*)"NullAcceleratorTable",NullAcceleratorTable_get, NullAcceleratorTable_set);
SWIG_addvarlink(SWIG_globals(),(char*)"PanelNameStr",PanelNameStr_get, PanelNameStr_set);
SWIG_Python_SetConstant(d, "WINDOW_VARIANT_NORMAL",SWIG_From_int(static_cast< int >(wxWINDOW_VARIANT_NORMAL)));
def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGB bytes and be
- width*height*3 bytes long. A buffer object can optionally be supplied for
- the image's alpha channel data, and it is expected to be width*height
- bytes long. On Windows the RGB values are 'premultiplied' by the alpha
- values. (The other platforms appear to already be premultiplying the
- alpha.)
-
- Unlike `wx.ImageFromBuffer` the bitmap created with this function does not
- share the memory buffer with the buffer object. This is because the
- native pixel buffer format varies on different platforms, and so instead
- an efficient as possible copy of the data is made from the buffer objects
- to the bitmap's native pixel buffer. For direct access to a bitmap's
- pixel buffer see `wx.NativePixelData` and `wx.AlphaPixelData`.
+ parameter must be a Python object that implements the buffer
+ interface, such as a string, array, etc. The dataBuffer object is
+ expected to contain a series of RGB bytes and be width*height*3
+ bytes long. A buffer object can optionally be supplied for the
+ image's alpha channel data, and it is expected to be width*height
+ bytes long. On Windows the RGB values are 'premultiplied' by the
+ alpha values. (The other platforms do the multiplication
+ themselves.)
+
+ Unlike `wx.ImageFromBuffer` the bitmap created with this function
+ does not share the memory buffer with the buffer object. This is
+ because the native pixel buffer format varies on different
+ platforms, and so instead an efficient as possible copy of the
+ data is made from the buffer objects to the bitmap's native pixel
+ buffer. For direct access to a bitmap's pixel buffer see
+ `wx.NativePixelData` and `wx.AlphaPixelData`.
:see: `wx.Bitmap`, `wx.BitmapFromBufferRGBA`, `wx.NativePixelData`,
`wx.AlphaPixelData`, `wx.ImageFromBuffer`
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
- if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
- alphaBuffer = buffer(alphaBuffer)
if alphaBuffer is not None:
return _gdi_._BitmapFromBufferAlpha(width, height, dataBuffer, alphaBuffer)
else:
def BitmapFromBufferRGBA(width, height, dataBuffer):
"""
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGBA bytes (red,
- green, blue and alpha) and be width*height*4 bytes long. On Windows the
- RGB values are 'premultiplied' by the alpha values. (The other platforms
- appear to already be premultiplying the alpha.)
-
- Unlike `wx.ImageFromBuffer` the bitmap created with this function does not
- share the memory buffer with the buffer object. This is because the
- native pixel buffer format varies on different platforms, and so instead
- an efficient as possible copy of the data is made from the buffer object
- to the bitmap's native pixel buffer. For direct access to a bitmap's
- pixel buffer see `wx.NativePixelData` and `wx.AlphaPixelData`.
+ parameter must be a Python object that implements the buffer
+ interface, such as a string, array, etc. The dataBuffer object is
+ expected to contain a series of RGBA bytes (red, green, blue and
+ alpha) and be width*height*4 bytes long. On Windows the RGB
+ values are 'premultiplied' by the alpha values. (The other
+ platforms do the multiplication themselves.)
+
+ Unlike `wx.ImageFromBuffer` the bitmap created with this function
+ does not share the memory buffer with the buffer object. This is
+ because the native pixel buffer format varies on different
+ platforms, and so instead an efficient as possible copy of the
+ data is made from the buffer object to the bitmap's native pixel
+ buffer. For direct access to a bitmap's pixel buffer see
+ `wx.NativePixelData` and `wx.AlphaPixelData`.
:see: `wx.Bitmap`, `wx.BitmapFromBuffer`, `wx.NativePixelData`,
`wx.AlphaPixelData`, `wx.ImageFromBuffer`
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
class PixelDataBase(object):
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
{
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
result = (wxBitmap *)_BitmapFromBuffer(arg1,arg2,arg3,arg4);
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
result = (wxBitmap *)_BitmapFromBufferRGBA(arg1,arg2,arg3,arg4);
ID_UNDELETE = _core_.ID_UNDELETE
ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
ID_HIGHEST = _core_.ID_HIGHEST
-ACCEL_ALT = _core_.ACCEL_ALT
-ACCEL_CTRL = _core_.ACCEL_CTRL
-ACCEL_SHIFT = _core_.ACCEL_SHIFT
-ACCEL_NORMAL = _core_.ACCEL_NORMAL
PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
PD_APP_MODAL = _core_.PD_APP_MODAL
PD_CAN_ABORT = _core_.PD_CAN_ABORT
def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGB bytes and be
- width*height*3 bytes long. A buffer object can optionally be supplied for
- the image's alpha channel data, and it is expected to be width*height
- bytes long.
+ parameter must be a Python object that implements the buffer interface,
+ such as a string, array, etc. The dataBuffer object is expected to
+ contain a series of RGB bytes and be width*height*3 bytes long. A buffer
+ object can optionally be supplied for the image's alpha channel data, and
+ it is expected to be width*height bytes long.
The wx.Image will be created with its data and alpha pointers initialized
to the memory address pointed to by the buffer objects, thus saving the
the objects used for the data and alpha buffers in a way that would cause
them to change size.
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
- if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
- alphaBuffer = buffer(alphaBuffer)
image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
image._buffer = dataBuffer
image._alpha = alphaBuffer
#---------------------------------------------------------------------------
+ACCEL_ALT = _core_.ACCEL_ALT
+ACCEL_CTRL = _core_.ACCEL_CTRL
+ACCEL_SHIFT = _core_.ACCEL_SHIFT
+ACCEL_NORMAL = _core_.ACCEL_NORMAL
+ACCEL_CMD = _core_.ACCEL_CMD
class AcceleratorEntry(object):
"""
A class used to define items in an `wx.AcceleratorTable`. wxPython
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
{
}
arg1 = reinterpret_cast< wxImage * >(argp1);
{
- if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
}
arg1 = reinterpret_cast< wxImage * >(argp1);
{
- if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
arg1 = reinterpret_cast< wxImage * >(argp1);
{
if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
}
{
arg1 = reinterpret_cast< wxImage * >(argp1);
{
if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
}
{
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
if (obj3) {
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
}
SWIG_Python_SetConstant(d, "ID_UNDELETE",SWIG_From_int(static_cast< int >(wxID_UNDELETE)));
SWIG_Python_SetConstant(d, "ID_REVERT_TO_SAVED",SWIG_From_int(static_cast< int >(wxID_REVERT_TO_SAVED)));
SWIG_Python_SetConstant(d, "ID_HIGHEST",SWIG_From_int(static_cast< int >(wxID_HIGHEST)));
- SWIG_Python_SetConstant(d, "ACCEL_ALT",SWIG_From_int(static_cast< int >(wxACCEL_ALT)));
- SWIG_Python_SetConstant(d, "ACCEL_CTRL",SWIG_From_int(static_cast< int >(wxACCEL_CTRL)));
- SWIG_Python_SetConstant(d, "ACCEL_SHIFT",SWIG_From_int(static_cast< int >(wxACCEL_SHIFT)));
- SWIG_Python_SetConstant(d, "ACCEL_NORMAL",SWIG_From_int(static_cast< int >(wxACCEL_NORMAL)));
SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE)));
SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL)));
SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT)));
SWIG_Python_SetConstant(d, "PYAPP_ASSERT_LOG",SWIG_From_int(static_cast< int >(wxPYAPP_ASSERT_LOG)));
SWIG_Python_SetConstant(d, "PRINT_WINDOWS",SWIG_From_int(static_cast< int >(wxPRINT_WINDOWS)));
SWIG_Python_SetConstant(d, "PRINT_POSTSCRIPT",SWIG_From_int(static_cast< int >(wxPRINT_POSTSCRIPT)));
+ SWIG_Python_SetConstant(d, "ACCEL_ALT",SWIG_From_int(static_cast< int >(wxACCEL_ALT)));
+ SWIG_Python_SetConstant(d, "ACCEL_CTRL",SWIG_From_int(static_cast< int >(wxACCEL_CTRL)));
+ SWIG_Python_SetConstant(d, "ACCEL_SHIFT",SWIG_From_int(static_cast< int >(wxACCEL_SHIFT)));
+ SWIG_Python_SetConstant(d, "ACCEL_NORMAL",SWIG_From_int(static_cast< int >(wxACCEL_NORMAL)));
+ SWIG_Python_SetConstant(d, "ACCEL_CMD",SWIG_From_int(static_cast< int >(wxACCEL_CMD)));
SWIG_addvarlink(SWIG_globals(),(char*)"NullAcceleratorTable",NullAcceleratorTable_get, NullAcceleratorTable_set);
SWIG_addvarlink(SWIG_globals(),(char*)"PanelNameStr",PanelNameStr_get, PanelNameStr_set);
SWIG_Python_SetConstant(d, "WINDOW_VARIANT_NORMAL",SWIG_From_int(static_cast< int >(wxWINDOW_VARIANT_NORMAL)));
def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGB bytes and be
- width*height*3 bytes long. A buffer object can optionally be supplied for
- the image's alpha channel data, and it is expected to be width*height
- bytes long. On Windows the RGB values are 'premultiplied' by the alpha
- values. (The other platforms appear to already be premultiplying the
- alpha.)
-
- Unlike `wx.ImageFromBuffer` the bitmap created with this function does not
- share the memory buffer with the buffer object. This is because the
- native pixel buffer format varies on different platforms, and so instead
- an efficient as possible copy of the data is made from the buffer objects
- to the bitmap's native pixel buffer. For direct access to a bitmap's
- pixel buffer see `wx.NativePixelData` and `wx.AlphaPixelData`.
+ parameter must be a Python object that implements the buffer
+ interface, such as a string, array, etc. The dataBuffer object is
+ expected to contain a series of RGB bytes and be width*height*3
+ bytes long. A buffer object can optionally be supplied for the
+ image's alpha channel data, and it is expected to be width*height
+ bytes long. On Windows the RGB values are 'premultiplied' by the
+ alpha values. (The other platforms do the multiplication
+ themselves.)
+
+ Unlike `wx.ImageFromBuffer` the bitmap created with this function
+ does not share the memory buffer with the buffer object. This is
+ because the native pixel buffer format varies on different
+ platforms, and so instead an efficient as possible copy of the
+ data is made from the buffer objects to the bitmap's native pixel
+ buffer. For direct access to a bitmap's pixel buffer see
+ `wx.NativePixelData` and `wx.AlphaPixelData`.
:see: `wx.Bitmap`, `wx.BitmapFromBufferRGBA`, `wx.NativePixelData`,
`wx.AlphaPixelData`, `wx.ImageFromBuffer`
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
- if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
- alphaBuffer = buffer(alphaBuffer)
if alphaBuffer is not None:
return _gdi_._BitmapFromBufferAlpha(width, height, dataBuffer, alphaBuffer)
else:
def BitmapFromBufferRGBA(width, height, dataBuffer):
"""
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGBA bytes (red,
- green, blue and alpha) and be width*height*4 bytes long. On Windows the
- RGB values are 'premultiplied' by the alpha values. (The other platforms
- appear to already be premultiplying the alpha.)
-
- Unlike `wx.ImageFromBuffer` the bitmap created with this function does not
- share the memory buffer with the buffer object. This is because the
- native pixel buffer format varies on different platforms, and so instead
- an efficient as possible copy of the data is made from the buffer object
- to the bitmap's native pixel buffer. For direct access to a bitmap's
- pixel buffer see `wx.NativePixelData` and `wx.AlphaPixelData`.
+ parameter must be a Python object that implements the buffer
+ interface, such as a string, array, etc. The dataBuffer object is
+ expected to contain a series of RGBA bytes (red, green, blue and
+ alpha) and be width*height*4 bytes long. On Windows the RGB
+ values are 'premultiplied' by the alpha values. (The other
+ platforms do the multiplication themselves.)
+
+ Unlike `wx.ImageFromBuffer` the bitmap created with this function
+ does not share the memory buffer with the buffer object. This is
+ because the native pixel buffer format varies on different
+ platforms, and so instead an efficient as possible copy of the
+ data is made from the buffer object to the bitmap's native pixel
+ buffer. For direct access to a bitmap's pixel buffer see
+ `wx.NativePixelData` and `wx.AlphaPixelData`.
:see: `wx.Bitmap`, `wx.BitmapFromBuffer`, `wx.NativePixelData`,
`wx.AlphaPixelData`, `wx.ImageFromBuffer`
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
class PixelDataBase(object):
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
{
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
result = (wxBitmap *)_BitmapFromBuffer(arg1,arg2,arg3,arg4);
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
result = (wxBitmap *)_BitmapFromBufferRGBA(arg1,arg2,arg3,arg4);
ID_UNDELETE = _core_.ID_UNDELETE
ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
ID_HIGHEST = _core_.ID_HIGHEST
-ACCEL_ALT = _core_.ACCEL_ALT
-ACCEL_CTRL = _core_.ACCEL_CTRL
-ACCEL_SHIFT = _core_.ACCEL_SHIFT
-ACCEL_NORMAL = _core_.ACCEL_NORMAL
PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
PD_APP_MODAL = _core_.PD_APP_MODAL
PD_CAN_ABORT = _core_.PD_CAN_ABORT
def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGB bytes and be
- width*height*3 bytes long. A buffer object can optionally be supplied for
- the image's alpha channel data, and it is expected to be width*height
- bytes long.
+ parameter must be a Python object that implements the buffer interface,
+ such as a string, array, etc. The dataBuffer object is expected to
+ contain a series of RGB bytes and be width*height*3 bytes long. A buffer
+ object can optionally be supplied for the image's alpha channel data, and
+ it is expected to be width*height bytes long.
The wx.Image will be created with its data and alpha pointers initialized
to the memory address pointed to by the buffer objects, thus saving the
the objects used for the data and alpha buffers in a way that would cause
them to change size.
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
- if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
- alphaBuffer = buffer(alphaBuffer)
image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
image._buffer = dataBuffer
image._alpha = alphaBuffer
#---------------------------------------------------------------------------
+ACCEL_ALT = _core_.ACCEL_ALT
+ACCEL_CTRL = _core_.ACCEL_CTRL
+ACCEL_SHIFT = _core_.ACCEL_SHIFT
+ACCEL_NORMAL = _core_.ACCEL_NORMAL
+ACCEL_CMD = _core_.ACCEL_CMD
class AcceleratorEntry(object):
"""
A class used to define items in an `wx.AcceleratorTable`. wxPython
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
{
}
arg1 = reinterpret_cast< wxImage * >(argp1);
{
- if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
}
arg1 = reinterpret_cast< wxImage * >(argp1);
{
- if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
arg1 = reinterpret_cast< wxImage * >(argp1);
{
if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
}
{
arg1 = reinterpret_cast< wxImage * >(argp1);
{
if (obj1 != Py_None) {
- if (!PyArg_Parse(obj1, "t#", &arg2, &arg3)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj1, (const void**)(&arg2), &arg3) == -1) SWIG_fail;
}
}
{
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
if (obj3) {
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
}
SWIG_Python_SetConstant(d, "ID_UNDELETE",SWIG_From_int(static_cast< int >(wxID_UNDELETE)));
SWIG_Python_SetConstant(d, "ID_REVERT_TO_SAVED",SWIG_From_int(static_cast< int >(wxID_REVERT_TO_SAVED)));
SWIG_Python_SetConstant(d, "ID_HIGHEST",SWIG_From_int(static_cast< int >(wxID_HIGHEST)));
- SWIG_Python_SetConstant(d, "ACCEL_ALT",SWIG_From_int(static_cast< int >(wxACCEL_ALT)));
- SWIG_Python_SetConstant(d, "ACCEL_CTRL",SWIG_From_int(static_cast< int >(wxACCEL_CTRL)));
- SWIG_Python_SetConstant(d, "ACCEL_SHIFT",SWIG_From_int(static_cast< int >(wxACCEL_SHIFT)));
- SWIG_Python_SetConstant(d, "ACCEL_NORMAL",SWIG_From_int(static_cast< int >(wxACCEL_NORMAL)));
SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE)));
SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL)));
SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT)));
SWIG_Python_SetConstant(d, "PYAPP_ASSERT_LOG",SWIG_From_int(static_cast< int >(wxPYAPP_ASSERT_LOG)));
SWIG_Python_SetConstant(d, "PRINT_WINDOWS",SWIG_From_int(static_cast< int >(wxPRINT_WINDOWS)));
SWIG_Python_SetConstant(d, "PRINT_POSTSCRIPT",SWIG_From_int(static_cast< int >(wxPRINT_POSTSCRIPT)));
+ SWIG_Python_SetConstant(d, "ACCEL_ALT",SWIG_From_int(static_cast< int >(wxACCEL_ALT)));
+ SWIG_Python_SetConstant(d, "ACCEL_CTRL",SWIG_From_int(static_cast< int >(wxACCEL_CTRL)));
+ SWIG_Python_SetConstant(d, "ACCEL_SHIFT",SWIG_From_int(static_cast< int >(wxACCEL_SHIFT)));
+ SWIG_Python_SetConstant(d, "ACCEL_NORMAL",SWIG_From_int(static_cast< int >(wxACCEL_NORMAL)));
+ SWIG_Python_SetConstant(d, "ACCEL_CMD",SWIG_From_int(static_cast< int >(wxACCEL_CMD)));
SWIG_addvarlink(SWIG_globals(),(char*)"NullAcceleratorTable",NullAcceleratorTable_get, NullAcceleratorTable_set);
SWIG_addvarlink(SWIG_globals(),(char*)"PanelNameStr",PanelNameStr_get, PanelNameStr_set);
SWIG_Python_SetConstant(d, "WINDOW_VARIANT_NORMAL",SWIG_From_int(static_cast< int >(wxWINDOW_VARIANT_NORMAL)));
def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGB bytes and be
- width*height*3 bytes long. A buffer object can optionally be supplied for
- the image's alpha channel data, and it is expected to be width*height
- bytes long. On Windows the RGB values are 'premultiplied' by the alpha
- values. (The other platforms appear to already be premultiplying the
- alpha.)
-
- Unlike `wx.ImageFromBuffer` the bitmap created with this function does not
- share the memory buffer with the buffer object. This is because the
- native pixel buffer format varies on different platforms, and so instead
- an efficient as possible copy of the data is made from the buffer objects
- to the bitmap's native pixel buffer. For direct access to a bitmap's
- pixel buffer see `wx.NativePixelData` and `wx.AlphaPixelData`.
+ parameter must be a Python object that implements the buffer
+ interface, such as a string, array, etc. The dataBuffer object is
+ expected to contain a series of RGB bytes and be width*height*3
+ bytes long. A buffer object can optionally be supplied for the
+ image's alpha channel data, and it is expected to be width*height
+ bytes long. On Windows the RGB values are 'premultiplied' by the
+ alpha values. (The other platforms do the multiplication
+ themselves.)
+
+ Unlike `wx.ImageFromBuffer` the bitmap created with this function
+ does not share the memory buffer with the buffer object. This is
+ because the native pixel buffer format varies on different
+ platforms, and so instead an efficient as possible copy of the
+ data is made from the buffer objects to the bitmap's native pixel
+ buffer. For direct access to a bitmap's pixel buffer see
+ `wx.NativePixelData` and `wx.AlphaPixelData`.
:see: `wx.Bitmap`, `wx.BitmapFromBufferRGBA`, `wx.NativePixelData`,
`wx.AlphaPixelData`, `wx.ImageFromBuffer`
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
- if alphaBuffer is not None and not isinstance(alphaBuffer, buffer):
- alphaBuffer = buffer(alphaBuffer)
if alphaBuffer is not None:
return _gdi_._BitmapFromBufferAlpha(width, height, dataBuffer, alphaBuffer)
else:
def BitmapFromBufferRGBA(width, height, dataBuffer):
"""
Creates a `wx.Bitmap` from the data in dataBuffer. The dataBuffer
- parameter must be a Python object that implements the buffer interface, or
- is convertable to a buffer object, such as a string, array, etc. The
- dataBuffer object is expected to contain a series of RGBA bytes (red,
- green, blue and alpha) and be width*height*4 bytes long. On Windows the
- RGB values are 'premultiplied' by the alpha values. (The other platforms
- appear to already be premultiplying the alpha.)
-
- Unlike `wx.ImageFromBuffer` the bitmap created with this function does not
- share the memory buffer with the buffer object. This is because the
- native pixel buffer format varies on different platforms, and so instead
- an efficient as possible copy of the data is made from the buffer object
- to the bitmap's native pixel buffer. For direct access to a bitmap's
- pixel buffer see `wx.NativePixelData` and `wx.AlphaPixelData`.
+ parameter must be a Python object that implements the buffer
+ interface, such as a string, array, etc. The dataBuffer object is
+ expected to contain a series of RGBA bytes (red, green, blue and
+ alpha) and be width*height*4 bytes long. On Windows the RGB
+ values are 'premultiplied' by the alpha values. (The other
+ platforms do the multiplication themselves.)
+
+ Unlike `wx.ImageFromBuffer` the bitmap created with this function
+ does not share the memory buffer with the buffer object. This is
+ because the native pixel buffer format varies on different
+ platforms, and so instead an efficient as possible copy of the
+ data is made from the buffer object to the bitmap's native pixel
+ buffer. For direct access to a bitmap's pixel buffer see
+ `wx.NativePixelData` and `wx.AlphaPixelData`.
:see: `wx.Bitmap`, `wx.BitmapFromBuffer`, `wx.NativePixelData`,
`wx.AlphaPixelData`, `wx.ImageFromBuffer`
"""
- if not isinstance(dataBuffer, buffer):
- dataBuffer = buffer(dataBuffer)
return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
class PixelDataBase(object):
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
if (obj3 != Py_None) {
- if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+ if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
}
}
{
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
result = (wxBitmap *)_BitmapFromBuffer(arg1,arg2,arg3,arg4);
}
arg2 = static_cast< int >(val2);
{
- if (obj2 != Py_None) {
- if (!PyArg_Parse(obj2, "t#", &arg3, &arg4)) SWIG_fail;
- }
+ if (PyObject_AsReadBuffer(obj2, (const void**)(&arg3), &arg4) == -1) SWIG_fail;
}
{
result = (wxBitmap *)_BitmapFromBufferRGBA(arg1,arg2,arg3,arg4);