diff --git a/CHANGES.rst b/CHANGES.rst index 9273e98c..ef16157b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -50,6 +50,12 @@ Changes in this release include the following: derived classes on Windows. This was due to an optimization that wasn't compatible with how the classes are wrapped. (#774) +* Added wrappers for wx.ClassInfo and exposed wx.Object.GetClassInfo. This + class is part of wxWidgets' internal type information system abd although + it is not very useful for Python applications but it is useful for debugging + some internal wxPython issues. + + diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index 2ae2aa70..0241f0e0 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -591,6 +591,7 @@ "Choice":"wx.", "ChoiceNameStr":"wx.", "Choicebook":"wx.", +"ClassInfo":"wx.", "ClientDC":"wx.", "ClientDataContainer":"wx.", "ClientDisplayRect":"wx.", @@ -2405,6 +2406,7 @@ "OS_WINDOWS_MICRO":"wx.", "OS_WINDOWS_NT":"wx.", "Object":"wx.", +"ObjectConstructorFn":"wx.", "ObjectRefData":"wx.", "OperatingSystemId":"wx.", "Orientation":"wx.", diff --git a/etg/object.py b/etg/object.py index 81e80a02..9343b4c2 100644 --- a/etg/object.py +++ b/etg/object.py @@ -20,7 +20,7 @@ DOCSTRING = "" ITEMS = [ 'wxRefCounter', 'wxObject', -# 'wxClassInfo', + 'wxClassInfo', ] #--------------------------------------------------------------------------- @@ -38,9 +38,13 @@ def run(): module.find('wxCreateDynamicObject').ignore() - #module.find('wxClassInfo').abstract = True - #module.find('wxClassInfo.wxClassInfo').ignore() + #-------------------------------------------------- + c = module.find('wxClassInfo') + assert isinstance(c, etgtools.ClassDef) + module.insertItemBefore(c, etgtools.TypedefDef(type='void*', name='wxObjectConstructorFn')) + module.find('wxClassInfo').abstract = True + module.find('wxClassInfo.wxClassInfo').ignore() #-------------------------------------------------- @@ -55,7 +59,6 @@ def run(): c = module.find('wxObject') c.find('operator delete').ignore() c.find('operator new').ignore() - c.find('GetClassInfo').ignore() c.find('IsKindOf').ignore() # EXPERIMENTAL: By turning off the virtualness of the wxObject dtor, and @@ -72,6 +75,7 @@ def run(): # those classes with custom C++ code. (See wxFont and wxAcceleratorTable # for examples.) c.find('~wxObject').isVirtual = False + c.find('GetClassInfo').isVirtual = False c.addCppMethod('const wxChar*', 'GetClassName', '()', body='return self->GetClassInfo()->GetClassName();',