reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-08-29 19:26:06 +00:00
parent 8989034ec9
commit eec1c382d0
12 changed files with 168 additions and 237 deletions

View File

@@ -275,10 +275,6 @@ ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
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
@@ -3070,12 +3066,11 @@ def _ImageFromBuffer(*args, **kwargs):
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
@@ -3093,10 +3088,6 @@ def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
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
@@ -7461,6 +7452,11 @@ _core_.EventLoopActivator_swigregister(EventLoopActivator)
#---------------------------------------------------------------------------
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

View File

@@ -13430,9 +13430,7 @@ SWIGINTERN PyObject *_wrap_new_ImageFromData(PyObject *SWIGUNUSEDPARM(self), PyO
}
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();
@@ -13480,13 +13478,11 @@ SWIGINTERN PyObject *_wrap_new_ImageFromDataWithAlpha(PyObject *SWIGUNUSEDPARM(s
}
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;
}
}
{
@@ -15509,9 +15505,7 @@ SWIGINTERN PyObject *_wrap_Image_SetData(PyObject *SWIGUNUSEDPARM(self), PyObjec
}
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();
@@ -15574,9 +15568,7 @@ SWIGINTERN PyObject *_wrap_Image_SetDataBuffer(PyObject *SWIGUNUSEDPARM(self), P
}
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();
@@ -15640,7 +15632,7 @@ SWIGINTERN PyObject *_wrap_Image_SetAlphaData(PyObject *SWIGUNUSEDPARM(self), Py
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;
}
}
{
@@ -15705,7 +15697,7 @@ SWIGINTERN PyObject *_wrap_Image_SetAlphaBuffer(PyObject *SWIGUNUSEDPARM(self),
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;
}
}
{
@@ -17082,14 +17074,12 @@ SWIGINTERN PyObject *_wrap__ImageFromBuffer(PyObject *SWIGUNUSEDPARM(self), PyOb
}
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;
}
}
}
@@ -56284,10 +56274,6 @@ SWIGEXPORT void SWIG_init(void) {
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)));
@@ -56936,6 +56922,11 @@ SWIGEXPORT void SWIG_init(void) {
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)));

View File

@@ -724,29 +724,26 @@ def _BitmapFromBuffer(*args, **kwargs):
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.)
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`.
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:
@@ -759,25 +756,24 @@ def _BitmapFromBufferRGBA(*args, **kwargs):
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.)
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`.
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):

View File

@@ -6680,13 +6680,11 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferAlpha(PyObject *SWIGUNUSEDPARM(self)
}
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;
}
}
{
@@ -6730,9 +6728,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBuffer(PyObject *SWIGUNUSEDPARM(self), PyO
}
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);
@@ -6775,9 +6771,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferRGBA(PyObject *SWIGUNUSEDPARM(self),
}
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);