CPP_TEMPLATE = os.path.abspath('./stc.cpp.in')
H_DEST = os.path.abspath('../../include/wx/stc/stc.h')
CPP_DEST = os.path.abspath('./stc.cpp')
-DOCSTR_DEST = os.path.abspath('../../../wxPython/contrib/stc/_stc_gendocs.i')
+DOCSTR_DEST = '/dev/null' #os.path.abspath('../../../wxPython/contrib/stc/_stc_gendocs.i')
# Value prefixes to convert
'PositionFromPoint' :
(0,
- 'int %s(wxPoint pt);',
+ 'int %s(wxPoint pt) const;',
- '''int %s(wxPoint pt) {
+ '''int %s(wxPoint pt) const {
return SendMsg(%s, pt.x, pt.y);''',
0),
'GetLine' :
(0,
- 'wxString %s(int line);',
+ 'wxString %s(int line) const;',
- '''wxString %s(int line) {
+ '''wxString %s(int line) const {
int len = LineLength(line);
if (!len) return wxEmptyString;
'GetText' :
(0,
- 'wxString %s();',
+ 'wxString %s() const;',
- '''wxString %s() {
+ '''wxString %s() const {
int len = GetTextLength();
wxMemoryBuffer mbuf(len+1); // leave room for the null...
char* buf = (char*)mbuf.GetWriteBuf(len+1);
}
+# all Scintilla getters are transformed into const member of wxSTC class but
+# some non-getter methods are also logically const and this set contains their
+# names (notice that it's useless to include here methods manually overridden
+# above)
+constNonGetterMethods = set((
+ 'LineFromPosition',
+ 'PositionFromLine',
+ 'LineLength',
+ 'CanRedo',
+ 'CanUndo',
+))
+
#----------------------------------------------------------------------------
def processIface(iface, h_tmplt, cpp_tmplt, h_dest, cpp_dest, docstr_dest):
if not FUNC_FOR_CMD:
return
- methods.append( (retType, name, number, param1, param2, tuple(docs), is_const) )
+ methods.append( (retType, name, number, param1, param2, tuple(docs),
+ is_const or name in constNonGetterMethods) )
#----------------------------------------------------------------------------