mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-20 03:11:23 +08:00
Update release
This commit is contained in:
@@ -115,6 +115,9 @@ Helper Functions
|
||||
bounds->SetOwnedElement(element);
|
||||
}
|
||||
break;
|
||||
case remoteprotocol::RendererType::Raw:
|
||||
// Do Nothing
|
||||
break;
|
||||
case remoteprotocol::RendererType::SolidBorder:
|
||||
{
|
||||
auto element = Ptr(GuiSolidBorderElement::Create());
|
||||
|
||||
@@ -851,9 +851,9 @@ IGuiRemoteProtocolMessages (Rendering - Element)
|
||||
vint index = loggedTrace.createdElements->Keys().IndexOf(id);
|
||||
CHECK_ERROR(index != -1, ERROR_MESSAGE_PREFIX L"Renderer with the specified id has not been created.");
|
||||
auto rendererType = loggedTrace.createdElements->Values()[index];
|
||||
if (rendererType == remoteprotocol::RendererType::FocusRectangle)
|
||||
if (rendererType == remoteprotocol::RendererType::FocusRectangle || rendererType == remoteprotocol::RendererType::Raw)
|
||||
{
|
||||
// FocusRectangle does not has a ElementDesc
|
||||
// FocusRectangle or Raw does not have a ElementDesc
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6372,6 +6372,11 @@ WindowsGDIResourceManager
|
||||
return layoutProvider.Obj();
|
||||
}
|
||||
|
||||
Ptr<IGuiGraphicsElement> CreateRawElement() override
|
||||
{
|
||||
return Ptr(GuiDirect2DElement::Create());
|
||||
}
|
||||
|
||||
void NativeWindowCreated(INativeWindow* window)override
|
||||
{
|
||||
auto renderTarget = Ptr(new WindowsDirect2DRenderTarget(window));
|
||||
@@ -12931,6 +12936,11 @@ WindowsGDIResourceManager
|
||||
return layoutProvider.Obj();
|
||||
}
|
||||
|
||||
Ptr<IGuiGraphicsElement> CreateRawElement() override
|
||||
{
|
||||
return Ptr(GuiGDIElement::Create());
|
||||
}
|
||||
|
||||
void NativeWindowCreated(INativeWindow* window)override
|
||||
{
|
||||
auto renderTarget = Ptr(new WindowsGDIRenderTarget(window));
|
||||
|
||||
+126
-54
@@ -125,6 +125,11 @@ External Functions (Basic)
|
||||
return GetCurrentController()->ResourceService()->GetSystemCursor(type);
|
||||
}
|
||||
|
||||
Ptr<elements::IGuiGraphicsElement> GuiRawElement_Constructor()
|
||||
{
|
||||
return GetGuiGraphicsResourceManager()->CreateRawElement();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
External Functions (Elements)
|
||||
***********************************************************************/
|
||||
@@ -37102,6 +37107,11 @@ GuiHostedGraphicsResourceManager
|
||||
{
|
||||
return nativeManager->GetLayoutProvider();
|
||||
}
|
||||
|
||||
Ptr<IGuiGraphicsElement> GuiHostedGraphicsResourceManager::CreateRawElement()
|
||||
{
|
||||
return nativeManager->CreateRawElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39322,6 +39332,7 @@ GuiRemoteGraphicsResourceManager
|
||||
void GuiRemoteGraphicsResourceManager::Initialize()
|
||||
{
|
||||
elements_remoteprotocol::GuiFocusRectangleElementRenderer::Register();
|
||||
elements_remoteprotocol::GuiRawElementRenderer::Register();
|
||||
elements_remoteprotocol::GuiSolidBorderElementRenderer::Register();
|
||||
elements_remoteprotocol::Gui3DBorderElementRenderer::Register();
|
||||
elements_remoteprotocol::Gui3DSplitterElementRenderer::Register();
|
||||
@@ -39368,6 +39379,11 @@ GuiRemoteGraphicsResourceManager
|
||||
{
|
||||
CHECK_FAIL(L"Not Implemented!");
|
||||
}
|
||||
|
||||
Ptr<IGuiGraphicsElement> GuiRemoteGraphicsResourceManager::CreateRawElement()
|
||||
{
|
||||
return Ptr(elements_remoteprotocol::GuiRemoteRawElement::Create());
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -39380,7 +39396,15 @@ namespace vl::presentation::elements_remoteprotocol
|
||||
using namespace remoteprotocol;
|
||||
|
||||
/***********************************************************************
|
||||
GuiSolidBorderElementRenderer
|
||||
GuiRemoteRawElement
|
||||
***********************************************************************/
|
||||
|
||||
GuiRemoteRawElement::GuiRemoteRawElement()
|
||||
{
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
GuiRemoteProtocolElementRenderer
|
||||
***********************************************************************/
|
||||
|
||||
#define RENDERER_TEMPLATE_HEADER template<typename TElement, typename TRenderer, remoteprotocol::RendererType _RendererType>
|
||||
@@ -39501,7 +39525,7 @@ GuiSolidBorderElementRenderer
|
||||
#undef RENDERER_TEMPLATE_HEADER
|
||||
|
||||
/***********************************************************************
|
||||
GuiSolidBorderElementRenderer
|
||||
GuiFocusRectangleElementRenderer
|
||||
***********************************************************************/
|
||||
|
||||
GuiFocusRectangleElementRenderer::GuiFocusRectangleElementRenderer()
|
||||
@@ -39529,6 +39553,35 @@ GuiSolidBorderElementRenderer
|
||||
// nothing to update
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
GuiRawElementRenderer
|
||||
***********************************************************************/
|
||||
|
||||
GuiRawElementRenderer::GuiRawElementRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
bool GuiRawElementRenderer::IsUpdated()
|
||||
{
|
||||
// there is no properties for this element
|
||||
return false;
|
||||
}
|
||||
|
||||
void GuiRawElementRenderer::ResetUpdated()
|
||||
{
|
||||
// nothing to update
|
||||
}
|
||||
|
||||
void GuiRawElementRenderer::OnElementStateChanged()
|
||||
{
|
||||
// nothing to update
|
||||
}
|
||||
|
||||
void GuiRawElementRenderer::SendUpdateElementMessages(bool fullContent)
|
||||
{
|
||||
// nothing to update
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
GuiSolidBorderElementRenderer
|
||||
***********************************************************************/
|
||||
@@ -40500,13 +40553,13 @@ namespace vl::presentation::remoteprotocol::channeling
|
||||
ChannelPackageSemantic
|
||||
***********************************************************************/
|
||||
|
||||
void JsonChannelPack(ChannelPackageSemantic semantic, vint id, const WString& name, Ptr<glr::json::JsonNode> arguments, Ptr<glr::json::JsonObject>& package)
|
||||
void JsonChannelPack(const ChannelPackageInfo& info, Ptr<glr::json::JsonNode> arguments, Ptr<glr::json::JsonObject>& package)
|
||||
{
|
||||
package = Ptr(new glr::json::JsonObject);
|
||||
|
||||
{
|
||||
auto value = Ptr(new glr::json::JsonString);
|
||||
switch (semantic)
|
||||
switch (info.semantic)
|
||||
{
|
||||
case ChannelPackageSemantic::Message:
|
||||
value->content.value = WString::Unmanaged(L"Message");
|
||||
@@ -40530,10 +40583,10 @@ ChannelPackageSemantic
|
||||
package->fields.Add(field);
|
||||
}
|
||||
|
||||
if (id != -1)
|
||||
if (info.id != -1)
|
||||
{
|
||||
auto value = Ptr(new glr::json::JsonNumber);
|
||||
value->content.value = itow(id);
|
||||
value->content.value = itow(info.id);
|
||||
|
||||
auto field = Ptr(new glr::json::JsonObjectField);
|
||||
field->name.value = WString::Unmanaged(L"id");
|
||||
@@ -40543,7 +40596,7 @@ ChannelPackageSemantic
|
||||
|
||||
{
|
||||
auto value = Ptr(new glr::json::JsonString);
|
||||
value->content.value = name;
|
||||
value->content.value = info.name;
|
||||
|
||||
auto field = Ptr(new glr::json::JsonObjectField);
|
||||
field->name.value = WString::Unmanaged(L"name");
|
||||
@@ -40560,7 +40613,7 @@ ChannelPackageSemantic
|
||||
}
|
||||
}
|
||||
|
||||
void JsonChannelUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageSemantic& semantic, vint& id, WString& name, Ptr<glr::json::JsonNode>& arguments)
|
||||
void JsonChannelUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageInfo& info, Ptr<glr::json::JsonNode>& arguments)
|
||||
{
|
||||
#define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::channeling::JsonChannelPack(Ptr<JsonObject>, ProtocolSemantic&, vint&, WString&, Ptr<JsonNode>&)#"
|
||||
|
||||
@@ -40573,19 +40626,19 @@ ChannelPackageSemantic
|
||||
|
||||
if (value->content.value == L"Message")
|
||||
{
|
||||
semantic = ChannelPackageSemantic::Message;
|
||||
info.semantic = ChannelPackageSemantic::Message;
|
||||
}
|
||||
else if (value->content.value == L"Request")
|
||||
{
|
||||
semantic = ChannelPackageSemantic::Request;
|
||||
info.semantic = ChannelPackageSemantic::Request;
|
||||
}
|
||||
else if (value->content.value == L"Response")
|
||||
{
|
||||
semantic = ChannelPackageSemantic::Response;
|
||||
info.semantic = ChannelPackageSemantic::Response;
|
||||
}
|
||||
else if (value->content.value == L"Event")
|
||||
{
|
||||
semantic = ChannelPackageSemantic::Event;
|
||||
info.semantic = ChannelPackageSemantic::Event;
|
||||
}
|
||||
}
|
||||
else if (field->name.value == L"id")
|
||||
@@ -40593,14 +40646,14 @@ ChannelPackageSemantic
|
||||
auto value = field->value.Cast<glr::json::JsonNumber>();
|
||||
CHECK_ERROR(value, ERROR_MESSAGE_PREFIX L"The id field should be a number.");
|
||||
|
||||
id = wtoi(value->content.value);
|
||||
info.id = wtoi(value->content.value);
|
||||
}
|
||||
else if (field->name.value == L"name")
|
||||
{
|
||||
auto value = field->value.Cast<glr::json::JsonString>();
|
||||
CHECK_ERROR(value, ERROR_MESSAGE_PREFIX L"The name field should be a string.");
|
||||
|
||||
name = value->content.value;
|
||||
info.name = value->content.value;
|
||||
}
|
||||
else if (field->name.value == L"arguments")
|
||||
{
|
||||
@@ -40610,10 +40663,10 @@ ChannelPackageSemantic
|
||||
#undef ERROR_MESSAGE_PREFIX
|
||||
}
|
||||
|
||||
void ChannelPackageSemanticUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageSemantic& semantic, vint& id, WString& name)
|
||||
void ChannelPackageSemanticUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageInfo& info)
|
||||
{
|
||||
Ptr<glr::json::JsonNode> arguments;
|
||||
JsonChannelUnpack(package, semantic, id, name, arguments);
|
||||
JsonChannelUnpack(package, info, arguments);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -40660,15 +40713,14 @@ GuiRemoteProtocolFromJsonChannel
|
||||
{
|
||||
#define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::channeling::GuiRemoteProtocolFromJsonChannel::OnReceive(const Ptr<JsonNode>&)#"
|
||||
|
||||
auto semantic = ChannelPackageSemantic::Unknown;
|
||||
vint id = -1;
|
||||
WString name;
|
||||
ChannelPackageInfo info;
|
||||
Ptr<glr::json::JsonNode> jsonArguments;
|
||||
JsonChannelUnpack(package, semantic, id, name, jsonArguments);
|
||||
JsonChannelUnpack(package, info, jsonArguments);
|
||||
BeforeOnReceive(info);
|
||||
|
||||
if (semantic == ChannelPackageSemantic::Event)
|
||||
if (info.semantic == ChannelPackageSemantic::Event)
|
||||
{
|
||||
vint index = onReceiveEventHandlers.Keys().IndexOf(name);
|
||||
vint index = onReceiveEventHandlers.Keys().IndexOf(info.name);
|
||||
if (index == -1)
|
||||
{
|
||||
CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Unrecognized event name");
|
||||
@@ -40678,16 +40730,16 @@ GuiRemoteProtocolFromJsonChannel
|
||||
(this->*onReceiveEventHandlers.Values()[index])(jsonArguments);
|
||||
}
|
||||
}
|
||||
else if (semantic == ChannelPackageSemantic::Response)
|
||||
else if (info.semantic == ChannelPackageSemantic::Response)
|
||||
{
|
||||
vint index = onReceiveResponseHandlers.Keys().IndexOf(name);
|
||||
vint index = onReceiveResponseHandlers.Keys().IndexOf(info.name);
|
||||
if (index == -1)
|
||||
{
|
||||
CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Unrecognized response name");
|
||||
}
|
||||
else
|
||||
{
|
||||
(this->*onReceiveResponseHandlers.Values()[index])(id, jsonArguments);
|
||||
(this->*onReceiveResponseHandlers.Values()[index])(info.id, jsonArguments);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -40702,7 +40754,9 @@ GuiRemoteProtocolFromJsonChannel
|
||||
void GuiRemoteProtocolFromJsonChannel::Request ## NAME()\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Message, -1, WString::Unmanaged(L ## #NAME), {}, package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Message, -1, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, {}, package);\
|
||||
BeforeWrite(info);\
|
||||
channel->Write(package);\
|
||||
}\
|
||||
|
||||
@@ -40710,7 +40764,9 @@ GuiRemoteProtocolFromJsonChannel
|
||||
void GuiRemoteProtocolFromJsonChannel::Request ## NAME(vint id)\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Request, id, WString::Unmanaged(L ## #NAME), {}, package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Request, id, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, {}, package);\
|
||||
BeforeWrite(info);\
|
||||
channel->Write(package);\
|
||||
}\
|
||||
|
||||
@@ -40718,7 +40774,9 @@ GuiRemoteProtocolFromJsonChannel
|
||||
void GuiRemoteProtocolFromJsonChannel::Request ## NAME(const REQUEST& arguments)\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Message, -1, WString::Unmanaged(L ## #NAME), ConvertCustomTypeToJson(arguments), package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Message, -1, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, ConvertCustomTypeToJson(arguments), package);\
|
||||
BeforeWrite(info);\
|
||||
channel->Write(package);\
|
||||
}\
|
||||
|
||||
@@ -40726,7 +40784,9 @@ GuiRemoteProtocolFromJsonChannel
|
||||
void GuiRemoteProtocolFromJsonChannel::Request ## NAME(vint id, const REQUEST& arguments)\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Request, id, WString::Unmanaged(L ## #NAME), ConvertCustomTypeToJson(arguments), package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Request, id, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, ConvertCustomTypeToJson(arguments), package);\
|
||||
BeforeWrite(info);\
|
||||
channel->Write(package);\
|
||||
}\
|
||||
|
||||
@@ -40780,7 +40840,7 @@ GuiRemoteProtocolFromJsonChannel
|
||||
|
||||
void GuiRemoteProtocolFromJsonChannel::ProcessRemoteEvents()
|
||||
{
|
||||
channel->ProcessRemoteEvents();
|
||||
channel->ProcessRemoteEvents();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -40791,7 +40851,9 @@ GuiRemoteJsonChannelFromProtocol
|
||||
void GuiRemoteJsonChannelFromProtocol::On ## NAME()\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Event, -1, WString::Unmanaged(L ## #NAME), {}, package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Event, -1, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, {}, package);\
|
||||
BeforeOnReceive(info);\
|
||||
receiver->OnReceive(package);\
|
||||
}\
|
||||
|
||||
@@ -40799,7 +40861,9 @@ GuiRemoteJsonChannelFromProtocol
|
||||
void GuiRemoteJsonChannelFromProtocol::On ## NAME(const REQUEST& arguments)\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Event, -1, WString::Unmanaged(L ## #NAME), ConvertCustomTypeToJson(arguments), package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Event, -1, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, ConvertCustomTypeToJson(arguments), package);\
|
||||
BeforeOnReceive(info);\
|
||||
receiver->OnReceive(package);\
|
||||
}\
|
||||
|
||||
@@ -40814,7 +40878,9 @@ GuiRemoteJsonChannelFromProtocol
|
||||
void GuiRemoteJsonChannelFromProtocol::Respond ## NAME(vint id, const RESPONSE& arguments)\
|
||||
{\
|
||||
Ptr<glr::json::JsonObject> package;\
|
||||
JsonChannelPack(ChannelPackageSemantic::Response, id, WString::Unmanaged(L ## #NAME), ConvertCustomTypeToJson(arguments), package);\
|
||||
ChannelPackageInfo info{ChannelPackageSemantic::Response, id, WString::Unmanaged(L ## #NAME)};\
|
||||
JsonChannelPack(info, ConvertCustomTypeToJson(arguments), package);\
|
||||
BeforeOnReceive(info);\
|
||||
receiver->OnReceive(package);\
|
||||
}\
|
||||
|
||||
@@ -40895,20 +40961,19 @@ GuiRemoteJsonChannelFromProtocol
|
||||
{
|
||||
#define ERROR_MESSAGE_PREFIX L"vl::presentation::remoteprotocol::channeling::GuiRemoteJsonChannelFromProtocol::Write(const Ptr<JsonNode>&)#"
|
||||
|
||||
auto semantic = ChannelPackageSemantic::Unknown;
|
||||
vint id = -1;
|
||||
WString name;
|
||||
ChannelPackageInfo info;
|
||||
Ptr<glr::json::JsonNode> jsonArguments;
|
||||
JsonChannelUnpack(package, semantic, id, name, jsonArguments);
|
||||
JsonChannelUnpack(package, info, jsonArguments);
|
||||
BeforeWrite(info);
|
||||
|
||||
vint index = writeHandlers.Keys().IndexOf(name);
|
||||
vint index = writeHandlers.Keys().IndexOf(info.name);
|
||||
if (index == -1)
|
||||
{
|
||||
CHECK_FAIL(ERROR_MESSAGE_PREFIX L"Unrecognized request name");
|
||||
}
|
||||
else
|
||||
{
|
||||
(this->*writeHandlers.Values()[index])(id, jsonArguments);
|
||||
(this->*writeHandlers.Values()[index])(info.id, jsonArguments);
|
||||
}
|
||||
|
||||
#undef ERROR_MESSAGE_PREFIX
|
||||
@@ -41679,9 +41744,9 @@ GuiRemoteWindow (events)
|
||||
|
||||
void GuiRemoteWindow::OnControllerConnect()
|
||||
{
|
||||
if (disconnected)
|
||||
if (controllerDisconnected)
|
||||
{
|
||||
disconnected = false;
|
||||
controllerDisconnected = false;
|
||||
}
|
||||
|
||||
sizingConfigInvalidated = true;
|
||||
@@ -41723,7 +41788,7 @@ GuiRemoteWindow (events)
|
||||
|
||||
void GuiRemoteWindow::OnControllerDisconnect()
|
||||
{
|
||||
disconnected = true;
|
||||
controllerDisconnected = true;
|
||||
}
|
||||
|
||||
void GuiRemoteWindow::OnControllerScreenUpdated(const remoteprotocol::ScreenConfig& arguments)
|
||||
@@ -43030,6 +43095,7 @@ namespace vl::presentation::remoteprotocol
|
||||
switch (value)
|
||||
{
|
||||
case ::vl::presentation::remoteprotocol::RendererType::FocusRectangle: node->content.value = WString::Unmanaged(L"FocusRectangle"); break;
|
||||
case ::vl::presentation::remoteprotocol::RendererType::Raw: node->content.value = WString::Unmanaged(L"Raw"); break;
|
||||
case ::vl::presentation::remoteprotocol::RendererType::SolidBorder: node->content.value = WString::Unmanaged(L"SolidBorder"); break;
|
||||
case ::vl::presentation::remoteprotocol::RendererType::SinkBorder: node->content.value = WString::Unmanaged(L"SinkBorder"); break;
|
||||
case ::vl::presentation::remoteprotocol::RendererType::SinkSplitter: node->content.value = WString::Unmanaged(L"SinkSplitter"); break;
|
||||
@@ -43654,6 +43720,7 @@ namespace vl::presentation::remoteprotocol
|
||||
auto jsonNode = node.Cast<glr::json::JsonString>();
|
||||
CHECK_ERROR(jsonNode, ERROR_MESSAGE_PREFIX L"Json node does not match the expected type.");
|
||||
if (jsonNode->content.value == L"FocusRectangle") value = ::vl::presentation::remoteprotocol::RendererType::FocusRectangle; else
|
||||
if (jsonNode->content.value == L"Raw") value = ::vl::presentation::remoteprotocol::RendererType::Raw; else
|
||||
if (jsonNode->content.value == L"SolidBorder") value = ::vl::presentation::remoteprotocol::RendererType::SolidBorder; else
|
||||
if (jsonNode->content.value == L"SinkBorder") value = ::vl::presentation::remoteprotocol::RendererType::SinkBorder; else
|
||||
if (jsonNode->content.value == L"SinkSplitter") value = ::vl::presentation::remoteprotocol::RendererType::SinkSplitter; else
|
||||
@@ -44814,10 +44881,9 @@ namespace vl::presentation::remote_renderer
|
||||
{
|
||||
auto primary = GetCurrentController()->ScreenService()->GetScreen((vint)0);
|
||||
NativeRect screenBounds = primary->GetBounds();
|
||||
NativeRect windowBounds = arguments;
|
||||
windowBounds.x1 = (screenBounds.Width() - windowBounds.Width()) / 2;
|
||||
windowBounds.y1 = (screenBounds.Height() - windowBounds.Height()) / 2;
|
||||
window->SetBounds(windowBounds);
|
||||
auto x = (screenBounds.Width() - arguments.Width()) / 2;
|
||||
auto y = (screenBounds.Height() - arguments.Height()) / 2;
|
||||
window->SetBounds({ {x,y},arguments.GetSize() });
|
||||
|
||||
screen = primary;
|
||||
windowSizingConfig = GetWindowSizingConfig();
|
||||
@@ -45000,6 +45066,9 @@ namespace vl::presentation::remote_renderer
|
||||
case RendererType::FocusRectangle:
|
||||
element = Ptr(GuiFocusRectangleElement::Create());
|
||||
break;
|
||||
case RendererType::Raw:
|
||||
// Do Nothing
|
||||
break;
|
||||
case RendererType::SolidBorder:
|
||||
element = Ptr(GuiSolidBorderElement::Create());
|
||||
break;
|
||||
@@ -45030,15 +45099,18 @@ namespace vl::presentation::remote_renderer
|
||||
default:;
|
||||
}
|
||||
|
||||
element->GetRenderer()->SetRenderTarget(GetGuiGraphicsResourceManager()->GetRenderTarget(window));
|
||||
if (element)
|
||||
{
|
||||
element->GetRenderer()->SetRenderTarget(GetGuiGraphicsResourceManager()->GetRenderTarget(window));
|
||||
|
||||
if (availableElements.Keys().Contains(rc.id))
|
||||
{
|
||||
availableElements.Set(rc.id, element);
|
||||
}
|
||||
else
|
||||
{
|
||||
availableElements.Add(rc.id, element);
|
||||
if (availableElements.Keys().Contains(rc.id))
|
||||
{
|
||||
availableElements.Set(rc.id, element);
|
||||
}
|
||||
else
|
||||
{
|
||||
availableElements.Add(rc.id, element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+61
-27
@@ -7409,6 +7409,11 @@ Resource Manager
|
||||
/// </summary>
|
||||
/// <returns>Returns the layout provider.</returns>
|
||||
virtual IGuiGraphicsLayoutProvider* GetLayoutProvider() = 0;
|
||||
/// <summary>
|
||||
/// Create a raw element based on the current renderer.
|
||||
/// </summary>
|
||||
/// <returns>Returns the created graphics element.</returns>
|
||||
virtual Ptr<IGuiGraphicsElement> CreateRawElement() = 0;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -7477,14 +7482,14 @@ Helpers
|
||||
public:
|
||||
static vint GetElementType()
|
||||
{
|
||||
static vint elementType = -1;
|
||||
static vint elementType = -1;
|
||||
if (elementType == -1)
|
||||
{
|
||||
auto manager = GetGuiGraphicsResourceManager();
|
||||
CHECK_ERROR(manager != nullptr, L"SetGuiGraphicsResourceManager must be called before registering element types.");
|
||||
elementType = manager->RegisterElementType(WString::Unmanaged(TElement::ElementTypeName));
|
||||
}
|
||||
return elementType;
|
||||
return elementType;
|
||||
}
|
||||
|
||||
static TElement* Create()
|
||||
@@ -7755,6 +7760,7 @@ GuiHostedGraphicsResourceManager
|
||||
void RecreateRenderTarget(INativeWindow* window) override;
|
||||
void ResizeRenderTarget(INativeWindow* window) override;
|
||||
IGuiGraphicsLayoutProvider* GetLayoutProvider() override;
|
||||
Ptr<IGuiGraphicsElement> CreateRawElement() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -22255,6 +22261,7 @@ namespace vl::presentation::remoteprotocol
|
||||
enum class RendererType
|
||||
{
|
||||
FocusRectangle,
|
||||
Raw,
|
||||
SolidBorder,
|
||||
SinkBorder,
|
||||
SinkSplitter,
|
||||
@@ -22994,6 +23001,7 @@ GuiRemoteGraphicsResourceManager
|
||||
void RecreateRenderTarget(INativeWindow* window) override;
|
||||
void ResizeRenderTarget(INativeWindow* window) override;
|
||||
IGuiGraphicsLayoutProvider* GetLayoutProvider() override;
|
||||
Ptr<IGuiGraphicsElement> CreateRawElement() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -23036,6 +23044,16 @@ namespace vl::presentation::elements_remoteprotocol
|
||||
virtual void NotifyMinSizeCacheInvalidated() = 0;
|
||||
};
|
||||
|
||||
class GuiRemoteRawElement : public GuiElementBase<GuiRemoteRawElement>
|
||||
{
|
||||
friend class GuiElementBase<GuiRemoteRawElement>;
|
||||
static constexpr const wchar_t* ElementTypeName = L"Raw";
|
||||
protected:
|
||||
|
||||
GuiRemoteRawElement();
|
||||
public:
|
||||
};
|
||||
|
||||
template<typename TElement, typename TRenderer, remoteprotocol::RendererType _RendererType>
|
||||
class GuiRemoteProtocolElementRenderer
|
||||
: public GuiElementRendererBase<TElement, TRenderer, GuiRemoteGraphicsRenderTarget>
|
||||
@@ -23081,6 +23099,18 @@ namespace vl::presentation::elements_remoteprotocol
|
||||
void OnElementStateChanged() override;
|
||||
};
|
||||
|
||||
class GuiRawElementRenderer : public GuiRemoteProtocolElementRenderer<GuiRemoteRawElement, GuiRawElementRenderer, remoteprotocol::RendererType::Raw>
|
||||
{
|
||||
friend class GuiElementRendererBase<GuiRemoteRawElement, GuiRawElementRenderer, GuiRemoteGraphicsRenderTarget>;
|
||||
public:
|
||||
GuiRawElementRenderer();
|
||||
|
||||
bool IsUpdated() override;
|
||||
void ResetUpdated() override;
|
||||
void SendUpdateElementMessages(bool fullContent) override;
|
||||
void OnElementStateChanged() override;
|
||||
};
|
||||
|
||||
class GuiSolidBorderElementRenderer : public GuiRemoteProtocolElementRenderer<GuiSolidBorderElement, GuiSolidBorderElementRenderer, remoteprotocol::RendererType::SolidBorder>
|
||||
{
|
||||
friend class GuiElementRendererBase<GuiSolidBorderElement, GuiSolidBorderElementRenderer, GuiRemoteGraphicsRenderTarget>;
|
||||
@@ -23633,6 +23663,13 @@ Metadata
|
||||
Unknown,
|
||||
};
|
||||
|
||||
struct ChannelPackageInfo
|
||||
{
|
||||
ChannelPackageSemantic semantic = ChannelPackageSemantic::Unknown;
|
||||
vint id = -1;
|
||||
WString name;
|
||||
};
|
||||
|
||||
enum class ChannelAsyncState
|
||||
{
|
||||
Ready,
|
||||
@@ -23648,9 +23685,7 @@ Async
|
||||
|
||||
void ChannelPackageSemanticUnpack(
|
||||
const T& package,
|
||||
ChannelPackageSemantic& semantic,
|
||||
vint& id,
|
||||
WString& name
|
||||
ChannelPackageInfo& info
|
||||
);
|
||||
***********************************************************************/
|
||||
|
||||
@@ -23693,9 +23728,7 @@ void ChannelPackageSemanticUnpack(
|
||||
static_assert(
|
||||
std::is_same_v<void, decltype(ChannelPackageSemanticUnpack(
|
||||
std::declval<const TPackage&>(),
|
||||
std::declval<ChannelPackageSemantic&>(),
|
||||
std::declval<vint&>(),
|
||||
std::declval<WString&>()
|
||||
std::declval<ChannelPackageInfo&>()
|
||||
))>,
|
||||
"ChannelPackageSemanticUnpack must be defined for this TPackage"
|
||||
);
|
||||
@@ -23801,12 +23834,10 @@ void ChannelPackageSemanticUnpack(
|
||||
// If it is a response, unblock Submit()
|
||||
// If it is an event, send to ProcessRemoteEvents()
|
||||
|
||||
auto semantic = ChannelPackageSemantic::Unknown;
|
||||
vint id = -1;
|
||||
WString name;
|
||||
ChannelPackageSemanticUnpack(package, semantic, id, name);
|
||||
ChannelPackageInfo info;
|
||||
ChannelPackageSemanticUnpack(package, info);
|
||||
|
||||
switch (semantic)
|
||||
switch (info.semantic)
|
||||
{
|
||||
case ChannelPackageSemantic::Event:
|
||||
{
|
||||
@@ -23820,7 +23851,7 @@ void ChannelPackageSemanticUnpack(
|
||||
{
|
||||
SPIN_LOCK(lockResponses)
|
||||
{
|
||||
queuedResponses.Add(id, package);
|
||||
queuedResponses.Add(info.id, package);
|
||||
if (AreCurrentPendingRequestGroupSatisfied(false))
|
||||
{
|
||||
eventAutoResponses.Signal();
|
||||
@@ -23863,14 +23894,12 @@ void ChannelPackageSemanticUnpack(
|
||||
requestGroup->connectionCounter = connectionCounter;
|
||||
for (auto&& package : uiPendingPackages)
|
||||
{
|
||||
auto semantic = ChannelPackageSemantic::Unknown;
|
||||
vint id = -1;
|
||||
WString name;
|
||||
ChannelPackageSemanticUnpack(package, semantic, id, name);
|
||||
ChannelPackageInfo info;
|
||||
ChannelPackageSemanticUnpack(package, info);
|
||||
|
||||
if (semantic == ChannelPackageSemantic::Request)
|
||||
if (info.semantic == ChannelPackageSemantic::Request)
|
||||
{
|
||||
requestGroup->requestIds.Add(id);
|
||||
requestGroup->requestIds.Add(info.id);
|
||||
}
|
||||
}
|
||||
SPIN_LOCK(lockResponses)
|
||||
@@ -23958,12 +23987,10 @@ void ChannelPackageSemanticUnpack(
|
||||
for (auto&& event : events)
|
||||
{
|
||||
{
|
||||
auto semantic = ChannelPackageSemantic::Unknown;
|
||||
vint id = -1;
|
||||
WString name;
|
||||
ChannelPackageSemanticUnpack(event, semantic, id, name);
|
||||
ChannelPackageInfo info;
|
||||
ChannelPackageSemanticUnpack(event, info);
|
||||
|
||||
if (name == L"ControllerConnect")
|
||||
if (info.name == L"ControllerConnect")
|
||||
{
|
||||
SPIN_LOCK(lockConnection)
|
||||
{
|
||||
@@ -24120,7 +24147,7 @@ namespace vl::presentation::remoteprotocol::channeling
|
||||
ChannelPackageSemantic
|
||||
***********************************************************************/
|
||||
|
||||
extern void ChannelPackageSemanticUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageSemantic& semantic, vint& id, WString& name);
|
||||
extern void ChannelPackageSemanticUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageInfo& info);
|
||||
|
||||
/***********************************************************************
|
||||
GuiRemoteProtocolFromJsonChannel
|
||||
@@ -24178,6 +24205,9 @@ GuiRemoteProtocolFromJsonChannel
|
||||
GuiRemoteProtocolFromJsonChannel(IJsonChannel* _channel);
|
||||
~GuiRemoteProtocolFromJsonChannel();
|
||||
|
||||
vl::Event<void(const ChannelPackageInfo&)> BeforeWrite;
|
||||
vl::Event<void(const ChannelPackageInfo&)> BeforeOnReceive;
|
||||
|
||||
void Initialize(IGuiRemoteProtocolEvents* _events) override;
|
||||
WString GetExecutablePath() override;
|
||||
void Submit(bool& disconnected) override;
|
||||
@@ -24236,6 +24266,9 @@ GuiRemoteJsonChannelFromProtocol
|
||||
GuiRemoteJsonChannelFromProtocol(IGuiRemoteProtocol* _protocol);
|
||||
~GuiRemoteJsonChannelFromProtocol();
|
||||
|
||||
vl::Event<void(const ChannelPackageInfo&)> BeforeWrite;
|
||||
vl::Event<void(const ChannelPackageInfo&)> BeforeOnReceive;
|
||||
|
||||
void Initialize(IJsonChannelReceiver* _receiver) override;
|
||||
IJsonChannelReceiver* GetReceiver() override;
|
||||
void Write(const Ptr<glr::json::JsonObject>& package) override;
|
||||
@@ -25835,6 +25868,7 @@ External Functions
|
||||
extern Ptr<presentation::INativeImage> INativeImage_Constructor(const WString& path);
|
||||
extern presentation::INativeCursor* INativeCursor_Constructor1();
|
||||
extern presentation::INativeCursor* INativeCursor_Constructor2(presentation::INativeCursor::SystemCursorType type);
|
||||
extern Ptr<presentation::elements::IGuiGraphicsElement> GuiRawElement_Constructor();
|
||||
|
||||
template<typename T>
|
||||
Ptr<T> Element_Constructor()
|
||||
@@ -29618,7 +29652,7 @@ GuiRemoteWindow
|
||||
collections::List<INativeWindowListener*> listeners;
|
||||
INativeWindow::WindowMode windowMode = INativeWindow::Normal;
|
||||
|
||||
bool disconnected = false;
|
||||
bool controllerDisconnected = false;
|
||||
remoteprotocol::WindowSizingConfig remoteWindowSizingConfig;
|
||||
bool sizingConfigInvalidated = false;
|
||||
double scalingX = 1;
|
||||
|
||||
@@ -2553,6 +2553,10 @@ GuiInstanceLoaderManager
|
||||
{
|
||||
return CopyTypeInfo(ctor->GetMethod(0)->GetReturn());
|
||||
}
|
||||
else if (td == description::GetTypeDescriptor<elements::IGuiGraphicsElement>())
|
||||
{
|
||||
return Ptr(new SharedPtrTypeInfo(Ptr(new TypeDescriptorTypeInfo(td, TypeInfoHint::Normal))));
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ptr(new RawPtrTypeInfo(Ptr(new TypeDescriptorTypeInfo(td, TypeInfoHint::Normal))));
|
||||
@@ -8742,6 +8746,7 @@ GuiInstanceLoader_Plugin.cpp
|
||||
default: GuiControl*, GuiGraphicsComposition*
|
||||
GuiInstanceRootObject
|
||||
default: GuiComponent*
|
||||
GuiRawElement
|
||||
GuiInstanceLoader_TemplateControl.h
|
||||
GuiControl
|
||||
GuiInstanceLoader_Compositions.cpp
|
||||
@@ -8929,6 +8934,58 @@ GuiControlInstanceLoader
|
||||
}
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
GuiRawElementInstanceLoader
|
||||
***********************************************************************/
|
||||
|
||||
class GuiRawElementInstanceLoader : public Object, public IGuiInstanceLoader
|
||||
{
|
||||
protected:
|
||||
GlobalStringKey typeName;
|
||||
|
||||
public:
|
||||
GuiRawElementInstanceLoader()
|
||||
{
|
||||
typeName = GlobalStringKey::Get(L"presentation::elements::GuiRawElement");
|
||||
}
|
||||
|
||||
GlobalStringKey GetTypeName()override
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
bool CanCreate(const TypeInfo& typeInfo) override
|
||||
{
|
||||
return typeName == typeInfo.typeName;
|
||||
}
|
||||
|
||||
Ptr<workflow::WfStatement> CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors)override
|
||||
{
|
||||
if (CanCreate(typeInfo))
|
||||
{
|
||||
auto refCreateRawElement = Ptr(new WfChildExpression);
|
||||
refCreateRawElement->parent = GetExpressionFromTypeDescriptor(description::GetTypeDescriptor<IGuiGraphicsElement>());
|
||||
refCreateRawElement->name.value = L"CreateRawElement";
|
||||
|
||||
auto call = Ptr(new WfCallExpression);
|
||||
call->function = refCreateRawElement;
|
||||
|
||||
auto refVariable = Ptr(new WfReferenceExpression);
|
||||
refVariable->name.value = variableName.ToString();
|
||||
|
||||
auto assign = Ptr(new WfBinaryExpression);
|
||||
assign->op = WfBinaryOperator::Assign;
|
||||
assign->first = refVariable;
|
||||
assign->second = call;
|
||||
|
||||
auto stat = Ptr(new WfExpressionStatement);
|
||||
stat->expression = assign;
|
||||
return stat;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
@@ -8982,7 +9039,7 @@ GuiPredefinedInstanceLoadersPlugin
|
||||
|
||||
#define ADD_TEMPLATE_CONTROL(TYPENAME, THEME_NAME)\
|
||||
manager->SetLoader(\
|
||||
Ptr(new GuiTemplateControlInstanceLoader<TYPENAME>(\
|
||||
Ptr(new GuiTemplateControlInstanceLoader<TYPENAME>(\
|
||||
L"presentation::controls::" L ## #TYPENAME,\
|
||||
theme::ThemeName::THEME_NAME\
|
||||
)\
|
||||
@@ -8990,7 +9047,7 @@ GuiPredefinedInstanceLoadersPlugin
|
||||
|
||||
#define ADD_VIRTUAL_CONTROL(VIRTUALTYPENAME, TYPENAME, THEME_NAME)\
|
||||
manager->CreateVirtualType(GlobalStringKey::Get(description::TypeInfo<TYPENAME>::content.typeName),\
|
||||
Ptr(new GuiTemplateControlInstanceLoader<TYPENAME>(\
|
||||
Ptr(new GuiTemplateControlInstanceLoader<TYPENAME>(\
|
||||
L"presentation::controls::Gui" L ## #VIRTUALTYPENAME,\
|
||||
theme::ThemeName::THEME_NAME\
|
||||
)\
|
||||
@@ -8998,7 +9055,7 @@ GuiPredefinedInstanceLoadersPlugin
|
||||
|
||||
#define ADD_VIRTUAL_CONTROL_F(VIRTUALTYPENAME, TYPENAME, THEME_NAME, INIT_FUNCTION)\
|
||||
manager->CreateVirtualType(GlobalStringKey::Get(description::TypeInfo<TYPENAME>::content.typeName),\
|
||||
Ptr(new GuiTemplateControlInstanceLoader<TYPENAME>(\
|
||||
Ptr(new GuiTemplateControlInstanceLoader<TYPENAME>(\
|
||||
L"presentation::controls::Gui" L ## #VIRTUALTYPENAME,\
|
||||
theme::ThemeName::THEME_NAME,\
|
||||
nullptr,\
|
||||
@@ -9006,6 +9063,11 @@ GuiPredefinedInstanceLoadersPlugin
|
||||
)\
|
||||
))
|
||||
|
||||
manager->CreateVirtualType(
|
||||
GlobalStringKey::Get(description::TypeInfo<IGuiGraphicsElement>::content.typeName),
|
||||
Ptr(new GuiRawElementInstanceLoader)
|
||||
);
|
||||
|
||||
manager->SetLoader(Ptr(new GuiControlInstanceLoader));
|
||||
|
||||
/* REAL-CONTROL-TYPE THEME-NAME */
|
||||
|
||||
@@ -3209,6 +3209,7 @@ Type Declaration (Extra)
|
||||
|
||||
BEGIN_INTERFACE_MEMBER_NOPROXY(IGuiGraphicsElement)
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(OwnerComposition)
|
||||
CLASS_MEMBER_STATIC_EXTERNALMETHOD(CreateRawElement, NO_PARAMETER, Ptr<IGuiGraphicsElement>(*)(), vl::reflection::description::GuiRawElement_Constructor)
|
||||
END_INTERFACE_MEMBER(IGuiGraphicsElement)
|
||||
|
||||
BEGIN_CLASS_MEMBER(IGuiGraphicsParagraph)
|
||||
|
||||
@@ -2082,6 +2082,9 @@
|
||||
"members": [{
|
||||
"$ast": "EnumMember",
|
||||
"name": "FocusRectangle"
|
||||
}, {
|
||||
"$ast": "EnumMember",
|
||||
"name": "Raw"
|
||||
}, {
|
||||
"$ast": "EnumMember",
|
||||
"name": "SolidBorder"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
enum RendererType
|
||||
{
|
||||
FocusRectangle,
|
||||
Raw,
|
||||
SolidBorder,
|
||||
SinkBorder,
|
||||
SinkSplitter,
|
||||
|
||||
@@ -619,10 +619,10 @@ Semaphore
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
AString astr = wtoa(name);
|
||||
|
||||
|
||||
if ((internalData->semNamed = sem_open(astr.Buffer(), O_CREAT, 0777, initialCount)) == SEM_FAILED)
|
||||
{
|
||||
delete internalData;
|
||||
|
||||
+6
-2
@@ -1157,13 +1157,17 @@ RegexLexer
|
||||
{
|
||||
public:
|
||||
NOT_COPYABLE(RegexLexer_<T>);
|
||||
|
||||
/// <summary>Create a lexical analyzer by a set of regular expressions. [F:vl.regex.RegexToken.token] will be the index of the matched regular expression in the first argument.</summary>
|
||||
/// <param name="tokens">ALl regular expression, each one represent a kind of tokens.</param>
|
||||
|
||||
/// <param name="tokens">All regular expression, each one represent a kind of tokens.</param>
|
||||
RegexLexer_(const collections::IEnumerable<ObjectString<T>>& tokens);
|
||||
/// <summary>Create a lexical analyzer from definitions storing in a stream. The definition should be serialized by <see cref="Serialize"/>.</summary>
|
||||
/// <param name="inputStream">The stream storing the definition.</param>
|
||||
RegexLexer_(stream::IStream& inputStream);
|
||||
~RegexLexer_() = default;
|
||||
|
||||
/// <summary>Serialize the definition of the lexical analyzer.</summary>
|
||||
/// <param name="outputStream">The stream to store the definition.</param>
|
||||
void Serialize(stream::IStream & outputStream);
|
||||
};
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user