mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 16:36:31 +00:00
Add type hints to python for class constructors
* We enforce default and copy constructors where possible, this isn't very pythonic but we can't use copy.deepcopy on our types. * The structs that have specialised constructors e.g. FloatVector or Subresource also have those documented though we have no way to enforce it.
This commit is contained in:
@@ -279,7 +279,12 @@ BITMASK_OPERATORS(DialogButton);
|
||||
DISABLE_PYTHON_FLAG_ENUMS;
|
||||
#endif
|
||||
|
||||
DOCUMENT("The metadata for an extension.");
|
||||
DOCUMENT(R"(
|
||||
ExtensionMetadata()
|
||||
ExtensionMetadata(other: ExtensionMetadata)
|
||||
|
||||
The metadata for an extension.
|
||||
)");
|
||||
struct ExtensionMetadata
|
||||
{
|
||||
DOCUMENT("");
|
||||
|
||||
@@ -30,7 +30,11 @@
|
||||
|
||||
class QMutex;
|
||||
|
||||
DOCUMENT(R"(Contains the output from invoking a :class:`ShaderProcessingTool`, including both the
|
||||
DOCUMENT(R"(
|
||||
ShaderToolOutput()
|
||||
ShaderToolOutput(other: ShaderToolOutput)
|
||||
|
||||
Contains the output from invoking a :class:`ShaderProcessingTool`, including both the
|
||||
actual output data desired as well as any stdout/stderr messages.
|
||||
)");
|
||||
struct ShaderToolOutput
|
||||
@@ -48,7 +52,11 @@ struct ShaderToolOutput
|
||||
bytebuf result;
|
||||
};
|
||||
|
||||
DOCUMENT(R"(Describes an external program that can be used to process shaders, typically either
|
||||
DOCUMENT(R"(
|
||||
ShaderProcessingTool()
|
||||
ShaderProcessingTool(other: ShaderProcessingTool)
|
||||
|
||||
Describes an external program that can be used to process shaders, typically either
|
||||
compiling from a high-level language to a binary format, or decompiling from the binary format to
|
||||
a high-level language or textual representation.
|
||||
|
||||
@@ -58,6 +66,9 @@ struct ShaderProcessingTool
|
||||
{
|
||||
DOCUMENT("");
|
||||
ShaderProcessingTool() = default;
|
||||
ShaderProcessingTool(const ShaderProcessingTool &) = default;
|
||||
ShaderProcessingTool &operator=(const ShaderProcessingTool &) = default;
|
||||
|
||||
VARIANT_CAST(ShaderProcessingTool);
|
||||
bool operator==(const ShaderProcessingTool &o) const
|
||||
{
|
||||
@@ -159,7 +170,12 @@ DECLARE_REFLECTION_STRUCT(ShaderProcessingTool);
|
||||
#define BUGREPORT_URL "https://renderdoc.org/bugreporter"
|
||||
#endif
|
||||
|
||||
DOCUMENT("Describes a submitted bug report.");
|
||||
DOCUMENT(R"(
|
||||
BugReport()
|
||||
BugReport(other: BugReport)
|
||||
|
||||
Describes a submitted bug report.
|
||||
)");
|
||||
struct BugReport
|
||||
{
|
||||
DOCUMENT("");
|
||||
@@ -879,7 +895,10 @@ struct CustomPersistentStorage
|
||||
};
|
||||
#endif
|
||||
|
||||
DOCUMENT(R"(A persistant config file that is automatically loaded and saved, which contains any
|
||||
DOCUMENT(R"(
|
||||
PersistantConfig()
|
||||
|
||||
A persistant config file that is automatically loaded and saved, which contains any
|
||||
settings and information that needs to be preserved from one run to the next.
|
||||
|
||||
The config is retrieved by calling :meth:`CaptureContext.Config`.
|
||||
|
||||
@@ -95,10 +95,18 @@ struct ICaptureContext;
|
||||
#include "PersistantConfig.h"
|
||||
#include "RemoteHost.h"
|
||||
|
||||
DOCUMENT("Contains all of the settings that control how to capture an executable.");
|
||||
DOCUMENT(R"(
|
||||
CaptureSettings()
|
||||
CaptureSettings(other: CaptureSettings)
|
||||
|
||||
Contains all of the settings that control how to capture an executable.
|
||||
)");
|
||||
struct CaptureSettings
|
||||
{
|
||||
DOCUMENT("");
|
||||
CaptureSettings();
|
||||
CaptureSettings(const CaptureSettings &) = default;
|
||||
CaptureSettings &operator=(const CaptureSettings &) = default;
|
||||
|
||||
VARIANT_CAST(CaptureSettings);
|
||||
|
||||
@@ -151,7 +159,11 @@ struct CaptureSettings
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(CaptureSettings);
|
||||
|
||||
DOCUMENT(R"(The details of a capture that has been made on a connection but may not
|
||||
DOCUMENT(R"(
|
||||
ConnectedTempCapture()
|
||||
ConnectedTempCapture(other: ConnectedTempCapture)
|
||||
|
||||
The details of a capture that has been made on a connection but may not
|
||||
have been saved to disk or local.
|
||||
)");
|
||||
struct ConnectedTempCapture
|
||||
@@ -1804,7 +1816,11 @@ protected:
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(IPixelHistoryView);
|
||||
|
||||
DOCUMENT("An interface implemented by any object wanting to be notified of capture events.");
|
||||
DOCUMENT(R"(
|
||||
CaptureViewer()
|
||||
|
||||
An interface implemented by any object wanting to be notified of capture events.
|
||||
)");
|
||||
struct ICaptureViewer
|
||||
{
|
||||
DOCUMENT("Called whenever a capture is opened.");
|
||||
@@ -2193,7 +2209,13 @@ enum class CaptureModifications : uint32_t
|
||||
|
||||
BITMASK_OPERATORS(CaptureModifications);
|
||||
|
||||
DOCUMENT("A description of a bookmark on an event");
|
||||
DOCUMENT(R"(
|
||||
EventBookmark()
|
||||
EventBookmark(other: EventBookmark)
|
||||
EventBookmark(eventId: int)
|
||||
|
||||
A description of a bookmark on an event
|
||||
)");
|
||||
struct EventBookmark
|
||||
{
|
||||
DOCUMENT(R"(The :data:`eventId <renderdoc.APIEvent.eventId>` at which this bookmark is placed.
|
||||
@@ -2210,6 +2232,7 @@ struct EventBookmark
|
||||
|
||||
DOCUMENT("");
|
||||
EventBookmark() = default;
|
||||
EventBookmark(const EventBookmark &) = default;
|
||||
EventBookmark(uint32_t e) : eventId(e) {}
|
||||
bool operator==(const EventBookmark &o) const { return eventId == o.eventId; }
|
||||
bool operator!=(const EventBookmark &o) const { return eventId != o.eventId; }
|
||||
|
||||
@@ -38,7 +38,13 @@ struct RemoteHostData;
|
||||
// are unexpectedly removed (such as disconnecting an auto-populated device) these structs are
|
||||
// copied around and they have a shared locked data pointer. All accessors then lock and look up the
|
||||
// data there to fetch or modify
|
||||
DOCUMENT("A handle for interacting with a remote server on a given host.");
|
||||
DOCUMENT(R"(
|
||||
RemoteHost()
|
||||
RemoteHost(other: RemoteHost)
|
||||
RemoteHost(hostname: str)
|
||||
|
||||
A handle for interacting with a remote server on a given host.
|
||||
)");
|
||||
class RemoteHost
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user