* When the pyside2 we ship was built it accidentally included a small dependency
on Qt5Qml, which we don't distribute so the pyside2 libraries wouldn't load.
* We can generate a tiny stub with the right exports and load it manually from
the PySide2 folder on 32-bit qrenderdoc builds to allow pyside2 to load
subsequently. The stub source is tiny, and added alongside.
* Putting it in the PySide2 folder means that even if someone puts RenderDoc's
build folder in their PATH, our stub Qt5Qml won't break anything because it
won't be loaded. If they put PySide2 in the PATH it might, but then it's their
fault!
* When calling the register() function there is no frame or globals, so we need
to set an internal handle external to that.
* This means functions that get wrapped know that there's a global handler for
exceptions, which just prints to the log. Otherwise they think they're running
synchronously and write to an invalid exception handling object.
* The GUIInvoke object takes a QObject, and uses QPointer to check that
it hasn't been deleted when the callback fires. This prevents delayed
callbacks from executing after the object has been deleted and
crashing.
* In most cases the pointer is just 'this'.
* It's already optional on linux due to distributions not necessarily
carrying packages for it yet. We also make it optional on windows
since by the same measure it's not a huge problem if it's missing, and
official builds will include it. This means we don't have to ship the
binary dependencies
* The main addition here apart from some extra stubs is a new rdc type
for date time objects.
* Although the module doesn't do anything and is only used for docs
reflection it is desirable to not have to link against Qt as this
can cause problems when linking the module without unresolved symbols.
* These .py wrappers are relevant for the non-builtin path, but since we
use -builtin they serve no purpose except to make things more complex.
* So instead we make the module directly exported as 'module' instead of
'_module'.
* On windows there's no conflict because we have renderdoc.dll vs
renderdoc.pyd. On linux it's librenderdoc.so vs renderdoc.so.
* To prevent supporting files like .lib / .pdb from conflicting on
windows we build the python modules into a subdirectory. They're not
ever used by the UI (it links in the bindings directly).
* The former is only needed inside tp_init of a new object. Instead when
we want to pass in and own a pointer, we use SWIG_POINTER_OWN.
* This also removes the need to pass 'self' all the way down in
ConvertToPy which tidies up a lot of code.
* In future we could handle async exceptions by storing the exception
information in a std::function derived object (instead of the separate
ExceptionHandling that lives on the stack) and query it out in a new
WaitForInvoke function maybe. Right now we just print the exception
to the output log and abort the callback.
* Even if we don't have pyside2 to treat qwidgets as full objects and
access their methods and data, we still need to be able to pass around
the QWidget* as an opaque pointer to be able to use the API properly.
* This change falls back to just using SWIG's default opaque pointer
wrapping and unwrapping when pyside2 isn't available.
* Added a couple of utility macros to help with the conversion. lit() is
paired with tr() for untranslated text.
* QFormatStr is more explicitly for non-textual formatting strings.
* Both are just #define'd to QStringLiteral()
* This is only relevant for static qrenderdoc builds where the python
used isn't the system python, so it needs to locate its libs.
Otherwise the system libpython3.so and libs will be used.