Set a bunch of mustHaveApp flags

This commit is contained in:
Robin Dunn
2017-01-21 20:13:46 -08:00
parent 98135c2220
commit dc73188688
34 changed files with 131 additions and 11 deletions

View File

@@ -33,11 +33,16 @@ def run():
module.addHeaderCode('#include <wx/generic/aboutdlgg.h>')
for funcname in ['wxAboutBox',
'wxGenericAboutBox',
]:
c = module.find(funcname)
c.mustHaveApp()
c = module.find('wxAboutDialogInfo')
assert isinstance(c, etgtools.ClassDef)
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
# Add some aliases for the non-UK spelling

View File

@@ -34,8 +34,9 @@ def run():
c = module.find('wxArtProvider')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()
# These are protrected and so they are ignored by default. Unignore them.
# These are protected and so they are ignored by default. Unignore them.
c.find('CreateBitmap').ignore(False)
c.find('CreateIconBundle').ignore(False)

View File

@@ -37,8 +37,12 @@ def run():
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
c = module.find('wxMask')
c.mustHaveApp()
c = module.find('wxBitmap')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()
tools.removeVirtuals(c)

View File

@@ -34,6 +34,7 @@ def run():
c = module.find('wxBrush')
assert isinstance(c, etgtools.ClassDef)
tools.removeVirtuals(c)
c.mustHaveApp()
c.addCppMethod('int', '__nonzero__', '()', """\
return self->IsOk();

View File

@@ -86,6 +86,19 @@ def run():
func.ignore()
for c in module.find('wxGetSingleChoiceIndex').all():
c.mustHaveApp()
for c in module.find('wxGetSingleChoice').all():
c.mustHaveApp()
for c in module.find('wxGetSingleChoiceData').all():
c.mustHaveApp()
#c = module.find('wxGetSingleChoiceIndex')
#c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxClipboard')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()
c.find('AddData.data').transfer = True
c.find('SetData.data').transfer = True

View File

@@ -39,6 +39,11 @@ def run():
tools.fixTopLevelWindowClass(c)
c = module.find('wxGetColourFromUser')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -66,6 +66,7 @@ def run():
c = module.find('wxColour')
assert isinstance(c, etgtools.ClassDef)
tools.removeVirtuals(c)
c.mustHaveApp()
# Hide the string ctor so our typemap will be invoked for the copy ctor instead.
c.find('wxColour').findOverload('wxString').ignore()

View File

@@ -36,6 +36,7 @@ def run():
c = module.find('wxConfigBase')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()
c.abstract = True
ctor = c.find('wxConfigBase')
@@ -161,6 +162,7 @@ def run():
#-----------------------------------------------------------------
c = module.find('wxFileConfig')
c.mustHaveApp()
c.addPrivateCopyCtor()
c.find('wxFileConfig').findOverload('wxInputStream').find('conv').ignore()
ctor = c.find('wxFileConfig').findOverload('wxString').find('conv').ignore()

View File

@@ -44,15 +44,21 @@ def run():
c.abstract = True
c.find('Set').transferBack = True
c.find('Set.helpProvider').transfer = True
c.mustHaveApp()
c = module.find('wxSimpleHelpProvider')
c.addItem(etgtools.WigCode("virtual wxString GetHelp(const wxWindowBase* window);"))
c.mustHaveApp()
c = module.find('wxHelpControllerHelpProvider')
c.addPrivateCopyCtor()
c.mustHaveApp()
c = module.find('wxContextHelp')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxCursor')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()
c.find('wxCursor').findOverload('bits').ignore()
c.find('wxCursor').findOverload('cursorName').find('type').default='wxBITMAP_TYPE_ANY'

View File

@@ -44,6 +44,7 @@ def run():
c = module.find('wxDC')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()
c.addPrivateCopyCtor()
c.addPublic()
@@ -449,10 +450,6 @@ def run():
# TODO: Port the PseudoDC from Classic
#-----------------------------------------------------------------
c = module.find('wxDCClipper')
assert isinstance(c, etgtools.ClassDef)

View File

@@ -37,6 +37,8 @@ def run():
c = module.find('wxBufferedDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
for m in c.find('wxBufferedDC').all() + c.find('Init').all():
if m.findItem('dc'):
m.findItem('dc').keepReference = True
@@ -45,6 +47,8 @@ def run():
c = module.find('wxBufferedPaintDC')
c.mustHaveApp()
c.addPrivateCopyCtor()
c.find('wxBufferedPaintDC').findOverload('wxBitmap').find('buffer').keepReference = True
@@ -54,6 +58,8 @@ def run():
# static_cast<> to one of the buffered DCs, so we'll change the base class
# here to more truly adhere to reality.
c = module.find('wxAutoBufferedPaintDC')
c.mustHaveApp()
c.addPrivateCopyCtor()
c.bases = ['wxPaintDC']

View File

@@ -36,12 +36,15 @@ def run():
c = module.find('wxPaintDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
c = module.find('wxClientDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
c = module.find('wxWindowDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -32,6 +32,7 @@ def run():
c = module.find('wxGCDC')
c.mustHaveApp()
# FIXME: Do we handle platform-specific classes, and if so, how?
c.find('wxGCDC').findOverload('wxEnhMetaFileDC').ignore()
c.addPrivateCopyCtor()

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxMemoryDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxMirrorDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -34,6 +34,7 @@ def run():
c = module.find('wxPrinterDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxPostScriptDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxScreenDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -33,6 +33,7 @@ def run():
c = module.find('wxSVGFileDC')
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------

View File

@@ -38,6 +38,9 @@ def run():
module.find('wxDirSelectorPromptStr').ignore()
c = module.find('wxDirSelector')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -36,6 +36,7 @@ def run():
assert isinstance(c, etgtools.ClassDef)
c.addPrivateAssignOp()
c.addPrivateCopyCtor()
c.mustHaveApp()
c.addProperty('ClientArea GetClientArea')
@@ -44,6 +45,7 @@ def run():
c.addProperty('Name GetName')
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -34,6 +34,7 @@ def run():
di = module.find('wxDragImage')
assert isinstance(di, etgtools.ClassDef)
di.mustHaveApp()
# make a copy and rename it to 'wxGenericDragImage'
gdi = tools.copyClassDef(di, 'wxGenericDragImage')

View File

@@ -69,6 +69,16 @@ def run():
tools.fixTopLevelWindowClass(c)
for funcname in ['wxFileSelector',
'wxFileSelectorEx',
'wxLoadFileSelector',
'wxSaveFileSelector',
]:
c = module.find(funcname)
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -36,6 +36,7 @@ def run():
c = module.find('wxFont')
assert isinstance(c, etgtools.ClassDef)
tools.removeVirtuals(c)
c.mustHaveApp()
# FFont factory function for backwards compatibility
module.addCppFunction('wxFont*', 'FFont',
@@ -63,7 +64,7 @@ def run():
c.addProperty('Style GetStyle SetStyle')
c.addProperty('Weight GetWeight SetWeight')
# TODO, there is now a Underlined method so we can't have a
# TODO, there is now an Underlined method so we can't have a
# property of the same name.
#c.addProperty('Underlined GetUnderlined SetUnderlined')
#c.addProperty('Strikethrough GetStrikethrough SetStrikethrough')

View File

@@ -41,6 +41,11 @@ def run():
# there are two of these, ignore one of them
c.find('GetFontData').ignore()
c = module.find('wxGetFontFromUser')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -34,6 +34,7 @@ def run():
c = module.find('wxFontEnumerator')
assert isinstance(c, etgtools.ClassDef)
c.addPrivateCopyCtor()
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -17,7 +17,7 @@ DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [ 'wxFrame' ]
ITEMS = [ 'wxFrame' ]
#---------------------------------------------------------------------------
@@ -25,14 +25,14 @@ def run():
# Parse the XML file(s) building a collection of Extractor objects
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
etgtools.parseDoxyXML(module, ITEMS)
#-----------------------------------------------------------------
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
c = module.find('wxFrame')
assert isinstance(c, etgtools.ClassDef)
c.find('wxFrame.title').default = 'wxEmptyString'
c.find('Create.title').default = 'wxEmptyString'

View File

@@ -357,6 +357,20 @@ def run():
"""
)
for funcname in ['wxColourDisplay',
'wxDisplayDepth',
'wxDisplaySize',
'wxGetDisplaySize',
'wxDisplaySizeMM',
'wxGetDisplaySizeMM',
'wxGetDisplayPPI',
'wxClientDisplayRect',
'wxGetClientDisplayRect',
]:
c = module.find(funcname)
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -83,6 +83,10 @@ def run():
module.find('wxMessageBox').releaseGIL()
c = module.find('wxMessageBox')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -53,6 +53,13 @@ def run():
tools.fixTopLevelWindowClass(c)
c = module.find('wxGetPasswordFromUser')
c.mustHaveApp()
c = module.find('wxGetTextFromUser')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -34,6 +34,13 @@ def run():
module.addHeaderCode('#include <wx/tipdlg.h>')
module.find('wxCreateFileTipProvider').factory = True
c = module.find('wxCreateFileTipProvider')
c.mustHaveApp()
c = module.find('wxShowTip')
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -71,11 +71,23 @@ def run():
module.find('wxGetOsVersion.minor').out = True
c = module.find('wxBusyCursor')
c.mustHaveApp()
# add context manager methods
c.addPyMethod('__enter__', '(self)', 'return self')
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'pass')
for funcname in ['wxBell',
'wxBeginBusyCursor',
'wxEndBusyCursor',
'wxShutdown',
'wxInfoMessageBox',
'wxIsBusy',
]:
c = module.find(funcname)
c.mustHaveApp()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)