mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Set a bunch of mustHaveApp flags
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -39,6 +39,11 @@ def run():
|
||||
tools.fixTopLevelWindowClass(c)
|
||||
|
||||
|
||||
c = module.find('wxGetColourFromUser')
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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']
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -33,6 +33,7 @@ def run():
|
||||
|
||||
c = module.find('wxMemoryDC')
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -33,6 +33,7 @@ def run():
|
||||
|
||||
c = module.find('wxMirrorDC')
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -34,6 +34,7 @@ def run():
|
||||
|
||||
c = module.find('wxPrinterDC')
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -33,6 +33,7 @@ def run():
|
||||
|
||||
c = module.find('wxPostScriptDC')
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -33,6 +33,7 @@ def run():
|
||||
|
||||
c = module.find('wxScreenDC')
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -33,6 +33,7 @@ def run():
|
||||
|
||||
c = module.find('wxSVGFileDC')
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
@@ -38,6 +38,9 @@ def run():
|
||||
|
||||
module.find('wxDirSelectorPromptStr').ignore()
|
||||
|
||||
c = module.find('wxDirSelector')
|
||||
c.mustHaveApp()
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -34,6 +34,7 @@ def run():
|
||||
c = module.find('wxFontEnumerator')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
c.addPrivateCopyCtor()
|
||||
c.mustHaveApp()
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -83,6 +83,10 @@ def run():
|
||||
|
||||
module.find('wxMessageBox').releaseGIL()
|
||||
|
||||
c = module.find('wxMessageBox')
|
||||
c.mustHaveApp()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
tools.doCommonTweaks(module)
|
||||
tools.runGenerators(module)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
12
etg/utils.py
12
etg/utils.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user