[arch-commits] Commit in python-wxpython/trunk (7 files)

Antonio Rojas arojas at gemini.archlinux.org
Sun Jul 10 16:41:16 UTC 2022


    Date: Sunday, July 10, 2022 @ 16:41:16
  Author: arojas
Revision: 1249315

Update to 4.1.1, fix build with wxwidgets 3.2

Added:
  python-wxpython/trunk/sip-5.patch
  python-wxpython/trunk/sip-6.patch
  python-wxpython/trunk/wxwidgets-3.1.5.patch
  python-wxpython/trunk/wxwidgets-3.1.6.patch
  python-wxpython/trunk/wxwidgets-3.1.7.patch
  python-wxpython/trunk/wxwidgets-3.2.patch
Modified:
  python-wxpython/trunk/PKGBUILD

-----------------------+
 PKGBUILD              |   49 +-
 sip-5.patch           | 1020 ++++++++++++++++++++++++++++++++++++++++++++++++
 sip-6.patch           |  147 ++++++
 wxwidgets-3.1.5.patch |  257 ++++++++++++
 wxwidgets-3.1.6.patch |  717 +++++++++++++++++++++++++++++++++
 wxwidgets-3.1.7.patch |  230 ++++++++++
 wxwidgets-3.2.patch   |  181 ++++++++
 7 files changed, 2590 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-07-10 16:36:12 UTC (rev 1249314)
+++ PKGBUILD	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -4,34 +4,61 @@
 
 pkgname=python-wxpython
 _pkgname=wxPython
-pkgver=4.0.7.2
+pkgver=4.1.1
+_wxver=3.2.0
 _pkgver="${pkgver%.*}"
 _post="${pkgver##*.}"
-pkgrel=3
+pkgrel=1
 epoch=1
 pkgdesc='Cross-platform GUI toolkit'
 arch=('x86_64')
 license=('custom:wxWindows')
 url='https://www.wxpython.org'
-depends=('wxgtk3' 'python-six')
+depends=('wxwidgets-gtk3' 'python-six')
 optdepends=('python-pypubsub: Alternative to the deprecated wx.lib.pubsub API')
-makedepends=('mesa' 'glu' 'webkit2gtk' 'python-requests' 'python-setuptools')
+makedepends=('mesa' 'glu' 'webkit2gtk' 'python-requests' 'python-setuptools' 'sip' 'doxygen' 'waf')
 checkdepends=('xorg-server-xvfb' 'python-pytest-forked' 'python-numpy')
-source=("https://files.pythonhosted.org/packages/source/w/wxPython/wxPython-$_pkgver.post$_post.tar.gz")
-sha512sums=('7af89db90a0f7e6b644d61c1ede01ec36a2c295e46d44692ae9dbc4af923310c1b498a52f45b02a89e8917d844c6abe67e5f3fdd9c1d51da3312899319a349e4')
+source=("https://files.pythonhosted.org/packages/source/w/wxPython/wxPython-$pkgver.tar.gz"
+         https://github.com/wxWidgets/wxWidgets/releases/download/v$_wxver/wxWidgets-$_wxver.tar.bz2
+         sip-5.patch
+         sip-6.patch
+         wxwidgets-3.1.5.patch
+         wxwidgets-3.1.6.patch
+         wxwidgets-3.1.7.patch
+         wxwidgets-3.2.patch)
+sha512sums=('00924008b97bbecb824c3fffd46fc76a5a3115d9346eb95baccc6cca99c080aa80b586af42fece8a3b4d234f2d07ffa8b66b50a164c41cbd95abc9b139c32809'
+            'e55e7c5ac7abcacf2ecff7c22e367db17ff5a077d3d5d2aa7589e8ba7cc6695cfa48c0f00bcfdffeda8dc4f974f97a857fb61b4b300a724f7687d710fbb23967'
+            'f619d9b405299558b84646f457a3bddcfffbd0eb90d23f329e107ebb9e3b6e1c6550cbb7a6c775dd65a08d679abcc7b4a6353d5d78ab263213789998b7c24346'
+            '25a260238ee91b920cce184af6a24cf534ef1eb6a0e1148e52279b0b4990cc34b3cd81ea49ba71e2a9f437891d438b16cc4037bc787e7b44187f8f356a3982b9'
+            'f06aa02ebe5b30e88c64ffd04946a8f5512f8b6aebc5d62d35c792396f4e9528d03cdafb5db6e4f606c5c9271ceb6d86c2195a7338cfcbc91aace6ce87cd60f8'
+            '289211f6d7060c1387b27167403665831d721b693ca03485ce7663794c684af7e59c93e65bc4cae9aa3fa539f565e687bbd7efbd63adfaa9fa3aaf83bbfb6ea0'
+            '95dd41b6d11b8b89aa639e3f1b16610124b38b5a711c1d1a35c4588f2ee9650e5f534af439d57c77c1971c7e08738abc518eafe5b0b7eb608237b316d1884169'
+            'b919a9b714c076c2e2746c3e011802a56de10f5182f48db1f5da62797b204abd12a19d179f5aad4ad15799686be7c718a8ad256f611c2d1d734a7220f0f21658')
 
 prepare() {
-  sed -i "s|WX_CONFIG = 'wx-config'|WX_CONFIG = 'wx-config-gtk3'|" $_pkgname-$_pkgver.post$_post/build.py
+  cd $_pkgname-$pkgver
+  # Fix build with sip 6
+  patch -p1 -i ../sip-5.patch
+  patch -p1 -i ../sip-6.patch
+  # Fix build with wxWidgets 3.2
+  patch -p1 -i ../wxwidgets-3.1.5.patch
+  patch -p1 -i ../wxwidgets-3.1.6.patch
+  patch -p1 -i ../wxwidgets-3.1.7.patch
+  patch -p1 -i ../wxwidgets-3.2.patch
+  rm -r ext/wxWidgets
+  mv "$srcdir"/wxWidgets-$_wxver ext/wxWidgets
 }
 
 build() {
-  cd "$_pkgname-$_pkgver.post$_post"
+  cd $_pkgname-$pkgver
 
-  python build.py build --use_syswx --release
+  rm -r sip/{cpp,gen}/* # Recreate sip files with current wxWidgets
+  SIP=/usr/bin/sip DOXYGEN=/usr/bin/doxygen WAF=/usr/bin/waf \
+  python build.py dox etg --nodoc sip build --use_syswx --release
 }
 
 check() {
-  cd "$_pkgname-$_pkgver.post$_post"
+  cd $_pkgname-$pkgver
 
   # there are segfaulting tests so --forked ensures we get sensible results
   PYTHONPATH=$PWD xvfb-run pytest --forked unittests || echo "==> WARNING: tests usually fail randomly"
@@ -38,7 +65,7 @@
 }
 
 package() {
-  cd "$_pkgname-$_pkgver.post$_post"
+  cd $_pkgname-$pkgver
 
   python build.py install --destdir="$pkgdir"
 

Added: sip-5.patch
===================================================================
--- sip-5.patch	                        (rev 0)
+++ sip-5.patch	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -0,0 +1,1020 @@
+From c8e25b79e1374f6e5e5046097443d0f395a7c8a8 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Tue, 5 Jan 2021 10:56:42 -0800
+Subject: [PATCH] Run SIP via its Python interface rather than as a separate
+ subprocess
+
+---
+ build.py                  |  50 ++--
+ buildtools/config.py      |   2 -
+ buildtools/wxpysip.py     | 110 +++++++++
+ wscript                   |   7 -
+ wx/include/wxPython/sip.h | 463 ++++++--------------------------------
+ 5 files changed, 209 insertions(+), 423 deletions(-)
+ create mode 100644 buildtools/wxpysip.py
+
+diff --git a/build.py b/build.py
+index 34038cc32..9ffd520b6 100755
+--- a/build.py
++++ b/build.py
+@@ -45,6 +45,7 @@
+                                getVcsRev, runcmd, textfile_open, getSipFiles, \
+                                getVisCVersion, getToolsPlatformName, updateLicenseFiles, \
+                                TemporaryDirectory
++from buildtools.wxpysip import sip_runner
+ 
+ import buildtools.version as version
+ 
+@@ -87,14 +88,6 @@
+ 
+ # Some tools will be downloaded for the builds. These are the versions and
+ # MD5s of the tool binaries currently in use.
+-sipCurrentVersion = '4.19.24'
+-sipMD5 = {
+-    'darwin'   : '2a22cb7a35eb14384b0829593a366c29',
+-    'win32'    : '49e0aa36397d7629fea95418452961fb',
+-    'linux32'  : 'ea773f6fd92d5f23530730428a86df2f',
+-    'linux64'  : 'b44a45191f5f84db10e2ba1c4cecd8ff',
+-}
+-
+ wafCurrentVersion = '2.0.19'
+ wafMD5 = 'ac362b60111a59ab2df63513018d5ad8'
+ 
+@@ -638,15 +631,6 @@ def _error_msg(txt):
+ 
+ # The download and MD5 check only needs to happen once per run, cache the sip
+ # cmd value here the first time through.
+-_sipCmd = None
+-def getSipCmd():
+-    global _sipCmd
+-    if _sipCmd is None:
+-        _sipCmd = getTool('sip', sipCurrentVersion, sipMD5, 'SIP', True, True)
+-    return _sipCmd
+-
+-
+-# Same thing for WAF
+ _wafCmd = None
+ def getWafCmd():
+     global _wafCmd
+@@ -1285,15 +1269,31 @@ def cmd_sip(options, args):
+         if not newer_group(sipFiles, sbf) and os.path.exists(pycode):
+             continue
+ 
+-        # leave this turned off for now...
+-        # typehint = '-y {}'.format(posixjoin(cfg.PKGDIR, base[1:]) + '.pyi')
+-        typehint = ''
++        # Leave it turned off for now. TODO: Experiment with this...
++        # pyi_extract = posixjoin(cfg.PKGDIR, base[1:]) + '.pyi'
++        pyi_extract = None
++
++        # SIP extracts are used to pull python snippets and put them into the
++        # module's .py file
++        pycode = 'pycode'+base+':'+pycode
++
++        sip_runner(src_name,
++            abi_version = '12.8',       # siplib abi version
++            warnings = True,            # enable warning messages
++            docstrings = True,          # enable the automatic generation of docstrings
++            release_gil = True,         # always release and reacquire the GIL
++            sip_module = 'wx.siplib',   # the fully qualified name of the sip module
++            sbf_file=sbf,               # File to write the generated file lists to
++            exceptions = False,         # enable support for exceptions
++            tracing = False,            # generate code with tracing enabled
++            sources_dir = tmpdir,       # the name of the code directory
++            extracts = [pycode],        # add <ID:FILE> to the list of extracts to generate
++            pyi_extract=pyi_extract,    # the name of the .pyi stub file
++            include_dirs = [
++                os.path.join(phoenixDir(), 'src'),
++                os.path.join(phoenixDir(), 'sip', 'gen'),
++            ])
+ 
+-        pycode = '-X pycode'+base+':'+pycode
+-        sip = getSipCmd()
+-        cmd = '%s %s -c %s -b %s %s %s %s'  % \
+-            (sip, cfg.SIPOPTS, tmpdir, sbf, pycode, typehint, src_name)
+-        runcmd(cmd)
+ 
+         classesNeedingClassInfo = { 'sip_corewxTreeCtrl.cpp' : 'wxTreeCtrl', }
+ 
+diff --git a/buildtools/config.py b/buildtools/config.py
+index 99a1a2258..a7c2a0d59 100644
+--- a/buildtools/config.py
++++ b/buildtools/config.py
+@@ -169,8 +169,6 @@ def finishSetup(self, wx_config=None, debug=None):
+                              ('WXUSINGDLL', '1'),
+                              ('ISOLATION_AWARE_ENABLED', None),
+                              #('NDEBUG',),  # using a 1-tuple makes it do an undef
+-                             ('SIP_MODULE_NAME', 'wx.siplib'),
+-                             ('SIP_MODULE_BASENAME', 'siplib'),
+                              ]
+             if int(getVisCVersion()) > 100:
+                 self.defines += [ ('wxUSE_RC_MANIFEST', '1'),
+diff --git a/buildtools/wxpysip.py b/buildtools/wxpysip.py
+new file mode 100644
+index 000000000..c58102b84
+--- /dev/null
++++ b/buildtools/wxpysip.py
+@@ -0,0 +1,110 @@
++#----------------------------------------------------------------------
++# Name:        buildtools.wxpysip
++# Purpose:     Code to help migrate to SIP 5 with as little disruption
++#              as possible.
++#
++# Author:      Robin Dunn
++#
++# Created:     4-Jan-2021
++# Copyright:   (c) 2021 by Total Control Software
++# License:     wxWindows License
++#----------------------------------------------------------------------
++
++# NOTE: This code is mostly copied, adapted, and extended from the
++#       sipbuild.legacy.sip5 module. The main intent is to make it easy to run
++#       sip the same way as the legacy sip5 entry point, but without needing to
++#       run a subprocess, and to also add a little missing sip 4 functionality
++#       that we were depending on with the old SIP.
++import os
++
++from sipbuild.code_generator import (set_globals, parse, generateCode,
++        generateExtracts, generateAPI, generateXML, generateTypeHints)
++from sipbuild.exceptions import handle_exception, UserException
++from sipbuild.module import resolve_abi_version
++from sipbuild.version import SIP_VERSION, SIP_VERSION_STR
++
++
++def sip_runner(
++    specification,              # the name of the specification file [default stdin]
++    sources_dir=None,           # the name of the code output directory [default not generated]
++    include_dirs=[],            # add <DIR> to the list of directories to search when importing or including .sip files
++    warnings=False,             # enable warning messages [default disabled]
++    docstrings=False,           # enable the automatic generation of docstrings [default disabled]
++    release_gil=False,          # always release and reacquire the GIL [default only when specified]
++    sip_module=None,            # the fully qualified name of the sip module
++    api_extract=None,           # the name of the QScintilla API file [default not generated
++    exceptions=False,           # enable support for C++ exceptions [default disabled]
++    tracing=False,              # generate code with tracing enabled [default disabled]
++    extracts=[],                # add <ID:FILE> to the list of extracts to generate
++    pyi_extract=None,           # the name of the .pyi stub file [default not generated]
++    sbf_file=None,              # File to write the generated file lists to [default not generated]
++    abi_version=None,           # the sip ABI version
++    backstops=[],               # add <TAG> to the list of timeline backstops
++    py_debug=False,             # generate code for a debug build of Python
++    warnings_are_errors=False,  # warnings are handled as errors
++    parts=0,                    # split the generated code into <FILES> files [default 1 per class]
++    xml_extract=None,           # file to write sip xml to
++    protected_is_public=False,  # enable the protected/public hack [default disabled]
++    source_suffix=None,         # the suffix to use for C or C++ source files [default \".c\" or \".cpp\"]
++    tags=[],                    # add <TAG> to the list of versions/platforms to generate code for
++    disabled_features=[],       # add <FEATURE> to the list of disabled features
++    ):
++
++    print("Running SIP code generator on: {}".format(specification))
++
++    generated_files = []
++    try:
++        # The code generator requires the name of the sip module.
++        if sources_dir is not None and sip_module is None:
++            raise UserException("the name of the sip module must be given")
++
++        # Check the ABI version.
++        abi_major, abi_minor = resolve_abi_version(abi_version).split('.')
++
++        # Set the globals.
++        set_globals(SIP_VERSION, SIP_VERSION_STR, int(abi_major), int(abi_minor),
++                UserException, include_dirs)
++
++        # Parse the input file.
++        pt, _, _, _, tags, disabled_features = parse(specification,
++                (xml_extract is None), tags, backstops, disabled_features,
++                protected_is_public)
++
++        # Generate the bindings.
++        if sources_dir is not None:
++            generated_files = generateCode(pt, sources_dir, source_suffix,
++                    exceptions, tracing, release_gil, parts, tags,
++                    disabled_features, docstrings, py_debug, sip_module)
++
++        if sbf_file is not None:
++            generateBuildFile(sbf_file, generated_files)
++
++        # Generate any extracts.
++        generateExtracts(pt, extracts)
++
++        # Generate the API file.
++        if api_extract is not None:
++            generateAPI(pt, api_extract)
++
++        # Generate the type hints file.
++        if pyi_extract is not None:
++            generateTypeHints(pt, pyi_extract)
++
++        # Generate the XML file.
++        if xml_extract is not None:
++            generateXML(pt, xml_extract)
++
++    except Exception as e:
++        handle_exception(e)
++
++    return generated_files
++
++
++def generateBuildFile(sbf_file, generated_files):
++    header, sources = generated_files
++    header = os.path.basename(header)
++    sources = [os.path.basename(n) for n in sources]
++    with open(sbf_file, 'w') as f:
++        f.write("sources = {}\n".format(' '.join(sources)))
++        f.write("headers = {}\n".format(header))
++
+diff --git a/wscript b/wscript
+index 1e143be67..7fc4f7ca8 100644
+--- a/wscript
++++ b/wscript
+@@ -323,13 +323,6 @@ def configure(conf):
+         conf.env.CFLAGS_WXPY.append('-UNDEBUG')
+         conf.env.CXXFLAGS_WXPY.append('-UNDEBUG')
+ 
+-        # set the name of our siplib module
+-        conf.env.CFLAGS_WXPY.append('-DSIP_MODULE_NAME=wx.siplib')
+-        conf.env.CXXFLAGS_WXPY.append('-DSIP_MODULE_NAME=wx.siplib')
+-
+-        conf.env.CFLAGS_WXPY.append('-DSIP_MODULE_BASENAME=siplib')
+-        conf.env.CXXFLAGS_WXPY.append('-DSIP_MODULE_BASENAME=siplib')
+-
+         # Add basic debug info for all builds
+         conf.env.CFLAGS_WXPY.append('-g')
+         conf.env.CXXFLAGS_WXPY.append('-g')
+diff --git a/wx/include/wxPython/sip.h b/wx/include/wxPython/sip.h
+index ad9036373..aa911aee7 100644
+--- a/wx/include/wxPython/sip.h
++++ b/wx/include/wxPython/sip.h
+@@ -21,22 +21,11 @@
+ #define _SIP_H
+ 
+ 
+-/*
+- * This gets round a problem with Qt's moc and Python v2.3.  Strictly speaking
+- * it's a Qt problem but later versions of Python include a fix for it so we
+- * might as well too.
+- */
+-#undef slots
+-
+-
+ #include <Python.h>
+ 
+-/*
+- * There is a mis-feature somewhere with the Borland compiler.  This works
+- * around it.
+- */
+-#if defined(__BORLANDC__)
+-#include <rpc.h>
++/* Sanity check on the Python version. */
++#if PY_VERSION_HEX < 0x03050000
++#error "This version of SIP requires Python v3.5 or later"
+ #endif
+ 
+ 
+@@ -45,238 +34,35 @@ extern "C" {
+ #endif
+ 
+ 
+-/* Sanity check on the Python version. */
+-#if PY_VERSION_HEX < 0x02030000
+-#error "This version of SIP requires Python v2.3 or later"
+-#endif
++/* The patch version of this implementation of the ABI. */
++#define SIP_MODULE_PATCH_VERSION    1
+ 
+ 
+ /*
+- * Define the SIP version number.
++ * The changes to this version of the ABI.
++ *
++ * Preserve any current exception in the wrapper tp_dealloc functions.
+  */
+-#define SIP_VERSION         0x041318
+-#define SIP_VERSION_STR     "4.19.24"
+ 
+ 
+-/*
+- * Define the current API version number.  SIP must handle modules with the
+- * same major number and with the same or earlier minor number.  Whenever
+- * members are added to non-embedded data structures they must be appended and
+- * the minor number incremented.  Whenever data structure members are removed
+- * or their offset changed then the major number must be incremented and the
+- * minor number set * to 0.
+- *
+- * History:
+- *
+- * 12.7 Added sip_api_visit_wrappers() to the public API.
+- *      Added sip_api_register_exit_notifier() to the public API.
+- *      sip_api_is_owned_by_python() is now part of the public API.
+- *
+- * 12.6 Added sip_api_long_as_size_t() to the public API.
+- *      Added the '=' format character to sip_api_build_result().
+- *      Added the '=' format character to sip_api_parse_result_ex().
+- *
+- * 12.5 Replaced the sipConvertFromSliceObject() macro with
+- *      sip_api_convert_from_slice_object() in the public API.
+- *
+- * 12.4 Added sip_api_instance_destroyed_ex() to the private API.
+- *
+- * 12.3 Added SIP_TYPE_SCOPED_ENUM to the sipTypeDef flags.
+- *      Added sip_api_convert_to_enum() to the public API.
+- *      Added sip_api_convert_to_bool() to the public API.
+- *      Added sip_api_long_as_char(), sip_api_long_as_signed_char(),
+- *      sip_api_long_as_unsigned_char(), sip_api_long_as_short(),
+- *      sip_api_long_as_unsigned_short(), sip_api_long_as_int(),
+- *      sip_api_long_as_unsigned_int(), sip_api_long_as_long(),
+- *      sip_api_long_as_unsigned_long(), sip_api_long_as_long_long(),
+- *      sip_api_long_as_unsigned_long_long() to the public API.
+- *      Deprecated sip_api_can_convert_to_enum().
+- *
+- * 12.2 Added sip_api_print_object() to the public API.
+- *      Renamed sip_api_common_dtor() to sip_api_instance_destroyed() and added
+- *      it to the public API.
+- *      Added sipEventType and sip_api_register_event_handler() to the public
+- *      API.
+- *
+- * 12.1 Added sip_api_enable_gc() to the public API.
+- *
+- * 12.0 Added SIP_TYPE_LIMITED_API to the sipTypeDef flags.
+- *      Added sip_api_py_type_dict() and sip_api_py_type_name() to the public
+- *      API.
+- *      Added sip_api_set_new_user_type_handler() to the public API.
+- *      Added sip_api_is_user_type() to the public API.
+- *      Added sip_api_set_type_user_data() and sip_api_get_type_user_data() to
+- *      the public API.
+- *      Added sip_api_set_user_object() and sip_api_get_user_object() to the
+- *      public API.
+- *      Added sip_api_get_method() and sip_api_from_method() to the public API.
+- *      Added sip_api_get_c_function() to the public API.
+- *      Added sip_api_get_date() and sip_api_from_date() to the public API.
+- *      Added sip_api_get_datetime() and sip_api_from_datetime() to the public
+- *      API.
+- *      Added sip_api_get_time() and sip_api_from_time() to the public API.
+- *      Added sip_api_get_frame() to the public API.
+- *      Added sip_api_check_plugin_for_type() to the public API.
+- *      Added sip_api_unicode_new(), sip_api_unicode_write() and
+- *      sip_api_unicode_data() to the public API.
+- *      Added sip_api_get_buffer_info() and sip_api_relese_buffer_info() to the
+- *      public API.
+- *      Added sip_api_call_procedure_method() to the public API.
+- *      Added sip_api_is_owned_by_python() to the private API.
+- *      Added sip_api_is_derived_class() to the private API.
+- *      Removed the im_version member from sipImportedModuleDef.
+- *      Removed the im_module member from sipImportedModuleDef.
+- *      Removed the em_version member from sipExportedModuleDef.
+- *      Removed the em_virthandlers member from sipExportedModuleDef.
+- *      Re-ordered the API functions.
+- *
+- * 11.3 Added sip_api_get_interpreter() to the public API.
+- *
+- * 11.2 Added sip_api_get_reference() to the private API.
+- *
+- * 11.1 Added sip_api_invoke_slot_ex().
+- *
+- * 11.0 Added the pyqt5QtSignal and pyqt5ClassTypeDef structures.
+- *      Removed qt_interface from pyqt4ClassTypeDef.
+- *      Added hack to pyqt4QtSignal.
+- *
+- * 10.1 Added ctd_final to sipClassTypeDef.
+- *      Added ctd_init_mixin to sipClassTypeDef.
+- *      Added sip_api_get_mixin_address() to the public API.
+- *      Added sip_api_convert_from_new_pytype() to the public API.
+- *      Added sip_api_convert_to_array() to the public API.
+- *      Added sip_api_convert_to_typed_array() to the public API.
+- *      Added sip_api_register_proxy_resolver() to the public API.
+- *      Added sip_api_init_mixin() to the private API.
+- *      Added qt_interface to pyqt4ClassTypeDef.
+- *
+- * 10.0 Added sip_api_set_destroy_on_exit().
+- *      Added sip_api_enable_autoconversion().
+- *      Removed sip_api_call_error_handler_old().
+- *      Removed sip_api_start_thread().
+- *
+- * 9.2  Added sip_gilstate_t and SIP_RELEASE_GIL to the public API.
+- *      Renamed sip_api_call_error_handler() to
+- *      sip_api_call_error_handler_old().
+- *      Added the new sip_api_call_error_handler() to the private API.
+- *
+- * 9.1  Added the capsule type.
+- *      Added the 'z' format character to sip_api_build_result().
+- *      Added the 'z', '!' and '$' format characters to
+- *      sip_api_parse_result_ex().
+- *
+- * 9.0  Changed the sipVariableGetterFunc signature.
+- *      Added sip_api_parse_result_ex() to the private API.
+- *      Added sip_api_call_error_handler() to the private API.
+- *      Added em_virterrorhandlers to sipExportedModuleDef.
+- *      Re-ordered the API functions.
+- *
+- * 8.1  Revised the sipVariableDef structure.
+- *      sip_api_get_address() is now part of the public API.
+- *
+- * 8.0  Changed the size of the sipSimpleWrapper structure.
+- *      Added sip_api_get_address().
+- *
+- * 7.1  Added the 'H' format character to sip_api_parse_result().
+- *      Deprecated the 'D' format character of sip_api_parse_result().
+- *
+- * 7.0  Added sip_api_parse_kwd_args().
+- *      Added sipErrorState, sip_api_add_exception().
+- *      The type initialisation function is now passed a dictionary of keyword
+- *      arguments.
+- *      All argument parsers now update a set of error messages rather than an
+- *      argument count.
+- *      The signatures of sip_api_no_function() and sip_api_no_method() have
+- *      changed.
+- *      Added ctd_docstring to sipClassTypeDef.
+- *      Added vf_docstring to sipVersionedFunctionDef.
+- *
+- * 6.0  Added the sipContainerDef structure to define the contents of a class
+- *      or mapped type.  Restructured sipClassDef and sipMappedTypeDef
+- *      accordingly.
+- *      Added the 'r' format character to sip_api_parse_args().
+- *      Added the 'r' format character to sip_api_call_method() and
+- *      sip_api_build_result().
+- *      Added the assignment, array and copy allocation helpers.
+- *
+- * 5.0  Added sip_api_is_api_enabled().
+- *      Renamed the td_version_nr member of sipTypeDef to be int and where -1
+- *      indicates it is not versioned.
+- *      Added the em_versions member to sipExportedModuleDef.
+- *      Added the em_versioned_functions member to sipExportedModuleDef.
+- *
+- * 4.0  Much refactoring.
+- *
+- * 3.8  Added sip_api_register_qt_metatype() and sip_api_deprecated().
+- *      Added qt_register_meta_type() to the Qt support API.
+- *      The C/C++ names of enums and types are now always defined in the
+- *      relevant structures and don't default to the Python name.
+- *      Added the 'XE' format characters to sip_api_parse_args().
+- *
+- * 3.7  Added sip_api_convert_from_const_void_ptr(),
+- *      sip_api_convert_from_void_ptr_and_size() and
+- *      sip_api_convert_from_const_void_ptr_and_size().
+- *      Added the 'g' and 'G' format characters (to replace the now deprecated
+- *      'a' and 'A' format characters) to sip_api_build_result(),
+- *      sip_api_call_method() and sip_api_parse_result().
+- *      Added the 'k' and 'K' format characters (to replace the now deprecated
+- *      'a' and 'A' format characters) to sip_api_parse_args().
+- *      Added sip_api_invoke_slot().
+- *      Added sip_api_parse_type().
+- *      Added sip_api_is_exact_wrapped_type().
+- *      Added the td_assign and td_qt fields to the sipTypeDef structure.
+- *      Added the mt_assign field to the sipMappedType structure.
+- *
+- * 3.6  Added the 'g' format character to sip_api_parse_args().
+- *
+- * 3.5  Added the td_pickle field to the sipTypeDef structure.
+- *      Added sip_api_transfer_break().
+- *
+- * 3.4  Added qt_find_connection() to the Qt support API.
+- *      Added sip_api_string_as_char(), sip_api_unicode_as_wchar(),
+- *      sip_api_unicode_as_wstring(), sip_api_find_class(),
+- *      sip_api_find_named_enum() and sip_api_parse_signature().
+- *      Added the 'A', 'w' and 'x' format characters to sip_api_parse_args(),
+- *      sip_api_parse_result(), sip_api_build_result() and
+- *      sip_api_call_method().
+- *
+- * 3.3  Added sip_api_register_int_types().
+- *
+- * 3.2  Added sip_api_export_symbol() and sip_api_import_symbol().
+- *
+- * 3.1  Added sip_api_add_mapped_type_instance().
+- *
+- * 3.0  Moved the Qt support out of the sip module and into PyQt.  This is
+- *      such a dramatic change that there is no point in attempting to maintain
+- *      backwards compatibility.
+- *
+- * 2.0  Added the td_flags field to the sipTypeDef structure.
+- *      Added the first_child, sibling_next, sibling_prev and parent fields to
+- *      the sipWrapper structure.
+- *      Added the td_traverse and td_clear fields to the sipTypeDef structure.
+- *      Added the em_api_minor field to the sipExportedModuleDef structure.
+- *      Added sip_api_bad_operator_arg().
+- *      Added sip_api_wrapper_check().
+- *
+- * 1.1  Added support for __pos__ and __abs__.
+- *
+- * 1.0  Removed all deprecated parts of the API.
+- *      Removed the td_proxy field from the sipTypeDef structure.
+- *      Removed the create proxy function from the 'q' and 'y' format
+- *      characters to sip_api_parse_args().
+- *      Removed sip_api_emit_to_slot().
+- *      Reworked the enum related structures.
+- *
+- * 0.2  Added the 'H' format character to sip_api_parse_args().
+- *
+- * 0.1  Added sip_api_add_class_instance().
+- *      Added the 't' format character to sip_api_parse_args().
+- *      Deprecated the 'J' and 'K' format characters to sip_api_parse_result().
+- *
+- * 0.0  Original version.
+- */
+-#define SIP_API_MAJOR_NR    12
+-#define SIP_API_MINOR_NR    7
++/* The ABI version implemented. */
++#define SIP_ABI_MAJOR_VERSION       12
++#define SIP_ABI_MINOR_VERSION       8
++
++/* The version of the code generator. */
++#define SIP_VERSION                 0x50500
++#define SIP_VERSION_STR             "5.5.0"
++
++/* These are all dependent on the user-specified name of the sip module. */
++#define _SIP_MODULE_FQ_NAME         "wx.siplib"
++#define _SIP_MODULE_NAME            "siplib"
++#define _SIP_MODULE_SHARED          1
++#define _SIP_MODULE_ENTRY           PyInit_siplib
++#define _SIP_MODULE_LEGACY          0
++
++/* Support the historical names. */
++#define SIP_API_MAJOR_NR    SIP_ABI_MAJOR_VERSION
++#define SIP_API_MINOR_NR    SIP_ABI_MINOR_VERSION
+ 
+ 
+ /*
+@@ -324,29 +110,16 @@ typedef unsigned int uint;
+ #endif
+ 
+ 
+-/* Some Python compatibility stuff. */
+-#if PY_VERSION_HEX >= 0x02050000
+-
+-#define SIP_SSIZE_T         Py_ssize_t
+-#define SIP_SSIZE_T_FORMAT  "%zd"
+-
+-#define SIP_MLNAME_CAST(s)  (s)
+-#define SIP_MLDOC_CAST(s)   (s)
+-#define SIP_TPNAME_CAST(s)  (s)
+-
+-#else
+-
+-#define SIP_SSIZE_T         int
+-#define SIP_SSIZE_T_FORMAT  "%d"
+-
+-#define SIP_MLNAME_CAST(s)  ((char *)(s))
+-#define SIP_MLDOC_CAST(s)   ((char *)(s))
+-#define SIP_TPNAME_CAST(s)  ((char *)(s))
+-
+-#endif
+-
+-#if PY_MAJOR_VERSION >= 3
++/* Remove in v5.1. */
++#define SIP_SSIZE_T             Py_ssize_t
++#define SIP_SSIZE_T_FORMAT      "%zd"
++#define SIP_USE_PYCAPSULE
++#define SIP_MODULE_RETURN(v)    return (v)
+ 
++/*
++ * Remove in v5.1.  These are undocumented and can be removed when PyQt5 drops
++ * support for Python v2.
++ */
+ #define SIPLong_Check       PyLong_Check
+ #define SIPLong_FromLong    PyLong_FromLong
+ #define SIPLong_AsLong      PyLong_AsLong
+@@ -359,57 +132,6 @@ typedef unsigned int uint;
+ #define SIPBytes_AS_STRING  PyBytes_AS_STRING
+ #define SIPBytes_GET_SIZE   PyBytes_GET_SIZE
+ 
+-#if PY_MINOR_VERSION >= 1
+-#define SIP_USE_PYCAPSULE
+-#endif
+-
+-#if PY_MINOR_VERSION < 2
+-#define SIP_SUPPORT_PYCOBJECT
+-#endif
+-
+-#else
+-
+-#define SIPLong_Check       PyInt_Check
+-#define SIPLong_FromLong    PyInt_FromLong
+-#define SIPLong_AsLong      PyInt_AsLong
+-
+-#define SIPBytes_Check      PyString_Check
+-#define SIPBytes_FromString PyString_FromString
+-#define SIPBytes_FromStringAndSize  PyString_FromStringAndSize
+-#define SIPBytes_AsString   PyString_AsString
+-#define SIPBytes_Size       PyString_Size
+-#define SIPBytes_AS_STRING  PyString_AS_STRING
+-#define SIPBytes_GET_SIZE   PyString_GET_SIZE
+-
+-#if PY_MINOR_VERSION >= 7
+-#define SIP_USE_PYCAPSULE
+-#endif
+-
+-#define SIP_SUPPORT_PYCOBJECT
+-
+-#endif
+-
+-#if !defined(Py_REFCNT)
+-#define Py_REFCNT(ob)       (((PyObject*)(ob))->ob_refcnt)
+-#endif
+-
+-#if !defined(Py_TYPE)
+-#define Py_TYPE(ob)         (((PyObject*)(ob))->ob_type)
+-#endif
+-
+-#if !defined(PyVarObject_HEAD_INIT)
+-#define PyVarObject_HEAD_INIT(type, size)   PyObject_HEAD_INIT(type) size,
+-#endif
+-
+-
+-#if defined(SIP_USE_PYCAPSULE)
+-#define SIPCapsule_FromVoidPtr(p, n)    PyCapsule_New((p), (n), NULL)
+-#define SIPCapsule_AsVoidPtr(p, n)      PyCapsule_GetPointer((p), (n))
+-#else
+-#define SIPCapsule_FromVoidPtr(p, n)    sipConvertFromVoidPtr((p))
+-#define SIPCapsule_AsVoidPtr(p, n)      sipConvertToVoidPtr((p))
+-#endif
+-
+ 
+ /*
+  * The mask that can be passed to sipTrace().
+@@ -512,17 +234,12 @@ typedef int (*sipFinalFunc)(PyObject *, void *, PyObject *, PyObject **);
+ typedef void *(*sipAccessFunc)(sipSimpleWrapper *, AccessFuncOp);
+ typedef int (*sipTraverseFunc)(void *, visitproc, void *);
+ typedef int (*sipClearFunc)(void *);
+-#if PY_MAJOR_VERSION >= 3
+ typedef int (*sipGetBufferFuncLimited)(PyObject *, void *, sipBufferDef *);
+ typedef void (*sipReleaseBufferFuncLimited)(PyObject *, void *);
+ #if !defined(Py_LIMITED_API)
+ typedef int (*sipGetBufferFunc)(PyObject *, void *, Py_buffer *, int);
+ typedef void (*sipReleaseBufferFunc)(PyObject *, void *, Py_buffer *);
+ #endif
+-#else
+-typedef SIP_SSIZE_T (*sipBufferFunc)(PyObject *, void *, SIP_SSIZE_T, void **);
+-typedef SIP_SSIZE_T (*sipSegCountFunc)(PyObject *, void *, SIP_SSIZE_T *);
+-#endif
+ typedef void (*sipDeallocFunc)(sipSimpleWrapper *);
+ typedef void *(*sipCastFunc)(void *, const sipTypeDef *);
+ typedef const sipTypeDef *(*sipSubClassConvertFunc)(void **);
+@@ -531,9 +248,9 @@ typedef PyObject *(*sipConvertFromFunc)(void *, PyObject *);
+ typedef void (*sipVirtErrorHandlerFunc)(sipSimpleWrapper *, sip_gilstate_t);
+ typedef int (*sipVirtHandlerFunc)(sip_gilstate_t, sipVirtErrorHandlerFunc,
+         sipSimpleWrapper *, PyObject *, ...);
+-typedef void (*sipAssignFunc)(void *, SIP_SSIZE_T, void *);
+-typedef void *(*sipArrayFunc)(SIP_SSIZE_T);
+-typedef void *(*sipCopyFunc)(const void *, SIP_SSIZE_T);
++typedef void (*sipAssignFunc)(void *, Py_ssize_t, void *);
++typedef void *(*sipArrayFunc)(Py_ssize_t);
++typedef void *(*sipCopyFunc)(const void *, Py_ssize_t);
+ typedef void (*sipReleaseFunc)(void *, int);
+ typedef PyObject *(*sipPickleFunc)(void *);
+ typedef int (*sipAttrGetterFunc)(const sipTypeDef *, PyObject *);
+@@ -544,7 +261,7 @@ typedef int (*sipNewUserTypeFunc)(sipWrapperType *);
+ typedef void (*sipWrapperVisitorFunc)(sipSimpleWrapper *, void *);
+ 
+ 
+-#if !defined(Py_LIMITED_API) || PY_VERSION_HEX < 0x03020000
++#if !defined(Py_LIMITED_API)
+ /*
+  * The meta-type of a wrapper type.
+  */
+@@ -638,6 +355,7 @@ struct _sipWrapper {
+ 
+ 
+ /*
++ * Removed in v5.1.
+  * The meta-type of an enum type.  (This is exposed only to support the
+  * deprecated sipConvertFromNamedEnum() macro.)
+  */
+@@ -761,7 +479,7 @@ struct _sipBufferDef {
+     void *bd_buffer;
+ 
+     /* The length of the buffer. */
+-    SIP_SSIZE_T bd_length;
++    Py_ssize_t bd_length;
+ 
+     /* Set if the buffer is read-only. */
+     int bd_readonly;
+@@ -782,7 +500,7 @@ struct _sipBufferInfoDef {
+     PyObject *bi_obj;
+ 
+     /* The length of the buffer in bytes. */
+-    SIP_SSIZE_T bi_len;
++    Py_ssize_t bi_len;
+ 
+     /* The number of dimensions. */
+     int bi_ndim;
+@@ -813,11 +531,6 @@ struct _sipMethodDef {
+ 
+     /* The bound object. */
+     PyObject *pm_self;
+-
+-#if PY_MAJOR_VERSION < 3
+-    /* The class. */
+-    PyObject *pm_class;
+-#endif
+ };
+ 
+ 
+@@ -871,9 +584,6 @@ typedef enum {
+ typedef enum {
+     str_slot,           /* __str__ */
+     int_slot,           /* __int__ */
+-#if PY_MAJOR_VERSION < 3
+-    long_slot,          /* __long__ */
+-#endif
+     float_slot,         /* __float__ */
+     len_slot,           /* __len__ */
+     contains_slot,      /* __contains__ */
+@@ -916,18 +626,13 @@ typedef enum {
+     ne_slot,            /* __ne__ */
+     gt_slot,            /* __gt__ */
+     ge_slot,            /* __ge__ */
+-#if PY_MAJOR_VERSION < 3
+-    cmp_slot,           /* __cmp__ */
+-#endif
+     bool_slot,          /* __bool__, __nonzero__ */
+     neg_slot,           /* __neg__ */
+     repr_slot,          /* __repr__ */
+     hash_slot,          /* __hash__ */
+     pos_slot,           /* __pos__ */
+     abs_slot,           /* __abs__ */
+-#if PY_VERSION_HEX >= 0x02050000
+     index_slot,         /* __index__ */
+-#endif
+     iter_slot,          /* __iter__ */
+     next_slot,          /* __next__ */
+     setattr_slot,       /* __setattr__, __delattr__ */
+@@ -1039,14 +744,8 @@ struct _sipTypeDef {
+     /* The C/C++ name of the type. */
+     int td_cname;
+ 
+-    /*
+-     * The Python type object.  This needs to be a union until we remove the
+-     * deprecated sipClass_* macros.
+-     */
+-    union {
+-        PyTypeObject *td_py_type;
+-        sipWrapperType *td_wrapper_type;
+-    } u;
++    /* The Python type object. */
++    PyTypeObject *td_py_type;
+ 
+     /* Any additional fixed data generated by a plugin. */
+     void *td_plugin_data;
+@@ -1130,7 +829,6 @@ typedef struct _sipClassTypeDef {
+     /* The clear function. */
+     sipClearFunc ctd_clear;
+ 
+-#if PY_MAJOR_VERSION >= 3
+     /* The get buffer function. */
+ #if defined(Py_LIMITED_API)
+     sipGetBufferFuncLimited ctd_getbuffer;
+@@ -1144,19 +842,6 @@ typedef struct _sipClassTypeDef {
+ #else
+     sipReleaseBufferFunc ctd_releasebuffer;
+ #endif
+-#else
+-    /* The read buffer function. */
+-    sipBufferFunc ctd_readbuffer;
+-
+-    /* The write buffer function. */
+-    sipBufferFunc ctd_writebuffer;
+-
+-    /* The segment count function. */
+-    sipSegCountFunc ctd_segcount;
+-
+-    /* The char buffer function. */
+-    sipBufferFunc ctd_charbuffer;
+-#endif
+ 
+     /* The deallocation function. */
+     sipDeallocFunc ctd_dealloc;
+@@ -1257,6 +942,7 @@ typedef struct _sipExternalTypeDef {
+ 
+ 
+ /*
++ * Remove in v5.1.
+  * The information describing a mapped class.  This (and anything that uses it)
+  * is deprecated.
+  */
+@@ -1625,8 +1311,9 @@ typedef struct _sipTypeInstanceDef {
+ 
+ 
+ /*
++ * Remove in v5.1.
+  * Define a mapping between a wrapped type identified by a string and the
+- * corresponding Python type.  This is deprecated.
++ * corresponding Python type.
+  */
+ typedef struct _sipStringTypeClassMap {
+     /* The type as a string. */
+@@ -1638,8 +1325,9 @@ typedef struct _sipStringTypeClassMap {
+ 
+ 
+ /*
++ * Remove in v5.1.
+  * Define a mapping between a wrapped type identified by an integer and the
+- * corresponding Python type.  This is deprecated.
++ * corresponding Python type.
+  */
+ typedef struct _sipIntTypeClassMap {
+     /* The type as an integer. */
+@@ -1660,11 +1348,6 @@ typedef struct _sipPyMethod {
+ 
+     /* Self if it is a bound method. */
+     PyObject *mself;
+-
+-#if PY_MAJOR_VERSION < 3
+-    /* The class. */
+-    PyObject *mclass;
+-#endif
+ } sipPyMethod;
+ 
+ 
+@@ -1707,7 +1390,7 @@ typedef struct _sipAPIDef {
+     PyTypeObject *api_voidptr_type;
+ 
+     void (*api_bad_catcher_result)(PyObject *method);
+-    void (*api_bad_length_for_slice)(SIP_SSIZE_T seqlen, SIP_SSIZE_T slicelen);
++    void (*api_bad_length_for_slice)(Py_ssize_t seqlen, Py_ssize_t slicelen);
+     PyObject *(*api_build_result)(int *isErr, const char *fmt, ...);
+     PyObject *(*api_call_method)(int *isErr, PyObject *method, const char *fmt,
+             ...);
+@@ -1715,8 +1398,8 @@ typedef struct _sipAPIDef {
+             sipSimpleWrapper *, PyObject *, const char *, ...);
+     PyObject *(*api_connect_rx)(PyObject *txObj, const char *sig,
+             PyObject *rxObj, const char *slot, int type);
+-    SIP_SSIZE_T (*api_convert_from_sequence_index)(SIP_SSIZE_T idx,
+-            SIP_SSIZE_T len);
++    Py_ssize_t (*api_convert_from_sequence_index)(Py_ssize_t idx,
++            Py_ssize_t len);
+     int (*api_can_convert_to_type)(PyObject *pyObj, const sipTypeDef *td,
+             int flags);
+     void *(*api_convert_to_type)(PyObject *pyObj, const sipTypeDef *td,
+@@ -1754,9 +1437,9 @@ typedef struct _sipAPIDef {
+     PyObject *(*api_convert_from_void_ptr)(void *val);
+     PyObject *(*api_convert_from_const_void_ptr)(const void *val);
+     PyObject *(*api_convert_from_void_ptr_and_size)(void *val,
+-            SIP_SSIZE_T size);
++            Py_ssize_t size);
+     PyObject *(*api_convert_from_const_void_ptr_and_size)(const void *val,
+-            SIP_SSIZE_T size);
++            Py_ssize_t size);
+     void *(*api_convert_to_void_ptr)(PyObject *obj);
+     int (*api_export_symbol)(const char *name, void *sym);
+     void *(*api_import_symbol)(const char *name);
+@@ -1777,12 +1460,12 @@ typedef struct _sipAPIDef {
+     PyObject *(*api_convert_from_new_pytype)(void *cpp, PyTypeObject *py_type,
+             sipWrapper *owner, sipSimpleWrapper **selfp, const char *fmt, ...);
+     PyObject *(*api_convert_to_typed_array)(void *data, const sipTypeDef *td,
+-            const char *format, size_t stride, SIP_SSIZE_T len, int flags);
++            const char *format, size_t stride, Py_ssize_t len, int flags);
+     PyObject *(*api_convert_to_array)(void *data, const char *format,
+-            SIP_SSIZE_T len, int flags);
++            Py_ssize_t len, int flags);
+     int (*api_register_proxy_resolver)(const sipTypeDef *td,
+             sipProxyResolverFunc resolver);
+-    PyInterpreterState *(*api_get_interpreter)();
++    PyInterpreterState *(*api_get_interpreter)(void);
+     sipNewUserTypeFunc (*api_set_new_user_type_handler)(const sipTypeDef *,
+             sipNewUserTypeFunc);
+     void (*api_set_type_user_data)(sipWrapperType *, void *);
+@@ -1801,9 +1484,9 @@ typedef struct _sipAPIDef {
+     int (*api_is_user_type)(const sipWrapperType *);
+     struct _frame *(*api_get_frame)(int);
+     int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
+-    PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **);
++    PyObject *(*api_unicode_new)(Py_ssize_t, unsigned, int *, void **);
+     void (*api_unicode_write)(int, void *, int, unsigned);
+-    void *(*api_unicode_data)(PyObject *, int *, SIP_SSIZE_T *);
++    void *(*api_unicode_data)(PyObject *, int *, Py_ssize_t *);
+     int (*api_get_buffer_info)(PyObject *, sipBufferInfoDef *);
+     void (*api_release_buffer_info)(sipBufferInfoDef *);
+     PyObject *(*api_get_user_object)(const sipSimpleWrapper *);
+@@ -1948,14 +1631,22 @@ typedef struct _sipAPIDef {
+     /*
+      * The following are part of the public API.
+      */
+-    int (*api_convert_from_slice_object)(PyObject *slice, SIP_SSIZE_T length,
+-            SIP_SSIZE_T *start, SIP_SSIZE_T *stop, SIP_SSIZE_T *step,
+-            SIP_SSIZE_T *slicelength);
++    int (*api_convert_from_slice_object)(PyObject *slice, Py_ssize_t length,
++            Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
++            Py_ssize_t *slicelength);
+     size_t (*api_long_as_size_t)(PyObject *o);
+     void (*api_visit_wrappers)(sipWrapperVisitorFunc visitor, void *closure);
+     int (*api_register_exit_notifier)(PyMethodDef *md);
++
++    /*
++     * The following are not part of the public API.
++     */
++    PyObject *(*api_is_py_method_12_8)(sip_gilstate_t *gil, char *pymc,
++            sipSimpleWrapper **sipSelfp, const char *cname, const char *mname);
+ } sipAPIDef;
+ 
++const sipAPIDef *sip_init_library(PyObject *mod_dict);
++
+ 
+ /*
+  * The API implementing the optional Qt support.
+@@ -2020,7 +1711,7 @@ typedef struct _sipQtAPI {
+ #define SIP_ACCFUNC         0x0008  /* If there is an access function. */
+ #define SIP_NOT_IN_MAP      0x0010  /* If Python object is not in the map. */
+ 
+-#if !defined(Py_LIMITED_API) || PY_VERSION_HEX < 0x03020000
++#if !defined(Py_LIMITED_API)
+ #define SIP_PY_OWNED        0x0020  /* If owned by Python. */
+ #define SIP_SHARE_MAP       0x0040  /* If the map slot might be occupied. */
+ #define SIP_CPP_HAS_REF     0x0080  /* If C/C++ has a reference. */
+@@ -2068,22 +1759,16 @@ typedef struct _sipQtAPI {
+ #define sipTypeIsMapped(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_MAPPED)
+ #define sipTypeIsEnum(td)   (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_ENUM)
+ #define sipTypeIsScopedEnum(td) (((td)->td_flags & SIP_TYPE_TYPE_MASK) == SIP_TYPE_SCOPED_ENUM)
+-#define sipTypeAsPyTypeObject(td)   ((td)->u.td_py_type)
++#define sipTypeAsPyTypeObject(td)   ((td)->td_py_type)
+ #define sipTypeName(td)     sipNameFromPool((td)->td_module, (td)->td_cname)
+ #define sipTypePluginData(td)   ((td)->td_plugin_data)
+ 
+ 
+ /*
+- * Note that this was never actually documented as being part of the public
+- * API.  It is now deprecated.  sipIsUserType() should be used instead.
+- */
+-#define sipIsExactWrappedType(wt)   (sipTypeAsPyTypeObject((wt)->wt_td) == (PyTypeObject *)(wt))
+-
+-
+-/*
+- * The following are deprecated parts of the public API.
++ * Remove in v5.1.
+  */
+ #define sipClassName(w)     PyString_FromString(Py_TYPE(w)->tp_name)
++#define sipIsExactWrappedType(wt)   (sipTypeAsPyTypeObject((wt)->wt_td) == (PyTypeObject *)(wt))
+ 
+ 
+ /*
+From c385873d705581260e3f9f22524062a3045fec00 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Tue, 5 Jan 2021 11:11:26 -0800
+Subject: [PATCH] Add SIP_ABI to the config object
+
+---
+ build.py             | 2 +-
+ buildtools/config.py | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/build.py b/build.py
+index 9ffd520b6..1db1b92ae 100755
+--- a/build.py
++++ b/build.py
+@@ -1278,7 +1278,7 @@ def cmd_sip(options, args):
+         pycode = 'pycode'+base+':'+pycode
+ 
+         sip_runner(src_name,
+-            abi_version = '12.8',       # siplib abi version
++            abi_version = cfg.SIP_ABI,  # siplib abi version
+             warnings = True,            # enable warning messages
+             docstrings = True,          # enable the automatic generation of docstrings
+             release_gil = True,         # always release and reacquire the GIL
+diff --git a/buildtools/config.py b/buildtools/config.py
+index a7c2a0d59..e9b865dd7 100644
+--- a/buildtools/config.py
++++ b/buildtools/config.py
+@@ -85,6 +85,8 @@ class Configuration(object):
+     PKGDIR = 'wx'
+     # The name of the top-level package
+ 
++    SIP_ABI = '12.8'
++
+     # ---------------------------------------------------------------
+     # Basic initialization and configuration code
+ 
+From 224630cf647341bc719d5fbde08e42e99317aab6 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Thu, 7 Jan 2021 13:43:11 -0800
+Subject: [PATCH] Add Config.SIP_TRACE flag
+
+---
+ build.py             | 2 +-
+ buildtools/config.py | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build.py b/build.py
+index 1db1b92ae..73e5d5018 100755
+--- a/build.py
++++ b/build.py
+@@ -1285,7 +1285,7 @@ def cmd_sip(options, args):
+             sip_module = 'wx.siplib',   # the fully qualified name of the sip module
+             sbf_file=sbf,               # File to write the generated file lists to
+             exceptions = False,         # enable support for exceptions
+-            tracing = False,            # generate code with tracing enabled
++            tracing = cfg.SIP_TRACE,    # generate code with tracing enabled
+             sources_dir = tmpdir,       # the name of the code directory
+             extracts = [pycode],        # add <ID:FILE> to the list of extracts to generate
+             pyi_extract=pyi_extract,    # the name of the .pyi stub file
+diff --git a/buildtools/config.py b/buildtools/config.py
+index e9b865dd7..c6d94da12 100644
+--- a/buildtools/config.py
++++ b/buildtools/config.py
+@@ -86,6 +86,7 @@ class Configuration(object):
+     # The name of the top-level package
+ 
+     SIP_ABI = '12.8'
++    SIP_TRACE = False
+ 
+     # ---------------------------------------------------------------
+     # Basic initialization and configuration code

Added: sip-6.patch
===================================================================
--- sip-6.patch	                        (rev 0)
+++ sip-6.patch	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -0,0 +1,147 @@
+diff --git a/build.py b/build.py
+index be0312e97..8673e4234 100755
+--- a/build.py
++++ b/build.py
+@@ -46,7 +46,6 @@
+                                getVcsRev, runcmd, textfile_open, getSipFiles, \
+                                getVisCVersion, getToolsPlatformName, updateLicenseFiles, \
+                                TemporaryDirectory
+-from buildtools.wxpysip import sip_runner
+ 
+ import buildtools.version as version
+ 
+@@ -1263,7 +1262,7 @@ def cmd_sip(options, args):
+         base = os.path.basename(os.path.splitext(src_name)[0])
+         sbf = posixjoin(cfg.SIPOUT, base) + '.sbf'
+         pycode = base[1:] # remove the leading _
+-        pycode = posixjoin(cfg.PKGDIR, pycode) + '.py'
++        pycode = opj(cfg.ROOT_DIR, cfg.PKGDIR, pycode) + '.py'
+ 
+         # Check if any of the included files are newer than the .sbf file
+         # produced by the previous run of sip. If not then we don't need to
+@@ -1281,23 +1280,54 @@ def cmd_sip(options, args):
+         # module's .py file
+         pycode = 'pycode'+base+':'+pycode
+ 
+-        sip_runner(src_name,
+-            abi_version = cfg.SIP_ABI,  # siplib abi version
+-            warnings = True,            # enable warning messages
+-            docstrings = True,          # enable the automatic generation of docstrings
+-            release_gil = True,         # always release and reacquire the GIL
+-            sip_module = 'wx.siplib',   # the fully qualified name of the sip module
+-            sbf_file=sbf,               # File to write the generated file lists to
+-            exceptions = False,         # enable support for exceptions
+-            tracing = cfg.SIP_TRACE,    # generate code with tracing enabled
+-            sources_dir = tmpdir,       # the name of the code directory
+-            extracts = [pycode],        # add <ID:FILE> to the list of extracts to generate
+-            pyi_extract=pyi_extract,    # the name of the .pyi stub file
+-            include_dirs = [
+-                os.path.join(phoenixDir(), 'src'),
+-                os.path.join(phoenixDir(), 'sip', 'gen'),
+-            ])
+-
++        # Write out a pyproject.toml to configure sip
++        pyproject_toml = (
++            '[build-system]\n'
++            'requires = ["sip >=5.5.0, <7"]\n'
++            'build-backend = "sipbuild.api"\n'
++            '\n'
++            '[tool.sip.metadata]\n'
++            'name = "{base}"\n'
++            '\n'
++            '[tool.sip.bindings.{base}]\n'
++            'docstrings = true\n'
++            'release-gil = true\n'
++            'exceptions = false\n'
++            'tracing = {tracing}\n'
++            'protected-is-public = false\n'
++            'generate-extracts = [\'{extracts}\']\n'
++            'pep484-pyi = false\n'
++            '\n'
++            '[tool.sip.project]\n'
++            'abi-version = "{abi_version}"\n'
++            'sip-files-dir = \'{sip_gen_dir}\'\n'
++            'sip-include-dirs = [\'{src_dir}\']\n'
++            'sip-module = "wx.siplib"\n'
++        ).format(
++            base=base,
++            abi_version=cfg.SIP_ABI,
++            tracing=str(cfg.SIP_TRACE).lower(),
++            extracts=pycode,
++            src_dir=opj(phoenixDir(), 'src'),
++            sip_gen_dir=opj(phoenixDir(), 'sip', 'gen'),
++        )
++        with open(opj(tmpdir, 'pyproject.toml'), 'w') as f:
++            f.write(pyproject_toml)
++
++        sip_pwd = pushDir(tmpdir)
++        cmd = 'sip-build --no-compile'
++        runcmd(cmd)
++        del sip_pwd
++
++        # Write out a sip build file (no longer done by sip itself)
++        sip_tmp_out_dir = opj(tmpdir, 'build', base)
++        sip_pwd = pushDir(sip_tmp_out_dir)
++        header = glob.glob('*.h')[0]
++        sources = glob.glob('*.cpp')
++        del sip_pwd
++        with open(sbf, 'w') as f:
++            f.write("sources = {}\n".format(' '.join(sources)))
++            f.write("headers = {}\n".format(header))
+ 
+         classesNeedingClassInfo = { 'sip_corewxTreeCtrl.cpp' : 'wxTreeCtrl', }
+ 
+@@ -1306,7 +1336,7 @@ def processSrc(src, keepHashLines=False):
+                 srcTxt = f.read()
+                 if keepHashLines:
+                     # Either just fix the pathnames in the #line lines...
+-                    srcTxt = srcTxt.replace(tmpdir, cfg.SIPOUT)
++                    srcTxt = srcTxt.replace(sip_tmp_out_dir, cfg.SIPOUT)
+                 else:
+                     # ...or totally remove them by replacing those lines with ''
+                     import re
+@@ -1337,7 +1367,7 @@ def injectClassInfo(className, srcTxt):
+         # Check each file in tmpdir to see if it is different than the same file
+         # in cfg.SIPOUT. If so then copy the new one to cfg.SIPOUT, otherwise
+         # ignore it.
+-        for src in glob.glob(tmpdir + '/*'):
++        for src in glob.glob(sip_tmp_out_dir + '/*'):
+             dest = opj(cfg.SIPOUT, os.path.basename(src))
+             if not os.path.exists(dest):
+                 msg('%s is a new file, copying...' % os.path.basename(src))
+@@ -1360,6 +1390,17 @@ def injectClassInfo(className, srcTxt):
+         # Remove tmpdir and its contents
+         shutil.rmtree(tmpdir)
+ 
++    # Generate sip module code
++    deleteIfExists(cfg.SIPINC)
++    with tempfile.TemporaryDirectory() as tmpdir:
++        cmd = 'sip-module --sdist --abi-version {} --target-dir {} wx.siplib'.format(cfg.SIP_ABI, tmpdir)
++        runcmd(cmd)
++        tf_name = glob.glob(tmpdir + '/*.tar*')[0]
++        tf_dir = os.path.splitext(os.path.splitext(tf_name)[0])[0]
++        with tarfile.open(tf_name) as tf:
++            tf.extractall(tmpdir)
++        shutil.move(tf_dir, cfg.SIPINC)
++
+ 
+ def cmd_touch(options, args):
+     cmdTimer = CommandTimer('touch')
+diff --git a/wscript b/wscript
+index 4f0d0bf5f..80306098d 100644
+--- a/wscript
++++ b/wscript
+@@ -563,12 +563,12 @@ def build(bld):
+         features = 'c cxx cshlib cxxshlib pyext',
+         target   = makeTargetName(bld, 'siplib'),
+         source   = ['sip/siplib/apiversions.c',
+-                    'sip/siplib/array.c',
+                     'sip/siplib/bool.cpp',
+                     'sip/siplib/descriptors.c',
+                     'sip/siplib/int_convertors.c',
+                     'sip/siplib/objmap.c',
+                     'sip/siplib/qtlib.c',
++                    'sip/siplib/sip_array.c',
+                     'sip/siplib/siplib.c',
+                     'sip/siplib/threads.c',
+                     'sip/siplib/voidptr.c',

Added: wxwidgets-3.1.5.patch
===================================================================
--- wxwidgets-3.1.5.patch	                        (rev 0)
+++ wxwidgets-3.1.5.patch	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -0,0 +1,257 @@
+From 70535a722b945b817af5217841fbd5895d3ba7a9 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Sat, 24 Jul 2021 15:59:37 -0700
+Subject: [PATCH] remove wx.webkit
+
+---
+ etg/_webkit.py           | 71 ------------------------------------
+ etg/webkit.py            | 77 ----------------------------------------
+ unittests/test_webkit.py | 77 ----------------------------------------
+ 3 files changed, 225 deletions(-)
+ delete mode 100644 etg/_webkit.py
+ delete mode 100644 etg/webkit.py
+ delete mode 100644 unittests/test_webkit.py
+
+diff --git a/etg/_webkit.py b/etg/_webkit.py
+deleted file mode 100644
+index 95e9e8a52..000000000
+--- a/etg/_webkit.py
++++ /dev/null
+@@ -1,71 +0,0 @@
+-#---------------------------------------------------------------------------
+-# Name:        etg/_webkit.py
+-# Author:      Robin Dunn
+-#
+-# Created:     22-Aug-2013
+-# Copyright:   (c) 2013-2020 by Total Control Software
+-# License:     wxWindows License
+-#---------------------------------------------------------------------------
+-
+-import etgtools
+-import etgtools.tweaker_tools as tools
+-
+-PACKAGE   = "wx"
+-MODULE    = "_webkit"
+-NAME      = "_webkit"   # Base name of the file to generate to for this script
+-DOCSTRING = """\
+-The :ref:`wx.webkit.wxWebKitCtrl` and related classes are provided mainly for
+-backwards compatibility only. New code would be more future-proof by using the
+-``wx.html2`` module.  The classes in this module are light wrappers around
+-the OSX WebKit control and is not implemented on any other platform.
+-"""
+-
+-# The classes and/or the basename of the Doxygen XML files to be processed by
+-# this script.
+-ITEMS  = [ ]
+-
+-
+-# The list of other ETG scripts and back-end generator modules that are
+-# included as part of this module. These should all be items that are put in
+-# the wxWidgets "webview" library in a multi-lib build.
+-INCLUDES = [ 'webkit',
+-             ]
+-
+-
+-# Separate the list into those that are generated from ETG scripts and the
+-# rest. These lists can be used from the build scripts to get a list of
+-# sources and/or additional dependencies when building this extension module.
+-ETGFILES = ['etg/%s.py' % NAME] + tools.getEtgFiles(INCLUDES)
+-DEPENDS = tools.getNonEtgFiles(INCLUDES)
+-OTHERDEPS = [  ]
+-
+-
+-#---------------------------------------------------------------------------
+-
+-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.check4unittest = False
+-
+-    #-----------------------------------------------------------------
+-    # Tweak the parsed meta objects in the module object as needed for
+-    # customizing the generated code and docstrings.
+-
+-    module.addHeaderCode('#include <wxPython/wxpy_api.h>')
+-    module.addImport('_core')
+-    module.addPyCode('import wx', order=10)
+-    module.addInclude(INCLUDES)
+-
+-
+-    #-----------------------------------------------------------------
+-    #-----------------------------------------------------------------
+-    tools.doCommonTweaks(module)
+-    tools.runGenerators(module)
+-
+-
+-
+-#---------------------------------------------------------------------------
+-
+-if __name__ == '__main__':
+-    run()
+diff --git a/etg/webkit.py b/etg/webkit.py
+deleted file mode 100644
+index 7a3e70e6d..000000000
+--- a/etg/webkit.py
++++ /dev/null
+@@ -1,77 +0,0 @@
+-#---------------------------------------------------------------------------
+-# Name:        etg/webkit.py
+-# Author:      Robin Dunn
+-#
+-# Created:     22-Aug-2013
+-# Copyright:   (c) 2013-2020 by Total Control Software
+-# License:     wxWindows License
+-#---------------------------------------------------------------------------
+-
+-import etgtools
+-import etgtools.tweaker_tools as tools
+-
+-PACKAGE   = "wx"
+-MODULE    = "_webkit"
+-NAME      = "webkit"   # 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  = [ 'wxWebKitCtrl',
+-           'wxWebKitBeforeLoadEvent',
+-           'wxWebKitStateChangedEvent',
+-           'wxWebKitNewWindowEvent',
+-           ]
+-
+-#---------------------------------------------------------------------------
+-
+-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/html/webkit.h>')
+-
+-    tools.generateStubs('wxUSE_WEBKIT', module,
+-                        extraHdrCode='extern const char* wxWebKitCtrlNameStr;\n',
+-                        extraCppCode='const char* wxWebKitCtrlNameStr = "";\n')
+-
+-
+-    c = module.find('wxWebKitCtrl')
+-    assert isinstance(c, etgtools.ClassDef)
+-    c.addPrivateCopyCtor()
+-    tools.fixWindowClass(c)
+-    c.find('wxWebKitCtrl.strURL').default = '""'
+-    c.find('Create.strURL').default = '""'
+-
+-
+-    module.addGlobalStr('wxWebKitCtrlNameStr', c)
+-
+-    c = module.find('wxWebKitBeforeLoadEvent')
+-    tools.fixEventClass(c)
+-
+-    c = module.find('wxWebKitStateChangedEvent')
+-    tools.fixEventClass(c)
+-
+-    c = module.find('wxWebKitNewWindowEvent')
+-    tools.fixEventClass(c)
+-
+-    module.addPyCode("""\
+-        EVT_WEBKIT_BEFORE_LOAD = wx.PyEventBinder( wxEVT_WEBKIT_BEFORE_LOAD, 1 )
+-        EVT_WEBKIT_STATE_CHANGED = wx.PyEventBinder( wxEVT_WEBKIT_STATE_CHANGED, 1 )
+-        EVT_WEBKIT_NEW_WINDOW = wx.PyEventBinder( wxEVT_WEBKIT_NEW_WINDOW, 1 )
+-        """)
+-
+-    #-----------------------------------------------------------------
+-    tools.doCommonTweaks(module)
+-    tools.runGenerators(module)
+-
+-
+-#---------------------------------------------------------------------------
+-if __name__ == '__main__':
+-    run()
+-
+diff --git a/unittests/test_webkit.py b/unittests/test_webkit.py
+deleted file mode 100644
+index 3241d319a..000000000
+--- a/unittests/test_webkit.py
++++ /dev/null
+@@ -1,77 +0,0 @@
+-import unittest
+-from unittests import wtc
+-import wx
+-import sys
+-if sys.platform == 'darwin':
+-    import wx.webkit
+-
+-#---------------------------------------------------------------------------
+-
+-class webkit_Tests(wtc.WidgetTestCase):
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit01(self):
+-        wk = wx.webkit.WebKitCtrl()
+-        wk.Create(self.frame)
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit02(self):
+-        wk = wx.webkit.WebKitCtrl(self.frame)
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit03(self):
+-        wk = wx.webkit.WebKitCtrl(self.frame, -1, "http://wxpython.org")
+-
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit04(self):
+-        e = wx.webkit.WebKitBeforeLoadEvent()
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit05(self):
+-        e = wx.webkit.WebKitStateChangedEvent()
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit06(self):
+-        e = wx.webkit.WebKitNewWindowEvent()
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit07(self):
+-        wx.webkit.WEBKIT_STATE_START
+-        wx.webkit.WEBKIT_STATE_NEGOTIATING
+-        wx.webkit.WEBKIT_STATE_REDIRECTING
+-        wx.webkit.WEBKIT_STATE_TRANSFERRING
+-        wx.webkit.WEBKIT_STATE_STOP
+-        wx.webkit.WEBKIT_STATE_FAILED
+-
+-        wx.webkit.WEBKIT_NAV_LINK_CLICKED
+-        wx.webkit.WEBKIT_NAV_BACK_NEXT
+-        wx.webkit.WEBKIT_NAV_FORM_SUBMITTED
+-        wx.webkit.WEBKIT_NAV_RELOAD
+-        wx.webkit.WEBKIT_NAV_FORM_RESUBMITTED
+-        wx.webkit.WEBKIT_NAV_OTHER
+-
+-        wx.webkit.wxEVT_WEBKIT_STATE_CHANGED
+-        wx.webkit.wxEVT_WEBKIT_BEFORE_LOAD
+-        wx.webkit.wxEVT_WEBKIT_NEW_WINDOW
+-
+-        wx.webkit.EVT_WEBKIT_STATE_CHANGED
+-        wx.webkit.EVT_WEBKIT_BEFORE_LOAD
+-        wx.webkit.EVT_WEBKIT_NEW_WINDOW
+-
+-
+-    @unittest.skipIf(sys.platform != 'darwin', 'WebKit only implemented on Mac')
+-    def test_webkit08(self):
+-        wx.webkit.wxEVT_WEBKIT_STATE_CHANGED
+-        wx.webkit.wxEVT_WEBKIT_BEFORE_LOAD
+-        wx.webkit.wxEVT_WEBKIT_NEW_WINDOW
+-
+-        wx.webkit.EVT_WEBKIT_STATE_CHANGED
+-        wx.webkit.EVT_WEBKIT_BEFORE_LOAD
+-        wx.webkit.EVT_WEBKIT_NEW_WINDOW
+-
+-
+-#---------------------------------------------------------------------------
+-
+-if __name__ == '__main__':
+-    unittest.main()

Added: wxwidgets-3.1.6.patch
===================================================================
--- wxwidgets-3.1.6.patch	                        (rev 0)
+++ wxwidgets-3.1.6.patch	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -0,0 +1,717 @@
+From aa1ef7bd75412191e7912855abdfdc1af1c70335 Mon Sep 17 00:00:00 2001
+From: Scott Talbert <swt at techie.net>
+Date: Thu, 14 Apr 2022 19:51:57 -0400
+Subject: [PATCH] Update ETG scripts to support wxWidgets 3.1.6 functionality
+
+Fixes #2136.
+---
+ docs/sphinx/itemToModuleMap.json |   3 +-
+ etg/_core.py                     |   2 +
+ etg/_stc.py                      |   1 +
+ etg/app.py                       |   3 +
+ etg/bmpbndl.py                   |  58 +++++++++++++++++
+ etg/cursor.py                    |   1 +
+ etg/dataview.py                  |   2 +-
+ etg/defs.py                      |   3 +
+ etg/event.py                     |   5 ++
+ etg/gdicmn.py                    |   3 +
+ etg/htmlwin.py                   |   2 +-
+ etg/icon.py                      |   3 +
+ etg/listctrl.py                  |   4 ++
+ etg/menuitem.py                  |   9 ++-
+ etg/richtextbuffer.py            |  17 ++++-
+ etg/textctrl.py                  |  11 ++++
+ etg/treectrl.py                  |   1 -
+ etg/webview.py                   |  12 ++++
+ etgtools/tweaker_tools.py        |   1 -
+ src/wxvector.sip                 | 106 +++++++++++++++++++++++++++++++
+ 20 files changed, 238 insertions(+), 9 deletions(-)
+ create mode 100644 etg/bmpbndl.py
+ create mode 100644 src/wxvector.sip
+
+diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json
+index 5fa174fba..6d97957a7 100644
+--- a/docs/sphinx/itemToModuleMap.json
++++ b/docs/sphinx/itemToModuleMap.json
+@@ -753,6 +753,7 @@
+ "Country":"wx.DateTime.",
+ "CreateDynamicObject":"wx.",
+ "CreateFileTipProvider":"wx.adv.",
++"CredentialEntryDialog":"wx.",
+ "Cursor":"wx.",
+ "CursorProperty":"wx.propgrid.",
+ "CustomDataObject":"wx.",
+@@ -1038,6 +1039,9 @@
+ "FD_SAVE":"wx.",
+ "FD_SHOW_HIDDEN":"wx.",
+ "FFont":"wx.",
++"FH_PATH_SHOW_ALWAYS":"wx.",
++"FH_PATH_SHOW_IF_DIFFERENT":"wx.",
++"FH_PATH_SHOW_NEVER":"wx.",
+ "FIXED_LENGTH":"wx.",
+ "FIXED_MINSIZE":"wx.",
+ "FLEX_GROWMODE_ALL":"wx.",
+@@ -1254,6 +1258,7 @@
+ "FileDirPickerEvent":"wx.",
+ "FileDropTarget":"wx.",
+ "FileHistory":"wx.",
++"FileHistoryMenuPathStyle":"wx.",
+ "FileLayout":"wx.StandardPaths.",
+ "FileOffset":"wx.",
+ "FilePickerCtrl":"wx.",
+@@ -1319,6 +1324,7 @@
+ "FromEnd":"wx.",
+ "FromStart":"wx.",
+ "FromString":"wx.",
++"FullScreenEvent":"wx.",
+ "GA_HORIZONTAL":"wx.",
+ "GA_PROGRESS":"wx.",
+ "GA_SMOOTH":"wx.",
+@@ -2066,6 +2072,7 @@
+ "LANGUAGE_ENGLISH_CARIBBEAN":"wx.",
+ "LANGUAGE_ENGLISH_DENMARK":"wx.",
+ "LANGUAGE_ENGLISH_EIRE":"wx.",
++"LANGUAGE_ENGLISH_ISRAEL":"wx.",
+ "LANGUAGE_ENGLISH_JAMAICA":"wx.",
+ "LANGUAGE_ENGLISH_NEW_ZEALAND":"wx.",
+ "LANGUAGE_ENGLISH_PHILIPPINES":"wx.",
+@@ -2623,7 +2630,7 @@
+ "ObjectRefData":"wx.",
+ "OperatingSystemId":"wx.",
+ "Orientation":"wx.",
+-"Origin":"wx.grid.GridActivationSource.",
++"Origin":"wx.HelpEvent.",
+ "OutBottom":"wx.",
+ "OutCode":"wx.",
+ "OutLeft":"wx.",
+@@ -2784,6 +2791,9 @@
+ "PENSTYLE_TRANSPARENT":"wx.",
+ "PENSTYLE_USER_DASH":"wx.",
+ "PENSTYLE_VERTICAL_HATCH":"wx.",
++"PEN_QUALITY_DEFAULT":"wx.",
++"PEN_QUALITY_HIGH":"wx.",
++"PEN_QUALITY_LOW":"wx.",
+ "PGArrayEditorDialog":"wx.propgrid.",
+ "PGArrayStringEditorDialog":"wx.propgrid.",
+ "PGAttributeStorage":"wx.propgrid.",
+@@ -3057,10 +3067,12 @@
+ "PenInfo":"wx.",
+ "PenJoin":"wx.",
+ "PenList":"wx.",
++"PenQuality":"wx.",
+ "PenStyle":"wx.",
+ "PercentOf":"wx.",
+ "PickerBase":"wx.",
+ "PixelDataBase":"wx.",
++"PlatformId":"wx.",
+ "PlatformInformation":"wx.",
+ "Point":"wx.",
+ "Point2D":"wx.",
+@@ -3216,6 +3228,8 @@
+ "RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR":"wx.ribbon.",
+ "RIBBON_ART_PANEL_BORDER_COLOUR":"wx.ribbon.",
+ "RIBBON_ART_PANEL_BORDER_GRADIENT_COLOUR":"wx.ribbon.",
++"RIBBON_ART_PANEL_HOVER_BORDER_COLOUR":"wx.ribbon.",
++"RIBBON_ART_PANEL_HOVER_BORDER_GRADIENT_COLOUR":"wx.ribbon.",
+ "RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR":"wx.ribbon.",
+ "RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR":"wx.ribbon.",
+ "RIBBON_ART_PANEL_HOVER_LABEL_COLOUR":"wx.ribbon.",
+@@ -6675,6 +6689,8 @@
+ "WEBVIEW_FIND_HIGHLIGHT_RESULT":"wx.html2.",
+ "WEBVIEW_FIND_MATCH_CASE":"wx.html2.",
+ "WEBVIEW_FIND_WRAP":"wx.html2.",
++"WEBVIEW_INJECT_AT_DOCUMENT_END":"wx.html2.",
++"WEBVIEW_INJECT_AT_DOCUMENT_START":"wx.html2.",
+ "WEBVIEW_NAV_ACTION_NONE":"wx.html2.",
+ "WEBVIEW_NAV_ACTION_OTHER":"wx.html2.",
+ "WEBVIEW_NAV_ACTION_USER":"wx.html2.",
+@@ -6952,6 +6968,7 @@
+ "WebViewNavigationActionFlags":"wx.html2.",
+ "WebViewNavigationError":"wx.html2.",
+ "WebViewReloadFlags":"wx.html2.",
++"WebViewUserScriptInjectionTime":"wx.html2.",
+ "WebViewZoom":"wx.html2.",
+ "WebViewZoomType":"wx.html2.",
+ "WeekDay":"wx.DateTime.",
+@@ -7161,6 +7178,7 @@
+ "wxEVT_FIND_REPLACE_ALL":"wx.",
+ "wxEVT_FONTPICKER_CHANGED":"wx.",
+ "wxEVT_FSWATCHER":"wx.",
++"wxEVT_FULLSCREEN":"wx.",
+ "wxEVT_GESTURE_PAN":"wx.",
+ "wxEVT_GESTURE_ROTATE":"wx.",
+ "wxEVT_GESTURE_ZOOM":"wx.",
+@@ -7483,10 +7501,13 @@
+ "wxEVT_WEBKIT_NEW_WINDOW":"wx.webkit.",
+ "wxEVT_WEBKIT_STATE_CHANGED":"wx.webkit.",
+ "wxEVT_WEBVIEW_ERROR":"wx.html2.",
++"wxEVT_WEBVIEW_FULLSCREEN_CHANGED":"wx.html2.",
++"wxEVT_WEBVIEW_FULL_SCREEN_CHANGED":"wx.html2.",
+ "wxEVT_WEBVIEW_LOADED":"wx.html2.",
+ "wxEVT_WEBVIEW_NAVIGATED":"wx.html2.",
+ "wxEVT_WEBVIEW_NAVIGATING":"wx.html2.",
+ "wxEVT_WEBVIEW_NEWWINDOW":"wx.html2.",
++"wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED":"wx.html2.",
+ "wxEVT_WEBVIEW_TITLE_CHANGED":"wx.html2.",
+ "wxEVT_WINDOW_MODAL_DIALOG_CLOSED":"wx.",
+ "wxEVT_WIZARD_BEFORE_PAGE_CHANGED":"wx.adv.",
+diff --git a/etg/grid.py b/etg/grid.py
+index 23703b8d3..77e5023c4 100644
+--- a/etg/grid.py
++++ b/etg/grid.py
+@@ -425,6 +425,8 @@ def fixEditorClass(name):
+     c.find('SetEditor.editor').transfer = True  # these are probably redundant now...
+     c.find('SetRenderer.renderer').transfer = True
+ 
++    c.find('GetRendererPtr').ignore()
++
+     #-----------------------------------------------------------------
+     module.find('wxGridCellRendererPtr').piIgnored = True
+     module.find('wxGridCellEditorPtr').piIgnored = True
+@@ -635,7 +637,7 @@ def fixEditorClass(name):
+     # Custom code to deal with the wxGridBlockCoordsVector return type of these
+     # methods. It's a wxVector, which we'll just convert to a list.
+ 
+-    # TODO: There are a few of these now to we ought to either wrap wxVector, or add
++    # TODO: There are a few of these now so we ought to either wrap wxVector, or add
+     #       something in tweaker_tools to make adding code like this easier and more
+     #       automated.
+     code = """\
+diff --git a/etg/menu.py b/etg/menu.py
+index c7fd309a8..14530e9cd 100644
+--- a/etg/menu.py
++++ b/etg/menu.py
+@@ -99,6 +99,7 @@ def addTransferAnnotations(c, arg):
+         body="""\
+             return self->FindItem(id);""")
+ 
++    c.find('MSWCommand').ignore()
+ 
+     #-----------------------------------------------------------------
+     c = module.find('wxMenuBar')
+diff --git a/etg/object.py b/etg/object.py
+index cb86d495c..650675423 100644
+--- a/etg/object.py
++++ b/etg/object.py
+@@ -103,6 +103,8 @@ def run():
+     dtor = c.find('~wxObjectDataPtr')
+     dtor.isDtor = True
+ 
++    ctor.findOverload('< U >').ignore()
++
+     # more name hacks/fixes
+     c.nodeBases = ({'wxObjectDataPtr': ('wxObjectDataPtr', [])},
+                    ['wxObjectDataPtr'])
+diff --git a/etg/platinfo.py b/etg/platinfo.py
+index f96f5d6ed..ca0d65ec8 100644
+--- a/etg/platinfo.py
++++ b/etg/platinfo.py
+@@ -19,6 +19,7 @@
+ # this script.
+ ITEMS  = [ 'wxPlatformInfo',
+            'wxLinuxDistributionInfo',
++           'wxPlatformId',
+            ]
+ 
+ #---------------------------------------------------------------------------
+diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json
+index 7cbd105eb..80caca1ca 100644
+--- a/docs/sphinx/itemToModuleMap.json
++++ b/docs/sphinx/itemToModuleMap.json
+@@ -3582,6 +3582,7 @@
+ "RichTextImageBlock":"wx.richtext.",
+ "RichTextLine":"wx.richtext.",
+ "RichTextLineBreakChar":"wx.richtext.",
++"RichTextLineVector":"wx.richtext.",
+ "RichTextListStyleDefinition":"wx.richtext.",
+ "RichTextModuleInit":"wx.richtext.",
+ "RichTextObject":"wx.richtext.",
+diff --git a/etg/_core.py b/etg/_core.py
+index 9bf82d21c..220c13711 100644
+--- a/etg/_core.py
++++ b/etg/_core.py
+@@ -49,6 +49,7 @@
+               'userdata',
+               'wxpybuffer',
+               'msgdlg_btnlabel',
++              'wxvector',
+ 
+               'stockgdi',
+               'longlong',
+@@ -76,6 +77,7 @@
+               'image',
+               'gdiobj',
+               'bitmap',
++              'bmpbndl',
+               'icon', 'iconloc', 'iconbndl',
+               'font',
+               'fontutil',
+diff --git a/etg/_stc.py b/etg/_stc.py
+index 50d384333..bcf8b55f6 100644
+--- a/etg/_stc.py
++++ b/etg/_stc.py
+@@ -152,6 +152,7 @@ def run():
+     tc_excludes = ['OSXEnableAutomaticQuoteSubstitution',
+                    'OSXEnableAutomaticDashSubstitution',
+                    'OSXDisableAllSmartSubstitutions',
++                   'OSXEnableNewLineReplacement',
+                    ]
+     import textctrl
+     mod = textctrl.parseAndTweakModule()
+diff --git a/etg/app.py b/etg/app.py
+index ccb4cb6c4..bd2ef2aea 100644
+--- a/etg/app.py
++++ b/etg/app.py
+@@ -10,6 +10,7 @@
+ import etgtools
+ import etgtools.tweaker_tools as tools
+ from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef
++import sys
+ 
+ PACKAGE   = "wx"
+ MODULE    = "_core"
+@@ -206,6 +207,8 @@ def run():
+     c.addProperty('UseBestVisual GetUseBestVisual SetUseBestVisual')
+     c.addProperty('TopWindow GetTopWindow SetTopWindow')
+ 
++    if sys.platform != 'linux':
++        c.find('GTKSuppressDiagnostics').ignore()
+ 
+     #-------------------------------------------------------
+ 
+diff --git a/etg/bmpbndl.py b/etg/bmpbndl.py
+new file mode 100644
+index 000000000..a166b576c
+--- /dev/null
++++ b/etg/bmpbndl.py
+@@ -0,0 +1,58 @@
++#---------------------------------------------------------------------------
++# Name:        etg/bmpbndl.py
++# Author:      Scott Talbert
++#
++# Created:     13-Apr-2022
++# Copyright:   (c) 2022 by Scott Talbert
++# License:     wxWindows License
++#---------------------------------------------------------------------------
++
++import etgtools
++import etgtools.tweaker_tools as tools
++from etgtools import MethodDef
++
++PACKAGE   = "wx"
++MODULE    = "_core"
++NAME      = "bmpbndl"   # 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  = [ 'wxBitmapBundle',
++           'wxBitmapBundleImpl',
++           ]
++
++#---------------------------------------------------------------------------
++
++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/some_header_file.h>')
++
++    c = module.find('wxBitmapBundle')
++    assert isinstance(c, etgtools.ClassDef)
++
++    c.find('FromSVG').findOverload('char *data, const wxSize &sizeDef').ignore()
++
++
++    c = module.find('wxBitmapBundleImpl')
++    assert isinstance(c, etgtools.ClassDef)
++
++    m = MethodDef(name='~wxBitmapBundleImpl', isDtor=True, isVirtual=True, protection='protected')
++    c.addItem(m)
++
++    #-----------------------------------------------------------------
++    tools.doCommonTweaks(module)
++    tools.runGenerators(module)
++
++
++#---------------------------------------------------------------------------
++if __name__ == '__main__':
++    run()
++
+diff --git a/etg/cursor.py b/etg/cursor.py
+index 5e221fe91..f957358b5 100644
+--- a/etg/cursor.py
++++ b/etg/cursor.py
+@@ -45,6 +45,7 @@ def run():
+     c.find('wxCursor').findOverload('cursorName').find('type').default='wxBITMAP_TYPE_ANY'
+     # TODO: This ctor ^^ in Classic has a custom implementation for wxGTK that
+     # sets the hotspot. Is that still needed?
++    c.find('wxCursor').findOverload('(const char *const *xpmData)').ignore()
+ 
+     c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();")
+     c.addCppMethod('int', '__bool__', '()', "return self->IsOk();")
+diff --git a/etg/dataview.py b/etg/dataview.py
+index 80eade26e..fdfb4e1ae 100644
+--- a/etg/dataview.py
++++ b/etg/dataview.py
+@@ -344,7 +344,7 @@ def _fixupTypeParam(klass):
+     c.addItem(etgtools.WigCode("""\
+         virtual void SetTitle(const wxString& title);
+         virtual wxString GetTitle() const;
+-        virtual void SetBitmap(const wxBitmap& bitmap);
++        virtual void SetBitmap(const wxBitmapBundle& bitmap);
+         virtual wxBitmap GetBitmap() const;
+         virtual void SetWidth(int width);
+         virtual int GetWidth() const;
+diff --git a/etg/defs.py b/etg/defs.py
+index 167e07264..4445cf93c 100644
+--- a/etg/defs.py
++++ b/etg/defs.py
+@@ -110,6 +110,9 @@ class wxExecuteEnv;
+     module.addPyCode("ADJUST_MINSIZE = 0")
+     module.addPyCode("WS_EX_VALIDATE_RECURSIVELY = 0")
+ 
++    # This is only supported with C++14, so ignore it for now
++    module.find('wxDEPRECATED_ATTR').ignore()
++
+ 
+     #-----------------------------------------------------------------
+     tools.doCommonTweaks(module)
+diff --git a/etg/event.py b/etg/event.py
+index 4a5c30e1e..5f79d8881 100644
+--- a/etg/event.py
++++ b/etg/event.py
+@@ -100,6 +100,11 @@ def run():
+     #endif
+     """)
+ 
++    # Missing in 3.1.6
++    module.addItem(etgtools.WigCode("""\
++        wxEventType wxEVT_FULLSCREEN /PyName=wxEVT_FULLSCREEN/;
++        """))
++
+ 
+     module.addPyClass('PyEventBinder', ['object'],
+         doc="""\
+diff --git a/etg/gdicmn.py b/etg/gdicmn.py
+index 04ca36931..f182266a3 100644
+--- a/etg/gdicmn.py
++++ b/etg/gdicmn.py
+@@ -155,6 +155,9 @@ def run():
+              c.find('operator*=').all() + \
+              c.find('operator/=').all():
+         f.ignore(False)
++    # Ignore these because they conflict with __imul__() and __itruediv__()
++    c.find('operator*=').findOverload('double').ignore()
++    c.find('operator/=').findOverload('double').ignore()
+ 
+     c.addCppMethod('bool', '__eq__', '(const wxSize& other)',
+         body="return *self == *other;")
+diff --git a/etg/htmlwin.py b/etg/htmlwin.py
+index 1023e7519..fd902921c 100644
+--- a/etg/htmlwin.py
++++ b/etg/htmlwin.py
+@@ -73,7 +73,7 @@ def run():
+         virtual wxWindow* GetHTMLWindow();
+         virtual wxColour GetHTMLBackgroundColour() const;
+         virtual void SetHTMLBackgroundColour(const wxColour& clr);
+-        virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg);
++        virtual void SetHTMLBackgroundImage(const wxBitmapBundle& bmpBg);
+         virtual void SetHTMLStatusText(const wxString& text);
+         virtual wxCursor GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor type) const;
+         """))
+diff --git a/etg/icon.py b/etg/icon.py
+index 2733ddd6f..6b1faf239 100644
+--- a/etg/icon.py
++++ b/etg/icon.py
+@@ -79,6 +79,9 @@ def run():
+             #endif
+             """)
+ 
++    # Documented wrongly in 3.1.6
++    c.find('GetLogicalSize').type = 'wxSize'
++
+ 
+     # For compatibility:
+     module.addPyFunction('EmptyIcon', '()',
+diff --git a/etg/listctrl.py b/etg/listctrl.py
+index d25171da2..6362b866e 100644
+--- a/etg/listctrl.py
++++ b/etg/listctrl.py
+@@ -333,6 +333,10 @@ def run():
+         #endif
+         """)
+ 
++    # Documented wrongly in 3.1.6
++    c.find('RemoveSortIndicator').type = 'void'
++    c.find('RemoveSortIndicator').isConst = False
++
+ 
+     #-------------------------------------------------------
+     c = module.find('wxListView')
+diff --git a/etg/menuitem.py b/etg/menuitem.py
+index b2f620b4c..ac6cdb38f 100644
+--- a/etg/menuitem.py
++++ b/etg/menuitem.py
+@@ -109,11 +109,12 @@ def run():
+ 
+ 
+     c.find('GetBitmap').type = 'const wxBitmap*'
++    c.find('GetBitmap').transferBack = True
+     c.find('GetBitmap').setCppCode("""\
+         #ifdef __WXMSW__
+-            return &self->GetBitmap(checked);
++            return new wxBitmap(self->GetBitmap(checked));
+         #else
+-            return &self->GetBitmap();
++            return new wxBitmap(self->GetBitmap());
+         #endif
+         """)
+ 
+@@ -157,6 +158,10 @@ def run():
+ 
+     module.addItem(tools.wxListWrapperTemplate('wxMenuItemList', 'wxMenuItem', module))
+ 
++    # Documented wrongly in 3.1.6
++    c.find('AddExtraAccel.accel').isConst = True
++    c.find('AddExtraAccel.accel').type = 'wxAcceleratorEntry&'
++
+ 
+ 
+     #-----------------------------------------------------------------
+diff --git a/etg/richtextbuffer.py b/etg/richtextbuffer.py
+index aaaba8584..dad166b12 100644
+--- a/etg/richtextbuffer.py
++++ b/etg/richtextbuffer.py
+@@ -79,8 +79,6 @@ def run():
+         tools.wxArrayWrapperTemplate('wxRichTextVariantArray', 'wxVariant', module))
+     module.addItem(
+         tools.wxListWrapperTemplate('wxRichTextObjectList', 'wxRichTextObject', module))
+-    module.addItem(
+-        tools.wxListWrapperTemplate('wxRichTextLineList', 'wxRichTextLine', module))
+ 
+     # Can this even work?  Apparently it does.
+     module.addItem(
+@@ -319,6 +317,21 @@ def _fixDrawObject(c, addMissingVirtuals=True):
+                                     fakeListClassName='wxRichTextObjectList_'))
+     c.find('MoveToList.list').type = 'wxRichTextObjectList_&'
+     c.find('MoveFromList.list').type = 'wxRichTextObjectList_&'
++    # TODO: figure out why wxvector.sip doesn't work for this
++    c.find('GetLines').type = 'PyObject*'
++    c.find('GetLines').setCppCode("""\
++        wxPyThreadBlocker blocker;
++        PyObject* result = PyList_New(0);
++        const wxRichTextLineVector& vector = self->GetLines();
++        for (size_t idx=0; idx < vector.size(); idx++) {{
++            PyObject* obj;
++            wxRichTextLine* item = new wxRichTextLine(*vector.at(idx));
++            obj = wxPyConstructObject((void*)item, "wxRichTextLine", true);
++            PyList_Append(result, obj);
++            Py_DECREF(obj);
++        }}
++        return result;
++        """)
+ 
+ 
+     #-------------------------------------------------------
+diff --git a/etg/textctrl.py b/etg/textctrl.py
+index 7f1c1fba0..a590512ec 100644
+--- a/etg/textctrl.py
++++ b/etg/textctrl.py
+@@ -9,6 +9,8 @@
+ # License:     wxWindows License
+ #---------------------------------------------------------------------------
+ 
++import sys
++
+ import etgtools
+ import etgtools.tweaker_tools as tools
+ 
+@@ -144,6 +146,15 @@ def parseAndTweakModule():
+             #endif
+             """)
+ 
++    # TODO: add support for wxTextProofOptions (only supported on MSW/GTK3)
++    # so will need stubs on other platforms.
++    c.find('EnableProofCheck').ignore()
++    c.find('GetProofCheckOptions').ignore()
++
++    # This function only exists on OSX
++    if sys.platform != 'darwin':
++        c.find('OSXEnableNewLineReplacement').ignore()
++
+ 
+ 
+     c = module.find('wxTextUrlEvent')
+diff --git a/etg/treectrl.py b/etg/treectrl.py
+index 4b1d0a227..23945b607 100644
+--- a/etg/treectrl.py
++++ b/etg/treectrl.py
+@@ -150,7 +150,6 @@ def TreeItemData(data):
+ 
+ 
+     # transfer imagelist ownership
+-    c.find('AssignImageList.imageList').transfer = True
+     c.find('AssignStateImageList.imageList').transfer = True
+     c.find('AssignButtonsImageList.imageList').transfer = True
+ 
+diff --git a/etg/webview.py b/etg/webview.py
+index b4abb35c2..6fec50458 100644
+--- a/etg/webview.py
++++ b/etg/webview.py
+@@ -91,6 +91,11 @@ def run():
+     # This tweak is needed only for the stub code
+     module.find('wxWebViewHandler.wxWebViewHandler').argsString = '(const wxString& scheme="")'
+ 
++    # Documented wrongly in 3.1.6 (needs to be fixed in stubs too)
++    c = module.find('wxWebViewFactory')
++    c.find('GetVersionInfo').argsString = '()'
++    c.find('GetVersionInfo').items = []
++
+     tools.generateStubs('wxUSE_WEBVIEW', module,
+                         typeValMap={
+                             'wxWebViewNavigationActionFlags': 'wxWEBVIEW_NAV_ACTION_NONE',
+@@ -98,6 +103,13 @@ def run():
+                             'wxVersionInfo': 'wxVersionInfo()',
+                             })
+ 
++    # Missing in 3.1.6
++    module.addItem(etgtools.WigCode("""\
++        wxEventType wxEVT_WEBVIEW_FULLSCREEN_CHANGED /PyName=wxEVT_WEBVIEW_FULLSCREEN_CHANGED/;
++        wxEventType wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED /PyName=wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED/;
++        wxEventType wxEVT_WEBVIEW_SCRIPT_RESULT /PyName=wxEVT_WEBVIEW_SCRIPT_RESULT/;
++        """))
++
+     c = module.find('wxWebView')
+     assert isinstance(c, etgtools.ClassDef)
+     tools.fixWindowClass(c)
+diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py
+index e67975db2..5b76888e4 100644
+--- a/etgtools/tweaker_tools.py
++++ b/etgtools/tweaker_tools.py
+@@ -497,7 +497,6 @@ def addWindowVirtuals(klass):
+         ('DoSetSize',                 'void DoSetSize(int x, int y, int width, int height, int sizeFlags)'),
+         ('DoSetClientSize',           'void DoSetClientSize(int width, int height)'),
+         ('DoSetSizeHints',            'void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH )'),
+-        ('DoGetBorderSize',           'wxSize DoGetBorderSize() const'),
+         ('DoMoveWindow',              'void DoMoveWindow(int x, int y, int width, int height)'),
+         ('DoSetWindowVariant',        'void DoSetWindowVariant( wxWindowVariant variant)'),
+         ('GetDefaultBorder',          'wxBorder GetDefaultBorder() const'),
+diff --git a/src/wxvector.sip b/src/wxvector.sip
+new file mode 100644
+index 000000000..16c0a9434
+--- /dev/null
++++ b/src/wxvector.sip
+@@ -0,0 +1,106 @@
++//--------------------------------------------------------------------------
++// Name:        wxvector.sip
++// Purpose:     MappedType for wxVector
++//
++// Author:      Scott Talbert
++//
++// Created:     14-Apr-2022
++// Copyright:   (c) 2022 by Scott Talbert
++// Licence:     wxWindows license
++//--------------------------------------------------------------------------
++
++template<_TYPE_>
++%MappedType wxVector<_TYPE_>
++{
++    %ConvertFromTypeCode
++        PyObject *l = PyList_New(sipCpp->size());
++
++        if (!l)
++            return 0;
++
++        for (int i = 0; i < sipCpp->size(); ++i) {
++            _TYPE_ *t = new _TYPE_(sipCpp->at(i));
++            PyObject *tobj = sipConvertFromNewType(t, sipType__TYPE_,
++                    sipTransferObj);
++
++            if (!tobj) {
++                delete t;
++                Py_DECREF(l);
++
++                return 0;
++            }
++
++            PyList_SetItem(l, i, tobj);
++        }
++
++        return l;
++    %End
++
++    %ConvertToTypeCode
++        PyObject *iter = PyObject_GetIter(sipPy);
++
++        if (!sipIsErr) {
++            PyErr_Clear();
++            Py_XDECREF(iter);
++
++            return (iter
++#if PY_MAJOR_VERSION < 3
++                    && !PyString_Check(sipPy)
++#endif
++                    && !PyUnicode_Check(sipPy));
++        }
++
++        if (!iter) {
++            *sipIsErr = 1;
++
++            return 0;
++        }
++
++        wxVector<_TYPE_> *wv = new wxVector<_TYPE_>;
++
++        for (Py_ssize_t i = 0; ; ++i) {
++            PyErr_Clear();
++            PyObject *itm = PyIter_Next(iter);
++
++            if (!itm) {
++                if (PyErr_Occurred()) {
++                    delete wv;
++                    Py_DECREF(iter);
++                    *sipIsErr = 1;
++
++                    return 0;
++                }
++
++                break;
++            }
++
++            int state;
++            _TYPE_ *t = reinterpret_cast<_TYPE_ *>(
++                    sipForceConvertToType(itm, sipType__TYPE_, sipTransferObj,
++                            SIP_NOT_NONE, &state, sipIsErr));
++
++            if (*sipIsErr) {
++                PyErr_Format(PyExc_TypeError,
++                        "index %zd has type '%s' but '_TYPE_' is expected", i,
++                        sipPyTypeName(Py_TYPE(itm)));
++
++                Py_DECREF(itm);
++                delete wv;
++                Py_DECREF(iter);
++
++                return 0;
++            }
++
++            wv->push_back(*t);
++
++            sipReleaseType(t, sipType__TYPE_, state);
++            Py_DECREF(itm);
++        }
++
++        Py_DECREF(iter);
++ 
++        *sipCppPtr = wv;
++ 
++        return sipGetState(sipTransferObj);
++    %End
++};
+

Added: wxwidgets-3.1.7.patch
===================================================================
--- wxwidgets-3.1.7.patch	                        (rev 0)
+++ wxwidgets-3.1.7.patch	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -0,0 +1,230 @@
+diff --git a/etg/menuitem.py b/etg/menuitem.py
+index ac6cdb38f..ba7940390 100644
+--- a/etg/menuitem.py
++++ b/etg/menuitem.py
+@@ -136,11 +136,12 @@ def run():
+ 
+ 
+     c.find('GetDisabledBitmap').type = 'const wxBitmap*'
++    c.find('GetDisabledBitmap').transferBack = True  # Python takes ownership of the return value
+     c.find('GetDisabledBitmap').setCppCode("""\
+         #ifdef __WXMSW__
+-            return &self->GetDisabledBitmap();
++            return new wxBitmap(self->GetDisabledBitmap());
+         #else
+-            return &wxNullBitmap;
++            return new wxBitmap(wxNullBitmap);
+         #endif
+         """)
+ 
+diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json
+index ce1b856c9..dd7959386 100644
+--- a/docs/sphinx/itemToModuleMap.json
++++ b/docs/sphinx/itemToModuleMap.json
+@@ -1261,7 +1261,16 @@
+ "FileCtrlNameStr":"wx.",
+ "FileDataObject":"wx.",
+ "FileDialog":"wx.",
++"FileDialogButton":"wx.",
++"FileDialogCheckBox":"wx.",
++"FileDialogChoice":"wx.",
++"FileDialogCustomControl":"wx.",
++"FileDialogCustomize":"wx.",
++"FileDialogCustomizeHook":"wx.",
+ "FileDialogNameStr":"wx.",
++"FileDialogRadioButton":"wx.",
++"FileDialogStaticText":"wx.",
++"FileDialogTextCtrl":"wx.",
+ "FileDirPickerEvent":"wx.",
+ "FileDropTarget":"wx.",
+ "FileHistory":"wx.",
+@@ -6832,6 +6841,7 @@
+ "SetDisplayName":"wx.",
+ "SetEnv":"wx.",
+ "SettableHeaderColumn":"wx.",
++"SharedClientDataContainer":"wx.",
+ "Shell":"wx.",
+ "ShowEffect":"wx.",
+ "ShowEvent":"wx.",
+@@ -7903,6 +7913,8 @@
+ "wxEVT_GRID_RANGE_SELECT":"wx.grid.",
+ "wxEVT_GRID_RANGE_SELECTED":"wx.grid.",
+ "wxEVT_GRID_RANGE_SELECTING":"wx.grid.",
++"wxEVT_GRID_ROW_AUTO_SIZE":"wx.grid.",
++"wxEVT_GRID_ROW_MOVE":"wx.grid.",
+ "wxEVT_GRID_ROW_SIZE":"wx.grid.",
+ "wxEVT_GRID_SELECT_CELL":"wx.grid.",
+ "wxEVT_GRID_TABBING":"wx.grid.",
+@@ -8212,6 +8224,7 @@
+ "wxEVT_WEBVIEW_NAVIGATING":"wx.html2.",
+ "wxEVT_WEBVIEW_NEWWINDOW":"wx.html2.",
+ "wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED":"wx.html2.",
++"wxEVT_WEBVIEW_SCRIPT_RESULT":"wx.html2.",
+ "wxEVT_WEBVIEW_TITLE_CHANGED":"wx.html2.",
+ "wxEVT_WINDOW_MODAL_DIALOG_CLOSED":"wx.",
+ "wxEVT_WIZARD_BEFORE_PAGE_CHANGED":"wx.adv.",
+diff --git a/etg/_core.py b/etg/_core.py
+index 220c13711..04d47438c 100644
+--- a/etg/_core.py
++++ b/etg/_core.py
+@@ -196,6 +196,7 @@
+               'dirdlg',
+               'dirctrl',
+               'filedlg',
++              'filedlgcustomize',
+               'frame',
+               'msgdlg',
+               'richmsgdlg',
+diff --git a/etg/clntdatactnr.py b/etg/clntdatactnr.py
+index 69364a7b6..a2c3c8bc1 100644
+--- a/etg/clntdatactnr.py
++++ b/etg/clntdatactnr.py
+@@ -17,7 +17,8 @@
+ 
+ # The classes and/or the basename of the Doxygen XML files to be processed by
+ # this script.
+-ITEMS  = [ 'wxClientDataContainer' ]
++ITEMS  = [ 'wxClientDataContainer',
++           'wxSharedClientDataContainer' ]
+ 
+ #---------------------------------------------------------------------------
+ 
+diff --git a/etg/event.py b/etg/event.py
+index 5f79d8881..4a5c30e1e 100644
+--- a/etg/event.py
++++ b/etg/event.py
+@@ -100,11 +100,6 @@ def run():
+     #endif
+     """)
+ 
+-    # Missing in 3.1.6
+-    module.addItem(etgtools.WigCode("""\
+-        wxEventType wxEVT_FULLSCREEN /PyName=wxEVT_FULLSCREEN/;
+-        """))
+-
+ 
+     module.addPyClass('PyEventBinder', ['object'],
+         doc="""\
+diff --git a/etg/filedlgcustomize.py b/etg/filedlgcustomize.py
+new file mode 100644
+index 000000000..9f8e72cff
+--- /dev/null
++++ b/etg/filedlgcustomize.py
+@@ -0,0 +1,86 @@
++#---------------------------------------------------------------------------
++# Name:        etg/filedlgcustomize.py
++# Author:      Scott Talbert
++#
++# Created:     07-Jun-2022
++# Copyright:   (c) 2022 by Total Control Software
++# License:     wxWindows License
++#---------------------------------------------------------------------------
++
++import etgtools
++import etgtools.tweaker_tools as tools
++
++PACKAGE   = "wx"
++MODULE    = "_core"
++NAME      = "filedlgcustomize"   # 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  = [ 'wxFileDialogButton',
++           'wxFileDialogChoice',
++           'wxFileDialogCheckBox',
++           'wxFileDialogCustomControl',
++           'wxFileDialogCustomize',
++           'wxFileDialogCustomizeHook',
++           'wxFileDialogRadioButton',
++           'wxFileDialogStaticText',
++           'wxFileDialogTextCtrl',
++          ]
++
++#---------------------------------------------------------------------------
++
++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('wxFileDialogButton')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogChoice')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogCheckBox')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogCustomControl')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogCustomize')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogCustomizeHook')
++    assert isinstance(c, etgtools.ClassDef)
++
++    c = module.find('wxFileDialogRadioButton')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogStaticText')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++    c = module.find('wxFileDialogTextCtrl')
++    assert isinstance(c, etgtools.ClassDef)
++    c.noDefCtor = True
++
++
++    #-----------------------------------------------------------------
++    tools.doCommonTweaks(module)
++    tools.runGenerators(module)
++
++
++#---------------------------------------------------------------------------
++if __name__ == '__main__':
++    run()
++
+diff --git a/etg/propgridpagestate.py b/etg/propgridpagestate.py
+index 0799adb53..adf085f52 100644
+--- a/etg/propgridpagestate.py
++++ b/etg/propgridpagestate.py
+@@ -46,6 +46,8 @@ def run():
+ 
+     c = module.find('wxPropertyGridPageState')
+     tools.ignoreConstOverloads(c)
++    # Incorrectly documented in 3.1.7
++    c.find('GetColumnFullWidth.p').type = 'wxPGProperty *'
+ 
+ 
+     module.find('wxPG_IT_CHILDREN').ignore()
+diff --git a/etg/webview.py b/etg/webview.py
+index 6fec50458..4a6bde2d3 100644
+--- a/etg/webview.py
++++ b/etg/webview.py
+@@ -103,13 +103,6 @@ def run():
+                             'wxVersionInfo': 'wxVersionInfo()',
+                             })
+ 
+-    # Missing in 3.1.6
+-    module.addItem(etgtools.WigCode("""\
+-        wxEventType wxEVT_WEBVIEW_FULLSCREEN_CHANGED /PyName=wxEVT_WEBVIEW_FULLSCREEN_CHANGED/;
+-        wxEventType wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED /PyName=wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED/;
+-        wxEventType wxEVT_WEBVIEW_SCRIPT_RESULT /PyName=wxEVT_WEBVIEW_SCRIPT_RESULT/;
+-        """))
+-
+     c = module.find('wxWebView')
+     assert isinstance(c, etgtools.ClassDef)
+     tools.fixWindowClass(c)

Added: wxwidgets-3.2.patch
===================================================================
--- wxwidgets-3.2.patch	                        (rev 0)
+++ wxwidgets-3.2.patch	2022-07-10 16:41:16 UTC (rev 1249315)
@@ -0,0 +1,181 @@
+From 323129f44917b3c972800cd82603e8b2c596bb61 Mon Sep 17 00:00:00 2001
+From: Robin Dunn <robin at alldunn.com>
+Date: Tue, 17 May 2022 17:20:59 -0700
+Subject: [PATCH] Adjust all the custom wx.MenuItem methods. Return new
+ instances, mark them as factories, etc.
+
+---
+ etg/menuitem.py            | 38 ++++++++++++++++++++++----------------
+ unittests/test_menuitem.py |  2 +-
+ 2 files changed, 23 insertions(+), 17 deletions(-)
+
+diff --git a/etg/menuitem.py b/etg/menuitem.py
+index ba7940390..242ed4f6b 100644
+--- a/etg/menuitem.py
++++ b/etg/menuitem.py
+@@ -47,13 +47,16 @@ def run():
+     c.find('GetLabelFromText').ignore()
+ 
+ 
+-    # These are MSW only. Make them be empty stubs for the other ports
+-    c.find('GetBackgroundColour').type = 'const wxColour*'
++    # These are MSW only. Make them be empty stubs for the other ports. Several
++    # have incorrect details in the interface docs, so we need to tweak their
++    # return types too.
++    c.find('GetBackgroundColour').type = 'wxColour*'
++    c.find('GetBackgroundColour').factory = True
+     c.find('GetBackgroundColour').setCppCode("""\
+         #ifdef __WXMSW__
+-            return &self->GetBackgroundColour();
++            return new wxColor(self->GetBackgroundColour());
+         #else
+-            return &wxNullColour;
++            return new wxColour;
+         #endif
+         """)
+ 
+@@ -63,12 +66,13 @@ def run():
+         #endif
+         """)
+ 
+-    c.find('GetFont').type = 'const wxFont*'
++    c.find('GetFont').type = 'wxFont*'
++    c.find('GetFont').factory = True
+     c.find('GetFont').setCppCode("""\
+         #ifdef __WXMSW__
+-            return &self->GetFont();
++            return new wxFont(self->GetFont());
+         #else
+-            return &wxNullFont;
++            return new wxFont;
+         #endif
+         """)
+ 
+@@ -92,12 +96,13 @@ def run():
+         #endif
+         """)
+ 
+-    c.find('GetTextColour').type = 'const wxColour*'
++    c.find('GetTextColour').type = 'wxColour*'
++    c.find('GetTextColour').factory = True
+     c.find('GetTextColour').setCppCode("""\
+         #ifdef __WXMSW__
+-            return &self->GetTextColour();
++            return new wxColour(self->GetTextColour());
+         #else
+-            return &wxNullColour;
++            return new wxColour;
+         #endif
+         """)
+ 
+@@ -108,13 +113,13 @@ def run():
+         """)
+ 
+ 
+-    c.find('GetBitmap').type = 'const wxBitmap*'
+-    c.find('GetBitmap').transferBack = True
++    c.find('GetBitmap').type = 'wxBitmap*'
++    c.find('GetBitmap').factory = True
+     c.find('GetBitmap').setCppCode("""\
+         #ifdef __WXMSW__
+             return new wxBitmap(self->GetBitmap(checked));
+         #else
+-            return new wxBitmap(self->GetBitmap());
++            return new wxBitmap(self->GetBitmap()); // no checked arg in this case
+         #endif
+         """)
+ 
+@@ -135,13 +140,13 @@ def run():
+         """)
+ 
+ 
+-    c.find('GetDisabledBitmap').type = 'const wxBitmap*'
+-    c.find('GetDisabledBitmap').transferBack = True  # Python takes ownership of the return value
++    c.find('GetDisabledBitmap').type = 'wxBitmap*'
++    c.find('GetDisabledBitmap').factory = True
+     c.find('GetDisabledBitmap').setCppCode("""\
+         #ifdef __WXMSW__
+             return new wxBitmap(self->GetDisabledBitmap());
+         #else
+-            return new wxBitmap(wxNullBitmap);
++            return new wxBitmap;
+         #endif
+         """)
+ 
+@@ -151,6 +156,7 @@ def run():
+         #endif
+         """)
+ 
++
+     c.addAutoProperties()
+     c.addItem(etgtools.PropertyDef('Enabled', 'IsEnabled', 'Enable'))
+ 
+diff --git a/unittests/test_menuitem.py b/unittests/test_menuitem.py
+index 0d028a7e0..b58cb52b5 100644
+--- a/unittests/test_menuitem.py
++++ b/unittests/test_menuitem.py
+@@ -12,7 +12,7 @@ class menuitem_Tests(wtc.WidgetTestCase):
+     def test_menuitemCtor(self):
+         m1 = wx.MenuItem()
+         m2 = wx.MenuItem(None, -1, "Menu Item", "Help text", wx.ITEM_NORMAL)
+-        m2.SetBitmap(wx.Bitmap(pngFile))
++        m2.SetBitmap(wx.BitmapBundle(wx.Bitmap(pngFile)))
+ 
+ 
+     def test_menuitemProperties(self):
+diff --git a/etg/bmpbndl.py b/etg/bmpbndl.py
+index 71fded894..b7e9caed0 100644
+--- a/etg/bmpbndl.py
++++ b/etg/bmpbndl.py
+@@ -37,7 +37,7 @@ def run():
+ 
+     c = module.find('wxBitmapBundle')
+     assert isinstance(c, etgtools.ClassDef)
+-
++    c.find('wxBitmapBundle').findOverload('xpm').ignore()
+     c.find('FromSVG').findOverload('char *data, const wxSize &sizeDef').ignore()
+     c.find('FromImpl.impl').transfer = True
+ 
+diff --git a/etg/menuitem.py b/etg/menuitem.py
+index 242ed4f6b..fa61c926a 100644
+--- a/etg/menuitem.py
++++ b/etg/menuitem.py
+@@ -113,9 +113,10 @@ def run():
+         """)
+ 
+ 
+-    c.find('GetBitmap').type = 'wxBitmap*'
+-    c.find('GetBitmap').factory = True
+-    c.find('GetBitmap').setCppCode("""\
++    m = c.find('GetBitmap').findOverload('checked')
++    m.type = 'wxBitmap*'
++    m.factory = True
++    m.setCppCode("""\
+         #ifdef __WXMSW__
+             return new wxBitmap(self->GetBitmap(checked));
+         #else
+@@ -123,7 +124,8 @@ def run():
+         #endif
+         """)
+ 
+-    c.find('SetBitmap').setCppCode("""\
++    m = c.find('SetBitmap').findOverload('checked')
++    m.setCppCode("""\
+         #ifdef __WXMSW__
+             self->SetBitmap(*bmp, checked);
+         #else
+diff --git a/etg/bitmap.py b/etg/bitmap.py
+index 7b9019219..e5c767129 100644
+--- a/etg/bitmap.py
++++ b/etg/bitmap.py
+@@ -92,6 +92,10 @@ def run():
+ 
+     c.find('SetMask.mask').transfer = True
+ 
++    # TODO: This is different than the docs, but only on MSW... Remove this
++    # if/when that gets fixed.
++    c.find('UseAlpha').type = 'void'
++
+     c.addCppMethod('void', 'SetMaskColour', '(const wxColour& colour)',
+         doc="Create a mask for this bitmap based on the pixels with the given colour.",
+         body="""\



More information about the arch-commits mailing list