@@ -64,6 +64,7 @@ def run():
64
64
#-----------------------------------------------------------------
65
65
66
66
module .addHeaderCode ('#include <wx/stc/stc.h>' )
67
+ module .addHeaderCode ('#include "wxpybuffer.h"' )
67
68
68
69
69
70
c = module .find ('wxStyledTextCtrl' )
@@ -162,6 +163,29 @@ def run():
162
163
c .find ('ShowNativeCaret' ).ignore ()
163
164
c .find ('HideNativeCaret' ).ignore ()
164
165
166
+ # Change the *RGBAImage methods to accept any buffer object
167
+ c .find ('MarkerDefineRGBAImage' ).ignore ()
168
+ c .addCppMethod ('void' , 'MarkerDefineRGBAImage' , '(int markerNumber, wxPyBuffer* pixels)' ,
169
+ doc = """\
170
+ Define a marker from RGBA data.\n
171
+ It has the width and height from RGBAImageSetWidth/Height. You must
172
+ ensure that the buffer is at least width*height*4 bytes long.
173
+ """ ,
174
+ body = """\
175
+ self->MarkerDefineRGBAImage(markerNumber, (unsigned char*)pixels->m_ptr);
176
+ """ )
177
+
178
+ c .find ('RegisterRGBAImage' ).ignore ()
179
+ c .addCppMethod ('void' , 'RegisterRGBAImage' , '(int type, wxPyBuffer* pixels)' ,
180
+ doc = """\
181
+ Register an RGBA image for use in autocompletion lists.\n
182
+ It has the width and height from RGBAImageSetWidth/Height. You must
183
+ ensure that the buffer is at least width*height*4 bytes long.
184
+ """ ,
185
+ body = """\
186
+ self->RegisterRGBAImage(type, (unsigned char*)pixels->m_ptr);
187
+ """ )
188
+
165
189
166
190
# TODO: Add the UTF8 PyMethods from classic (see _stc_utf8_methods.py)
167
191
0 commit comments