Permalink
Browse files

Merge pull request wxWidgets#1034 from RobinD42/fix-issue958-291-wxAc…

…cessible

Add wxAccessible and a tool to generate C++ stubs

(cherry picked from commit 3a9f37f)
  • Loading branch information...
RobinD42 committed Oct 11, 2018
1 parent 0cfefbb commit 2f540a91e6216a9d9c9863ee91532b29e15eb405
@@ -405,6 +405,7 @@ def main(wxDir, args):
flags["wxUSE_AFM_FOR_POSTSCRIPT"] = "0"
flags["wxUSE_DATEPICKCTRL_GENERIC"] = "1"
flags["wxUSE_IFF"] = "1"
flags["wxUSE_ACCESSIBILITY"] = "1"
# Remove this when Windows XP finally dies, or when there is a
# solution for ticket #13116...
@@ -5,6 +5,86 @@
"ACCEL_NORMAL":"wx.",
"ACCEL_RAW_CTRL":"wx.",
"ACCEL_SHIFT":"wx.",
"ACC_EVENT_OBJECT_ACCELERATORCHANGE":"wx.",
"ACC_EVENT_OBJECT_CREATE":"wx.",
"ACC_EVENT_OBJECT_DEFACTIONCHANGE":"wx.",
"ACC_EVENT_OBJECT_DESCRIPTIONCHANGE":"wx.",
"ACC_EVENT_OBJECT_DESTROY":"wx.",
"ACC_EVENT_OBJECT_FOCUS":"wx.",
"ACC_EVENT_OBJECT_HELPCHANGE":"wx.",
"ACC_EVENT_OBJECT_HIDE":"wx.",
"ACC_EVENT_OBJECT_LOCATIONCHANGE":"wx.",
"ACC_EVENT_OBJECT_NAMECHANGE":"wx.",
"ACC_EVENT_OBJECT_PARENTCHANGE":"wx.",
"ACC_EVENT_OBJECT_REORDER":"wx.",
"ACC_EVENT_OBJECT_SELECTION":"wx.",
"ACC_EVENT_OBJECT_SELECTIONADD":"wx.",
"ACC_EVENT_OBJECT_SELECTIONREMOVE":"wx.",
"ACC_EVENT_OBJECT_SELECTIONWITHIN":"wx.",
"ACC_EVENT_OBJECT_SHOW":"wx.",
"ACC_EVENT_OBJECT_STATECHANGE":"wx.",
"ACC_EVENT_OBJECT_VALUECHANGE":"wx.",
"ACC_EVENT_SYSTEM_ALERT":"wx.",
"ACC_EVENT_SYSTEM_CAPTUREEND":"wx.",
"ACC_EVENT_SYSTEM_CAPTURESTART":"wx.",
"ACC_EVENT_SYSTEM_CONTEXTHELPEND":"wx.",
"ACC_EVENT_SYSTEM_CONTEXTHELPSTART":"wx.",
"ACC_EVENT_SYSTEM_DIALOGEND":"wx.",
"ACC_EVENT_SYSTEM_DIALOGSTART":"wx.",
"ACC_EVENT_SYSTEM_DRAGDROPEND":"wx.",
"ACC_EVENT_SYSTEM_DRAGDROPSTART":"wx.",
"ACC_EVENT_SYSTEM_FOREGROUND":"wx.",
"ACC_EVENT_SYSTEM_MENUEND":"wx.",
"ACC_EVENT_SYSTEM_MENUPOPUPEND":"wx.",
"ACC_EVENT_SYSTEM_MENUPOPUPSTART":"wx.",
"ACC_EVENT_SYSTEM_MENUSTART":"wx.",
"ACC_EVENT_SYSTEM_MINIMIZEEND":"wx.",
"ACC_EVENT_SYSTEM_MINIMIZESTART":"wx.",
"ACC_EVENT_SYSTEM_MOVESIZEEND":"wx.",
"ACC_EVENT_SYSTEM_MOVESIZESTART":"wx.",
"ACC_EVENT_SYSTEM_SCROLLINGEND":"wx.",
"ACC_EVENT_SYSTEM_SCROLLINGSTART":"wx.",
"ACC_EVENT_SYSTEM_SOUND":"wx.",
"ACC_EVENT_SYSTEM_SWITCHEND":"wx.",
"ACC_EVENT_SYSTEM_SWITCHSTART":"wx.",
"ACC_FAIL":"wx.",
"ACC_FALSE":"wx.",
"ACC_NOT_IMPLEMENTED":"wx.",
"ACC_NOT_SUPPORTED":"wx.",
"ACC_OK":"wx.",
"ACC_SELF":"wx.",
"ACC_SEL_ADDSELECTION":"wx.",
"ACC_SEL_EXTENDSELECTION":"wx.",
"ACC_SEL_NONE":"wx.",
"ACC_SEL_REMOVESELECTION":"wx.",
"ACC_SEL_TAKEFOCUS":"wx.",
"ACC_SEL_TAKESELECTION":"wx.",
"ACC_STATE_SYSTEM_ALERT_HIGH":"wx.",
"ACC_STATE_SYSTEM_ALERT_LOW":"wx.",
"ACC_STATE_SYSTEM_ALERT_MEDIUM":"wx.",
"ACC_STATE_SYSTEM_ANIMATED":"wx.",
"ACC_STATE_SYSTEM_BUSY":"wx.",
"ACC_STATE_SYSTEM_CHECKED":"wx.",
"ACC_STATE_SYSTEM_COLLAPSED":"wx.",
"ACC_STATE_SYSTEM_DEFAULT":"wx.",
"ACC_STATE_SYSTEM_EXPANDED":"wx.",
"ACC_STATE_SYSTEM_EXTSELECTABLE":"wx.",
"ACC_STATE_SYSTEM_FLOATING":"wx.",
"ACC_STATE_SYSTEM_FOCUSABLE":"wx.",
"ACC_STATE_SYSTEM_FOCUSED":"wx.",
"ACC_STATE_SYSTEM_HOTTRACKED":"wx.",
"ACC_STATE_SYSTEM_INVISIBLE":"wx.",
"ACC_STATE_SYSTEM_MARQUEED":"wx.",
"ACC_STATE_SYSTEM_MIXED":"wx.",
"ACC_STATE_SYSTEM_MULTISELECTABLE":"wx.",
"ACC_STATE_SYSTEM_OFFSCREEN":"wx.",
"ACC_STATE_SYSTEM_PRESSED":"wx.",
"ACC_STATE_SYSTEM_PROTECTED":"wx.",
"ACC_STATE_SYSTEM_READONLY":"wx.",
"ACC_STATE_SYSTEM_SELECTABLE":"wx.",
"ACC_STATE_SYSTEM_SELECTED":"wx.",
"ACC_STATE_SYSTEM_SELFVOICING":"wx.",
"ACC_STATE_SYSTEM_UNAVAILABLE":"wx.",
"AC_DEFAULT_STYLE":"wx.adv.",
"AC_NO_AUTORESIZE":"wx.adv.",
"ADJUST_MINSIZE":"wx.",
@@ -203,9 +283,14 @@
"AboutDialogInfo":"wx.adv.",
"Above":"wx.",
"Absolute":"wx.",
"AccObject":"wx.",
"AccRole":"wx.",
"AccSelectionFlags":"wx.",
"AccStatus":"wx.",
"AcceleratorEntry":"wx.",
"AcceleratorEntryFlags":"wx.",
"AcceleratorTable":"wx.",
"Accessible":"wx.",
"ActivateEvent":"wx.",
"AffineMatrix2D":"wx.",
"AffineMatrix2DBase":"wx.",
@@ -816,7 +901,7 @@
"DirProperty":"wx.propgrid.",
"DirSelector":"wx.",
"DirSelectorPromptStr":"wx.",
"Direction":"wx.DataObject.",
"Direction":"wx.",
"DisableAsserts":"wx.",
"Display":"wx.",
"DisplayChangedEvent":"wx.",
@@ -2346,6 +2431,14 @@
"MultiChoiceDialog":"wx.",
"MultiChoiceProperty":"wx.propgrid.",
"NAND":"wx.",
"NAVDIR_DOWN":"wx.",
"NAVDIR_FIRSTCHILD":"wx.",
"NAVDIR_LASTCHILD":"wx.",
"NAVDIR_LEFT":"wx.",
"NAVDIR_NEXT":"wx.",
"NAVDIR_PREVIOUS":"wx.",
"NAVDIR_RIGHT":"wx.",
"NAVDIR_UP":"wx.",
"NB_BOTTOM":"wx.",
"NB_DEFAULT":"wx.",
"NB_FIXEDWIDTH":"wx.",
@@ -2374,6 +2467,7 @@
"NativeFontInfo":"wx.",
"NativePixelData":"wx.",
"NativePixelData_Accessor":"wx.",
"NavDir":"wx.",
"NavigationKeyEvent":"wx.",
"NavigationKeyEventFlags":"wx.NavigationKeyEvent.",
"NewEventType":"wx.",
@@ -2407,6 +2501,18 @@
"NumberEntryDialog":"wx.",
"NumericPropertyValidator":"wx.propgrid.",
"NumericType":"wx.propgrid.NumericPropertyValidator.",
"OBJID_ALERT":"wx.",
"OBJID_CARET":"wx.",
"OBJID_CLIENT":"wx.",
"OBJID_CURSOR":"wx.",
"OBJID_HSCROLL":"wx.",
"OBJID_MENU":"wx.",
"OBJID_SIZEGRIP":"wx.",
"OBJID_SOUND":"wx.",
"OBJID_SYSMENU":"wx.",
"OBJID_TITLEBAR":"wx.",
"OBJID_VSCROLL":"wx.",
"OBJID_WINDOW":"wx.",
"ODCB_DCLICK_CYCLES":"wx.adv.",
"ODCB_PAINTING_CONTROL":"wx.adv.",
"ODCB_PAINTING_SELECTED":"wx.adv.",
@@ -3231,6 +3337,68 @@
"RICHTEXT_VARIABLE_HEIGHT":"wx.richtext.",
"RICHTEXT_VARIABLE_WIDTH":"wx.richtext.",
"RIGHT":"wx.",
"ROLE_NONE":"wx.",
"ROLE_SYSTEM_ALERT":"wx.",
"ROLE_SYSTEM_ANIMATION":"wx.",
"ROLE_SYSTEM_APPLICATION":"wx.",
"ROLE_SYSTEM_BORDER":"wx.",
"ROLE_SYSTEM_BUTTONDROPDOWN":"wx.",
"ROLE_SYSTEM_BUTTONDROPDOWNGRID":"wx.",
"ROLE_SYSTEM_BUTTONMENU":"wx.",
"ROLE_SYSTEM_CARET":"wx.",
"ROLE_SYSTEM_CELL":"wx.",
"ROLE_SYSTEM_CHARACTER":"wx.",
"ROLE_SYSTEM_CHART":"wx.",
"ROLE_SYSTEM_CHECKBUTTON":"wx.",
"ROLE_SYSTEM_CLIENT":"wx.",
"ROLE_SYSTEM_CLOCK":"wx.",
"ROLE_SYSTEM_COLUMN":"wx.",
"ROLE_SYSTEM_COLUMNHEADER":"wx.",
"ROLE_SYSTEM_COMBOBOX":"wx.",
"ROLE_SYSTEM_CURSOR":"wx.",
"ROLE_SYSTEM_DIAGRAM":"wx.",
"ROLE_SYSTEM_DIAL":"wx.",
"ROLE_SYSTEM_DIALOG":"wx.",
"ROLE_SYSTEM_DOCUMENT":"wx.",
"ROLE_SYSTEM_DROPLIST":"wx.",
"ROLE_SYSTEM_EQUATION":"wx.",
"ROLE_SYSTEM_GRAPHIC":"wx.",
"ROLE_SYSTEM_GRIP":"wx.",
"ROLE_SYSTEM_GROUPING":"wx.",
"ROLE_SYSTEM_HELPBALLOON":"wx.",
"ROLE_SYSTEM_HOTKEYFIELD":"wx.",
"ROLE_SYSTEM_INDICATOR":"wx.",
"ROLE_SYSTEM_LINK":"wx.",
"ROLE_SYSTEM_LIST":"wx.",
"ROLE_SYSTEM_LISTITEM":"wx.",
"ROLE_SYSTEM_MENUBAR":"wx.",
"ROLE_SYSTEM_MENUITEM":"wx.",
"ROLE_SYSTEM_MENUPOPUP":"wx.",
"ROLE_SYSTEM_OUTLINE":"wx.",
"ROLE_SYSTEM_OUTLINEITEM":"wx.",
"ROLE_SYSTEM_PAGETAB":"wx.",
"ROLE_SYSTEM_PAGETABLIST":"wx.",
"ROLE_SYSTEM_PANE":"wx.",
"ROLE_SYSTEM_PROGRESSBAR":"wx.",
"ROLE_SYSTEM_PROPERTYPAGE":"wx.",
"ROLE_SYSTEM_PUSHBUTTON":"wx.",
"ROLE_SYSTEM_RADIOBUTTON":"wx.",
"ROLE_SYSTEM_ROW":"wx.",
"ROLE_SYSTEM_ROWHEADER":"wx.",
"ROLE_SYSTEM_SCROLLBAR":"wx.",
"ROLE_SYSTEM_SEPARATOR":"wx.",
"ROLE_SYSTEM_SLIDER":"wx.",
"ROLE_SYSTEM_SOUND":"wx.",
"ROLE_SYSTEM_SPINBUTTON":"wx.",
"ROLE_SYSTEM_STATICTEXT":"wx.",
"ROLE_SYSTEM_STATUSBAR":"wx.",
"ROLE_SYSTEM_TABLE":"wx.",
"ROLE_SYSTEM_TEXT":"wx.",
"ROLE_SYSTEM_TITLEBAR":"wx.",
"ROLE_SYSTEM_TOOLBAR":"wx.",
"ROLE_SYSTEM_TOOLTIP":"wx.",
"ROLE_SYSTEM_WHITESPACE":"wx.",
"ROLE_SYSTEM_WINDOW":"wx.",
"RadioBox":"wx.",
"RadioBoxNameStr":"wx.",
"RadioButton":"wx.",
@@ -6337,6 +6505,10 @@
"URLDataObject":"wx.",
"USER_ATTENTION_ERROR":"wx.",
"USER_ATTENTION_INFO":"wx.",
"USE_ACCESSIBILITY":"wx.",
"USE_GLCANVAS":"wx.glcanvas.",
"USE_MEDIACTRL":"wx.media.",
"USE_WEBVIEW":"wx.html2.",
"Uint16":"wx.",
"Uint32":"wx.",
"Uint64":"wx.",
View
@@ -69,7 +69,8 @@
'position',
'colour',
'stream', 'filesys',
'stream',
'filesys',
# GDI and graphics
'image',
@@ -101,6 +102,7 @@
'rawbmp',
# more core
'access',
'accel',
'log',
'dataobj',
View
@@ -62,7 +62,7 @@ def run():
#-----------------------------------------------------------------
module.addHeaderCode('#include <wx/glcanvas.h>')
tools.generateStubs('wxUSE_GLCANVAS', module)
c = module.find('wxGLContext')
assert isinstance(c, etgtools.ClassDef)
@@ -82,12 +82,12 @@ def run():
c.find('wxGLCanvas').findOverload('const int *attribList').ignore()
m = c.addCppCtor_sip(
argsString="""(
wxWindow* parent /TransferThis/,
wxWindowID id=wxID_ANY,
wxWindow* parent /TransferThis/,
wxWindowID id=wxID_ANY,
wxArrayInt* attribList=NULL,
const wxPoint& pos=wxDefaultPosition,
const wxPoint& pos=wxDefaultPosition,
const wxSize& size=wxDefaultSize,
long style=0,
long style=0,
const wxString& name="GLCanvas",
const wxPalette& palette=wxNullPalette)
""",
View
@@ -29,7 +29,7 @@
# remove it from this list of Includes, and change the MODULE value in the
# promoted script to be the same as its NAME.
INCLUDES = [#'metafile',
INCLUDES = [
'axbase',
]
@@ -60,7 +60,7 @@ def run():
module.addPyCode("""\
Metafile = wx.deprecated(wx.Metafile, 'Metafile has moved to the core wx module.')
MetafileDC = wx.deprecated(wx.MetafileDC, 'MetafileDC has moved to the core wx module.')
MetafileDC = wx.deprecated(wx.MetafileDC, 'MetafileDC has moved to the core wx module.')
""")
# -----------------------------------------------------------------
View
@@ -0,0 +1,68 @@
#---------------------------------------------------------------------------
# Name: etg/access.py
# Author: Robin Dunn
#
# Created: 08-Oct-2018
# Copyright: (c) 2018 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
import etgtools
import etgtools.tweaker_tools as tools
PACKAGE = "wx"
MODULE = "_core"
NAME = "access" # Base name of the file to generate to for this script
DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [ 'wxAccessible',
]
#---------------------------------------------------------------------------
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.
module.addHeaderCode('#include <wx/access.h>')
tools.generateStubs('wxUSE_ACCESSIBILITY', module,
typeValMap={'wxAccStatus':'wxACC_NOT_IMPLEMENTED'})
c = module.find('wxAccessible')
assert isinstance(c, etgtools.ClassDef)
c.addPrivateCopyCtor()
c.find('GetChild.child').out = True
c.find('GetChildCount.childCount').out = True
c.find('GetDefaultAction.actionName').out = True
c.find('GetDescription.description').out = True
c.find('GetFocus.child').out = True
c.find('GetHelpText.helpText').out = True
c.find('GetKeyboardShortcut.shortcut').out = True
c.find('GetName.name').out = True
c.find('GetParent.parent').out = True
c.find('GetRole.role').out = True
c.find('GetSelections.selections').out = True
c.find('GetState.state').out = True
c.find('GetValue.strValue').out = True
#TODO: double-check this one
c.find('GetLocation.rect').out = True
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)
#---------------------------------------------------------------------------
if __name__ == '__main__':
run()
View
@@ -29,12 +29,16 @@ def run():
# Parse the XML file(s) building a collection of Extractor objects
module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING)
etgtools.parseDoxyXML(module, ITEMS)
module.addHeaderCode('#include "wx/mediactrl.h"')
#-----------------------------------------------------------------
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addHeaderCode('#include <wx/mediactrl.h>')
module.addHeaderCode('#include <wx/uri.h>')
tools.generateStubs('wxUSE_MEDIACTRL', module,
typeValMap={'wxMediaState': 'wxMEDIASTATE_STOPPED'})
c = module.find('wxMediaCtrl')
c.addPrivateCopyCtor()
Oops, something went wrong.

0 comments on commit 2f540a9

Please sign in to comment.