Update release

This commit is contained in:
vczh
2025-05-02 22:29:10 -07:00
parent 1ee765cff9
commit ba029cae83
20 changed files with 5320 additions and 1259 deletions
File diff suppressed because it is too large Load Diff
+15 -52
View File
@@ -38,7 +38,6 @@ https://github.com/vczh-libraries
namespace vl_workflow_global
{
struct __vwsnf10_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
struct __vwsnf1_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
struct __vwsnf2_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
struct __vwsnf3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
@@ -53,8 +52,7 @@ namespace vl_workflow_global
class __vwsnc3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc4_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc7_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings;
class __vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings;
}
namespace __vwsn_enums
@@ -101,7 +99,6 @@ namespace gaclib_controls
public:
virtual ::vl::WString GetName() = 0;
virtual ::vl::WString GetElementsAsJsonText() = 0;
virtual ::vl::WString GetCommandsAsJsonText() = 0;
virtual ::vl::WString GetDomAsJsonText() = 0;
};
@@ -125,7 +122,7 @@ namespace gaclib_controls
class UnitTestSnapshotViewerStrings : public ::vl::Object, public ::vl::reflection::Description<UnitTestSnapshotViewerStrings>
{
friend class ::vl_workflow_global::__vwsnc7_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings;
friend class ::vl_workflow_global::__vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<UnitTestSnapshotViewerStrings>;
#endif
@@ -143,8 +140,6 @@ namespace gaclib_controls
friend class ::vl_workflow_global::__vwsnc3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc4_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf10_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf1_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf2_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
@@ -158,8 +153,11 @@ namespace gaclib_controls
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<UnitTestSnapshotViewerWindowConstructor>;
#endif
protected:
::gaclib_controls::UnitTestSnapshotViewerWindow* self;
::vl::Ptr<::gaclib_controls::IUnitTestSnapshotViewerViewModel> ViewModel;
::gaclib_controls::UnitTestSnapshotViewerWindow* self;
::vl::presentation::controls::GuiBindableTreeView* treeViewFileNodes;
::vl::presentation::controls::GuiBindableTextList* textListFrames;
::vl::presentation::controls::GuiScrollContainer* scRendering;
::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0;
::vl::presentation::compositions::GuiColumnSplitterComposition* __vwsn_precompile_1;
::vl::presentation::compositions::GuiColumnSplitterComposition* __vwsn_precompile_2;
@@ -181,12 +179,6 @@ namespace gaclib_controls
::vl::presentation::controls::GuiTabPage* __vwsn_precompile_18;
::vl::presentation::controls::GuiMultilineTextBox* __vwsn_precompile_19;
::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_20;
::vl::presentation::controls::GuiTabPage* __vwsn_precompile_21;
::vl::presentation::controls::GuiMultilineTextBox* __vwsn_precompile_22;
::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_23;
::vl::presentation::controls::GuiBindableTreeView* treeViewFileNodes;
::vl::presentation::controls::GuiBindableTextList* textListFrames;
::vl::presentation::controls::GuiScrollContainer* scRendering;
void __vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize(::gaclib_controls::UnitTestSnapshotViewerWindow* __vwsn_this_);
public:
UnitTestSnapshotViewerWindowConstructor();
@@ -200,8 +192,6 @@ namespace gaclib_controls
friend class ::vl_workflow_global::__vwsnc3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc4_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf10_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf1_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf2_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf3_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_;
@@ -251,15 +241,6 @@ namespace vl_workflow_global
Closures
***********************************************************************/
struct __vwsnf10_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_
{
::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnthis_0;
__vwsnf10_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_(::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnctorthis_0);
void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const;
};
struct __vwsnf1_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize_
{
::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnthis_0;
@@ -397,29 +378,11 @@ Closures
class __vwsnc4_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription
{
public:
::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnthis_0;
__vwsnc4_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnctorthis_0);
::vl::presentation::controls::GuiBindableTextList* __vwsn_bind_cache_0 = nullptr;
::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0;
bool __vwsn_bind_opened_ = false;
bool __vwsn_bind_closed_ = false;
void __vwsn_bind_activator_();
void __vwsn_bind_callback_0_0(::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_bind_callback_argument_0, ::vl::presentation::compositions::GuiEventArgs* __vwsn_bind_callback_argument_1);
bool Open() override;
bool Update() override;
bool Close() override;
};
class __vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription
{
public:
::gaclib_controls::UnitTestSnapshotViewerWindow* __vwsn_this_;
::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnthis_0;
__vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::UnitTestSnapshotViewerWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnctorthis_0);
__vwsnc4_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::UnitTestSnapshotViewerWindow* __vwsnctor___vwsn_this_, ::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnctorthis_0);
::gaclib_controls::UnitTestSnapshotViewerWindow* __vwsn_bind_cache_0 = nullptr;
::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0;
@@ -432,12 +395,12 @@ Closures
bool Close() override;
};
class __vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription
class __vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription
{
public:
::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnthis_0;
__vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnctorthis_0);
__vwsnc5_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerWindowConstructor___vwsn_gaclib_controls_UnitTestSnapshotViewerWindow_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::UnitTestSnapshotViewerWindowConstructor* __vwsnctorthis_0);
::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr;
::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0;
@@ -450,10 +413,10 @@ Closures
bool Close() override;
};
class __vwsnc7_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings : public ::vl::Object, public virtual ::gaclib_controls::IUnitTestSnapshotViewerStringsStrings
class __vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings : public ::vl::Object, public virtual ::gaclib_controls::IUnitTestSnapshotViewerStringsStrings
{
public:
__vwsnc7_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings();
__vwsnc6_GuiUnitTestSnapshotViewer_gaclib_controls_UnitTestSnapshotViewerStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IUnitTestSnapshotViewerStringsStrings();
::vl::WString WindowTitle() override;
};
@@ -495,8 +458,8 @@ https://github.com/vczh-libraries
namespace vl::presentation::remoteprotocol
{
struct RenderingFrame;
struct RenderingTrace;
struct UnitTest_RenderingFrame;
struct UnitTest_RenderingTrace;
}
namespace vl::presentation::unittest
@@ -515,8 +478,8 @@ namespace vl::presentation::unittest
Ptr<gaclib_controls::IUnitTestSnapshotFileNode> GetRootNode() override;
};
extern const remoteprotocol::RenderingTrace& GetRenderingTrace(Ptr<gaclib_controls::IUnitTestSnapshotFileNode> node);
extern const remoteprotocol::RenderingFrame& GetRenderingFrame(Ptr<gaclib_controls::IUnitTestSnapshotFrame> frame);
extern const remoteprotocol::UnitTest_RenderingTrace& GetRenderingTrace(Ptr<gaclib_controls::IUnitTestSnapshotFileNode> node);
extern const remoteprotocol::UnitTest_RenderingFrame& GetRenderingFrame(Ptr<gaclib_controls::IUnitTestSnapshotFrame> frame);
}
/***********************************************************************
-5
View File
@@ -64,11 +64,9 @@ namespace vl
BEGIN_INTERFACE_MEMBER(::gaclib_controls::IUnitTestSnapshotFrame)
CLASS_MEMBER_BASE(::vl::reflection::IDescriptable)
CLASS_MEMBER_METHOD(GetCommandsAsJsonText, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetDomAsJsonText, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetElementsAsJsonText, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetName, NO_PARAMETER)
CLASS_MEMBER_PROPERTY_READONLY(CommandsAsJsonText, GetCommandsAsJsonText)
CLASS_MEMBER_PROPERTY_READONLY(DomAsJsonText, GetDomAsJsonText)
CLASS_MEMBER_PROPERTY_READONLY(ElementsAsJsonText, GetElementsAsJsonText)
CLASS_MEMBER_PROPERTY_READONLY(Name, GetName)
@@ -133,9 +131,6 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_19)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_20)
CLASS_MEMBER_FIELD(__vwsn_precompile_21)
CLASS_MEMBER_FIELD(__vwsn_precompile_22)
CLASS_MEMBER_FIELD(__vwsn_precompile_23)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
CLASS_MEMBER_FIELD(__vwsn_precompile_5)
-4
View File
@@ -86,10 +86,6 @@ namespace vl
END_INTERFACE_PROXY(::gaclib_controls::IUnitTestSnapshotFileNode)
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(::gaclib_controls::IUnitTestSnapshotFrame)
::vl::WString GetCommandsAsJsonText() override
{
INVOKEGET_INTERFACE_PROXY_NOPARAMS(GetCommandsAsJsonText);
}
::vl::WString GetDomAsJsonText() override
{
INVOKEGET_INTERFACE_PROXY_NOPARAMS(GetDomAsJsonText);
+284 -37
View File
@@ -146,9 +146,167 @@ File GacUIUnitTest_PrepareSnapshotFile(const WString& appName, const WString& ex
#undef ERROR_MESSAGE_PREFIX
}
void GacUIUnitTest_WriteSnapshotFileIfChanged(File& snapshotFile, const WString& textLog)
{
#define ERROR_MESSAGE_PREFIX L"GacUIUnitTest_WriteSnapshotFileIfChanged(File&, const WString&)#"
bool skipWriting = false;
if (snapshotFile.Exists())
{
auto previousLog = snapshotFile.ReadAllTextByBom();
if (previousLog == textLog)
{
skipWriting = true;
}
}
if (!skipWriting)
{
bool succeeded = snapshotFile.WriteAllText(textLog, true, stream::BomEncoder::Utf8);
CHECK_ERROR(succeeded, ERROR_MESSAGE_PREFIX L"Failed to write the snapshot file.");
}
#undef ERROR_MESSAGE_PREFIX
}
void GacUIUnitTest_LogUI(const WString& appName, UnitTestRemoteProtocol& unitTestProtocol)
{
#define ERROR_MESSAGE_PREFIX L"GacUIUnitTest_LogUI(const WString&, UnitTestRemoteProtocol&)#"
File snapshotFile = GacUIUnitTest_PrepareSnapshotFile(appName, WString::Unmanaged(L".json"));
JsonFormatting formatting;
formatting.spaceAfterColon = true;
formatting.spaceAfterComma = true;
formatting.crlf = true;
formatting.compact = true;
auto jsonLog = remoteprotocol::ConvertCustomTypeToJson(unitTestProtocol.GetLoggedTrace());
auto textLog = JsonToString(jsonLog, formatting);
{
remoteprotocol::UnitTest_RenderingTrace deserialized;
remoteprotocol::ConvertJsonToCustomType(jsonLog, deserialized);
auto jsonLog2 = remoteprotocol::ConvertCustomTypeToJson(deserialized);
auto textLog2 = JsonToString(jsonLog2, formatting);
CHECK_ERROR(textLog == textLog2, ERROR_MESSAGE_PREFIX L"Serialization and deserialization doesn't match.");
}
GacUIUnitTest_WriteSnapshotFileIfChanged(snapshotFile, textLog);
#undef ERROR_MESSAGE_PREFIX
}
void GacUIUnitTest_LogCommands(const WString& appName, UnitTestRemoteProtocol& unitTestProtocol)
{
File snapshotFile = GacUIUnitTest_PrepareSnapshotFile(appName, WString::Unmanaged(L"[commands].txt"));
JsonFormatting formatting;
formatting.spaceAfterColon = true;
formatting.spaceAfterComma = true;
formatting.crlf = false;
formatting.compact = true;
auto textLog = stream::GenerateToStream([&unitTestProtocol, &formatting](stream::TextWriter& writer)
{
auto&& loggedFrames = unitTestProtocol.GetLoggedFrames();
for (auto loggedFrame : loggedFrames)
{
writer.WriteLine(L"========================================");
writer.WriteLine(itow(loggedFrame->frameId));
writer.WriteLine(L"========================================");
for (auto&& commandLog : loggedFrame->renderingCommandsLog)
{
writer.WriteLine(commandLog);
}
};
});
GacUIUnitTest_WriteSnapshotFileIfChanged(snapshotFile, textLog);
}
void GacUIUnitTest_LogDiffs(const WString& appName, UnitTestRemoteProtocol& unitTestProtocol)
{
File snapshotFile = GacUIUnitTest_PrepareSnapshotFile(appName, WString::Unmanaged(L"[diffs].txt"));
JsonFormatting formatting;
formatting.spaceAfterColon = true;
formatting.spaceAfterComma = true;
formatting.crlf = false;
formatting.compact = true;
auto textLog = stream::GenerateToStream([&unitTestProtocol, &formatting](stream::TextWriter& writer)
{
Ptr<RenderingDom> dom;
DomIndex domIndex;
auto&& loggedFrames = unitTestProtocol.GetLoggedFrames();
for (auto loggedFrame : loggedFrames)
{
writer.WriteLine(L"========================================");
writer.WriteLine(itow(loggedFrame->frameId));
writer.WriteLine(L"========================================");
if (!dom)
{
dom = loggedFrame->renderingDom;
BuildDomIndex(dom, domIndex);
List<Pair<vint, Ptr<RenderingDom>>> lines;
lines.Add({ 0,dom });
for (vint i = 0; i < lines.Count(); i++)
{
for (vint j = 0; j < lines[i].key; j++)
{
writer.WriteString(L" ");
}
auto line = lines[i].value;
writer.WriteString(itow(line->id));
writer.WriteString(L": ");
auto jsonLog = remoteprotocol::ConvertCustomTypeToJson(line->content);
writer.WriteLine(JsonToString(jsonLog, formatting));
if (line->children)
{
for (auto child : *line->children.Obj())
{
lines.Add({ lines[i].key + 1,child });
}
}
}
}
else
{
DomIndex nextDomIndex;
BuildDomIndex(loggedFrame->renderingDom, nextDomIndex);
Ptr<List<RenderingDom_Diff>> diffList;
if (loggedFrame->renderingDiffs)
{
diffList = loggedFrame->renderingDiffs.Value().diffsInOrder;
}
else
{
RenderingDom_DiffsInOrder diffs;
DiffDom(dom, domIndex, loggedFrame->renderingDom, nextDomIndex, diffs);
diffList = diffs.diffsInOrder;
}
if (diffList)
{
for (auto&& diff : *diffList.Obj())
{
auto jsonLog = remoteprotocol::ConvertCustomTypeToJson(diff);
writer.WriteLine(JsonToString(jsonLog, formatting));
}
}
dom = loggedFrame->renderingDom;
domIndex = std::move(nextDomIndex);
}
};
});
GacUIUnitTest_WriteSnapshotFileIfChanged(snapshotFile, textLog);
}
void GacUIUnitTest_Start(const WString& appName, Nullable<UnitTestScreenConfig> config)
{
#define ERROR_MESSAGE_PREFIX L"GacUIUnitTest_Start(const WString&, Nullable<UnitTestScreenConfig>)#"
UnitTestScreenConfig globalConfig;
if (config)
{
@@ -159,50 +317,131 @@ void GacUIUnitTest_Start(const WString& appName, Nullable<UnitTestScreenConfig>
globalConfig.FastInitialize(1024, 768);
}
// Renderer
UnitTestRemoteProtocol unitTestProtocol(appName, globalConfig);
repeatfiltering::GuiRemoteProtocolFilterVerifier verifierProtocol(unitTestProtocol.GetProtocol());
auto jsonParser = Ptr(new glr::json::Parser);
// Data Processing in Renderer
channeling::GuiRemoteJsonChannelFromProtocol channelReceiver(unitTestProtocol.GetProtocol());
channeling::GuiRemoteJsonChannelStringDeserializer channelJsonDeserializer(&channelReceiver, jsonParser);
channeling::GuiRemoteUtfStringChannelDeserializer<wchar_t, char8_t> channelUtf8Deserializer(&channelJsonDeserializer);
// Boundary between Binaries
// Data Processing in Core
channeling::GuiRemoteUtfStringChannelSerializer<wchar_t, char8_t> channelUtf8Serializer(&channelUtf8Deserializer);
channeling::GuiRemoteJsonChannelStringSerializer channelJsonSerializer(&channelUtf8Serializer, jsonParser);
// Boundary between threads
channeling::GuiRemoteProtocolFromJsonChannel channelSender(&channelJsonSerializer);
// Core
repeatfiltering::GuiRemoteProtocolFilterVerifier verifierProtocol(
globalConfig.useChannel == UnitTestRemoteChannel::None
? unitTestProtocol.GetProtocol()
: &channelSender
);
repeatfiltering::GuiRemoteProtocolFilter filteredProtocol(&verifierProtocol);
GuiRemoteProtocolDomDiffConverter diffConverterProtocol(&filteredProtocol);
UnitTestContextImpl unitTestContext(&unitTestProtocol);
guiMainUnitTestContext = &unitTestContext;
SetupRemoteNativeController(&filteredProtocol);
SetupRemoteNativeController(
globalConfig.useDomDiff
? static_cast<IGuiRemoteProtocol*>(&diffConverterProtocol)
: &filteredProtocol
);
GacUIUnitTest_SetGuiMainProxy({});
GacUIUnitTest_LogUI(appName, unitTestProtocol);
if (!globalConfig.useDomDiff)
{
File snapshotFile = GacUIUnitTest_PrepareSnapshotFile(appName, WString::Unmanaged(L".json"));
JsonFormatting formatting;
formatting.spaceAfterColon = true;
formatting.spaceAfterComma = true;
formatting.crlf = true;
formatting.compact = true;
auto jsonLog = remoteprotocol::ConvertCustomTypeToJson(unitTestProtocol.GetLoggedTrace());
auto textLog = JsonToString(jsonLog, formatting);
{
remoteprotocol::RenderingTrace deserialized;
remoteprotocol::ConvertJsonToCustomType(jsonLog, deserialized);
auto jsonLog2 = remoteprotocol::ConvertCustomTypeToJson(deserialized);
auto textLog2 = JsonToString(jsonLog2, formatting);
CHECK_ERROR(textLog == textLog2, ERROR_MESSAGE_PREFIX L"Serialization and deserialization doesn't match.");
}
bool skipWriting = false;
if (snapshotFile.Exists())
{
auto previousLog = snapshotFile.ReadAllTextByBom();
if (previousLog == textLog)
{
skipWriting = true;
}
}
if (!skipWriting)
{
bool succeeded = snapshotFile.WriteAllText(textLog, true, stream::BomEncoder::Utf8);
CHECK_ERROR(succeeded, ERROR_MESSAGE_PREFIX L"Failed to write the snapshot file.");
}
GacUIUnitTest_LogCommands(appName, unitTestProtocol);
}
#undef ERROR_MESSAGE_PREFIX
GacUIUnitTest_LogDiffs(appName, unitTestProtocol);
}
template<typename T>
void RunInNewThread(T&& threadProc)
{
Thread::CreateAndStart([threadProc]()
{
try
{
threadProc();
}
catch (const Exception& e)
{
(void)e;
throw;
}
catch (const Error& e)
{
(void)e;
throw;
}
});
}
void GacUIUnitTest_StartAsync(const WString& appName, Nullable<UnitTestScreenConfig> config)
{
TEST_ASSERT(config && config.Value().useChannel == UnitTestRemoteChannel::Async);
// Renderer
UnitTestRemoteProtocol unitTestProtocol(appName, config.Value());
auto jsonParser = Ptr(new glr::json::Parser);
// Data Processing in Renderer
channeling::GuiRemoteJsonChannelFromProtocol channelReceiver(unitTestProtocol.GetProtocol());
channeling::GuiRemoteJsonChannelStringDeserializer channelJsonDeserializer(&channelReceiver, jsonParser);
channeling::GuiRemoteUtfStringChannelDeserializer<wchar_t, char8_t> channelUtf8Deserializer(&channelJsonDeserializer);
// Boundary between Binaries
// Data Processing in Core
channeling::GuiRemoteUtfStringChannelSerializer<wchar_t, char8_t> channelUtf8Serializer(&channelUtf8Deserializer);
channeling::GuiRemoteJsonChannelStringSerializer channelJsonSerializer(&channelUtf8Serializer, jsonParser);
// Boundary between threads
channeling::GuiRemoteProtocolAsyncJsonChannelSerializer asyncChannelSender;
asyncChannelSender.Start(
&channelJsonSerializer,
[&unitTestProtocol, config](channeling::GuiRemoteProtocolAsyncJsonChannelSerializer* channel)
{
channeling::GuiRemoteProtocolFromJsonChannel channelSender(channel);
// Core
repeatfiltering::GuiRemoteProtocolFilterVerifier verifierProtocol(&channelSender);
repeatfiltering::GuiRemoteProtocolFilter filteredProtocol(&verifierProtocol);
GuiRemoteProtocolDomDiffConverter diffConverterProtocol(&filteredProtocol);
UnitTestContextImpl unitTestContext(&unitTestProtocol);
guiMainUnitTestContext = &unitTestContext;
SetupRemoteNativeController(
config.Value().useDomDiff
? static_cast<IGuiRemoteProtocol*>(&diffConverterProtocol)
: &filteredProtocol
);
GacUIUnitTest_SetGuiMainProxy({});
},
[](
channeling::GuiRemoteProtocolAsyncJsonChannelSerializer::TChannelThreadProc channelThreadProc,
channeling::GuiRemoteProtocolAsyncJsonChannelSerializer::TUIThreadProc uiThreadProc
)
{
RunInNewThread(channelThreadProc);
RunInNewThread(uiThreadProc);
});
asyncChannelSender.WaitForStopped();
GacUIUnitTest_LogUI(appName, unitTestProtocol);
if (!config.Value().useDomDiff)
{
GacUIUnitTest_LogCommands(appName, unitTestProtocol);
}
GacUIUnitTest_LogDiffs(appName, unitTestProtocol);
}
void GacUIUnitTest_Start_WithResourceAsText(const WString& appName, Nullable<UnitTestScreenConfig> config, const WString& resourceText)
@@ -240,7 +479,15 @@ void GacUIUnitTest_Start_WithResourceAsText(const WString& appName, Nullable<Uni
}
previousMainProxy(protocol, context);
});
GacUIUnitTest_Start(appName, config);
if (config && config.Value().useChannel == UnitTestRemoteChannel::Async)
{
GacUIUnitTest_StartAsync(appName, config);
}
else
{
GacUIUnitTest_Start(appName, config);
}
#undef ERROR_MESSAGE_PREFIX
}
+211 -217
View File
File diff suppressed because it is too large Load Diff
+61 -30
View File
@@ -999,13 +999,14 @@ WindowsForm
return true;
}
break;
case WM_NCLBUTTONUP:
case WM_LBUTTONUP:
{
POINTS location = MAKEPOINTS(lParam);
NativeWindowMouseInfo info = ConvertMouse(wParam, lParam, false, nonClient);
// TODO: (enumerable) this for-loop needs to be removed, because it is not looping, just leave the body
for (vint i = 0; i < listeners.Count(); i++)
{
switch (PerformHitTest(From(listeners), { location.x,location.y }))
switch (PerformHitTest(From(listeners), { info.x,info.y }))
{
case INativeWindowListener::ButtonMinimum:
ShowMinimized();
@@ -2867,7 +2868,7 @@ using namespace vl::presentation;
using namespace vl::presentation::windows;
using namespace vl::presentation::elements_windows_d2d;
int SetupWindowsDirect2DRendererInternal(bool hosted)
int SetupWindowsDirect2DRendererInternal(bool hosted, bool raw)
{
InitDpiAwareness(true);
CoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -2897,7 +2898,7 @@ int SetupWindowsDirect2DRendererInternal(bool hosted)
nativeController->CallbackService()->InstallListener(&listener);
direct2DListener = &listener;
// main
RendererMainDirect2D(hostedController);
RendererMainDirect2D(hostedController, raw);
// uninstall listener
direct2DListener = nullptr;
nativeController->CallbackService()->UninstallListener(&listener);
@@ -2916,12 +2917,17 @@ int SetupWindowsDirect2DRendererInternal(bool hosted)
int SetupWindowsDirect2DRenderer()
{
return SetupWindowsDirect2DRendererInternal(false);
return SetupWindowsDirect2DRendererInternal(false, false);
}
int SetupHostedWindowsDirect2DRenderer()
{
return SetupWindowsDirect2DRendererInternal(true);
return SetupWindowsDirect2DRendererInternal(true, false);
}
int SetupRawWindowsDirect2DRenderer()
{
return SetupWindowsDirect2DRendererInternal(false, true);
}
/***********************************************************************
@@ -5127,24 +5133,27 @@ GuiImageFrameElementRenderer
void GuiImageFrameElementRenderer::UpdateBitmap(IWindowsDirect2DRenderTarget* renderTarget)
{
if(renderTarget && element->GetImage())
if (element->GetImage() && 0 <= element->GetFrameIndex() && element->GetFrameIndex() < element->GetImage()->GetFrameCount())
{
INativeImageFrame* frame=element->GetImage()->GetFrame(element->GetFrameIndex());
bitmap=renderTarget->GetBitmap(frame, element->GetEnabled());
INativeImageFrame* frame = element->GetImage()->GetFrame(element->GetFrameIndex());
if (renderTarget)
{
bitmap = renderTarget->GetBitmap(frame, element->GetEnabled());
}
if (element->GetStretch())
{
minSize=Size(0,0);
minSize = Size(0, 0);
}
else
{
minSize=frame->GetSize();
minSize = frame->GetSize();
}
}
else
{
bitmap=nullptr;
minSize=Size(0, 0);
bitmap = nullptr;
minSize = Size(0, 0);
}
}
@@ -6439,9 +6448,11 @@ NativeMain
using namespace vl::presentation;
using namespace vl::presentation::elements;
extern void GuiRawMain();
extern void GuiApplicationMain();
void RendererMainDirect2D(GuiHostedController* hostedController)
void RendererMainDirect2D(GuiHostedController* hostedController, bool raw)
{
elements_windows_d2d::WindowsDirect2DResourceManager resourceManager;
elements_windows_d2d::SetWindowsDirect2DResourceManager(&resourceManager);
@@ -6470,7 +6481,14 @@ void RendererMainDirect2D(GuiHostedController* hostedController)
elements::GuiDocumentElement::GuiDocumentElementRenderer::Register();
if (hostedController) hostedController->Initialize();
GuiApplicationMain();
if (raw)
{
GuiRawMain();
}
else
{
GuiApplicationMain();
}
if (hostedController) hostedController->Finalize();
}
@@ -8627,7 +8645,7 @@ using namespace vl::presentation;
using namespace vl::presentation::windows;
using namespace vl::presentation::elements_windows_gdi;
int SetupWindowsGDIRendererInternal(bool hosted)
int SetupWindowsGDIRendererInternal(bool hosted, bool raw)
{
InitDpiAwareness(false);
CoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -8657,7 +8675,7 @@ int SetupWindowsGDIRendererInternal(bool hosted)
nativeController->CallbackService()->InstallListener(&listener);
gdiListener = &listener;
// main
RendererMainGDI(hostedController);
RendererMainGDI(hostedController, raw);
// uninstall listener
gdiListener = nullptr;
nativeController->CallbackService()->UninstallListener(&listener);
@@ -8676,12 +8694,17 @@ int SetupWindowsGDIRendererInternal(bool hosted)
int SetupWindowsGDIRenderer()
{
return SetupWindowsGDIRendererInternal(false);
return SetupWindowsGDIRendererInternal(false, false);
}
int SetupHostedWindowsGDIRenderer()
{
return SetupWindowsGDIRendererInternal(true);
return SetupWindowsGDIRendererInternal(true, false);
}
int SetupRawWindowsGDIRenderer()
{
return SetupWindowsGDIRendererInternal(false, true);
}
/***********************************************************************
@@ -9658,25 +9681,25 @@ GuiImageFrameElementRenderer
void GuiImageFrameElementRenderer::UpdateBitmap()
{
if(element->GetImage())
if (element->GetImage() && 0 <= element->GetFrameIndex() && element->GetFrameIndex() < element->GetImage()->GetFrameCount())
{
auto resourceManager=GetWindowsGDIResourceManager();
INativeImageFrame* frame=element->GetImage()->GetFrame(element->GetFrameIndex());
bitmap=resourceManager->GetBitmap(frame, element->GetEnabled());
auto resourceManager = GetWindowsGDIResourceManager();
INativeImageFrame* frame = element->GetImage()->GetFrame(element->GetFrameIndex());
bitmap = resourceManager->GetBitmap(frame, element->GetEnabled());
if (element->GetStretch())
{
minSize=Size(0,0);
minSize = Size(0, 0);
}
else
{
minSize=frame->GetSize();
minSize = frame->GetSize();
}
}
else
{
bitmap=0;
minSize=Size(0, 0);
bitmap = nullptr;
minSize = Size(0, 0);
}
}
@@ -9740,7 +9763,7 @@ GuiImageFrameElementRenderer
}
destination=Rect(x, y, x+minSize.x, y+minSize.y);
}
if(element->GetImage()->GetFormat()==INativeImage::Gif && element->GetFrameIndex()>0)
if(element->GetImage()->GetFormat()==INativeImage::Gif && element->GetFrameIndex()>0)
{
auto resourceManager=GetWindowsGDIResourceManager();
vint max=element->GetFrameIndex();
@@ -13041,9 +13064,10 @@ NativeMain
using namespace vl::presentation;
using namespace vl::presentation::elements;
extern void GuiRawMain();
extern void GuiApplicationMain();
void RendererMainGDI(GuiHostedController* hostedController)
void RendererMainGDI(GuiHostedController* hostedController, bool raw)
{
elements_windows_gdi::WindowsGDIResourceManager resourceManager;
elements_windows_gdi::SetWindowsGDIResourceManager(&resourceManager);
@@ -13072,7 +13096,14 @@ void RendererMainGDI(GuiHostedController* hostedController)
elements::GuiDocumentElement::GuiDocumentElementRenderer::Register();
if (hostedController) hostedController->Initialize();
GuiApplicationMain();
if (raw)
{
GuiRawMain();
}
else
{
GuiApplicationMain();
}
if (hostedController) hostedController->Finalize();
}
+2 -2
View File
@@ -229,7 +229,7 @@ OS Supporting
}
}
extern void RendererMainDirect2D(vl::presentation::GuiHostedController* hostedController);
extern void RendererMainDirect2D(vl::presentation::GuiHostedController* hostedController, bool raw);
#endif
@@ -1512,7 +1512,7 @@ OS Supporting
}
}
extern void RendererMainGDI(vl::presentation::GuiHostedController* hostedController);
extern void RendererMainGDI(vl::presentation::GuiHostedController* hostedController, bool raw);
#endif
+3182 -102
View File
File diff suppressed because it is too large Load Diff
+1292 -479
View File
File diff suppressed because it is too large Load Diff
+127 -72
View File
@@ -2211,6 +2211,13 @@
"attributes": [],
"name": "ElementBoundary",
"members": [{
"$ast": "StructMember",
"name": "id",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "hitTestResult",
"type": {
@@ -2383,42 +2390,10 @@
"name": "ElementMeasurings"
}
}
}, {
"$ast": "UnionDecl",
"attributes": [],
"name": "ElementDescVariant",
"members": [{
"$ast": "UnionMember",
"name": "ElementDesc_SolidBorder"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SinkBorder"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SinkSplitter"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SolidBackground"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_GradientBackground"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_InnerShadow"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_Polygon"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SolidLabel"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_ImageFrame"
}]
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingDom",
"name": "RenderingDomContent",
"members": [{
"$ast": "StructMember",
"name": "hitTestResult",
@@ -2463,6 +2438,26 @@
"$ast": "ReferenceType",
"name": "Rect"
}
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingDom",
"members": [{
"$ast": "StructMember",
"name": "id",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "content",
"type": {
"$ast": "ReferenceType",
"name": "RenderingDomContent"
}
}, {
"$ast": "StructMember",
"name": "children",
@@ -2476,40 +2471,52 @@
}],
"type": "Class"
}, {
"$ast": "StructDecl",
"$ast": "EnumDecl",
"attributes": [],
"name": "RenderingCommand_BeginBoundary",
"name": "RenderingDom_DiffType",
"members": [{
"$ast": "StructMember",
"name": "boundary",
"type": {
"$ast": "ReferenceType",
"name": "ElementBoundary"
}
}],
"type": "Struct"
"$ast": "EnumMember",
"name": "Deleted"
}, {
"$ast": "EnumMember",
"name": "Created"
}, {
"$ast": "EnumMember",
"name": "Modified"
}]
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingCommand_EndBoundary",
"members": [],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingCommand_Element",
"name": "RenderingDom_Diff",
"members": [{
"$ast": "StructMember",
"name": "rendering",
"name": "id",
"type": {
"$ast": "ReferenceType",
"name": "ElementRendering"
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "element",
"name": "diffType",
"type": {
"$ast": "ReferenceType",
"name": "RenderingDom_DiffType"
}
}, {
"$ast": "StructMember",
"name": "content",
"type": {
"$ast": "OptionalType",
"element": {
"$ast": "ReferenceType",
"name": "RenderingDomContent"
}
}
}, {
"$ast": "StructMember",
"name": "children",
"type": {
"$ast": "ArrayType",
"element": {
"$ast": "PrimitiveType",
"type": "Integer"
@@ -2517,24 +2524,82 @@
}
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingDom_DiffsInOrder",
"members": [{
"$ast": "StructMember",
"name": "diffsInOrder",
"type": {
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "RenderingDom_Diff"
}
}
}],
"type": "Struct"
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererRenderDom",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "RenderingDom"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererRenderDomDiff",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "RenderingDom_DiffsInOrder"
}
},
"response": null
}, {
"$ast": "UnionDecl",
"attributes": [],
"name": "RenderingCommand",
"name": "UnitTest_ElementDescVariant",
"members": [{
"$ast": "UnionMember",
"name": "RenderingCommand_BeginBoundary"
"name": "ElementDesc_SolidBorder"
}, {
"$ast": "UnionMember",
"name": "RenderingCommand_EndBoundary"
"name": "ElementDesc_SinkBorder"
}, {
"$ast": "UnionMember",
"name": "RenderingCommand_Element"
"name": "ElementDesc_SinkSplitter"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SolidBackground"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_GradientBackground"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_InnerShadow"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_Polygon"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SolidLabel"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_ImageFrame"
}]
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingFrame",
"name": "UnitTest_RenderingFrame",
"members": [{
"$ast": "StructMember",
"name": "frameId",
@@ -2566,23 +2631,13 @@
"$ast": "MapType",
"element": {
"$ast": "ReferenceType",
"name": "ElementDescVariant"
"name": "UnitTest_ElementDescVariant"
},
"keyType": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}
}, {
"$ast": "StructMember",
"name": "commands",
"type": {
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "RenderingCommand"
}
}
}, {
"$ast": "StructMember",
"name": "root",
@@ -2595,7 +2650,7 @@
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "RenderingTrace",
"name": "UnitTest_RenderingTrace",
"members": [{
"$ast": "StructMember",
"name": "createdElements",
@@ -2633,7 +2688,7 @@
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "RenderingFrame"
"name": "UnitTest_RenderingFrame"
}
}
}],
@@ -37,6 +37,7 @@ struct ElementRendering
struct ElementBoundary
{
var id : int;
var hitTestResult : WindowHitTestResult?;
var cursor: WindowSystemCursorType?;
var bounds : Rect;
@@ -1,62 +1,39 @@
union ElementDescVariant
{
ElementDesc_SolidBorder,
ElementDesc_SinkBorder,
ElementDesc_SinkSplitter,
ElementDesc_SolidBackground,
ElementDesc_GradientBackground,
ElementDesc_InnerShadow,
ElementDesc_Polygon,
ElementDesc_SolidLabel,
ElementDesc_ImageFrame,
}
class RenderingDom
struct RenderingDomContent
{
var hitTestResult: WindowHitTestResult?;
var cursor: WindowSystemCursorType?;
var element: int?;
var bounds: Rect;
var validArea: Rect;
}
class RenderingDom
{
var id: int;
var content: RenderingDomContent;
var children: RenderingDom[];
}
struct RenderingCommand_BeginBoundary
enum RenderingDom_DiffType
{
var boundary: ElementBoundary;
Deleted,
Created,
Modified,
}
struct RenderingCommand_EndBoundary
struct RenderingDom_Diff
{
var id: int;
var diffType: RenderingDom_DiffType;
var content: RenderingDomContent?;
var children: int[];
}
struct RenderingCommand_Element
struct RenderingDom_DiffsInOrder
{
var rendering: ElementRendering;
var element: int?;
var diffsInOrder: RenderingDom_Diff[];
}
union RenderingCommand
{
RenderingCommand_BeginBoundary,
RenderingCommand_EndBoundary,
RenderingCommand_Element,
}
struct RenderingFrame
{
var frameId : int;
var frameName : string?;
var windowSize: WindowSizingConfig;
var elements: ElementDescVariant[int];
var commands: RenderingCommand[];
var root: RenderingDom;
}
struct RenderingTrace
{
var createdElements: RendererType[int];
var imageCreations: ImageCreation[.id];
var imageMetadatas: ImageMetadata[.id];
var frames: RenderingFrame[];
}
message RendererRenderDom { request: RenderingDom; }
message RendererRenderDomDiff { request: RenderingDom_DiffsInOrder; }
@@ -0,0 +1,29 @@
union UnitTest_ElementDescVariant
{
ElementDesc_SolidBorder,
ElementDesc_SinkBorder,
ElementDesc_SinkSplitter,
ElementDesc_SolidBackground,
ElementDesc_GradientBackground,
ElementDesc_InnerShadow,
ElementDesc_Polygon,
ElementDesc_SolidLabel,
ElementDesc_ImageFrame,
}
struct UnitTest_RenderingFrame
{
var frameId : int;
var frameName : string?;
var windowSize: WindowSizingConfig;
var elements: UnitTest_ElementDescVariant[int];
var root: RenderingDom;
}
struct UnitTest_RenderingTrace
{
var createdElements: RendererType[int];
var imageCreations: ImageCreation[.id];
var imageMetadatas: ImageMetadata[.id];
var frames: UnitTest_RenderingFrame[];
}
+2 -1
View File
@@ -4,4 +4,5 @@ Protocol_IO
Protocol_Renderer_BasicElements
Protocol_Renderer_ImageFrame
Protocol_Renderer
Protocol_SyncDom
Protocol_SyncDom
Protocol_UnitTest
+1
View File
@@ -466,6 +466,7 @@ Licensed under https://github.com/vczh-libraries/License
#if defined VCZH_ARM
#include <arm_acle.h>
#elif defined VCZH_MSVC || defined VCZH_GCC
#include <emmintrin.h>
#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.