Document the QRenderDoc python API

This commit is contained in:
baldurk
2017-04-07 18:41:12 +01:00
parent 0ff4117e50
commit c7acbb3990
12 changed files with 1566 additions and 38 deletions
+1 -1
View File
@@ -6,4 +6,4 @@ Python API
funcs
enums_data
pipelines/index
qrenderdoc
qrenderdoc/index
-8
View File
@@ -1,8 +0,0 @@
QRenderDoc
==========
.. automodule:: qrenderdoc
:members:
:undoc-members:
:imported-members:
+22
View File
@@ -0,0 +1,22 @@
Persistant Config
=================
.. contents::
.. module:: qrenderdoc
Config
------
.. autoclass:: qrenderdoc.PersistantConfig
.. autoclass:: qrenderdoc.SPIRVDisassembler
:members:
:undoc-members:
Remote Host
-----------
.. autoclass:: qrenderdoc.RemoteHost
:members:
:undoc-members:
+8
View File
@@ -0,0 +1,8 @@
QRenderDoc
==========
.. toctree::
main
windows
config
pipeline
+40
View File
@@ -0,0 +1,40 @@
Main Interfaces
===============
.. contents::
.. module:: qrenderdoc
Context
-------
.. autoclass:: qrenderdoc.CaptureContext
:members:
:undoc-members:
Replay Manager
--------------
.. autoclass:: qrenderdoc.ReplayManager
:members:
:undoc-members:
LogViewer Interface
-------------------
.. autoclass:: qrenderdoc.LogViewer
:members:
:undoc-members:
Utilities
---------
.. autoclass:: qrenderdoc.DockReference
:members:
:undoc-members:
:exclude-members: enum_constants__,
.. autoclass:: qrenderdoc.CaptureSettings
:members:
:undoc-members:
+37
View File
@@ -0,0 +1,37 @@
Pipeline Abstraction
====================
.. contents::
.. module:: qrenderdoc
Pipeline
--------
.. autoclass:: qrenderdoc.CommonPipelineState
:members:
:undoc-members:
Bindings
--------
.. autoclass:: qrenderdoc.BoundResource
:members:
:undoc-members:
.. autoclass:: qrenderdoc.BoundVBuffer
:members:
:undoc-members:
.. autoclass:: qrenderdoc.BoundCBuffer
:members:
:undoc-members:
.. autoclass:: qrenderdoc.VertexInputAttribute
:members:
:undoc-members:
.. autoclass:: qrenderdoc.Viewport
:members:
:undoc-members:
+91
View File
@@ -0,0 +1,91 @@
Windows
=======
.. contents::
.. module:: qrenderdoc
MainWindow
----------
.. autoclass:: qrenderdoc.MainWindow
:members:
:undoc-members:
EventBrowser
------------
.. autoclass:: qrenderdoc.EventBrowser
:members:
:undoc-members:
APIInspector
------------
.. autoclass:: qrenderdoc.APIInspector
:members:
:undoc-members:
PipelineStateViewer
-------------------
.. autoclass:: qrenderdoc.PipelineStateViewer
:members:
:undoc-members:
TextureViewer
-------------
.. autoclass:: qrenderdoc.TextureViewer
:members:
:undoc-members:
BufferViewer
------------
.. autoclass:: qrenderdoc.BufferViewer
:members:
:undoc-members:
CaptureDialog
-------------
.. autoclass:: qrenderdoc.CaptureDialog
:members:
:undoc-members:
DebugMessageView
----------------
.. autoclass:: qrenderdoc.DebugMessageView
:members:
:undoc-members:
StatisticsViewer
----------------
.. autoclass:: qrenderdoc.StatisticsViewer
:members:
:undoc-members:
ShaderViewer
------------
.. autoclass:: qrenderdoc.ShaderViewer
:members:
:undoc-members:
ConstantBufferPreviewer
-----------------------
.. autoclass:: qrenderdoc.ConstantBufferPreviewer
:members:
:undoc-members:
PixelHistoryView
----------------
.. autoclass:: qrenderdoc.PixelHistoryView
:members:
:undoc-members:
+2
View File
@@ -1,6 +1,8 @@
Options Window
==============
.. _settings-window:
The options window contains various advanced or niche settings that configure the analysis UI.
Options
+246 -9
View File
@@ -27,6 +27,7 @@
// do not include any headers here, they must all be in QRDInterface.h
#include "QRDInterface.h"
DOCUMENT("Information about a single resource bound to a slot in an API-specific way.");
struct BoundResource
{
BoundResource()
@@ -44,57 +45,106 @@ struct BoundResource
typeHint = CompType::Typeless;
}
DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the bound resource.");
ResourceId Id;
DOCUMENT("For textures, the highest mip level available on this binding, or -1 for all mips");
int HighestMip;
DOCUMENT("For textures, the first array slice available on this binding. or -1 for all slices.");
int FirstSlice;
DOCUMENT(
"For textures, a :class:`~renderdoc.CompType` hint for how to interpret typeless textures.");
CompType typeHint;
};
DECLARE_REFLECTION_STRUCT(BoundResource);
DOCUMENT("Information about a single vertex buffer binding.");
struct BoundVBuffer
{
DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the buffer.");
ResourceId Buffer;
uint64_t ByteOffset;
uint32_t ByteStride;
DOCUMENT("The offset in bytes from the start of the buffer to the vertex data.");
uint64_t ByteOffset = 0;
DOCUMENT("The stride in bytes between the start of one vertex and the start of the next.");
uint32_t ByteStride = 0;
};
DECLARE_REFLECTION_STRUCT(BoundVBuffer);
DOCUMENT("Information about a single constant buffer binding.");
struct BoundCBuffer
{
DOCUMENT("A :class:`~renderdoc.ResourceId` identifying the buffer.");
ResourceId Buffer;
DOCUMENT("The offset in bytes from the start of the buffer to the constant data.");
uint64_t ByteOffset = 0;
DOCUMENT("The size in bytes for the constant buffer. Access outside this size returns 0.");
uint32_t ByteSize = 0;
};
DECLARE_REFLECTION_STRUCT(BoundCBuffer);
DOCUMENT("Information about a vertex input attribute feeding the vertex shader.");
struct VertexInputAttribute
{
DOCUMENT("The name of this input. This may be a variable name or a semantic name.");
QString Name;
DOCUMENT("The index of the vertex buffer used to provide this attribute.");
int VertexBuffer;
DOCUMENT("The byte offset from the start of the vertex data for this VB to this attribute.");
uint32_t RelativeByteOffset;
DOCUMENT("``True`` if this attribute runs at instance rate.");
bool PerInstance;
DOCUMENT(R"(If :data:`PerInstance` is ``True``, the number of instances that source the same value
from the vertex buffer before advancing to the next value.
)");
int InstanceRate;
DOCUMENT("A :class:`~renderdoc.ResourceFormat` with the interpreted format of this attribute.");
ResourceFormat Format;
DOCUMENT(R"(A :class:`~renderdoc.PixelValue` with the generic value for this attribute if it has
no VB bound.
)");
PixelValue GenericValue;
DOCUMENT("``True`` if this attribute is enabled and used by the vertex shader.");
bool Used;
};
DECLARE_REFLECTION_STRUCT(VertexInputAttribute);
DOCUMENT("Information about a viewport.");
struct Viewport
{
float x, y, width, height;
DOCUMENT("The X co-ordinate of the viewport.");
float x;
DOCUMENT("The Y co-ordinate of the viewport.");
float y;
DOCUMENT("The width of the viewport.");
float width;
DOCUMENT("The height of the viewport.");
float height;
};
DECLARE_REFLECTION_STRUCT(Viewport);
DOCUMENT(R"(An API-agnostic view of the common aspects of the pipeline state. This allows simple
access to e.g. find out the bound resources or vertex buffers, or certain pipeline state which is
available on all APIs.
For more detailed or precise information without abstraction, access the specific pipeline state
for the capture that's open.
)");
class CommonPipelineState
{
public:
CommonPipelineState() {}
DOCUMENT(R"(Set the source API-specific states to read data from.
:param ~renderdoc.APIProperties props: The properties of the current capture.
:param ~renderdoc.D3D11_State d3d11: The D3D11 state.
:param ~renderdoc.D3D12_State d3d12: The D3D11 state.
:param ~renderdoc.GL_State gl: The OpenGL state.
:param ~renderdoc.VK_State vk: The Vulkan state.
)");
void SetStates(APIProperties props, D3D11Pipe::State *d3d11, D3D12Pipe::State *d3d12,
GLPipe::State *gl, VKPipe::State *vk)
{
@@ -105,36 +155,68 @@ public:
m_Vulkan = vk;
}
DOCUMENT(
"The default :class:`~renderdoc.GraphicsAPI` to pretend to contain, if no capture is "
"loaded.");
GraphicsAPI DefaultType = GraphicsAPI::D3D11;
DOCUMENT(R"(Determines whether or not a capture is currently loaded.
:return: A boolean indicating if a capture is currently loaded.
:rtype: ``bool``
)");
bool LogLoaded()
{
return m_D3D11 != NULL || m_D3D12 != NULL || m_GL != NULL || m_Vulkan != NULL;
}
DOCUMENT(R"(Determines whether or not a D3D11 capture is currently loaded.
:return: A boolean indicating if a D3D11 capture is currently loaded.
:rtype: ``bool``
)");
bool IsLogD3D11()
{
return LogLoaded() && m_APIProps.pipelineType == GraphicsAPI::D3D11 && m_D3D11 != NULL;
}
DOCUMENT(R"(Determines whether or not a D3D12 capture is currently loaded.
:return: A boolean indicating if a D3D12 capture is currently loaded.
:rtype: ``bool``
)");
bool IsLogD3D12()
{
return LogLoaded() && m_APIProps.pipelineType == GraphicsAPI::D3D12 && m_D3D12 != NULL;
}
DOCUMENT(R"(Determines whether or not an OpenGL capture is currently loaded.
:return: A boolean indicating if an OpenGL capture is currently loaded.
:rtype: ``bool``
)");
bool IsLogGL()
{
return LogLoaded() && m_APIProps.pipelineType == GraphicsAPI::OpenGL && m_GL != NULL;
}
DOCUMENT(R"(Determines whether or not a Vulkan capture is currently loaded.
:return: A boolean indicating if a Vulkan capture is currently loaded.
:rtype: ``bool``
)");
bool IsLogVK()
{
return LogLoaded() && m_APIProps.pipelineType == GraphicsAPI::Vulkan && m_Vulkan != NULL;
}
// add a bunch of generic properties that people can check to save having to see which pipeline
// state
// is valid and look at the appropriate part of it
// state is valid and look at the appropriate part of it
DOCUMENT(R"(Determines whether or not tessellation is currently enabled.
:return: A boolean indicating if tessellation is currently enabled.
:rtype: ``bool``
)");
bool IsTessellationEnabled()
{
if(LogLoaded())
@@ -155,33 +237,188 @@ public:
return false;
}
DOCUMENT(R"(Determines whether or not the current capture supports binding arrays of resources.
:return: A boolean indicating if binding arrays of resources is supported.
:rtype: ``bool``
)");
bool SupportsResourceArrays() { return LogLoaded() && IsLogVK(); }
DOCUMENT(R"(Determines whether or not the current capture uses explicit barriers.
:return: A boolean indicating if explicit barriers are used.
:rtype: ``bool``
)");
bool SupportsBarriers() { return LogLoaded() && (IsLogVK() || IsLogD3D12()); }
// whether or not the PostVS data is aligned in the typical fashion
// ie. vectors not crossing float4 boundaries). APIs that use stream-out
// or transform feedback have tightly packed data, but APIs that rewrite
// shaders to dump data might have these alignment requirements
DOCUMENT(R"(Determines whether or not the PostVS data is aligned in the typical fashion (ie.
vectors not crossing ``float4`` boundaries). APIs that use stream-out or transform feedback have
tightly packed data, but APIs that rewrite shaders to dump data might have these alignment
requirements.
:return: A boolean indicating if post-VS data is aligned.
:rtype: ``bool``
)");
bool HasAlignedPostVSData() { return LogLoaded() && IsLogVK(); }
DOCUMENT(R"(For APIs that have explicit barriers, retrieves the current layout of a resource.
:return: The name of the current resource layout.
:rtype: ``str``
)");
QString GetResourceLayout(ResourceId id);
DOCUMENT(R"(Retrieves a suitable two or three letter abbreviation of the given shader stage.
:param ~renderdoc.ShaderStage stage: The shader stage to abbreviate.
:return: The abbreviation of the stage.
:rtype: ``str``
)");
QString Abbrev(ShaderStage stage);
DOCUMENT(R"(Retrieves a suitable two or three letter abbreviation of the output stage. Typically
'OM' or 'FBO'.
:return: The abbreviation of the output stage.
:rtype: ``str``
)");
QString OutputAbbrev();
DOCUMENT(R"(Retrieves the viewport for a given index.
:param int index: The viewport index to retrieve.
:return: The viewport for the given index.
:rtype: Viewport
)");
Viewport GetViewport(int index);
DOCUMENT(R"(Retrieves the current bindpoint mapping for a shader stage.
This returns an empty bindpoint mapping if no shader is bound.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch.
:return: The bindpoint mapping for the given shader.
:rtype: ~renderdoc.ShaderBindpointMapping
)");
const ShaderBindpointMapping &GetBindpointMapping(ShaderStage stage);
DOCUMENT(R"(Retrieves the shader reflection information for a shader stage.
This returns ``None`` if no shader is bound.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch.
:return: The reflection data for the given shader.
:rtype: :class:`~renderdoc.ShaderBindpointMapping` or ``None``
)");
const ShaderReflection *GetShaderReflection(ShaderStage stage);
DOCUMENT(R"(Retrieves the name of the entry point function for a shader stage.
For some APIs that don't distinguish by entry point, this may be empty.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch.
:return: The entry point name for the given shader.
:rtype: ``str``
)");
QString GetShaderEntryPoint(ShaderStage stage);
DOCUMENT(R"(Retrieves the object ID of the shader bound at a shader stage.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch.
:return: The object ID for the given shader.
:rtype: ~renderdoc.ResourceId
)");
ResourceId GetShader(ShaderStage stage);
DOCUMENT(R"(Retrieves the name of the shader object at a shader stage.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch.
:return: The object name for the given shader.
:rtype: ``str``
)");
QString GetShaderName(ShaderStage stage);
DOCUMENT(R"(Retrieves the common file extension for high level shaders in the current API.
Typically this is ``glsl`` or ``hlsl``.
:return: The file extension with no ``.``.
:rtype: ``str``
)");
QString GetShaderExtension();
DOCUMENT(R"(Retrieves the current index buffer binding.
:return: A tuple with the buffer object bound to the index buffer slot, and the byte offset to the
start of the index data.
:rtype: ``tuple`` of :class:`~renderdoc.ResourceId` and ``int``
)");
QPair<ResourceId, uint64_t> GetIBuffer();
DOCUMENT(R"(Determines whether or not primitive restart is enabled.
:return: A boolean indicating if primitive restart is enabled.
:rtype: ``bool``
)");
bool IsStripRestartEnabled();
DOCUMENT(R"(Retrieves the primitive restart index.
:param int indexByteWidth: The width in bytes of the indices.
:return: The index value that represents a strip restart not a real index.
:rtype: ``int``
)");
uint32_t GetStripRestartIndex(uint32_t indexByteWidth);
DOCUMENT(R"(Retrieves the currently bound vertex buffers.
:return: The list of bound vertex buffers.
:rtype: ``list`` of :class:`BoundVBuffer`.
)");
QVector<BoundVBuffer> GetVBuffers();
DOCUMENT(R"(Retrieves the currently specified vertex attributes.
:return: The list of current vertex attributes.
:rtype: ``list`` of :class:`VertexInputAttribute`.
)");
QVector<VertexInputAttribute> GetVertexInputs();
DOCUMENT(R"(Retrieves the constant buffer at a given binding.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch from.
:param int BufIdx: The index in the shader's ConstantBlocks array to look up.
:param int ArrayIdx: For APIs that support arrays of constant buffers in a single binding, the index
in that array to look up.
:return: The constant buffer at the specified binding.
:rtype: BoundCBuffer
)");
BoundCBuffer GetConstantBuffer(ShaderStage stage, uint32_t BufIdx, uint32_t ArrayIdx);
DOCUMENT(R"(Retrieves the read-only resources bound to a particular shader stage.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch from.
:return: The currently bound read-only resoruces.
:rtype: ``dict`` with :class:`~renderdoc.BindpointMap` keys, to lists of :class:`BoundResource`.
)");
QMap<BindpointMap, QVector<BoundResource>> GetReadOnlyResources(ShaderStage stage);
DOCUMENT(R"(Retrieves the read/write resources bound to a particular shader stage.
:param ~renderdoc.ShaderStage stage: The shader stage to fetch from.
:return: The currently bound read/write resoruces.
:rtype: ``dict`` with :class:`~renderdoc.BindpointMap` keys, to lists of :class:`BoundResource`.
)");
QMap<BindpointMap, QVector<BoundResource>> GetReadWriteResources(ShaderStage stage);
DOCUMENT(R"(Retrieves the read/write resources bound to the depth-stencil output.
:return: The currently bound depth-stencil resource.
:rtype: BoundResource
)");
BoundResource GetDepthTarget();
DOCUMENT(R"(Retrieves the resources bound to the colour outputs.
:return: The currently bound output targets.
:rtype: ``list`` of :class:`BoundResource`.
)");
QVector<BoundResource> GetOutputTargets();
private:
@@ -30,13 +30,17 @@
typedef QMap<QString, QString> QStringMap;
DOCUMENT("Describes an external program that can be used to disassemble SPIR-V.");
struct SPIRVDisassembler
{
SPIRVDisassembler() {}
VARIANT_CAST(SPIRVDisassembler);
DOCUMENT("The human-readable name of the program.");
QString name;
DOCUMENT("The path to the executable to run for this program.");
QString executable;
DOCUMENT("The command line argmuents to pass to the program.");
QString args;
};
@@ -49,6 +53,10 @@ DECLARE_REFLECTION_STRUCT(SPIRVDisassembler);
access: \
type name;
// Since this macro is already complex enough, the documentation for each of these members is
// in the docstring for PersistantConfig as :data: members.
// Please keep that docstring up to date when you add/remove/change these config settings.
// Note that only public properties should be documented.
#define CONFIG_SETTINGS() \
\
CONFIG_SETTING_VAL(public, QString, QString, LastLogPath, "") \
@@ -121,6 +129,24 @@ DECLARE_REFLECTION_STRUCT(SPIRVDisassembler);
\
CONFIG_SETTING(private, QVariantList, QList<RemoteHost>, RemoteHostList)
DOCUMENT(R"(The unit that GPU durations are displayed in.
.. data:: Seconds
The durations are displayed as seconds (s).
.. data:: Milliseconds
The durations are displayed as milliseconds (ms).
.. data:: Microseconds
The durations are displayed as microseconds (µs).
.. data:: Nanoseconds
The durations are displayed as nanoseconds (ns).
)");
enum class TimeUnit : int
{
Seconds = 0,
@@ -130,6 +156,11 @@ enum class TimeUnit : int
Count,
};
DOCUMENT(R"(Gets the suffix for a time unit.
:return: The one or two character suffix.
:rtype: ``str``
)");
inline QString UnitSuffix(TimeUnit unit)
{
if(unit == TimeUnit::Seconds)
@@ -144,27 +175,268 @@ inline QString UnitSuffix(TimeUnit unit)
return "s";
}
DOCUMENT(R"(Checks if a given file is in a list. If it is, then it's shuffled to the end. If it's
not then it's added to the end and an item is dropped from the front of the list if necessary to
stay within a given maximum
As the name suggests, this is used for tracking a 'recent file' list.
:param list recentList: A ``list`` of ``str`` that is mutated by the function.
:param str file: The file to add to the list.
:param int maxItems: The maximum allowed length of the list.
)");
void AddRecentFile(QList<QString> &recentList, const QString &file, int maxItems);
DOCUMENT(R"(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.
For more information about some of these settings that are user-facing see
:ref:`the documentation for the settings window <settings-window>`.
.. data:: LastLogPath
The path to the last capture to be opened, which is useful as a default location for browsing.
.. data:: RecentLogFiles
A ``list`` of ``str`` with the recently opened capture files.
.. data:: LastCapturePath
The path containing the last executable that was captured, which is useful as a default location
for browsing.
.. data:: LastCaptureExe
The path to the last executable that was captured, inside :data:`LastCapturePath`.
.. data:: RecentCaptureSettings
A ``list`` of ``str`` with the recently opened capture settings files.
.. data:: TemporaryCaptureDirectory
The path to where temporary capture files should be stored until they're saved permanently.
.. data:: DefaultCaptureSaveDirectory
The default path to save captures in, when browsing to save a temporary capture somewhere.
.. data:: TextureViewer_ResetRange
``True`` if the :class:`TextureViewer` should reset the visible range when a new texture is
selected.
Defaults to ``False``.
.. data:: TextureViewer_PerTexSettings
``True`` if the :class:`TextureViewer` should store most visualisation settings on a per-texture
basis instead of keeping it persistent across different textures.
Defaults to ``True``.
.. data:: ShaderViewer_FriendlyNaming
``True`` if the :class:`ShaderViewer` should replace register names with the high-level language
variable names where possible.
Defaults to ``True``.
.. data:: AlwaysReplayLocally
``True`` if when loading a capture that was originally captured on a remote device but uses an
API that can be supported locally, should be loaded locally without prompting to switch to a
remote context.
Defaults to ``False``.
.. data:: LocalProxyAPI
The index of the local proxy API to use when using remote context replay. ``-1`` if the default
proxy should be used.
Defaults to ``-1``.
.. data:: EventBrowser_TimeUnit
The :class:`TimeUnit` to use to display the duration column in the :class:`EventBrowser`.
Defaults to microseconds.
.. data:: EventBrowser_HideEmpty
``True`` if the :class:`EventBrowser` should hide marker regions that don't contain any actual
non-marker events.
Defaults to ``False``.
.. data:: EventBrowser_HideAPICalls
``True`` if the :class:`EventBrowser` should hide marker regions that don't contain any events
that aren't just drawcalls (this will hide events under "API Events" faux-markers).
Defaults to ``False``.
.. data:: EventBrowser_ApplyColors
``True`` if the :class:`EventBrowser` should apply any colours specified with API marker regions.
Defaults to ``True``.
.. data:: EventBrowser_ColorEventRow
``True`` if when colouring marker regions in the :class:`EventBrowser`, the whole row should be
coloured instead of just a side-bar.
Defaults to ``True``.
.. data:: Formatter_MinFigures
The minimum number of significant figures to show in formatted floating point values.
Defaults to ``2``.
.. data:: Formatter_MaxFigures
The maximum number of significant figures to show in formatted floating point values.
Defaults to ``5``.
.. data:: Formatter_NegExp
The cut-off on negative exponents of a normalised values to display using scientific notation.
E.g. for a value of 5, anything below 1.0e-5 will be displayed using scientific notation.
Defaults to ``5``.
.. data:: Formatter_PosExp
The cut-off on the exponent of a normalised values to display using scientific notation.
E.g. for a value of 7, anything above 1.0e+7 will be displayed using scientific notation.
Defaults to ``7``.
.. data:: Font_PreferMonospaced
``True`` if a monospaced font should be used in all places where data is displayed, even if the
data is not tabular such as names.
Defaults to ``False``.
.. data:: Android_AdbExecutablePath
The path to the ``adb`` executable to use for Android interaction.
.. data:: Android_MaxConnectTimeout
The maximum timeout in seconds to wait when launching an Android package.
Defaults to ``30``.
.. data:: CheckUpdate_AllowChecks
``True`` if when colouring marker regions in the :class:`EventBrowser`, the whole row should be
coloured instead of just a side-bar.
Defaults to ``True``.
.. data:: CheckUpdate_UpdateAvailable
``True`` if an update to a newer version is currently available.
Defaults to ``False``.
.. data:: CheckUpdate_UpdateResponse
Contains the response from the update server from the last update check, with any release notes
for the new version.
.. data:: CheckUpdate_LastUpdate
A date containing the last time that update checks happened.
.. data:: DegradedLog_LastUpdate
A date containing the last time that the user was warned about captures being loaded in degraded
support. This prevents the user being spammed if their hardware is low spec.
.. data:: Tips_HasSeenFirst
``True`` if the user has seen the first tip, which should always be shown first before
randomising.
Defaults to ``False``.
.. data:: AllowGlobalHook
``True`` if global hooking is enabled. Since it has potentially problematic side-effects and is
dangerous, it requires explicit opt-in.
Defaults to ``False``.
.. data:: SPIRVDisassemblers
A list of :class:`SPIRVDisassembler` detailing the potential disassembler programs. The first one
in the list is the default.
.. data:: RemoteHosts
A ``list`` of :class:`RemoteHost` handles to the currently configured remote hosts.
)");
class PersistantConfig
{
public:
// Runtime list of dynamically allocated hosts.
// Saved to/from private RemoteHostList in CONFIG_SETTINGS()
// This is documented above in the docstring, similar to the values in CONFIG_SETTINGS()
DOCUMENT("");
QList<RemoteHost *> RemoteHosts;
DOCUMENT("If configured, queries ``adb`` to add android hosts to :data:`RemoteHosts`.");
void AddAndroidHosts();
DOCUMENT("");
CONFIG_SETTINGS()
public:
PersistantConfig() {}
~PersistantConfig();
DOCUMENT(R"(Loads the config from a given filename. This happens automatically on startup, so it's
not recommended thattyou call this function manually.
:return: A boolean status if the load was successful.
:rtype: ``bool``
)");
bool Load(const QString &filename);
DOCUMENT(R"(Saves the config to disk. This can happen if you want to be sure a setting has been
propagated and will not be forgotten in the case of crash or otherwise unexpected exit.
:return: A boolean status if the save was successful.
:rtype: ``bool``
)");
bool Save();
DOCUMENT("Configures the :class:`Formatter` class with the settings from this config.");
void SetupFormatting();
DOCUMENT(R"(Sets an arbitrary dynamic setting similar to a key-value store. This can be used for
storing custom settings to be persisted without needing to modify code.
:param str name: The name of the setting. Any existing setting will be overwritten.
:param str value: The contents of the setting.
)");
void SetConfigSetting(const QString &name, const QString &value);
DOCUMENT(R"(Retrieves an arbitrary dynamic setting. See :meth:`SetConfigSetting`.
:param str name: The name of the setting.
:return: The value of the setting, or the empty string if the setting did not exist.
:rtype: ``str``
)");
QString GetConfigSetting(const QString &name);
private:
File diff suppressed because it is too large Load Diff
+10 -1
View File
@@ -29,6 +29,7 @@ class RemoteHost;
// do not include any headers here, they must all be in QRDInterface.h
#include "QRDInterface.h"
DOCUMENT("A handle for interacting with a remote servers on a given host.");
class RemoteHost
{
public:
@@ -36,16 +37,24 @@ public:
VARIANT_CAST(RemoteHost);
bool IsValid() { return !Hostname.isEmpty(); }
DOCUMENT(
"Ping the host to check current status - if the server is running, connection status, etc.");
void CheckStatus();
DOCUMENT("Runs the command specified in :data:`RunCommand`.");
void Launch();
DOCUMENT("``True`` if a remote server is currently running on this host.");
bool ServerRunning : 1;
DOCUMENT("``True`` if an active connection exists to this remote server.");
bool Connected : 1;
DOCUMENT("``True`` if someone else is currently connected to this server.");
bool Busy : 1;
DOCUMENT("``True`` if there is a code version mismatch with this server.");
bool VersionMismatch : 1;
DOCUMENT("The hostname of this host.");
QString Hostname;
DOCUMENT("The command to run locally to try to launch the server remotely.");
QString RunCommand;
};