]> git.saurik.com Git - wxWidgets.git/commitdiff
reSWIGged
authorRobin Dunn <robin@alldunn.com>
Tue, 29 Aug 2006 19:26:06 +0000 (19:26 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 29 Aug 2006 19:26:06 +0000 (19:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
wxPython/src/gtk/_core.py
wxPython/src/gtk/_core_wrap.cpp
wxPython/src/gtk/_gdi.py
wxPython/src/gtk/_gdi_wrap.cpp
wxPython/src/mac/_core.py
wxPython/src/mac/_core_wrap.cpp
wxPython/src/mac/_gdi.py
wxPython/src/mac/_gdi_wrap.cpp
wxPython/src/msw/_core.py
wxPython/src/msw/_core_wrap.cpp
wxPython/src/msw/_gdi.py
wxPython/src/msw/_gdi_wrap.cpp

index 837170a76b97384765001083965c024a2948eaa7..3cc6d8209e5d42e5e7d070a64214605e6d4bf93b 100644 (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
 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
 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
 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 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.
     """
     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
     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
 class AcceleratorEntry(object):
     """
     A class used to define items in an `wx.AcceleratorTable`.  wxPython
index 12a9404d2ceeed22b7f971a4bc3981acd3775767..472b826d03349ea30899b1e71dca42b2dbf462d1 100644 (file)
@@ -13430,9 +13430,7 @@ SWIGINTERN PyObject *_wrap_new_ImageFromData(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -13480,13 +13478,11 @@ SWIGINTERN PyObject *_wrap_new_ImageFromDataWithAlpha(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (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);
   {
   }
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -15574,9 +15568,7 @@ SWIGINTERN PyObject *_wrap_Image_SetDataBuffer(PyObject *SWIGUNUSEDPARM(self), P
   }
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
   }
   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();
   }
   {
     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) {
   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) {
   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);
   {
   } 
   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 (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, "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, "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, "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)));
   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)));
index 08dec1ccae42e53ad3b3e6ddab3c3a1868f9c245..f24c6564f32ee8dfabe33f12ddb8567ebbc54066 100644 (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
 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`
     """
 
     :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:
     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
 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`
     """
 
     :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):
     return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
 
 class PixelDataBase(object):
index 04a530c65b9505a3ce2f3a2ed8c4a3bfd7d04003..ac6a4fd75c2f6c6c7386c7900deb759cc54c71eb 100644 (file)
@@ -6680,13 +6680,11 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferAlpha(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (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);
   {
   } 
   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);
   }
   {
     result = (wxBitmap *)_BitmapFromBuffer(arg1,arg2,arg3,arg4);
@@ -6775,9 +6771,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferRGBA(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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);
   }
   {
     result = (wxBitmap *)_BitmapFromBufferRGBA(arg1,arg2,arg3,arg4);
index 837170a76b97384765001083965c024a2948eaa7..3cc6d8209e5d42e5e7d070a64214605e6d4bf93b 100644 (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
 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
 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
 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 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.
     """
     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
     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
 class AcceleratorEntry(object):
     """
     A class used to define items in an `wx.AcceleratorTable`.  wxPython
index 6d1c4a09148edc32041c56f8231bdbf22d22885f..ccf9003de43044404792c76e4ae3955e57dda664 100644 (file)
@@ -13429,9 +13429,7 @@ SWIGINTERN PyObject *_wrap_new_ImageFromData(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -13479,13 +13477,11 @@ SWIGINTERN PyObject *_wrap_new_ImageFromDataWithAlpha(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (obj3 != Py_None) {
-      if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+      if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
     }
   }
   {
     }
   }
   {
@@ -15508,9 +15504,7 @@ SWIGINTERN PyObject *_wrap_Image_SetData(PyObject *SWIGUNUSEDPARM(self), PyObjec
   }
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
   }
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -15573,9 +15567,7 @@ SWIGINTERN PyObject *_wrap_Image_SetDataBuffer(PyObject *SWIGUNUSEDPARM(self), P
   }
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
   }
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -15639,7 +15631,7 @@ SWIGINTERN PyObject *_wrap_Image_SetAlphaData(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
     if (obj1 != Py_None) {
   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;
     }
   }
   {
     }
   }
   {
@@ -15704,7 +15696,7 @@ SWIGINTERN PyObject *_wrap_Image_SetAlphaBuffer(PyObject *SWIGUNUSEDPARM(self),
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
     if (obj1 != Py_None) {
   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;
     }
   }
   {
     }
   }
   {
@@ -17081,14 +17073,12 @@ SWIGINTERN PyObject *_wrap__ImageFromBuffer(PyObject *SWIGUNUSEDPARM(self), PyOb
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (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;
       }
     }
   }
       }
     }
   }
@@ -56283,10 +56273,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, "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, "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)));
@@ -56935,6 +56921,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, "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)));
   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)));
index e8683448ef57d6e9efa54a3cb9fb1e3fa96ad2be..d54219b4b12a6a9700c6a2515a4ce1e8d8ae78d9 100644 (file)
@@ -728,29 +728,26 @@ def _BitmapFromBuffer(*args, **kwargs):
 def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
     """
     Creates a `wx.Bitmap` from the data in dataBuffer.  The dataBuffer
 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`
     """
 
     :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:
     if alphaBuffer is not None:
         return _gdi_._BitmapFromBufferAlpha(width, height, dataBuffer, alphaBuffer)
     else:
@@ -763,25 +760,24 @@ def _BitmapFromBufferRGBA(*args, **kwargs):
 def BitmapFromBufferRGBA(width, height, dataBuffer):
     """
     Creates a `wx.Bitmap` from the data in dataBuffer.  The dataBuffer
 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`
     """
 
     :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):
     return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
 
 class PixelDataBase(object):
index e22f3153a407646f3ea89bd58e7ad7a450ff0312..613156b444927b988a1d2fe33acd02d72767d2c4 100644 (file)
@@ -6722,13 +6722,11 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferAlpha(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (obj3 != Py_None) {
-      if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+      if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
     }
   }
   {
     }
   }
   {
@@ -6772,9 +6770,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBuffer(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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);
   }
   {
     result = (wxBitmap *)_BitmapFromBuffer(arg1,arg2,arg3,arg4);
@@ -6817,9 +6813,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferRGBA(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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);
   }
   {
     result = (wxBitmap *)_BitmapFromBufferRGBA(arg1,arg2,arg3,arg4);
index 0eabd054bbc18fa763a5089e4569ce1fd83c8457..5daca2919fb31c0222fafed4aff1bbf50579524e 100644 (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
 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
 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
 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 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.
     """
     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
     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
 class AcceleratorEntry(object):
     """
     A class used to define items in an `wx.AcceleratorTable`.  wxPython
index 27e6fda8b996d63b252ffef338debd32da0ee047..3b3aa821460eb99e4cec3d60e1e52f28bde76f19 100644 (file)
@@ -13414,9 +13414,7 @@ SWIGINTERN PyObject *_wrap_new_ImageFromData(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -13464,13 +13462,11 @@ SWIGINTERN PyObject *_wrap_new_ImageFromDataWithAlpha(PyObject *SWIGUNUSEDPARM(s
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (obj3 != Py_None) {
-      if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+      if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
     }
   }
   {
     }
   }
   {
@@ -15493,9 +15489,7 @@ SWIGINTERN PyObject *_wrap_Image_SetData(PyObject *SWIGUNUSEDPARM(self), PyObjec
   }
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
   }
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -15558,9 +15552,7 @@ SWIGINTERN PyObject *_wrap_Image_SetDataBuffer(PyObject *SWIGUNUSEDPARM(self), P
   }
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
   }
   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();
   }
   {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -15624,7 +15616,7 @@ SWIGINTERN PyObject *_wrap_Image_SetAlphaData(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
     if (obj1 != Py_None) {
   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;
     }
   }
   {
     }
   }
   {
@@ -15689,7 +15681,7 @@ SWIGINTERN PyObject *_wrap_Image_SetAlphaBuffer(PyObject *SWIGUNUSEDPARM(self),
   arg1 = reinterpret_cast< wxImage * >(argp1);
   {
     if (obj1 != Py_None) {
   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;
     }
   }
   {
     }
   }
   {
@@ -17066,14 +17058,12 @@ SWIGINTERN PyObject *_wrap__ImageFromBuffer(PyObject *SWIGUNUSEDPARM(self), PyOb
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (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;
       }
     }
   }
       }
     }
   }
@@ -56310,10 +56300,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, "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, "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)));
@@ -56962,6 +56948,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, "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)));
   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)));
index 9f1e417d978304dbee99dd289916860e8076e88f..22bea127ebb227772b943b1e2d1b202a67337bec 100644 (file)
@@ -748,29 +748,26 @@ def _BitmapFromBuffer(*args, **kwargs):
 def BitmapFromBuffer(width, height, dataBuffer, alphaBuffer=None):
     """
     Creates a `wx.Bitmap` from the data in dataBuffer.  The dataBuffer
 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`
     """
 
     :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:
     if alphaBuffer is not None:
         return _gdi_._BitmapFromBufferAlpha(width, height, dataBuffer, alphaBuffer)
     else:
@@ -783,25 +780,24 @@ def _BitmapFromBufferRGBA(*args, **kwargs):
 def BitmapFromBufferRGBA(width, height, dataBuffer):
     """
     Creates a `wx.Bitmap` from the data in dataBuffer.  The dataBuffer
 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`
     """
 
     :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):
     return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
 
 class PixelDataBase(object):
index ec1eab7b195ec12eb0fd850a3c6f0de6ee1c99ef..44d9bdcc92d835b59f9570decbbe2dfa654a161c 100644 (file)
@@ -6874,13 +6874,11 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferAlpha(PyObject *SWIGUNUSEDPARM(self)
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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 (obj3 != Py_None) {
-      if (!PyArg_Parse(obj3, "t#", &arg5, &arg6)) SWIG_fail;
+      if (PyObject_AsReadBuffer(obj3, (const void**)(&arg5), &arg6) == -1) SWIG_fail;
     }
   }
   {
     }
   }
   {
@@ -6924,9 +6922,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBuffer(PyObject *SWIGUNUSEDPARM(self), PyO
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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);
   }
   {
     result = (wxBitmap *)_BitmapFromBuffer(arg1,arg2,arg3,arg4);
@@ -6969,9 +6965,7 @@ SWIGINTERN PyObject *_wrap__BitmapFromBufferRGBA(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< int >(val2);
   {
   } 
   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);
   }
   {
     result = (wxBitmap *)_BitmapFromBufferRGBA(arg1,arg2,arg3,arg4);