Update release

This commit is contained in:
vczh
2023-04-17 02:49:56 -07:00
parent 46a934ae44
commit 877e499cad
22 changed files with 3961 additions and 2930 deletions
+2 -2
View File
@@ -799,7 +799,7 @@ WindowsForm
}
for(vint i=0;i<listeners.Count();i++)
{
listeners[i]->SysKeyUp(info);
listeners[i]->KeyUp(info);
}
}
break;
@@ -812,7 +812,7 @@ WindowsForm
}
for(vint i=0;i<listeners.Count();i++)
{
listeners[i]->SysKeyDown(info);
listeners[i]->KeyDown(info);
}
}
break;
+324 -233
View File
File diff suppressed because it is too large Load Diff
+92 -63
View File
@@ -2241,16 +2241,6 @@ INativeWindow
/// <param name="info">Detailed information to this message.</param>
virtual void KeyUp(const NativeWindowKeyInfo& info);
/// <summary>
/// Called a system key is pressed.
/// </summary>
/// <param name="info">Detailed information to this message.</param>
virtual void SysKeyDown(const NativeWindowKeyInfo& info);
/// <summary>
/// Called a system key is released.
/// </summary>
/// <param name="info">Detailed information to this message.</param>
virtual void SysKeyUp(const NativeWindowKeyInfo& info);
/// <summary>
/// Called an input character is generated.
/// </summary>
/// <param name="info">Detailed information to this message.</param>
@@ -3809,10 +3799,6 @@ Event Receiver
GuiKeyEvent keyDown;
/// <summary>Key up event.</summary>
GuiKeyEvent keyUp;
/// <summary>System key down event.</summary>
GuiKeyEvent systemKeyDown;
/// <summary>System key up event.</summary>
GuiKeyEvent systemKeyUp;
/// <summary>Preview char input event.</summary>
GuiCharEvent previewCharInput;
/// <summary>Char input event.</summary>
@@ -4426,8 +4412,6 @@ Alt-Combined Shortcut Key Interfaces Helpers
void CloseAltHost();
bool KeyDown(const NativeWindowKeyInfo& info);
bool KeyUp(const NativeWindowKeyInfo& info);
bool SysKeyDown(const NativeWindowKeyInfo& info);
bool SysKeyUp(const NativeWindowKeyInfo& info);
bool Char(const NativeWindowCharInfo& info);
};
}
@@ -4780,8 +4764,6 @@ Host
void KeyDown(const NativeWindowKeyInfo& info)override;
void KeyUp(const NativeWindowKeyInfo& info)override;
void SysKeyDown(const NativeWindowKeyInfo& info)override;
void SysKeyUp(const NativeWindowKeyInfo& info)override;
void Char(const NativeWindowCharInfo& info)override;
bool NeedRefresh()override;
@@ -8103,19 +8085,19 @@ Resource Type Resolver
/// <summary>Get the precompiler for the type resolver.</summary>
/// <returns>Returns null if the type resolve does not support precompiling.</returns>
virtual IGuiResourceTypeResolver_Precompile* Precompile(){ return 0; }
virtual IGuiResourceTypeResolver_Precompile* Precompile(){ return nullptr; }
/// <summary>Get the initializer for the type resolver.</summary>
/// <returns>Returns null if the type resolve does not support initializing.</returns>
virtual IGuiResourceTypeResolver_Initialize* Initialize(){ return 0; }
virtual IGuiResourceTypeResolver_Initialize* Initialize(){ return nullptr; }
/// <summary>Get the object for convert the resource between xml and object.</summary>
/// <returns>Returns null if the type resolver does not have this ability.</returns>
virtual IGuiResourceTypeResolver_DirectLoadXml* DirectLoadXml(){ return 0; }
virtual IGuiResourceTypeResolver_DirectLoadXml* DirectLoadXml(){ return nullptr; }
/// <summary>Get the object for convert the resource between stream and object.</summary>
/// <returns>Returns null if the type resolver does not have this ability.</returns>
virtual IGuiResourceTypeResolver_DirectLoadStream* DirectLoadStream(){ return 0; }
virtual IGuiResourceTypeResolver_DirectLoadStream* DirectLoadStream(){ return nullptr; }
/// <summary>Get the object for convert the resource between the preload type and the current type.</summary>
/// <returns>Returns null if the type resolver does not have this ability.</returns>
virtual IGuiResourceTypeResolver_IndirectLoad* IndirectLoad(){ return 0; }
virtual IGuiResourceTypeResolver_IndirectLoad* IndirectLoad(){ return nullptr; }
};
/// <summary>
@@ -8129,7 +8111,7 @@ Resource Type Resolver
/// Pass 3: Compile
/// Pass 4: Generate instance types with event handler functions to TemporaryClass / Compile animation types
/// Pass 5: Compile
/// Pass 6: Generate instance types with everything to InstanceCtor / Compile animation types
/// Pass 6: Generate instance types with everything to InstanceCtor / Compile animation types / Compile localized strings injection
/// Pass 7: Compile
/// </summary>
class IGuiResourceTypeResolver_Precompile : public virtual IDescriptable, public Description<IGuiResourceTypeResolver_Precompile>
@@ -8148,6 +8130,8 @@ Resource Type Resolver
Instance_GenerateInstanceClass = 6,
Instance_CompileInstanceClass = 7,
Instance_Max = Instance_CompileInstanceClass,
Everything_Max = Instance_Max,
};
enum PassSupport
@@ -8157,13 +8141,10 @@ Resource Type Resolver
PerPass,
};
/// <summary>Get the maximum pass index that the precompiler needs.</summary>
/// <returns>Returns the maximum pass index. The precompiler doesn't not need to response to every pass.</returns>
virtual vint GetMaxPassIndex() = 0;
/// <summary>Get how this resolver supports precompiling.</summary>
/// <param name="passIndex">The pass index.</param>
/// <returns>Returns how this resolver supports precompiling.</returns>
virtual PassSupport GetPassSupport(vint passIndex) = 0;
virtual PassSupport GetPrecompilePassSupport(vint passIndex) = 0;
/// <summary>Precompile the resource item.</summary>
/// <param name="resource">The resource to precompile.</param>
/// <param name="context">The context for precompiling.</param>
@@ -8193,9 +8174,16 @@ Resource Type Resolver
class IGuiResourceTypeResolver_Initialize : public virtual IDescriptable, public Description<IGuiResourceTypeResolver_Initialize>
{
public:
/// <summary>Get the maximum pass index that the initializer needs.</summary>
/// <returns>Returns the maximum pass index. The initializer doesn't not need to response to every pass.</returns>
virtual vint GetMaxPassIndex() = 0;
enum PassNames
{
Workflow_Initialize = 0,
Everything_Max = Workflow_Initialize,
};
/// <summary>Get how this resolver supports precompiling.</summary>
/// <param name="passIndex">The pass index.</param>
/// <returns>Returns how this resolver supports precompiling.</returns>
virtual bool GetInitializePassSupport(vint passIndex) = 0;
/// <summary>Initialize the resource item.</summary>
/// <param name="resource">The resource to initializer.</param>
/// <param name="context">The context for initializing.</param>
@@ -8295,12 +8283,6 @@ Resource Resolver Manager
/// <returns>Returns true if this operation succeeded.</returns>
/// <param name="resolver">The resolver.</param>
virtual bool SetTypeResolver(Ptr<IGuiResourceTypeResolver> resolver) = 0;
/// <summary>Get the maximum precompiling pass index.</summary>
/// <returns>The maximum precompiling pass index.</returns>
virtual vint GetMaxPrecompilePassIndex() = 0;
/// <summary>Get the maximum initializing pass index.</summary>
/// <returns>The maximum initializing pass index.</returns>
virtual vint GetMaxInitializePassIndex() = 0;
/// <summary>Get names of all per resource resolvers for a pass.</summary>
/// <param name="passIndex">The pass index.</param>
/// <param name="names">Names of resolvers</param>
@@ -10462,7 +10444,8 @@ Rich Content Document (style)
static DocumentFontSize Parse(const WString& value);
WString ToString()const;
bool operator==(const DocumentFontSize& value) const = default;
std::partial_ordering operator<=>(const DocumentFontSize&) const = default;
bool operator==(const DocumentFontSize&) const = default;
};
/// <summary>Represents a text style.</summary>
@@ -13788,6 +13771,8 @@ Selectable List Control
void NormalizeSelectedItemIndexStartEnd();
void SetMultipleItemsSelectedSilently(vint start, vint end, bool selected);
void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments);
virtual vint FindItemByVirtualKeyDirection(vint index, compositions::KeyDirection keyDirection);
public:
/// <summary>Create a control with a specified style provider.</summary>
/// <param name="themeName">The theme name for retriving a default control template.</param>
@@ -14631,6 +14616,7 @@ GuiVirtualTreeListControl
void OnItemExpanded(tree::INodeProvider* node)override;
void OnItemCollapsed(tree::INodeProvider* node)override;
vint FindItemByVirtualKeyDirection(vint index, compositions::KeyDirection keyDirection)override;
protected:
tree::NodeItemProvider* nodeItemProvider;
tree::INodeItemView* nodeItemView;
@@ -21037,8 +21023,8 @@ View Models (MessageBox)
{
public:
using Icon = INativeDialogService::MessageBoxIcons;
using ButtonItem = INativeDialogService::MessageBoxButtonsOutput;
using ButtonItemList = collections::List<Ptr<IMessageBoxDialogAction>>;
using ButtonItem = Ptr<IMessageBoxDialogAction>;
using ButtonItemList = collections::List<ButtonItem>;
/// <summary>
/// Get the text to display on the message box.
@@ -21597,10 +21583,16 @@ namespace vl
{
struct SiteValue
{
vint row = 0;
vint column = 0;
vint rowSpan = 1;
vint columnSpan = 1;
vint row = 0;
vint column = 0;
vint rowSpan = 1;
vint columnSpan = 1;
};
class LocalizedStrings
{
public:
static WString FirstOrEmpty(const collections::LazyList<WString>& formats);
};
}
}
@@ -21620,7 +21612,6 @@ Serialization
static presentation::Color GetDefaultValue();
static bool Serialize(const presentation::Color& input, WString& output);
static bool Deserialize(const WString& input, presentation::Color& output);
static IBoxedValue::CompareResult Compare(const presentation::Color& a, const presentation::Color& b);
};
template<>
@@ -21629,7 +21620,6 @@ Serialization
static presentation::DocumentFontSize GetDefaultValue();
static bool Serialize(const presentation::DocumentFontSize& input, WString& output);
static bool Deserialize(const WString& input, presentation::DocumentFontSize& output);
static IBoxedValue::CompareResult Compare(const presentation::DocumentFontSize& a, const presentation::DocumentFontSize& b);
};
template<>
@@ -21638,7 +21628,6 @@ Serialization
static presentation::GlobalStringKey GetDefaultValue();
static bool Serialize(const presentation::GlobalStringKey& input, WString& output);
static bool Deserialize(const WString& input, presentation::GlobalStringKey& output);
static IBoxedValue::CompareResult Compare(const presentation::GlobalStringKey& a, const presentation::GlobalStringKey& b);
};
/***********************************************************************
@@ -21880,7 +21869,8 @@ namespace vl_workflow_global
struct __vwsnf84_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize_;
struct __vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
struct __vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
struct __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_;
struct __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
struct __vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_;
struct __vwsnf8_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_;
struct __vwsnf9_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize_;
struct __vwsno31_GuiFakeDialogServiceUI_gaclib_controls_FilePickerControlConstructor___vwsn_gaclib_controls_FilePickerControl_Initialize_;
@@ -21937,7 +21927,8 @@ namespace vl_workflow_global
class __vwsnc53_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc54_GuiFakeDialogServiceUI_gaclib_controls_SimpleFontDialogWindowConstructor___vwsn_gaclib_controls_SimpleFontDialogWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings_Get__gaclib_controls_IDialogStringsStrings;
class __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings;
class __vwsnc5_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc6_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc7_GuiFakeDialogServiceUI_gaclib_controls_ColorDialogControlConstructor___vwsn_gaclib_controls_ColorDialogControl_Initialize__vl_reflection_description_IValueSubscription;
@@ -22169,12 +22160,13 @@ namespace gaclib_controls
class DialogStrings : public ::vl::Object, public ::vl::reflection::Description<DialogStrings>
{
friend class ::vl_workflow_global::__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings_Get__gaclib_controls_IDialogStringsStrings;
friend class ::vl_workflow_global::__vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<DialogStrings>;
#endif
public:
static ::vl::WString __vwsn_ls_First(const ::vl::collections::LazyList<::vl::WString>& __vwsn_ls_formats);
static ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_ls_en_US_BuildStrings(::vl::Locale __vwsn_ls_locale);
static void Install(::vl::Locale __vwsn_ls_locale, ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_ls_impl);
static ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> Get(::vl::Locale __vwsn_ls_locale);
DialogStrings();
};
@@ -22688,16 +22680,18 @@ namespace gaclib_controls
class MessageBoxButtonTemplateConstructor : public ::vl::Object, public ::vl::reflection::Description<MessageBoxButtonTemplateConstructor>
{
friend class ::vl_workflow_global::__vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
friend struct ::vl_workflow_global::__vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
friend struct ::vl_workflow_global::__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MessageBoxButtonTemplateConstructor>;
#endif
protected:
::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> Action;
::gaclib_controls::MessageBoxButtonTemplate* self;
::vl::presentation::controls::GuiButton* __vwsn_precompile_0;
::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_1;
::vl::presentation::controls::GuiButton* buttonControl;
::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_0;
void __vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize(::gaclib_controls::MessageBoxButtonTemplate* __vwsn_this_);
public:
MessageBoxButtonTemplateConstructor();
@@ -22707,12 +22701,18 @@ namespace gaclib_controls
{
friend class ::gaclib_controls::MessageBoxButtonTemplateConstructor;
friend class ::vl_workflow_global::__vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
friend struct ::vl_workflow_global::__vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
friend struct ::vl_workflow_global::__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MessageBoxButtonTemplate>;
#endif
public:
::vl::presentation::controls::GuiButton* __vwsn_prop_ButtonControl;
::vl::presentation::controls::GuiButton* GetButtonControl();
void SetButtonControl(::vl::presentation::controls::GuiButton* __vwsn_value_);
::vl::Event<void()> ButtonControlChanged;
::vl::WString GetButtonText(::vl::presentation::INativeDialogService::MessageBoxButtonsOutput button, ::vl::Ptr<::gaclib_controls::IDialogStringsStrings> strings);
::vl::WString GetButtonAlt(::vl::presentation::INativeDialogService::MessageBoxButtonsOutput button);
::vl::Ptr<::gaclib_controls::IDialogStringsStrings> __vwsn_prop_Strings;
@@ -22722,18 +22722,20 @@ namespace gaclib_controls
::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> __vwsn_parameter_Action;
::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> GetAction();
MessageBoxButtonTemplate(::vl::Ptr<::vl::presentation::IMessageBoxDialogAction> __vwsn_ctor_parameter_Action);
void __vwsn_instance_ctor_();
~MessageBoxButtonTemplate();
};
class MessageBoxWindowConstructor : public ::vl::Object, public ::vl::reflection::Description<MessageBoxWindowConstructor>
{
friend struct ::vl_workflow_global::__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MessageBoxWindowConstructor>;
#endif
protected:
::gaclib_controls::MessageBoxWindow* self;
::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> ViewModel;
::vl::presentation::compositions::GuiRepeatStackComposition* buttonStack;
::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0;
::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1;
::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_2;
@@ -22749,7 +22751,6 @@ namespace gaclib_controls
::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_12;
::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_13;
::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_14;
::vl::presentation::compositions::GuiRepeatStackComposition* __vwsn_precompile_15;
void __vwsn_gaclib_controls_MessageBoxWindow_Initialize(::gaclib_controls::MessageBoxWindow* __vwsn_this_);
public:
MessageBoxWindowConstructor();
@@ -22758,7 +22759,7 @@ namespace gaclib_controls
class MessageBoxWindow : public ::vl::presentation::controls::GuiWindow, public ::gaclib_controls::MessageBoxWindowConstructor, public ::vl::reflection::Description<MessageBoxWindow>
{
friend class ::gaclib_controls::MessageBoxWindowConstructor;
friend struct ::vl_workflow_global::__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_;
friend struct ::vl_workflow_global::__vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MessageBoxWindow>;
#endif
@@ -22767,6 +22768,7 @@ namespace gaclib_controls
::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> __vwsn_parameter_ViewModel;
::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> GetViewModel();
MessageBoxWindow(::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel> __vwsn_ctor_parameter_ViewModel);
void __vwsn_instance_ctor_();
~MessageBoxWindow();
};
@@ -22866,6 +22868,8 @@ namespace vl_workflow_global
{
public:
::vl::Ptr<::vl::reflection::description::IValueDictionary> __vwsn_ls_DialogStrings;
static GuiFakeDialogServiceUI& Instance();
};
@@ -23582,7 +23586,7 @@ Closures
__vwsnf85_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0);
void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const;
void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const;
};
struct __vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_
@@ -23591,14 +23595,23 @@ Closures
__vwsnf86_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0);
void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const;
};
struct __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_
{
::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0;
__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize_(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0);
void operator()(const ::vl::reflection::description::Value& __vwsn_value_) const;
};
struct __vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_
struct __vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_
{
::gaclib_controls::MessageBoxWindowConstructor* __vwsnthis_0;
__vwsnf87_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_(::gaclib_controls::MessageBoxWindowConstructor* __vwsnctorthis_0);
__vwsnf88_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxWindowConstructor___vwsn_gaclib_controls_MessageBoxWindow_Initialize_(::gaclib_controls::MessageBoxWindowConstructor* __vwsnctorthis_0);
::vl::presentation::templates::GuiTemplate* operator()(const ::vl::reflection::description::Value& __vwsn_viewModel_) const;
};
@@ -24607,6 +24620,24 @@ Closures
__vwsnc55_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0);
::gaclib_controls::MessageBoxButtonTemplate* __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();
bool Open() override;
bool Update() override;
bool Close() override;
};
class __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription : public ::vl::Object, public virtual ::vl::reflection::description::IValueSubscription
{
public:
::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnthis_0;
__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_MessageBoxButtonTemplateConstructor___vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize__vl_reflection_description_IValueSubscription(::gaclib_controls::MessageBoxButtonTemplateConstructor* __vwsnctorthis_0);
::vl::presentation::controls::GuiApplication* __vwsn_bind_cache_0 = nullptr;
::vl::Ptr<::vl::reflection::description::IEventHandler> __vwsn_bind_handler_0_0;
bool __vwsn_bind_opened_ = false;
@@ -24618,10 +24649,10 @@ Closures
bool Close() override;
};
class __vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings_Get__gaclib_controls_IDialogStringsStrings : public ::vl::Object, public virtual ::gaclib_controls::IDialogStringsStrings
class __vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings : public ::vl::Object, public virtual ::gaclib_controls::IDialogStringsStrings
{
public:
__vwsnc56_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings_Get__gaclib_controls_IDialogStringsStrings();
__vwsnc57_GuiFakeDialogServiceUI_gaclib_controls_DialogStrings___vwsn_ls_en_US_BuildStrings__gaclib_controls_IDialogStringsStrings();
::vl::WString Abort() override;
::vl::WString Blue() override;
@@ -25062,8 +25093,6 @@ GuiHostedController
void KeyDown(const NativeWindowKeyInfo& info) override;
void KeyUp(const NativeWindowKeyInfo& info) override;
void SysKeyDown(const NativeWindowKeyInfo& info) override;
void SysKeyUp(const NativeWindowKeyInfo& info) override;
void Char(const NativeWindowCharInfo& info) override;
// =============================================================
+1072 -530
View File
File diff suppressed because it is too large Load Diff
+63 -24
View File
@@ -159,33 +159,32 @@ namespace vl
{
namespace presentation
{
class GuiInstanceLocalizedStrings : public Object, public Description<GuiInstanceLocalizedStrings>
class GuiInstanceLocalizedStringsBase : public Description<GuiInstanceLocalizedStringsBase>
{
public:
struct StringItem
{
public:
WString name;
WString text;
GuiResourceTextPos textPosition;
WString name;
WString text;
GuiResourceTextPos textPosition;
};
struct Strings
{
using StringItemMap = collections::Dictionary<WString, Ptr<StringItem>>;
collections::List<WString> locales;
StringItemMap items;
GuiResourceTextPos tagPosition;
collections::List<WString> locales;
StringItemMap items;
GuiResourceTextPos tagPosition;
WString GetLocalesName();
WString GetLocalesName();
};
WString className;
WString defaultLocale;
collections::List<Ptr<Strings>> strings;
GuiResourceTextPos tagPosition;
collections::List<Ptr<Strings>> strings;
GuiResourceTextPos tagPosition;
public:
using ParameterPair = collections::Pair<Ptr<reflection::description::ITypeInfo>, WString>;
using ParameterList = collections::List<ParameterPair>;
using PositionList = collections::List<vint>;
@@ -193,24 +192,63 @@ namespace vl
struct TextDesc
{
ParameterList parameters;
PositionList positions;
TextList texts;
ParameterList parameters;
PositionList positions;
TextList texts;
};
using TextDescMap = collections::Dictionary<collections::Pair<Ptr<Strings>, WString>, Ptr<TextDesc>>;
static Ptr<GuiInstanceLocalizedStrings> LoadFromXml(Ptr<GuiResourceItem> resource, Ptr<glr::xml::XmlDocument> xml, GuiResourceError::List& errors);
Ptr<glr::xml::XmlElement> SaveToXml();
protected:
static Ptr<Strings> LoadStringsFromXml(Ptr<GuiResourceItem> resource, Ptr<glr::xml::XmlElement> xmlStrings, collections::SortedList<WString>& existingLocales, GuiResourceError::List& errors);
static Ptr<glr::xml::XmlElement> SaveStringsToXml(Ptr<Strings> lss);
static Ptr<TextDesc> ParseLocalizedText(const WString& text, GuiResourceTextPos pos, GuiResourceError::List& errors);
Ptr<Strings> GetDefaultStrings();
WString GetInterfaceTypeName(bool hasNamespace);
static void FillStringsToTextDescMap(Ptr<Strings> lss, TextDescMap& textDescs, GuiResourceError::List& errors);
static void ValidateNamesAgainstDefaultStrings(Ptr<Strings> defaultStrings, Ptr<Strings> lss, GuiResourceError::List& errors);
static void ValidateSignatureAgainstDefaultStrings(Ptr<Strings> defaultStrings, Ptr<Strings> lss, TextDescMap& textDescs, GuiResourceError::List& errors);
static void ValidateAgainstDefaultStrings(Ptr<Strings> defaultStrings, collections::List<Ptr<Strings>>& nonDefaultStrings, TextDescMap& textDescs, GuiResourceError::List& errors);
Ptr<TextDesc> ParseLocalizedText(const WString& text, GuiResourceTextPos pos, GuiResourceError::List& errors);
void Validate(TextDescMap& textDescs, GuiResourcePrecompileContext& precompileContext, GuiResourceError::List& errors);
Ptr<workflow::WfFunctionDeclaration> GenerateFunction(Ptr<TextDesc> textDesc, const WString& functionName, workflow::WfFunctionKind functionKind);
Ptr<workflow::WfExpression> GenerateStrings(TextDescMap& textDescs, Ptr<Strings> ls);
Ptr<workflow::WfModule> Compile(GuiResourcePrecompileContext& precompileContext, const WString& moduleName, GuiResourceError::List& errors);
static WString GetInterfaceTypeName(const WString& className, bool hasNamespace);
static WString GenerateStringsCppName(Ptr<Strings> lss);
static Ptr<workflow::WfFunctionDeclaration> GenerateTextDescFunctionHeader(Ptr<TextDesc> textDesc, const WString& functionName, workflow::WfFunctionKind functionKind);
static Ptr<workflow::WfExpression> GenerateTextDescArgumentFormatting(Ptr<description::ITypeInfo> type, const WString& function, vint argumentIndex);
static Ptr<workflow::WfBlockStatement> GenerateTextDescFunctionBody(Ptr<TextDesc> textDesc);
static Ptr<workflow::WfExpression> GenerateStringsConstructor(const WString& interfaceFullName, TextDescMap& textDescs, Ptr<Strings> lss);
static Ptr<workflow::WfFunctionDeclaration> GenerateBuildStringsFunction(const WString& interfaceFullName, TextDescMap& textDescs, Ptr<Strings> lss);
static Ptr<workflow::WfBlockStatement> GenerateStaticInit(const WString& stringsClassWithoutNs, const WString& installClassFullName, collections::List<Ptr<Strings>>& strings);
};
class GuiInstanceLocalizedStrings : public GuiInstanceLocalizedStringsBase, public Description<GuiInstanceLocalizedStrings>
{
public:
WString className;
WString defaultLocale;
Ptr<Strings> defaultStrings;
public:
static Ptr<GuiInstanceLocalizedStrings> LoadFromXml(Ptr<GuiResourceItem> resource, Ptr<glr::xml::XmlDocument> xml, GuiResourceError::List& errors);
Ptr<glr::xml::XmlElement> SaveToXml();
Ptr<workflow::WfFunctionDeclaration> GenerateInstallFunction(const WString& cacheName);
Ptr<workflow::WfFunctionDeclaration> GenerateGetFunction(const WString& cacheName);
Ptr<workflow::WfModule> Compile(GuiResourcePrecompileContext& precompileContext, const WString& moduleName, GuiResourceError::List& errors);
};
class GuiInstanceLocalizedStringsInjection : public GuiInstanceLocalizedStringsBase, public Description<GuiInstanceLocalizedStringsInjection>
{
public:
WString className;
WString injectIntoClassName;
public:
static Ptr<GuiInstanceLocalizedStringsInjection> LoadFromXml(Ptr<GuiResourceItem> resource, Ptr<glr::xml::XmlDocument> xml, GuiResourceError::List& errors);
Ptr<glr::xml::XmlElement> SaveToXml();
void DecompileDefaultStrings(description::ITypeDescriptor* td, Ptr<Strings> defaultStrings, TextDescMap& textDescs, GuiResourceError::List& errors);
Ptr<workflow::WfModule> Compile(GuiResourcePrecompileContext& precompileContext, const WString& moduleName, GuiResourceError::List& errors);
};
}
}
@@ -1101,6 +1139,7 @@ WorkflowCompiler (Compile)
***********************************************************************/
extern Ptr<workflow::WfModule> Workflow_CreateModuleWithUsings(Ptr<GuiInstanceContext> context, const WString& moduleName);
extern WString Workflow_InstallWithClass(const WString& className, Ptr<workflow::WfModule> module, Ptr<workflow::WfDeclaration> decl);
extern Ptr<workflow::WfClassDeclaration> Workflow_InstallClass(const WString& className, Ptr<workflow::WfModule> module);
extern Ptr<workflow::WfBlockStatement> Workflow_InstallCtorClass(types::ResolvingResult& resolvingResult, Ptr<workflow::WfModule> module);
+25 -11
View File
@@ -52,7 +52,7 @@ GuiInstanceSharedScript
context = Ptr(new WfRuntimeGlobalContext(assembly));
LoadFunction<void()>(context, L"<initialize>")();
}
#else
#endif
if (initializeContext)
{
if (assembly->typeImpl)
@@ -63,7 +63,6 @@ GuiInstanceSharedScript
}
}
}
#endif
return true;
}
@@ -77,7 +76,7 @@ GuiInstanceSharedScript
{
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
context = nullptr;
#else
#endif
if (assembly && assembly->typeImpl)
{
if (auto tm = GetGlobalTypeManager())
@@ -85,7 +84,6 @@ GuiInstanceSharedScript
tm->RemoveTypeLoader(assembly->typeImpl);
}
}
#endif
}
/***********************************************************************
@@ -114,9 +112,15 @@ Compiled Workflow Type Resolver (Workflow)
return true;
}
vint GetMaxPassIndex()override
bool GetInitializePassSupport(vint passIndex)override
{
return 1;
switch (passIndex)
{
case Workflow_Initialize:
return true;
default:
return false;
}
}
void Initialize(Ptr<GuiResourceItem> resource, GuiResourceInitializeContext& context, GuiResourceError::List& errors)override
@@ -259,6 +263,10 @@ Type Declaration
STRUCT_MEMBER(columnSpan)
END_STRUCT_MEMBER(SiteValue)
BEGIN_CLASS_MEMBER(LocalizedStrings)
CLASS_MEMBER_STATIC_METHOD(FirstOrEmpty, {L"formats"})
END_CLASS_MEMBER(LocalizedStrings)
BEGIN_STRUCT_MEMBER(Color)
valueType = Ptr(new SerializableValueType<Color>);
serializableType = Ptr(new SerializableType<Color>);
@@ -1256,8 +1264,6 @@ Type Declaration (Class)
CLASS_MEMBER_GUIEVENT_COMPOSITION(previewKey)
CLASS_MEMBER_GUIEVENT_COMPOSITION(keyDown)
CLASS_MEMBER_GUIEVENT_COMPOSITION(keyUp)
CLASS_MEMBER_GUIEVENT_COMPOSITION(systemKeyDown)
CLASS_MEMBER_GUIEVENT_COMPOSITION(systemKeyUp)
CLASS_MEMBER_GUIEVENT_COMPOSITION(previewCharInput)
CLASS_MEMBER_GUIEVENT_COMPOSITION(charInput)
CLASS_MEMBER_GUIEVENT_COMPOSITION(gotFocus)
@@ -4041,8 +4047,9 @@ namespace vl
BEGIN_CLASS_MEMBER(::gaclib_controls::DialogStrings)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::gaclib_controls::DialogStrings>(), NO_PARAMETER)
CLASS_MEMBER_STATIC_METHOD(__vwsn_ls_First, { L"__vwsn_ls_formats" })
CLASS_MEMBER_STATIC_METHOD(__vwsn_ls_en_US_BuildStrings, { L"__vwsn_ls_locale" })
CLASS_MEMBER_STATIC_METHOD(Get, { L"__vwsn_ls_locale" })
CLASS_MEMBER_STATIC_METHOD(Install, { L"__vwsn_ls_locale" _ L"__vwsn_ls_impl" })
END_CLASS_MEMBER(::gaclib_controls::DialogStrings)
BEGIN_CLASS_MEMBER(::gaclib_controls::FileDialogWindow)
@@ -4338,15 +4345,21 @@ namespace vl
CLASS_MEMBER_BASE(::vl::presentation::templates::GuiControlTemplate)
CLASS_MEMBER_BASE(::gaclib_controls::MessageBoxButtonTemplateConstructor)
CLASS_MEMBER_CONSTRUCTOR(::gaclib_controls::MessageBoxButtonTemplate*(::vl::Ptr<::vl::presentation::IMessageBoxDialogAction>), { L"__vwsn_ctor_parameter_Action" })
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetAction, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetButtonAlt, { L"button" })
CLASS_MEMBER_METHOD(GetButtonControl, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetButtonText, { L"button" _ L"strings" })
CLASS_MEMBER_METHOD(GetStrings, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetButtonControl, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetStrings, { L"__vwsn_value_" })
CLASS_MEMBER_EVENT(ButtonControlChanged)
CLASS_MEMBER_EVENT(StringsChanged)
CLASS_MEMBER_FIELD(__vwsn_parameter_Action)
CLASS_MEMBER_FIELD(__vwsn_prop_ButtonControl)
CLASS_MEMBER_FIELD(__vwsn_prop_Strings)
CLASS_MEMBER_PROPERTY_READONLY(Action, GetAction)
CLASS_MEMBER_PROPERTY_EVENT_READONLY(ButtonControl, GetButtonControl, ButtonControlChanged)
CLASS_MEMBER_PROPERTY_EVENT(Strings, GetStrings, SetStrings, StringsChanged)
END_CLASS_MEMBER(::gaclib_controls::MessageBoxButtonTemplate)
@@ -4355,8 +4368,8 @@ namespace vl
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::gaclib_controls::MessageBoxButtonTemplateConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_gaclib_controls_MessageBoxButtonTemplate_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(Action)
CLASS_MEMBER_FIELD(buttonControl)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::gaclib_controls::MessageBoxButtonTemplateConstructor)
@@ -4364,6 +4377,7 @@ namespace vl
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow)
CLASS_MEMBER_BASE(::gaclib_controls::MessageBoxWindowConstructor)
CLASS_MEMBER_CONSTRUCTOR(::gaclib_controls::MessageBoxWindow*(::vl::Ptr<::vl::presentation::IMessageBoxDialogViewModel>), { L"__vwsn_ctor_parameter_ViewModel" })
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetIcon, { L"icon" })
CLASS_MEMBER_METHOD(GetViewModel, NO_PARAMETER)
CLASS_MEMBER_FIELD(__vwsn_parameter_ViewModel)
@@ -4381,7 +4395,6 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_12)
CLASS_MEMBER_FIELD(__vwsn_precompile_13)
CLASS_MEMBER_FIELD(__vwsn_precompile_14)
CLASS_MEMBER_FIELD(__vwsn_precompile_15)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
@@ -4391,6 +4404,7 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_8)
CLASS_MEMBER_FIELD(__vwsn_precompile_9)
CLASS_MEMBER_FIELD(ViewModel)
CLASS_MEMBER_FIELD(buttonStack)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::gaclib_controls::MessageBoxWindowConstructor)
+1
View File
@@ -109,6 +109,7 @@ Type List (Basic)
#define GUIREFLECTIONBASIC_TYPELIST(F)\
F(presentation::helper_types::SiteValue)\
F(presentation::helper_types::LocalizedStrings)\
F(presentation::Color)\
F(presentation::Alignment)\
F(presentation::AxisDirection)\
+1
View File
@@ -5791,6 +5791,7 @@ CheckMergeTrace
}
else
{
// TODO: check if last is in the same thread and is or after the merge trace
last = GetTrace(lastPostfix.trace);
ta->lastTrace = last;
ta->postfix = lastPostfix.ins;
+323 -481
View File
File diff suppressed because it is too large Load Diff
+221 -67
View File
@@ -775,6 +775,19 @@ namespace vl
Value
***********************************************************************/
enum class PredefinedBoxableType : vint
{
PBT_Unknown = -1,
PBT_S8, PBT_S16, PBT_S32, PBT_S64,
PBT_U8, PBT_U16, PBT_U32, PBT_U64,
PBT_F32, PBT_F64,
PBT_BOOL,
PBT_WCHAR,
PBT_STRING,
PBT_LOCALE,
PBT_DATETIME,
};
class IBoxedValue : public virtual IDescriptable, public Description<IBoxedValue>
{
public:
@@ -786,6 +799,7 @@ Value
NotComparable,
};
virtual PredefinedBoxableType GetBoxableType() = 0;
virtual Ptr<IBoxedValue> Copy() = 0;
virtual CompareResult ComparePrimitive(Ptr<IBoxedValue> boxedValue) = 0;
};
@@ -833,7 +847,7 @@ Value
Value(const Value& value);
Value& operator=(const Value& value);
friend std::strong_ordering operator<=>(const Value& a, const Value& b);
friend std::partial_ordering operator<=>(const Value& a, const Value& b);
friend bool operator==(const Value& a, const Value& b) { return (a <=> b) == 0; }
/// <summary>Find out how the value is stored.</summary>
@@ -1894,39 +1908,39 @@ namespace vl
ValueType
***********************************************************************/
namespace pbt_selector
{
template<PredefinedBoxableType _Value>
struct SelectorBase { static constexpr PredefinedBoxableType Value = _Value; };
template<typename T> struct Selector : SelectorBase<PredefinedBoxableType::PBT_Unknown> {};
template<> struct Selector<vint8_t> : SelectorBase<PredefinedBoxableType::PBT_S8> {};
template<> struct Selector<vint16_t> : SelectorBase<PredefinedBoxableType::PBT_S16> {};
template<> struct Selector<vint32_t> : SelectorBase<PredefinedBoxableType::PBT_S32> {};
template<> struct Selector<vint64_t> : SelectorBase<PredefinedBoxableType::PBT_S64> {};
template<> struct Selector<vuint8_t> : SelectorBase<PredefinedBoxableType::PBT_U8> {};
template<> struct Selector<vuint16_t> : SelectorBase<PredefinedBoxableType::PBT_U16> {};
template<> struct Selector<vuint32_t> : SelectorBase<PredefinedBoxableType::PBT_U32> {};
template<> struct Selector<vuint64_t> : SelectorBase<PredefinedBoxableType::PBT_U64> {};
template<> struct Selector<float> : SelectorBase<PredefinedBoxableType::PBT_F32> {};
template<> struct Selector<double> : SelectorBase<PredefinedBoxableType::PBT_F64> {};
template<> struct Selector<bool> : SelectorBase<PredefinedBoxableType::PBT_BOOL> {};
template<> struct Selector<wchar_t> : SelectorBase<PredefinedBoxableType::PBT_WCHAR> {};
template<> struct Selector<WString> : SelectorBase<PredefinedBoxableType::PBT_STRING> {};
template<> struct Selector<Locale> : SelectorBase<PredefinedBoxableType::PBT_LOCALE> {};
template<> struct Selector<DateTime> : SelectorBase<PredefinedBoxableType::PBT_DATETIME> {};
}
class IValueType : public virtual IDescriptable, public Description<IValueType>
{
public:
template<typename T>
class TypedBox : public IBoxedValue
{
private:
template<typename U = T>
static CompareResult ComparePrimitiveInternal(const U& a, const U& b, std::enable_if_t<sizeof(decltype(&TypedValueSerializerProvider<U>::Compare)) >= 0, vint>)
{
return TypedValueSerializerProvider<U>::Compare(a, b);
}
template<typename U = T>
static CompareResult ComparePrimitiveInternal(const U& a, const U& b, double)
{
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdynamic-class-memaccess"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
auto result = memcmp(&a, &b, sizeof(U));
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
if (result < 0) return IBoxedValue::Smaller;
if (result > 0) return IBoxedValue::Greater;
return IBoxedValue::Equal;
}
public:
T value;
@@ -1940,6 +1954,11 @@ ValueType
{
}
PredefinedBoxableType GetBoxableType()override
{
return pbt_selector::Selector<T>::Value;
}
Ptr<IBoxedValue> Copy()override
{
return Ptr(new TypedBox<T>(value));
@@ -1949,17 +1968,27 @@ ValueType
{
if (auto typedBox = boxedValue.Cast<TypedBox<T>>())
{
return ComparePrimitiveInternal(value, typedBox->value, (vint)0);
}
else
{
return IBoxedValue::NotComparable;
if constexpr (std::three_way_comparable<T, std::strong_ordering>)
{
auto r = value <=> typedBox->value;
if (r < 0) return IBoxedValue::Smaller;
if (r > 0) return IBoxedValue::Greater;
return IBoxedValue::Equal;
}
else if constexpr (std::three_way_comparable<T, std::partial_ordering>)
{
auto r = value <=> typedBox->value;
if (r == std::partial_ordering::unordered) return IBoxedValue::NotComparable;
if (r < 0) return IBoxedValue::Smaller;
if (r > 0) return IBoxedValue::Greater;
return IBoxedValue::Equal;
}
}
return IBoxedValue::NotComparable;
}
};
virtual Value CreateDefault() = 0;
virtual IBoxedValue::CompareResult Compare(const Value& a, const Value& b) = 0;
};
class IEnumType : public virtual IDescriptable, public Description<IEnumType>
@@ -2793,6 +2822,164 @@ namespace vl
#endif
/***********************************************************************
.\PREDEFINED\TYPEDVALUESERIALIZERPROVIDER.H
***********************************************************************/
/***********************************************************************
Author: Zihan Chen (vczh)
Licensed under https://github.com/vczh-libraries/License
***********************************************************************/
#ifndef VCZH_REFLECTION_TYPES_TYPEDVALUESERIALIZERPROVIDER
#define VCZH_REFLECTION_TYPES_TYPEDVALUESERIALIZERPROVIDER
namespace vl
{
namespace reflection
{
namespace description
{
/***********************************************************************
Signed Types
***********************************************************************/
template<typename T, T MinValue, T MaxValue>
struct TypedValueSerializerProvider_Signed
{
static T GetDefaultValue()
{
return 0;
}
static bool Serialize(const T& input, WString& output)
{
output = i64tow(input);
return true;
}
static bool Deserialize(const WString& input, T& output)
{
bool success = false;
vint64_t result = wtoi64_test(input, success);
if (!success) return false;
if (result < MinValue || result > MaxValue) return false;
output = (T)result;
return true;
}
};
/***********************************************************************
Unsigned Types
***********************************************************************/
template<typename T, T MaxValue>
struct TypedValueSerializerProvider_Unsigned
{
static T GetDefaultValue()
{
return 0;
}
static bool Serialize(const T& input, WString& output)
{
output = u64tow(input);
return true;
}
static bool Deserialize(const WString& input, T& output)
{
bool success = false;
vuint64_t result = wtou64_test(input, success);
if (!success) return false;
if (result > MaxValue) return false;
output = (T)result;
return true;
}
};
/***********************************************************************
Floating Point Types
***********************************************************************/
template<typename T, T MaxValue>
struct TypedValueSerializerProvider_FloatingPoint
{
static T GetDefaultValue()
{
return 0;
}
static bool Serialize(const T& input, WString& output)
{
output = ftow(input);
if (output == L"-0") output = L"0";
return true;
}
static bool Deserialize(const WString& input, T& output)
{
bool success = false;
double result = wtof_test(input, success);
if (!success) return false;
if (result < -MaxValue || result > MaxValue) return false;
output = (T)result;
return true;
}
};
/***********************************************************************
Serializable Types
***********************************************************************/
#define DEFINE_SIGNED_TVSP(TYPENAME, MINVALUE, MAXVALUE)\
template<> struct TypedValueSerializerProvider<TYPENAME> : TypedValueSerializerProvider_Signed<TYPENAME, MINVALUE, MAXVALUE> {};\
DEFINE_SIGNED_TVSP(vint8_t, _I8_MIN, _I8_MAX)
DEFINE_SIGNED_TVSP(vint16_t, _I16_MIN, _I16_MAX)
DEFINE_SIGNED_TVSP(vint32_t, _I32_MIN, _I32_MAX)
DEFINE_SIGNED_TVSP(vint64_t, _I64_MIN, _I64_MAX)
#undef DEFINE_SIGNED_TVSP
#define DEFINE_UNSIGNED_TVSP(TYPENAME, MAXVALUE)\
template<> struct TypedValueSerializerProvider<TYPENAME> : TypedValueSerializerProvider_Unsigned<TYPENAME, MAXVALUE> {};\
DEFINE_UNSIGNED_TVSP(vuint8_t, _UI8_MAX)
DEFINE_UNSIGNED_TVSP(vuint16_t, _UI16_MAX)
DEFINE_UNSIGNED_TVSP(vuint32_t, _UI32_MAX)
DEFINE_UNSIGNED_TVSP(vuint64_t, _UI64_MAX)
#undef DEFINE_UNSIGNED_TVSP
#define DEFINE_FLOAT_TVSP(TYPENAME, MAXVALUE)\
template<> struct TypedValueSerializerProvider<TYPENAME> : TypedValueSerializerProvider_FloatingPoint<TYPENAME, MAXVALUE> {};\
DEFINE_FLOAT_TVSP(float, (float)FLT_MAX)
DEFINE_FLOAT_TVSP(double, (double)DBL_MAX)
#undef DEFINE_FLOAT_TVSP
#define DEFINE_TVSP(TYPENAME)\
template<>\
struct TypedValueSerializerProvider<TYPENAME>\
{\
static TYPENAME GetDefaultValue();\
static bool Serialize(const TYPENAME& input, WString& output);\
static bool Deserialize(const WString& input, TYPENAME& output);\
};\
DEFINE_TVSP(bool)
DEFINE_TVSP(wchar_t)
DEFINE_TVSP(WString)
DEFINE_TVSP(Locale)
DEFINE_TVSP(DateTime)
#undef DEFINE_TYPED_VALUE_SERIALIZER_PROVIDER
}
}
}
#endif
/***********************************************************************
.\PREDEFINED\PREDEFINEDTYPES.H
***********************************************************************/
@@ -4262,13 +4449,6 @@ PrimitiveTypeDescriptor
{
return BoxValue<T>(TypedValueSerializerProvider<T>::GetDefaultValue());
}
IBoxedValue::CompareResult Compare(const Value& a, const Value& b)override
{
auto va = UnboxValue<T>(a);
auto vb = UnboxValue<T>(b);
return TypedValueSerializerProvider<T>::Compare(va, vb);
}
};
template<typename T>
@@ -4319,15 +4499,6 @@ EnumTypeDescriptor
{
return BoxValue<T>(static_cast<T>(0));
}
IBoxedValue::CompareResult Compare(const Value& a, const Value& b)override
{
auto ea = static_cast<vuint64_t>(UnboxValue<T>(a));
auto eb = static_cast<vuint64_t>(UnboxValue<T>(b));
if (ea < eb) return IBoxedValue::Smaller;
if (ea > eb)return IBoxedValue::Greater;
return IBoxedValue::Equal;
}
};
template<typename T, bool Flag>
@@ -4413,11 +4584,6 @@ StructTypeDescriptor
{
return BoxValue<T>(T{});
}
IBoxedValue::CompareResult Compare(const Value& a, const Value& b)override
{
return IBoxedValue::NotComparable;
}
};
template<typename T, TypeDescriptorFlags TDFlags>
@@ -7641,18 +7807,6 @@ Predefined Types
#endif
#define DEFINE_TYPED_VALUE_SERIALIZER_PROVIDER(TYPENAME)\
template<>\
struct TypedValueSerializerProvider<TYPENAME>\
{\
static TYPENAME GetDefaultValue();\
static bool Serialize(const TYPENAME& input, WString& output);\
static bool Deserialize(const WString& input, TYPENAME& output);\
static IBoxedValue::CompareResult Compare(const TYPENAME& a, const TYPENAME& b);\
};\
REFLECTION_PREDEFINED_SERIALIZABLE_TYPES(DEFINE_TYPED_VALUE_SERIALIZER_PROVIDER)
#undef DEFINE_TYPED_VALUE_SERIALIZER_PROVIDER
/***********************************************************************
File diff suppressed because it is too large Load Diff
+120 -83
View File
@@ -156,6 +156,7 @@ namespace vl::workflow
class WfStateSwitchCase;
class WfStateSwitchStatement;
class WfStatement;
class WfStaticInitDeclaration;
class WfStringExpression;
class WfStructDeclaration;
class WfStructMember;
@@ -484,6 +485,7 @@ namespace vl::workflow
virtual void Visit(WfVariableDeclaration* node) = 0;
virtual void Visit(WfEventDeclaration* node) = 0;
virtual void Visit(WfPropertyDeclaration* node) = 0;
virtual void Visit(WfStaticInitDeclaration* node) = 0;
virtual void Visit(WfConstructorDeclaration* node) = 0;
virtual void Visit(WfDestructorDeclaration* node) = 0;
virtual void Visit(WfClassDeclaration* node) = 0;
@@ -647,6 +649,14 @@ namespace vl::workflow
void Accept(WfDeclaration::IVisitor* visitor) override;
};
class WfStaticInitDeclaration : public WfDeclaration, vl::reflection::Description<WfStaticInitDeclaration>
{
public:
vl::Ptr<WfStatement> statement;
void Accept(WfDeclaration::IVisitor* visitor) override;
};
class WfBaseConstructorCall : public vl::glr::ParsingAstBase, vl::reflection::Description<WfBaseConstructorCall>
{
public:
@@ -1494,6 +1504,7 @@ namespace vl::reflection::description
DECL_TYPE_INFO(vl::workflow::WfVariableDeclaration)
DECL_TYPE_INFO(vl::workflow::WfEventDeclaration)
DECL_TYPE_INFO(vl::workflow::WfPropertyDeclaration)
DECL_TYPE_INFO(vl::workflow::WfStaticInitDeclaration)
DECL_TYPE_INFO(vl::workflow::WfClassKind)
DECL_TYPE_INFO(vl::workflow::WfConstructorType)
DECL_TYPE_INFO(vl::workflow::WfBaseConstructorCall)
@@ -1935,6 +1946,11 @@ namespace vl::reflection::description
INVOKE_INTERFACE_PROXY(Visit, node);
}
void Visit(vl::workflow::WfStaticInitDeclaration* node) override
{
INVOKE_INTERFACE_PROXY(Visit, node);
}
void Visit(vl::workflow::WfConstructorDeclaration* node) override
{
INVOKE_INTERFACE_PROXY(Visit, node);
@@ -2693,6 +2709,14 @@ namespace vl::workflow::builder
MakeStateSwitchStatement& type(WfStateSwitchType value);
};
class MakeStaticInitDeclaration : public vl::glr::ParsingAstBuilder<WfStaticInitDeclaration>
{
public:
MakeStaticInitDeclaration& statement(const vl::Ptr<WfStatement>& value);
MakeStaticInitDeclaration& attributes(const vl::Ptr<WfAttribute>& value);
MakeStaticInitDeclaration& name(const vl::WString& value);
};
class MakeStringExpression : public vl::glr::ParsingAstBuilder<WfStringExpression>
{
public:
@@ -2964,6 +2988,7 @@ namespace vl::workflow::copy_visitor
void CopyFields(WfStateSwitchCase* from, WfStateSwitchCase* to);
void CopyFields(WfStateSwitchStatement* from, WfStateSwitchStatement* to);
void CopyFields(WfStatement* from, WfStatement* to);
void CopyFields(WfStaticInitDeclaration* from, WfStaticInitDeclaration* to);
void CopyFields(WfStringExpression* from, WfStringExpression* to);
void CopyFields(WfStructDeclaration* from, WfStructDeclaration* to);
void CopyFields(WfStructMember* from, WfStructMember* to);
@@ -3072,6 +3097,7 @@ namespace vl::workflow::copy_visitor
void Visit(WfVariableDeclaration* node) override;
void Visit(WfEventDeclaration* node) override;
void Visit(WfPropertyDeclaration* node) override;
void Visit(WfStaticInitDeclaration* node) override;
void Visit(WfConstructorDeclaration* node) override;
void Visit(WfDestructorDeclaration* node) override;
void Visit(WfClassDeclaration* node) override;
@@ -3197,6 +3223,7 @@ namespace vl::workflow::copy_visitor
vl::Ptr<WfStateMachineDeclaration> CopyNode(WfStateMachineDeclaration* node);
vl::Ptr<WfStateMachineStatement> CopyNode(WfStateMachineStatement* node);
vl::Ptr<WfStateSwitchStatement> CopyNode(WfStateSwitchStatement* node);
vl::Ptr<WfStaticInitDeclaration> CopyNode(WfStaticInitDeclaration* node);
vl::Ptr<WfStringExpression> CopyNode(WfStringExpression* node);
vl::Ptr<WfStructDeclaration> CopyNode(WfStructDeclaration* node);
vl::Ptr<WfSwitchStatement> CopyNode(WfSwitchStatement* node);
@@ -3344,6 +3371,7 @@ namespace vl::workflow::empty_visitor
void Visit(WfVariableDeclaration* node) override;
void Visit(WfEventDeclaration* node) override;
void Visit(WfPropertyDeclaration* node) override;
void Visit(WfStaticInitDeclaration* node) override;
void Visit(WfConstructorDeclaration* node) override;
void Visit(WfDestructorDeclaration* node) override;
void Visit(WfClassDeclaration* node) override;
@@ -3572,6 +3600,7 @@ namespace vl::workflow::json_visitor
virtual void PrintFields(WfStateSwitchCase* node);
virtual void PrintFields(WfStateSwitchStatement* node);
virtual void PrintFields(WfStatement* node);
virtual void PrintFields(WfStaticInitDeclaration* node);
virtual void PrintFields(WfStringExpression* node);
virtual void PrintFields(WfStructDeclaration* node);
virtual void PrintFields(WfStructMember* node);
@@ -3663,6 +3692,7 @@ namespace vl::workflow::json_visitor
void Visit(WfVariableDeclaration* node) override;
void Visit(WfEventDeclaration* node) override;
void Visit(WfPropertyDeclaration* node) override;
void Visit(WfStaticInitDeclaration* node) override;
void Visit(WfConstructorDeclaration* node) override;
void Visit(WfDestructorDeclaration* node) override;
void Visit(WfClassDeclaration* node) override;
@@ -3845,6 +3875,7 @@ namespace vl::workflow::traverse_visitor
virtual void Traverse(WfStateSwitchCase* node);
virtual void Traverse(WfStateSwitchStatement* node);
virtual void Traverse(WfStatement* node);
virtual void Traverse(WfStaticInitDeclaration* node);
virtual void Traverse(WfStringExpression* node);
virtual void Traverse(WfStructDeclaration* node);
virtual void Traverse(WfStructMember* node);
@@ -3957,6 +3988,7 @@ namespace vl::workflow::traverse_visitor
virtual void Finishing(WfStateSwitchCase* node);
virtual void Finishing(WfStateSwitchStatement* node);
virtual void Finishing(WfStatement* node);
virtual void Finishing(WfStaticInitDeclaration* node);
virtual void Finishing(WfStringExpression* node);
virtual void Finishing(WfStructDeclaration* node);
virtual void Finishing(WfStructMember* node);
@@ -4048,6 +4080,7 @@ namespace vl::workflow::traverse_visitor
void Visit(WfVariableDeclaration* node) override;
void Visit(WfEventDeclaration* node) override;
void Visit(WfPropertyDeclaration* node) override;
void Visit(WfStaticInitDeclaration* node) override;
void Visit(WfConstructorDeclaration* node) override;
void Visit(WfDestructorDeclaration* node) override;
void Visit(WfClassDeclaration* node) override;
@@ -4211,29 +4244,30 @@ namespace vl::workflow
StateSwitchCase = 83,
StateSwitchStatement = 84,
Statement = 85,
StringExpression = 86,
StructDeclaration = 87,
StructMember = 88,
SwitchCase = 89,
SwitchStatement = 90,
ThisExpression = 91,
TopQualifiedExpression = 92,
TopQualifiedType = 93,
TryStatement = 94,
Type = 95,
TypeCastingExpression = 96,
TypeOfExpressionExpression = 97,
TypeOfTypeExpression = 98,
TypeTestingExpression = 99,
UnaryExpression = 100,
VariableDeclaration = 101,
VariableStatement = 102,
VirtualCfeDeclaration = 103,
VirtualCfeExpression = 104,
VirtualCseDeclaration = 105,
VirtualCseExpression = 106,
VirtualCseStatement = 107,
WhileStatement = 108,
StaticInitDeclaration = 86,
StringExpression = 87,
StructDeclaration = 88,
StructMember = 89,
SwitchCase = 90,
SwitchStatement = 91,
ThisExpression = 92,
TopQualifiedExpression = 93,
TopQualifiedType = 94,
TryStatement = 95,
Type = 96,
TypeCastingExpression = 97,
TypeOfExpressionExpression = 98,
TypeOfTypeExpression = 99,
TypeTestingExpression = 100,
UnaryExpression = 101,
VariableDeclaration = 102,
VariableStatement = 103,
VirtualCfeDeclaration = 104,
VirtualCfeExpression = 105,
VirtualCseDeclaration = 106,
VirtualCseExpression = 107,
VirtualCseStatement = 108,
WhileStatement = 109,
};
enum class WorkflowFields : vl::vint32_t
@@ -4399,42 +4433,43 @@ namespace vl::workflow
StateSwitchCase_statement = 158,
StateSwitchStatement_caseBranches = 159,
StateSwitchStatement_type = 160,
StringExpression_value = 161,
StructDeclaration_members = 162,
StructMember_attributes = 163,
StructMember_name = 164,
StructMember_type = 165,
SwitchCase_expression = 166,
SwitchCase_statement = 167,
SwitchStatement_caseBranches = 168,
SwitchStatement_defaultBranch = 169,
SwitchStatement_expression = 170,
TopQualifiedExpression_name = 171,
TopQualifiedType_name = 172,
TryStatement_catchStatement = 173,
TryStatement_finallyStatement = 174,
TryStatement_name = 175,
TryStatement_protectedStatement = 176,
TypeCastingExpression_expression = 177,
TypeCastingExpression_strategy = 178,
TypeCastingExpression_type = 179,
TypeOfExpressionExpression_expression = 180,
TypeOfTypeExpression_type = 181,
TypeTestingExpression_expression = 182,
TypeTestingExpression_test = 183,
TypeTestingExpression_type = 184,
UnaryExpression_op = 185,
UnaryExpression_operand = 186,
VariableDeclaration_expression = 187,
VariableDeclaration_type = 188,
VariableStatement_variable = 189,
VirtualCfeDeclaration_expandedDeclarations = 190,
VirtualCfeExpression_expandedExpression = 191,
VirtualCseDeclaration_expandedDeclarations = 192,
VirtualCseExpression_expandedExpression = 193,
VirtualCseStatement_expandedStatement = 194,
WhileStatement_condition = 195,
WhileStatement_statement = 196,
StaticInitDeclaration_statement = 161,
StringExpression_value = 162,
StructDeclaration_members = 163,
StructMember_attributes = 164,
StructMember_name = 165,
StructMember_type = 166,
SwitchCase_expression = 167,
SwitchCase_statement = 168,
SwitchStatement_caseBranches = 169,
SwitchStatement_defaultBranch = 170,
SwitchStatement_expression = 171,
TopQualifiedExpression_name = 172,
TopQualifiedType_name = 173,
TryStatement_catchStatement = 174,
TryStatement_finallyStatement = 175,
TryStatement_name = 176,
TryStatement_protectedStatement = 177,
TypeCastingExpression_expression = 178,
TypeCastingExpression_strategy = 179,
TypeCastingExpression_type = 180,
TypeOfExpressionExpression_expression = 181,
TypeOfTypeExpression_type = 182,
TypeTestingExpression_expression = 183,
TypeTestingExpression_test = 184,
TypeTestingExpression_type = 185,
UnaryExpression_op = 186,
UnaryExpression_operand = 187,
VariableDeclaration_expression = 188,
VariableDeclaration_type = 189,
VariableStatement_variable = 190,
VirtualCfeDeclaration_expandedDeclarations = 191,
VirtualCfeExpression_expandedExpression = 192,
VirtualCseDeclaration_expandedDeclarations = 193,
VirtualCseExpression_expandedExpression = 194,
VirtualCseStatement_expandedStatement = 195,
WhileStatement_condition = 196,
WhileStatement_statement = 197,
};
extern const wchar_t* WorkflowTypeName(WorkflowClasses type);
@@ -4662,29 +4697,30 @@ namespace vl::workflow
_Variable = 602,
_Event = 611,
_Property = 620,
_BaseConstructorCall = 633,
_ConstructorType = 641,
_Constructor = 646,
_Destructor = 657,
_ClassBody = 661,
_Class = 670,
_EnumItemInt = 682,
_EnumItemA = 685,
_EnumItemB = 692,
_Enum = 701,
_StructMember = 716,
_Struct = 723,
_APConfig = 730,
_AutoPropertyKind = 747,
_AutoProperty = 754,
_CastResultInterface = 763,
_DeclarationCandidates = 773,
_Declaration = 787,
_UsingFragment = 791,
_UsingItem = 795,
_UsingPath = 799,
_ModuleBody = 806,
_Module = 812,
_StaticInit = 633,
_BaseConstructorCall = 637,
_ConstructorType = 645,
_Constructor = 650,
_Destructor = 661,
_ClassBody = 665,
_Class = 674,
_EnumItemInt = 686,
_EnumItemA = 689,
_EnumItemB = 696,
_Enum = 705,
_StructMember = 720,
_Struct = 727,
_APConfig = 734,
_AutoPropertyKind = 751,
_AutoProperty = 758,
_CastResultInterface = 767,
_DeclarationCandidates = 777,
_Declaration = 792,
_UsingFragment = 796,
_UsingItem = 800,
_UsingPath = 804,
_ModuleBody = 811,
_Module = 817,
};
const wchar_t* ParserRuleName(vl::vint index);
@@ -5446,6 +5482,7 @@ Error Messages
static glr::ParsingError WrongDeclaration(WfDestructorDeclaration* node);
static glr::ParsingError WrongDeclaration(WfAutoPropertyDeclaration* node);
static glr::ParsingError WrongDeclaration(WfStateMachineDeclaration* node);
static glr::ParsingError WrongDeclaration(WfStaticInitDeclaration* node);
static glr::ParsingError WrongDeclarationInInterfaceConstructor(WfDeclaration* node);
static glr::ParsingError EnumValuesNotConsecutiveFromZero(WfEnumDeclaration* node);
static glr::ParsingError FlagValuesNotConsecutiveFromZero(WfEnumDeclaration* node);
@@ -5797,6 +5834,7 @@ namespace vl
collections::Group<Ptr<WfClassDeclaration>, Ptr<WfClassDeclaration>> classDecls; // class (nullable) to direct internal classes
collections::List<Ptr<WfVariableDeclaration>> varDecls; // global variables
collections::List<Ptr<WfFunctionDeclaration>> funcDecls; // global functions
collections::List<Ptr<WfStaticInitDeclaration>> staticInitDecls; // global static initialization declarations
collections::Group<WString, Ptr<WfClassDeclaration>> customFilesClasses; // @cpp:File to top level classes, empty key means the default cpp
collections::Group<vint, Ptr<WfClassDeclaration>> headerFilesClasses; // non-@cpp:File header file to top level classes, 0 means the default header
@@ -5847,7 +5885,6 @@ namespace vl
void WriteHeader_MainHeaderEnums(stream::StreamWriter& writer, collections::List<WString>& nss);
void WriteHeader_Struct(stream::StreamWriter& writer, Ptr<WfStructDeclaration> decl, const WString& name, const WString& prefix, bool mainHeaderDefinition);
void WriteHeader_StructOp(stream::StreamWriter& writer, Ptr<WfStructDeclaration> decl, const WString& name, const WString& prefix);
void WriteHeader_Struct(stream::StreamWriter& writer, Ptr<WfStructDeclaration> decl, collections::List<WString>& nss, bool mainHeaderDefinition);
void WriteHeader_MainHeaderStructs(stream::StreamWriter& writer, collections::List<WString>& nss);
+4 -9
View File
@@ -843,15 +843,10 @@ Sys
#define DEFINE_COMPARE(TYPE)\
vint Sys::Compare(TYPE a, TYPE b)\
{\
auto result = TypedValueSerializerProvider<TYPE>::Compare(a, b);\
switch (result)\
{\
case IBoxedValue::Smaller: return -1;\
case IBoxedValue::Greater: return 1;\
case IBoxedValue::Equal: return 0;\
default:\
CHECK_FAIL(L"Unexpected compare result.");\
}\
auto result = a <=> b;\
if (result < 0) return -1;\
if (result > 0) return 1;\
return 0;\
}\
REFLECTION_PREDEFINED_PRIMITIVE_TYPES(DEFINE_COMPARE)
+121 -44
View File
@@ -2352,7 +2352,7 @@ WfRuntimeLambda
***********************************************************************/
WfRuntimeLambda::WfRuntimeLambda(Ptr<WfRuntimeGlobalContext> _globalContext, Ptr<WfRuntimeVariableContext> _capturedVariables, vint _functionIndex)
:globalContext(_globalContext)
:globalContext(_globalContext.Obj())
, capturedVariables(_capturedVariables)
, functionIndex(_functionIndex)
{
@@ -2360,7 +2360,7 @@ WfRuntimeLambda
Value WfRuntimeLambda::Invoke(Ptr<reflection::description::IValueReadonlyList> arguments)
{
return Invoke(globalContext, capturedVariables, functionIndex, arguments);
return Invoke(Ptr(globalContext), capturedVariables, functionIndex, arguments);
}
Value WfRuntimeLambda::Invoke(Ptr<WfRuntimeGlobalContext> globalContext, Ptr<WfRuntimeVariableContext> capturedVariables, vint functionIndex, Ptr<reflection::description::IValueReadonlyList> arguments)
@@ -2412,7 +2412,7 @@ WfRuntimeInterfaceInstance
else
{
vint functionIndex = functions.Values()[index];
return WfRuntimeLambda::Invoke(globalContext, capturedVariables, functionIndex, arguments);
return WfRuntimeLambda::Invoke(Ptr(globalContext), capturedVariables, functionIndex, arguments);
}
}
}
@@ -3291,6 +3291,8 @@ WfRuntimeThreadContext (Operators)
CONTEXT_ACTION(PushValue(BoxValue(value)), L"failed to push a value to the stack.");
return WfRuntimeExecutionAction::ExecuteInstruction;
}
//-------------------------------------------------------------------------------
template<typename T>
WfRuntimeExecutionAction OPERATOR_OpCompare(WfRuntimeThreadContext& context)
@@ -3338,6 +3340,119 @@ WfRuntimeThreadContext (Operators)
}
return WfRuntimeExecutionAction::ExecuteInstruction;
}
//-------------------------------------------------------------------------------
WfRuntimeExecutionAction OPERATOR_OpCompareReference(WfRuntimeThreadContext& context)
{
Value first, second;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
bool result = first.GetValueType() != Value::BoxedValue && second.GetValueType() != Value::BoxedValue && first.GetRawPtr() == second.GetRawPtr();
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
return WfRuntimeExecutionAction::ExecuteInstruction;
}
//-------------------------------------------------------------------------------
bool OPERATOR_OpCompareValue(const Value& a, const Value& b);
bool OPERATOR_OpCompareValue(const WfStructInstance& as, const WfStructInstance& bs)
{
if (as.fieldValues.Count() == 0 && bs.fieldValues.Count() == 0) return true;
auto td = as.fieldValues.Count() > 0 ? as.fieldValues.Keys()[0]->GetOwnerTypeDescriptor() : bs.fieldValues.Keys()[0]->GetOwnerTypeDescriptor();
vint ai = 0;
vint bi = 0;
while (ai < as.fieldValues.Count() || bi < bs.fieldValues.Count())
{
Value af, bf;
auto ap = ai < as.fieldValues.Count() ? as.fieldValues.Keys()[ai] : nullptr;
auto bp = bi < bs.fieldValues.Count() ? bs.fieldValues.Keys()[bi] : nullptr;
auto p =
ap == nullptr ? bp :
bp == nullptr ? ap :
ap < bp ? ap : bp;
if (p == ap)
{
af = as.fieldValues.Values()[ai];
}
else if (p->GetReturn()->GetDecorator() == ITypeInfo::TypeDescriptor)
{
af = p->GetReturn()->GetTypeDescriptor()->GetValueType()->CreateDefault();
}
if (p == bp)
{
bf = bs.fieldValues.Values()[bi];
}
else if (p->GetReturn()->GetDecorator() == ITypeInfo::TypeDescriptor)
{
bf = p->GetReturn()->GetTypeDescriptor()->GetValueType()->CreateDefault();
}
if (!OPERATOR_OpCompareValue(af, bf)) return false;
if (p == ap) ai++;
if (p == bp) bi++;
}
return true;
}
bool OPERATOR_OpCompareValue(const Value& a, const Value& b)
{
auto avt = a.GetValueType();
auto bvt = b.GetValueType();
if (avt == Value::RawPtr || avt == Value::SharedPtr)
{
if (bvt == Value::RawPtr || bvt == Value::SharedPtr)
{
auto pa = a.GetRawPtr();
auto pb = b.GetRawPtr();
return pa == pb;
}
}
if (avt != bvt)
{
return avt == bvt;
}
if (avt == Value::BoxedValue)
{
if (auto as = a.GetBoxedValue().Cast<IValueType::TypedBox<WfStructInstance>>())
{
auto bs = b.GetBoxedValue().Cast<IValueType::TypedBox<WfStructInstance>>();
if (!bs) return false;
if (a.GetTypeDescriptor() != b.GetTypeDescriptor()) return false;
return OPERATOR_OpCompareValue(as->value, bs->value);
}
if (auto ae = a.GetBoxedValue().Cast<IValueType::TypedBox<WfEnumInstance>>())
{
auto be = b.GetBoxedValue().Cast<IValueType::TypedBox<WfEnumInstance>>();
if (!be) return false;
return ae->value.value == be->value.value;
}
return a == b;
}
return true;
}
WfRuntimeExecutionAction OPERATOR_OpCompareValue(WfRuntimeThreadContext& context)
{
Value first, second;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
bool result = OPERATOR_OpCompareValue(first, second);
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
return WfRuntimeExecutionAction::ExecuteInstruction;
}
/***********************************************************************
WfRuntimeThreadContext (TypeConversion)
@@ -3735,7 +3850,7 @@ WfRuntimeThreadContext
CONTEXT_ACTION(PopValue(operand), L"failed to pop a value from the stack.");
auto capturedVariables = operand.GetSharedPtr().Cast<WfRuntimeVariableContext>();
proxy->capturedVariables = capturedVariables;
proxy->globalContext = globalContext;
proxy->globalContext = globalContext.Obj();
Array<Value> arguments(1);
arguments[0] = Value::From(proxy);
@@ -4125,21 +4240,11 @@ WfRuntimeThreadContext
END_TYPE
case WfInsCode::CompareReference:
{
Value first, second;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
bool result = first.GetValueType() != Value::BoxedValue && second.GetValueType() != Value::BoxedValue && first.GetRawPtr() == second.GetRawPtr();
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
return WfRuntimeExecutionAction::ExecuteInstruction;
return OPERATOR_OpCompareReference(*this);
}
case WfInsCode::CompareValue:
{
Value first, second;
CONTEXT_ACTION(PopValue(second), L"failed to pop a value from the stack.");
CONTEXT_ACTION(PopValue(first), L"failed to pop a value from the stack.");
bool result = first == second;
CONTEXT_ACTION(PushValue(BoxValue(result)), L"failed to push a value to the stack.");
return WfRuntimeExecutionAction::ExecuteInstruction;
return OPERATOR_OpCompareValue(*this);
}
case WfInsCode::OpNot:
BEGIN_TYPE
@@ -5359,11 +5464,6 @@ WfStruct
#endif
}
IBoxedValue::CompareResult WfStruct::WfValueType::Compare(const Value& a, const Value& b)
{
return IBoxedValue::NotComparable;
}
WfStruct::WfStruct(const WString& typeName)
:WfCustomTypeBase<reflection::description::ValueTypeDescriptorBase>(TypeDescriptorFlags::Struct, typeName)
{
@@ -5494,29 +5594,6 @@ WfEnum
#endif
}
IBoxedValue::CompareResult WfEnum::WfValueType::Compare(const Value& a, const Value& b)
{
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
auto ea = a.GetBoxedValue().Cast<IValueType::TypedBox<WfEnumInstance>>();
if (!ea)
{
throw ArgumentTypeMismtatchException(L"ea", owner, Value::BoxedValue, a);
}
auto eb = b.GetBoxedValue().Cast<IValueType::TypedBox<WfEnumInstance>>();
if (!eb)
{
throw ArgumentTypeMismtatchException(L"eb", owner, Value::BoxedValue, b);
}
if (ea->value.value < eb->value.value) return IBoxedValue::Smaller;
if (ea->value.value > eb->value.value)return IBoxedValue::Greater;
return IBoxedValue::Equal;
#else
CHECK_FAIL(L"Not Implemented under VCZH_DEBUG_METAONLY_REFLECTION!");
#endif
}
WfEnum::WfEnum(bool isFlags, const WString& typeName)
:WfCustomTypeBase<reflection::description::ValueTypeDescriptorBase>((isFlags ? TypeDescriptorFlags::FlagEnum : TypeDescriptorFlags::NormalEnum), typeName)
{
+10 -4
View File
@@ -704,7 +704,6 @@ Custom Type
WfValueType(WfStruct* _owner);
Value CreateDefault()override;
IBoxedValue::CompareResult Compare(const Value& a, const Value& b)override;
};
protected:
@@ -740,7 +739,6 @@ Custom Type
WfValueType(WfEnum* _owner);
Value CreateDefault()override;
IBoxedValue::CompareResult Compare(const Value& a, const Value& b)override;
};
class WfEnumType : public Object, public virtual IEnumType
@@ -1060,7 +1058,11 @@ Lambda
{
typedef reflection::description::Value Value;
public:
Ptr<WfRuntimeGlobalContext> globalContext;
// use raw pointer because
// if a lambda is stored in a global variable
// it is stored in globalContext->globalVariables->variables[i]
// so that globalContext has a cyclic reference to itself
WfRuntimeGlobalContext* globalContext = nullptr;
Ptr<WfRuntimeVariableContext> capturedVariables;
vint functionIndex;
@@ -1082,7 +1084,11 @@ InterfaceInstance
typedef reflection::description::IValueReadonlyList IValueReadonlyList;
typedef collections::Dictionary<IMethodInfo*, vint> FunctionMap;
public:
Ptr<WfRuntimeGlobalContext> globalContext;
// use raw pointer because
// if a lambda is stored in a global variable
// it is stored in globalContext->globalVariables->variables[i]
// so that globalContext has a cyclic reference to itself
WfRuntimeGlobalContext* globalContext = nullptr;
Ptr<WfRuntimeVariableContext> capturedVariables;
FunctionMap functions;
Binary file not shown.
Binary file not shown.
@@ -36,7 +36,18 @@ Global Variables
BEGIN_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo)
vl_workflow_global::Demo instance;
INITIALIZE_GLOBAL_STORAGE_CLASS
instance.__vwsn_ls_StringResource = ::vl::reflection::description::IValueDictionary::Create();
([]()
{
::demo::StringResource::Install(::vl::__vwsn::Parse<::vl::Locale>(::vl::WString::Unmanaged(L"en-US")), ::demo::StringResource::__vwsn_ls_en_US_BuildStrings(::vl::__vwsn::Parse<::vl::Locale>(::vl::WString::Unmanaged(L"en-US"))));
::demo::StringResource::Install(::vl::__vwsn::Parse<::vl::Locale>(::vl::WString::Unmanaged(L"zh-CN")), ::demo::StringResource::__vwsn_ls_zh_CN_BuildStrings(::vl::__vwsn::Parse<::vl::Locale>(::vl::WString::Unmanaged(L"zh-CN"))));
}
)();
FINALIZE_GLOBAL_STORAGE_CLASS
instance.__vwsn_ls_StringResource = nullptr;
END_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo)
namespace vl_workflow_global
@@ -873,160 +884,160 @@ Closures
//-------------------------------------------------------------------
__vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::__vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale)
__vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::__vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale)
:__vwsn_ls_locale(__vwsnctor___vwsn_ls_locale)
{
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Currency(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatCurrency(__vwsn_ls_locale, __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"货币:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::DateFormat(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::WString::Unmanaged(L"yyyy"), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"日期格式:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Label()
{
return ::vl::WString::Unmanaged(L"语言设置:");
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::LongDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetLongDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"长日期:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::LongTime(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetLongTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"长时间:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Number(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatNumber(__vwsn_ls_locale, __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"数字:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Sentence(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = __vwsn_ls_0;
return ((::vl::WString::Unmanaged(L"$") + __vwsn_ls__0) + ::vl::WString::Unmanaged(L",早上好!$"));
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::ShortDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetShortDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"短日期:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::ShortTime(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetShortTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"短时间:") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::TimeFormat(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::WString::Unmanaged(L"HH"), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"时间格式: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Title()
{
return ::vl::WString::Unmanaged(L"本地化");
}
::vl::WString __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings::YearMonthDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetYearMonthDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"年月:") + __vwsn_ls__0);
}
//-------------------------------------------------------------------
__vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::__vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale)
:__vwsn_ls_locale(__vwsnctor___vwsn_ls_locale)
{
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Currency(const ::vl::WString& __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::Currency(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatCurrency(__vwsn_ls_locale, __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"Currency: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::DateFormat(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::DateFormat(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::WString::Unmanaged(L"yyyy"), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"DateFormat: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Label()
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::Label()
{
return ::vl::WString::Unmanaged(L"Selected Locale:");
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::LongDate(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::LongDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetLongDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetLongDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"LongDate: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::LongTime(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::LongTime(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetLongTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetLongTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"LongTime: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Number(const ::vl::WString& __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::Number(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatNumber(__vwsn_ls_locale, __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"Number: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Sentence(const ::vl::WString& __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::Sentence(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = __vwsn_ls_0;
return ((::vl::WString::Unmanaged(L"$Good morning, ") + __vwsn_ls__0) + ::vl::WString::Unmanaged(L"!$"));
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::ShortDate(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::ShortDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetShortDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetShortDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"ShortDate: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::ShortTime(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::ShortTime(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetShortTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetShortTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"ShortTime: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::TimeFormat(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::TimeFormat(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::WString::Unmanaged(L"HH"), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"TimeFormat: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::Title()
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::Title()
{
return ::vl::WString::Unmanaged(L"Localization");
}
::vl::WString __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings::YearMonthDate(::vl::DateTime __vwsn_ls_0)
::vl::WString __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings::YearMonthDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::demo::StringResource::__vwsn_ls_First(::vl::reflection::description::Localization::GetYearMonthDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetYearMonthDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"YearMonthDate: ") + __vwsn_ls__0);
}
//-------------------------------------------------------------------
__vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::__vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale)
:__vwsn_ls_locale(__vwsnctor___vwsn_ls_locale)
{
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::Currency(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatCurrency(__vwsn_ls_locale, __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"货币:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::DateFormat(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::WString::Unmanaged(L"yyyy"), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"日期格式:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::Label()
{
return ::vl::WString::Unmanaged(L"语言设置:");
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::LongDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetLongDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"长日期:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::LongTime(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetLongTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"长时间:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::Number(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatNumber(__vwsn_ls_locale, __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"数字:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::Sentence(const ::vl::WString& __vwsn_ls_0)
{
auto __vwsn_ls__0 = __vwsn_ls_0;
return ((::vl::WString::Unmanaged(L"$") + __vwsn_ls__0) + ::vl::WString::Unmanaged(L",早上好!$"));
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::ShortDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetShortDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"短日期:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::ShortTime(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetShortTimeFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"短时间:") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::TimeFormat(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatTime(__vwsn_ls_locale, ::vl::WString::Unmanaged(L"HH"), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"时间格式: ") + __vwsn_ls__0);
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::Title()
{
return ::vl::WString::Unmanaged(L"本地化");
}
::vl::WString __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings::YearMonthDate(::vl::DateTime __vwsn_ls_0)
{
auto __vwsn_ls__0 = ::vl::reflection::description::Localization::FormatDate(__vwsn_ls_locale, ::vl::presentation::helper_types::LocalizedStrings::FirstOrEmpty(::vl::reflection::description::Localization::GetYearMonthDateFormats(__vwsn_ls_locale)), __vwsn_ls_0);
return (::vl::WString::Unmanaged(L"年月:") + __vwsn_ls__0);
}
//-------------------------------------------------------------------
__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(::demo::MainWindow* __vwsnctor___vwsn_this_, ::demo::MainWindowConstructor* __vwsnctorthis_0)
:__vwsn_this_(__vwsnctor___vwsn_this_)
, __vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
@@ -1938,29 +1949,32 @@ Class (::demo::MainWindow)
Class (::demo::StringResource)
***********************************************************************/
::vl::WString StringResource::__vwsn_ls_First(const ::vl::collections::LazyList<::vl::WString>& __vwsn_ls_formats)
::vl::Ptr<::demo::IStringResourceStrings> StringResource::__vwsn_ls_en_US_BuildStrings(::vl::Locale __vwsn_ls_locale)
{
return ::vl::Ptr<::demo::IStringResourceStrings>(new ::vl_workflow_global::__vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings(__vwsn_ls_locale));
}
::vl::Ptr<::demo::IStringResourceStrings> StringResource::__vwsn_ls_zh_CN_BuildStrings(::vl::Locale __vwsn_ls_locale)
{
return ::vl::Ptr<::demo::IStringResourceStrings>(new ::vl_workflow_global::__vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings(__vwsn_ls_locale));
}
void StringResource::Install(::vl::Locale __vwsn_ls_locale, ::vl::Ptr<::demo::IStringResourceStrings> __vwsn_ls_impl)
{
if (::vl::__vwsn::This(::vl::__vwsn::This(GLOBAL_NAME __vwsn_ls_StringResource.Obj())->GetKeys().Obj())->Contains(::vl::__vwsn::Box(__vwsn_ls_locale)))
{
auto __vwsn_for_enumerable_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueEnumerable>(__vwsn_ls_formats);
auto __vwsn_for_enumerator_ = ::vl::__vwsn::This(__vwsn_for_enumerable_.Obj())->CreateEnumerator();
while (::vl::__vwsn::This(__vwsn_for_enumerator_.Obj())->Next())
{
auto __vwsn_ls_format = ::vl::__vwsn::Unbox<::vl::WString>(::vl::__vwsn::This(__vwsn_for_enumerator_.Obj())->GetCurrent());
{
return __vwsn_ls_format;
}
}
throw ::vl::Exception(((::vl::WString::Unmanaged(L"Localized strings \"demo::StringResource\" has already registered for locale \"") + ::vl::__vwsn::ToString(__vwsn_ls_locale)) + ::vl::WString::Unmanaged(L"\".")));
}
return ::vl::WString::Unmanaged(L"");
::vl::__vwsn::This(GLOBAL_NAME __vwsn_ls_StringResource.Obj())->Set(::vl::__vwsn::Box(__vwsn_ls_locale), ::vl::__vwsn::Box(__vwsn_ls_impl));
}
::vl::Ptr<::demo::IStringResourceStrings> StringResource::Get(::vl::Locale __vwsn_ls_locale)
{
if (::vl::__vwsn::InSet(::vl::__vwsn::ToString(__vwsn_ls_locale), (::vl::__vwsn::CreateList().Add(::vl::WString::Unmanaged(L"zh-CN"))).list))
if (::vl::__vwsn::This(::vl::__vwsn::This(GLOBAL_NAME __vwsn_ls_StringResource.Obj())->GetKeys().Obj())->Contains(::vl::__vwsn::Box(__vwsn_ls_locale)))
{
return ::vl::Ptr<::demo::IStringResourceStrings>(new ::vl_workflow_global::__vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings(__vwsn_ls_locale));
return ::vl::__vwsn::Unbox<::vl::Ptr<::demo::IStringResourceStrings>>(::vl::__vwsn::This(GLOBAL_NAME __vwsn_ls_StringResource.Obj())->Get(::vl::__vwsn::Box(__vwsn_ls_locale)));
}
return ::vl::Ptr<::demo::IStringResourceStrings>(new ::vl_workflow_global::__vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings(__vwsn_ls_locale));
return ::vl::__vwsn::Unbox<::vl::Ptr<::demo::IStringResourceStrings>>(::vl::__vwsn::This(GLOBAL_NAME __vwsn_ls_StringResource.Obj())->Get(::vl::__vwsn::Box(::vl::__vwsn::Parse<::vl::Locale>(::vl::WString::Unmanaged(L"en-US")))));
}
StringResource::StringResource()
@@ -50,8 +50,8 @@ namespace vl_workflow_global
class __vwsnc15_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc16_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc17_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings;
class __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings;
class __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings;
class __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings;
class __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription;
class __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription;
@@ -217,13 +217,15 @@ namespace demo
class StringResource : public ::vl::Object, public ::vl::reflection::Description<StringResource>
{
friend class ::vl_workflow_global::__vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings;
friend class ::vl_workflow_global::__vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings;
friend class ::vl_workflow_global::__vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings;
friend class ::vl_workflow_global::__vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<StringResource>;
#endif
public:
static ::vl::WString __vwsn_ls_First(const ::vl::collections::LazyList<::vl::WString>& __vwsn_ls_formats);
static ::vl::Ptr<::demo::IStringResourceStrings> __vwsn_ls_en_US_BuildStrings(::vl::Locale __vwsn_ls_locale);
static ::vl::Ptr<::demo::IStringResourceStrings> __vwsn_ls_zh_CN_BuildStrings(::vl::Locale __vwsn_ls_locale);
static void Install(::vl::Locale __vwsn_ls_locale, ::vl::Ptr<::demo::IStringResourceStrings> __vwsn_ls_impl);
static ::vl::Ptr<::demo::IStringResourceStrings> Get(::vl::Locale __vwsn_ls_locale);
StringResource();
};
@@ -239,6 +241,8 @@ namespace vl_workflow_global
{
public:
::vl::Ptr<::vl::reflection::description::IValueDictionary> __vwsn_ls_StringResource;
static Demo& Instance();
};
@@ -558,12 +562,12 @@ Closures
bool Close() override;
};
class __vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings : public ::vl::Object, public virtual ::demo::IStringResourceStrings
class __vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings : public ::vl::Object, public virtual ::demo::IStringResourceStrings
{
public:
::vl::Locale __vwsn_ls_locale;
__vwsnc18_Demo_demo_StringResource_Get__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale);
__vwsnc18_Demo_demo_StringResource___vwsn_ls_en_US_BuildStrings__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale);
::vl::WString Currency(const ::vl::WString& __vwsn_ls_0) override;
::vl::WString DateFormat(::vl::DateTime __vwsn_ls_0) override;
@@ -579,12 +583,12 @@ Closures
::vl::WString YearMonthDate(::vl::DateTime __vwsn_ls_0) override;
};
class __vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings : public ::vl::Object, public virtual ::demo::IStringResourceStrings
class __vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings : public ::vl::Object, public virtual ::demo::IStringResourceStrings
{
public:
::vl::Locale __vwsn_ls_locale;
__vwsnc19_Demo_demo_StringResource_Get__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale);
__vwsnc19_Demo_demo_StringResource___vwsn_ls_zh_CN_BuildStrings__demo_IStringResourceStrings(::vl::Locale __vwsnctor___vwsn_ls_locale);
::vl::WString Currency(const ::vl::WString& __vwsn_ls_0) override;
::vl::WString DateFormat(::vl::DateTime __vwsn_ls_0) override;
@@ -102,8 +102,10 @@ namespace vl
BEGIN_CLASS_MEMBER(::demo::StringResource)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::StringResource>(), NO_PARAMETER)
CLASS_MEMBER_STATIC_METHOD(__vwsn_ls_First, { L"__vwsn_ls_formats" })
CLASS_MEMBER_STATIC_METHOD(__vwsn_ls_en_US_BuildStrings, { L"__vwsn_ls_locale" })
CLASS_MEMBER_STATIC_METHOD(__vwsn_ls_zh_CN_BuildStrings, { L"__vwsn_ls_locale" })
CLASS_MEMBER_STATIC_METHOD(Get, { L"__vwsn_ls_locale" })
CLASS_MEMBER_STATIC_METHOD(Install, { L"__vwsn_ls_locale" _ L"__vwsn_ls_impl" })
END_CLASS_MEMBER(::demo::StringResource)
#undef _
Binary file not shown.
Binary file not shown.