mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-30 04:55:18 +08:00
Update release
This commit is contained in:
@@ -3067,13 +3067,6 @@ WindowsDirect2DParagraph
|
|||||||
TextRange(){}
|
TextRange(){}
|
||||||
TextRange(vint _start, vint _end):start(_start),end(_end){}
|
TextRange(vint _start, vint _end):start(_start),end(_end){}
|
||||||
|
|
||||||
inline vint Compare(const TextRange& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = start - value.start) != 0) return result;
|
|
||||||
if ((result = end - value.end) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(TextRange)
|
GUI_DEFINE_COMPARE_OPERATORS(TextRange)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-16
@@ -461,8 +461,7 @@ Renderers
|
|||||||
ColorItemResource selectedFocused;
|
ColorItemResource selectedFocused;
|
||||||
ColorItemResource selectedUnfocused;
|
ColorItemResource selectedUnfocused;
|
||||||
|
|
||||||
bool operator==(const ColorEntryResource& value){return false;}
|
bool operator==(const ColorEntryResource& value) const { return false; }
|
||||||
bool operator!=(const ColorEntryResource& value){return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef collections::Array<ColorEntryResource> ColorArray;
|
typedef collections::Array<ColorEntryResource> ColorArray;
|
||||||
@@ -1057,13 +1056,6 @@ UniscribeColor
|
|||||||
UniscribeColorRange(){}
|
UniscribeColorRange(){}
|
||||||
UniscribeColorRange(vint _start, vint _end):start(_start),end(_end){}
|
UniscribeColorRange(vint _start, vint _end):start(_start),end(_end){}
|
||||||
|
|
||||||
inline vint Compare(const UniscribeColorRange& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = start - value.start) != 0) return result;
|
|
||||||
if ((result = end - value.end) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(UniscribeColorRange)
|
GUI_DEFINE_COMPARE_OPERATORS(UniscribeColorRange)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1075,13 +1067,6 @@ UniscribeColor
|
|||||||
UniscribeColor(){}
|
UniscribeColor(){}
|
||||||
UniscribeColor(Color _fontColor, Color _backgroundColor):fontColor(_fontColor),backgroundColor(_backgroundColor){}
|
UniscribeColor(Color _fontColor, Color _backgroundColor):fontColor(_fontColor),backgroundColor(_backgroundColor){}
|
||||||
|
|
||||||
inline vint64_t Compare(const UniscribeColor& value)const
|
|
||||||
{
|
|
||||||
vint64_t result;
|
|
||||||
if ((result = fontColor.Compare(value.fontColor)) != 0) return result;
|
|
||||||
if ((result = backgroundColor.Compare(value.backgroundColor)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(UniscribeColor)
|
GUI_DEFINE_COMPARE_OPERATORS(UniscribeColor)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+425
-291
File diff suppressed because it is too large
Load Diff
+51
-154
@@ -74,12 +74,8 @@ Enumerations
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define GUI_DEFINE_COMPARE_OPERATORS(TYPE)\
|
#define GUI_DEFINE_COMPARE_OPERATORS(TYPE)\
|
||||||
inline bool operator==(const TYPE& right)const { return Compare(right) == 0; } \
|
std::strong_ordering operator<=>(const TYPE&) const = default;\
|
||||||
inline bool operator!=(const TYPE& right)const { return Compare(right) != 0; } \
|
bool operator==(const TYPE&) const = default;\
|
||||||
inline bool operator< (const TYPE& right)const { return Compare(right) < 0; } \
|
|
||||||
inline bool operator<=(const TYPE& right)const { return Compare(right) <= 0; } \
|
|
||||||
inline bool operator> (const TYPE& right)const { return Compare(right) > 0; } \
|
|
||||||
inline bool operator>=(const TYPE& right)const { return Compare(right) >= 0; } \
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
TextPos
|
TextPos
|
||||||
@@ -109,13 +105,6 @@ TextPos
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const TextPos& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = row - value.row) != 0) return result;
|
|
||||||
if ((result = column - value.column) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(TextPos)
|
GUI_DEFINE_COMPARE_OPERATORS(TextPos)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -147,13 +136,6 @@ GridPos
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const GridPos& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = row - value.row) != 0) return result;
|
|
||||||
if ((result = column - value.column) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(GridPos)
|
GUI_DEFINE_COMPARE_OPERATORS(GridPos)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -180,7 +162,6 @@ Coordinate
|
|||||||
NativeCoordinate& operator=(const NativeCoordinate& _value) = default;
|
NativeCoordinate& operator=(const NativeCoordinate& _value) = default;
|
||||||
NativeCoordinate& operator=(NativeCoordinate&& _value) = default;
|
NativeCoordinate& operator=(NativeCoordinate&& _value) = default;
|
||||||
|
|
||||||
inline vint Compare(NativeCoordinate c) const { return value - c.value; }
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(NativeCoordinate)
|
GUI_DEFINE_COMPARE_OPERATORS(NativeCoordinate)
|
||||||
|
|
||||||
inline NativeCoordinate operator+(NativeCoordinate c)const { return value + c.value; };
|
inline NativeCoordinate operator+(NativeCoordinate c)const { return value + c.value; };
|
||||||
@@ -227,13 +208,6 @@ Point
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const Point_<T>& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = CompareCoordinate(x, value.x)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(y, value.y)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(Point_<T>)
|
GUI_DEFINE_COMPARE_OPERATORS(Point_<T>)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -270,13 +244,6 @@ Size
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const Size_<T>& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = CompareCoordinate(x, value.x)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(y, value.y)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(Size_<T>)
|
GUI_DEFINE_COMPARE_OPERATORS(Size_<T>)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -326,15 +293,6 @@ Rectangle
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const Rect_<T>& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = CompareCoordinate(x1, value.x1)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(y1, value.y1)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(x2, value.x2)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(y2, value.y2)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(Rect_<T>)
|
GUI_DEFINE_COMPARE_OPERATORS(Rect_<T>)
|
||||||
|
|
||||||
Point_<T> LeftTop()const
|
Point_<T> LeftTop()const
|
||||||
@@ -536,11 +494,8 @@ Color
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
vint64_t Compare(Color color)const
|
std::strong_ordering operator<=>(const Color& c) const { return value <=> c.value; }
|
||||||
{
|
bool operator==(const Color& c) const { return value == c.value; }
|
||||||
return (vint64_t)value - (vint64_t)color.value;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(Color)
|
|
||||||
|
|
||||||
static Color Parse(const WString& value)
|
static Color Parse(const WString& value)
|
||||||
{
|
{
|
||||||
@@ -628,15 +583,6 @@ Margin
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const Margin_<T>& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = CompareCoordinate(left, value.left)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(top, value.top)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(right, value.right)) != 0) return result;
|
|
||||||
if ((result = CompareCoordinate(bottom, value.bottom)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(Margin_<T>)
|
GUI_DEFINE_COMPARE_OPERATORS(Margin_<T>)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -696,33 +642,6 @@ Resources
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
vint64_t Compare(const FontProperties& value)const
|
|
||||||
{
|
|
||||||
vint64_t result = 0;
|
|
||||||
|
|
||||||
result = WString::Compare(fontFamily, value.fontFamily);
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
result = (vint64_t)size - (vint64_t)value.size;
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
result = (vint64_t)bold - (vint64_t)value.bold;
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
result = (vint64_t)italic - (vint64_t)value.italic;
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
result = (vint64_t)underline - (vint64_t)value.underline;
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
result = (vint64_t)strikeline - (vint64_t)value.strikeline;
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
result = (vint64_t)antialias - (vint64_t)value.antialias;
|
|
||||||
if (result != 0) return result;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(FontProperties)
|
GUI_DEFINE_COMPARE_OPERATORS(FontProperties)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2347,7 +2266,12 @@ INativeWindow
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Returns true if the window needs to be updated.</returns>
|
/// <returns>Returns true if the window needs to be updated.</returns>
|
||||||
/// <param name="cleanBeforeRender">True when the whole render target needs to be cleaned.</param>
|
/// <param name="cleanBeforeRender">True when the whole render target needs to be cleaned.</param>
|
||||||
virtual void ForceRefresh(bool handleFailure, bool& failureByResized, bool& failureByLostDevice);
|
virtual void ForceRefresh(bool handleFailure, bool& updated, bool& failureByResized, bool& failureByLostDevice);
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the window becomes a main window in hosted mode.
|
||||||
|
/// This callback is only called once on the main window.
|
||||||
|
/// </summary>
|
||||||
|
virtual void BecomeMainHostedWindow();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the window becomes a non-main window in hosted mode.
|
/// Called when the window becomes a non-main window in hosted mode.
|
||||||
/// It requires MaximizedBox and MinimizedBox to be disabled.
|
/// It requires MaximizedBox and MinimizedBox to be disabled.
|
||||||
@@ -3707,6 +3631,10 @@ Predefined Events
|
|||||||
ParentLineChanged,
|
ParentLineChanged,
|
||||||
/// <summary>Service added changed.</summary>
|
/// <summary>Service added changed.</summary>
|
||||||
ServiceAdded,
|
ServiceAdded,
|
||||||
|
/// <summary>The window need to update when data or layout is changed. This even only triggered on <see cref="controls::GuiControlHost"/>.</summary>
|
||||||
|
UpdateRequested,
|
||||||
|
/// <summary>The window finished all the updating works after data or layout is changed. This even only triggered on <see cref="controls::GuiControlHost"/>.</summary>
|
||||||
|
UpdateFullfilled,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>Control signal event arguments.</summary>
|
/// <summary>Control signal event arguments.</summary>
|
||||||
@@ -4018,7 +3946,9 @@ Basic Construction
|
|||||||
|
|
||||||
friend class controls::GuiControl;
|
friend class controls::GuiControl;
|
||||||
friend class GuiGraphicsHost;
|
friend class GuiGraphicsHost;
|
||||||
friend void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition);
|
friend void InvokeOnCompositionStateChanged(GuiGraphicsComposition* composition);
|
||||||
|
friend Size InvokeGetMinPreferredClientSizeInternal(GuiGraphicsComposition* composition, bool considerPreferredMinSize);
|
||||||
|
friend Rect InvokeGetPreferredBoundsInternal(GuiGraphicsComposition* composition, bool considerPreferredMinSize);
|
||||||
public:
|
public:
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Minimum size limitation.
|
/// Minimum size limitation.
|
||||||
@@ -4073,6 +4003,9 @@ Basic Construction
|
|||||||
void SetAssociatedControl(controls::GuiControl* control);
|
void SetAssociatedControl(controls::GuiControl* control);
|
||||||
void InvokeOnCompositionStateChanged();
|
void InvokeOnCompositionStateChanged();
|
||||||
|
|
||||||
|
virtual Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) = 0;
|
||||||
|
virtual Rect GetPreferredBoundsInternal(bool considerPreferredMinSize) = 0;
|
||||||
|
|
||||||
static bool SharedPtrDestructorProc(DescriptableObject* obj, bool forceDisposing);
|
static bool SharedPtrDestructorProc(DescriptableObject* obj, bool forceDisposing);
|
||||||
public:
|
public:
|
||||||
GuiGraphicsComposition();
|
GuiGraphicsComposition();
|
||||||
@@ -4210,15 +4143,16 @@ Basic Construction
|
|||||||
/// <summary>Force to calculate layout and size immediately</summary>
|
/// <summary>Force to calculate layout and size immediately</summary>
|
||||||
virtual void ForceCalculateSizeImmediately();
|
virtual void ForceCalculateSizeImmediately();
|
||||||
|
|
||||||
|
/// <summary>Get the preferred minimum client size.</summary>
|
||||||
|
/// <returns>The preferred minimum client size.</returns>
|
||||||
|
Size GetMinPreferredClientSize();
|
||||||
|
/// <summary>Get the preferred bounds.</summary>
|
||||||
|
/// <returns>The preferred bounds.</returns>
|
||||||
|
Rect GetPreferredBounds();
|
||||||
|
|
||||||
/// <summary>Test is the size calculation affected by the parent.</summary>
|
/// <summary>Test is the size calculation affected by the parent.</summary>
|
||||||
/// <returns>Returns true if the size calculation is affected by the parent.</returns>
|
/// <returns>Returns true if the size calculation is affected by the parent.</returns>
|
||||||
virtual bool IsSizeAffectParent()=0;
|
virtual bool IsSizeAffectParent()=0;
|
||||||
/// <summary>Get the preferred minimum client size.</summary>
|
|
||||||
/// <returns>The preferred minimum client size.</returns>
|
|
||||||
virtual Size GetMinPreferredClientSize()=0;
|
|
||||||
/// <summary>Get the preferred bounds.</summary>
|
|
||||||
/// <returns>The preferred bounds.</returns>
|
|
||||||
virtual Rect GetPreferredBounds()=0;
|
|
||||||
/// <summary>Get the bounds.</summary>
|
/// <summary>Get the bounds.</summary>
|
||||||
/// <returns>The bounds.</returns>
|
/// <returns>The bounds.</returns>
|
||||||
virtual Rect GetBounds()=0;
|
virtual Rect GetBounds()=0;
|
||||||
@@ -4229,15 +4163,18 @@ Basic Construction
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
class GuiGraphicsSite : public GuiGraphicsComposition, public Description<GuiGraphicsSite>
|
class GuiGraphicsSite : public GuiGraphicsComposition, public Description<GuiGraphicsSite>
|
||||||
{
|
{
|
||||||
|
friend Rect InvokeGetBoundsInternal(GuiGraphicsSite* composition, Rect expectedBounds, bool considerPreferredMinSize);
|
||||||
protected:
|
protected:
|
||||||
Rect previousBounds;
|
Rect previousBounds;
|
||||||
|
|
||||||
/// <summary>Calculate the final bounds from an expected bounds.</summary>
|
/// <summary>Calculate the final bounds from an expected bounds.</summary>
|
||||||
/// <returns>The final bounds according to some configuration like margin, minimum size, etc..</returns>
|
/// <returns>The final bounds according to some configuration like margin, minimum size, etc..</returns>
|
||||||
/// <param name="expectedBounds">The expected bounds.</param>
|
/// <param name="expectedBounds">The expected bounds.</param>
|
||||||
virtual Rect GetBoundsInternal(Rect expectedBounds);
|
virtual Rect GetBoundsInternal(Rect expectedBounds, bool considerPreferredMinSize);
|
||||||
|
|
||||||
void UpdatePreviousBounds(Rect bounds);
|
void UpdatePreviousBounds(Rect bounds);
|
||||||
|
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||||
|
Rect GetPreferredBoundsInternal(bool considerPreferredMinSize)override;
|
||||||
public:
|
public:
|
||||||
GuiGraphicsSite();
|
GuiGraphicsSite();
|
||||||
~GuiGraphicsSite();
|
~GuiGraphicsSite();
|
||||||
@@ -4246,8 +4183,6 @@ Basic Construction
|
|||||||
compositions::GuiNotifyEvent BoundsChanged;
|
compositions::GuiNotifyEvent BoundsChanged;
|
||||||
|
|
||||||
bool IsSizeAffectParent()override;
|
bool IsSizeAffectParent()override;
|
||||||
Size GetMinPreferredClientSize()override;
|
|
||||||
Rect GetPreferredBounds()override;
|
|
||||||
|
|
||||||
/// <summary>Get the previous calculated bounds, ignoring any surrounding changes that could affect the bounds.</summary>
|
/// <summary>Get the previous calculated bounds, ignoring any surrounding changes that could affect the bounds.</summary>
|
||||||
/// <returns>The previous calculated bounds.</returns>
|
/// <returns>The previous calculated bounds.</returns>
|
||||||
@@ -4328,6 +4263,7 @@ Basic Compositions
|
|||||||
Rect compositionBounds;
|
Rect compositionBounds;
|
||||||
Margin alignmentToParent{ -1,-1,-1,-1 };
|
Margin alignmentToParent{ -1,-1,-1,-1 };
|
||||||
|
|
||||||
|
Rect GetPreferredBoundsInternal(bool considerPreferredMinSize)override;
|
||||||
public:
|
public:
|
||||||
GuiBoundsComposition();
|
GuiBoundsComposition();
|
||||||
~GuiBoundsComposition();
|
~GuiBoundsComposition();
|
||||||
@@ -4340,7 +4276,6 @@ Basic Compositions
|
|||||||
void SetSizeAffectParent(bool value);
|
void SetSizeAffectParent(bool value);
|
||||||
|
|
||||||
bool IsSizeAffectParent()override;
|
bool IsSizeAffectParent()override;
|
||||||
Rect GetPreferredBounds()override;
|
|
||||||
Rect GetBounds()override;
|
Rect GetBounds()override;
|
||||||
/// <summary>Set the expected bounds.</summary>
|
/// <summary>Set the expected bounds.</summary>
|
||||||
/// <param name="value">The expected bounds.</param>
|
/// <param name="value">The expected bounds.</param>
|
||||||
@@ -4789,6 +4724,7 @@ Host
|
|||||||
HostRecord hostRecord;
|
HostRecord hostRecord;
|
||||||
bool supressPaint = false;
|
bool supressPaint = false;
|
||||||
bool needRender = true;
|
bool needRender = true;
|
||||||
|
bool renderingTriggeredInLastFrame = false;
|
||||||
ProcList afterRenderProcs;
|
ProcList afterRenderProcs;
|
||||||
ProcMap afterRenderKeyedProcs;
|
ProcMap afterRenderKeyedProcs;
|
||||||
|
|
||||||
@@ -4849,9 +4785,11 @@ Host
|
|||||||
void Char(const NativeWindowCharInfo& info)override;
|
void Char(const NativeWindowCharInfo& info)override;
|
||||||
|
|
||||||
bool NeedRefresh()override;
|
bool NeedRefresh()override;
|
||||||
void ForceRefresh(bool handleFailure, bool& failureByResized, bool& failureByLostDevice)override;
|
void ForceRefresh(bool handleFailure, bool& updated, bool& failureByResized, bool& failureByLostDevice)override;
|
||||||
|
|
||||||
void GlobalTimer()override;
|
void GlobalTimer()override;
|
||||||
|
|
||||||
|
elements::RenderTargetFailure Render(bool forceUpdate, bool handleFailure, bool& updated);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GuiGraphicsHost(controls::GuiControlHost* _controlHost, GuiGraphicsComposition* boundsComposition);
|
GuiGraphicsHost(controls::GuiControlHost* _controlHost, GuiGraphicsComposition* boundsComposition);
|
||||||
~GuiGraphicsHost();
|
~GuiGraphicsHost();
|
||||||
@@ -4865,10 +4803,6 @@ Host
|
|||||||
/// <summary>Get the main <see cref="GuiWindowComposition"/>. If a window is associated, everything that put into the main composition will be shown in the window.</summary>
|
/// <summary>Get the main <see cref="GuiWindowComposition"/>. If a window is associated, everything that put into the main composition will be shown in the window.</summary>
|
||||||
/// <returns>The main compositoin.</returns>
|
/// <returns>The main compositoin.</returns>
|
||||||
GuiGraphicsComposition* GetMainComposition();
|
GuiGraphicsComposition* GetMainComposition();
|
||||||
/// <summary>Render the main composition and all content to the associated window.</summary>
|
|
||||||
/// <param name="forceUpdate">Set to true to force updating layout and then render.</param>
|
|
||||||
/// <param name="forceUpdate">Set to true to force updating layout and then render.</param>
|
|
||||||
elements::RenderTargetFailure Render(bool forceUpdate, bool handleFailure);
|
|
||||||
/// <summary>Request a rendering</summary>
|
/// <summary>Request a rendering</summary>
|
||||||
void RequestRender();
|
void RequestRender();
|
||||||
/// <summary>Invoke a specified function after rendering.</summary>
|
/// <summary>Invoke a specified function after rendering.</summary>
|
||||||
@@ -5031,6 +4965,7 @@ Flow Compositions
|
|||||||
void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments);
|
void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments);
|
||||||
void OnChildInserted(GuiGraphicsComposition* child)override;
|
void OnChildInserted(GuiGraphicsComposition* child)override;
|
||||||
void OnChildRemoved(GuiGraphicsComposition* child)override;
|
void OnChildRemoved(GuiGraphicsComposition* child)override;
|
||||||
|
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||||
public:
|
public:
|
||||||
GuiFlowComposition();
|
GuiFlowComposition();
|
||||||
~GuiFlowComposition();
|
~GuiFlowComposition();
|
||||||
@@ -5080,7 +5015,6 @@ Flow Compositions
|
|||||||
void SetAlignment(FlowAlignment value);
|
void SetAlignment(FlowAlignment value);
|
||||||
|
|
||||||
void ForceCalculateSizeImmediately()override;
|
void ForceCalculateSizeImmediately()override;
|
||||||
Size GetMinPreferredClientSize()override;
|
|
||||||
Rect GetBounds()override;
|
Rect GetBounds()override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5106,6 +5040,8 @@ Flow Compositions
|
|||||||
double percentage = 0.0;
|
double percentage = 0.0;
|
||||||
/// <summary>The distance value.</summary>
|
/// <summary>The distance value.</summary>
|
||||||
vint distance = 0;
|
vint distance = 0;
|
||||||
|
|
||||||
|
bool operator==(const GuiFlowOption& value) const = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -5702,6 +5638,7 @@ Stack Compositions
|
|||||||
void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments);
|
void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments);
|
||||||
void OnChildInserted(GuiGraphicsComposition* child)override;
|
void OnChildInserted(GuiGraphicsComposition* child)override;
|
||||||
void OnChildRemoved(GuiGraphicsComposition* child)override;
|
void OnChildRemoved(GuiGraphicsComposition* child)override;
|
||||||
|
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||||
public:
|
public:
|
||||||
GuiStackComposition();
|
GuiStackComposition();
|
||||||
~GuiStackComposition();
|
~GuiStackComposition();
|
||||||
@@ -5729,7 +5666,6 @@ Stack Compositions
|
|||||||
void SetPadding(vint value);
|
void SetPadding(vint value);
|
||||||
|
|
||||||
void ForceCalculateSizeImmediately()override;
|
void ForceCalculateSizeImmediately()override;
|
||||||
Size GetMinPreferredClientSize()override;
|
|
||||||
Rect GetBounds()override;
|
Rect GetBounds()override;
|
||||||
|
|
||||||
/// <summary>Get the extra margin inside the stack composition.</summary>
|
/// <summary>Get the extra margin inside the stack composition.</summary>
|
||||||
@@ -5932,8 +5868,7 @@ Table Compositions
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const GuiCellOption& value){return false;}
|
bool operator==(const GuiCellOption& value) const = default;
|
||||||
bool operator!=(const GuiCellOption& value){return true;}
|
|
||||||
|
|
||||||
/// <summary>Creates an absolute sizing option</summary>
|
/// <summary>Creates an absolute sizing option</summary>
|
||||||
/// <returns>The created option.</returns>
|
/// <returns>The created option.</returns>
|
||||||
@@ -6025,6 +5960,7 @@ Table Compositions
|
|||||||
);
|
);
|
||||||
|
|
||||||
void OnRenderContextChanged()override;
|
void OnRenderContextChanged()override;
|
||||||
|
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||||
public:
|
public:
|
||||||
GuiTableComposition();
|
GuiTableComposition();
|
||||||
~GuiTableComposition();
|
~GuiTableComposition();
|
||||||
@@ -6085,7 +6021,6 @@ Table Compositions
|
|||||||
void UpdateCellBounds();
|
void UpdateCellBounds();
|
||||||
|
|
||||||
void ForceCalculateSizeImmediately()override;
|
void ForceCalculateSizeImmediately()override;
|
||||||
Size GetMinPreferredClientSize()override;
|
|
||||||
Rect GetBounds()override;
|
Rect GetBounds()override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -6488,16 +6423,14 @@ Helpers
|
|||||||
struct Package\
|
struct Package\
|
||||||
{\
|
{\
|
||||||
TVALUE resource;\
|
TVALUE resource;\
|
||||||
vint counter;\
|
vint counter;\
|
||||||
bool operator==(const Package& package)const{return false;}\
|
bool operator==(const Package& package)const{return false;}\
|
||||||
bool operator!=(const Package& package)const{return true;}\
|
|
||||||
};\
|
};\
|
||||||
struct DeadPackage\
|
struct DeadPackage\
|
||||||
{\
|
{\
|
||||||
TKEY key;\
|
TKEY key;\
|
||||||
TVALUE value;\
|
TVALUE value;\
|
||||||
bool operator==(const DeadPackage& package)const{return false;}\
|
bool operator==(const DeadPackage& package)const{return false;}\
|
||||||
bool operator!=(const DeadPackage& package)const{return true;}\
|
|
||||||
};\
|
};\
|
||||||
Dictionary<TKEY, Package> aliveResources;\
|
Dictionary<TKEY, Package> aliveResources;\
|
||||||
List<DeadPackage> deadResources;\
|
List<DeadPackage> deadResources;\
|
||||||
@@ -7659,7 +7592,6 @@ Global String Key
|
|||||||
vint key = -1;
|
vint key = -1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline vint Compare(GlobalStringKey value)const{ return key - value.key; }
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(GlobalStringKey)
|
GUI_DEFINE_COMPARE_OPERATORS(GlobalStringKey)
|
||||||
|
|
||||||
static GlobalStringKey Get(const WString& string);
|
static GlobalStringKey Get(const WString& string);
|
||||||
@@ -7817,8 +7749,7 @@ Resource Structure
|
|||||||
GuiResourceLocation(const WString& _resourcePath, const WString& _filePath);
|
GuiResourceLocation(const WString& _resourcePath, const WString& _filePath);
|
||||||
GuiResourceLocation(Ptr<GuiResourceNodeBase> node);
|
GuiResourceLocation(Ptr<GuiResourceNodeBase> node);
|
||||||
|
|
||||||
bool operator==(const GuiResourceLocation& b)const { return resourcePath == b.resourcePath && filePath == b.filePath; }
|
GUI_DEFINE_COMPARE_OPERATORS(GuiResourceLocation)
|
||||||
bool operator!=(const GuiResourceLocation& b)const { return !(*this == b); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GuiResourceTextPos
|
struct GuiResourceTextPos
|
||||||
@@ -7830,8 +7761,7 @@ Resource Structure
|
|||||||
GuiResourceTextPos() = default;
|
GuiResourceTextPos() = default;
|
||||||
GuiResourceTextPos(GuiResourceLocation location, glr::ParsingTextPos position);
|
GuiResourceTextPos(GuiResourceLocation location, glr::ParsingTextPos position);
|
||||||
|
|
||||||
bool operator==(const GuiResourceTextPos& b)const { return originalLocation == b.originalLocation && row == b.row && column == b.column; }
|
GUI_DEFINE_COMPARE_OPERATORS(GuiResourceTextPos)
|
||||||
bool operator!=(const GuiResourceTextPos& b)const { return !(*this == b); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GuiResourceError
|
struct GuiResourceError
|
||||||
@@ -7848,8 +7778,7 @@ Resource Structure
|
|||||||
GuiResourceError(GuiResourceLocation _location, const WString& _message);
|
GuiResourceError(GuiResourceLocation _location, const WString& _message);
|
||||||
GuiResourceError(GuiResourceLocation _location, GuiResourceTextPos _position, const WString& _message);
|
GuiResourceError(GuiResourceLocation _location, GuiResourceTextPos _position, const WString& _message);
|
||||||
|
|
||||||
bool operator==(const GuiResourceError& b)const { return location == b.location && position == b.position && message == b.message; }
|
GUI_DEFINE_COMPARE_OPERATORS(GuiResourceError)
|
||||||
bool operator!=(const GuiResourceError& b)const { return !(*this == b); }
|
|
||||||
|
|
||||||
static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List<glr::ParsingError>& parsingErrors);
|
static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List<glr::ParsingError>& parsingErrors);
|
||||||
static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List<glr::ParsingError>& parsingErrors, glr::ParsingTextPos offset);
|
static void Transform(GuiResourceLocation _location, GuiResourceError::List& errors, collections::List<glr::ParsingError>& parsingErrors, glr::ParsingTextPos offset);
|
||||||
@@ -10533,15 +10462,7 @@ Rich Content Document (style)
|
|||||||
static DocumentFontSize Parse(const WString& value);
|
static DocumentFontSize Parse(const WString& value);
|
||||||
WString ToString()const;
|
WString ToString()const;
|
||||||
|
|
||||||
bool operator==(const DocumentFontSize& value)const
|
bool operator==(const DocumentFontSize& value) const = default;
|
||||||
{
|
|
||||||
return size == value.size && relative == value.relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=(const DocumentFontSize& value)const
|
|
||||||
{
|
|
||||||
return size != value.size || relative != value.relative;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>Represents a text style.</summary>
|
/// <summary>Represents a text style.</summary>
|
||||||
@@ -10922,8 +10843,7 @@ Elements
|
|||||||
int radiusX = 0;
|
int radiusX = 0;
|
||||||
int radiusY = 0;
|
int radiusY = 0;
|
||||||
|
|
||||||
bool operator==(const ElementShape& value)const { return shapeType == value.shapeType && radiusX == value.radiusX && radiusY == value.radiusY; }
|
bool operator==(const ElementShape& value) const = default;
|
||||||
bool operator!=(const ElementShape& value)const { return !(*this == value); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -11915,8 +11835,7 @@ Colorized Plain Text (model)
|
|||||||
~TextLine();
|
~TextLine();
|
||||||
|
|
||||||
static vint CalculateBufferLength(vint dataLength);
|
static vint CalculateBufferLength(vint dataLength);
|
||||||
bool operator==(const TextLine& value)const{return false;}
|
bool operator==(const TextLine& value) const { return false; }
|
||||||
bool operator!=(const TextLine& value)const{return true;}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initialize the <see cref="TextLine"/> instance to be an empty line.
|
/// Initialize the <see cref="TextLine"/> instance to be an empty line.
|
||||||
@@ -12266,13 +12185,6 @@ Colorized Plain Text (model)
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Color background;
|
Color background;
|
||||||
|
|
||||||
inline vint64_t Compare(const ColorItem& value)const
|
|
||||||
{
|
|
||||||
vint64_t result;
|
|
||||||
if ((result = text.Compare(value.text)) != 0) return result;
|
|
||||||
if ((result = background.Compare(value.background)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(ColorItem)
|
GUI_DEFINE_COMPARE_OPERATORS(ColorItem)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -12294,14 +12206,6 @@ Colorized Plain Text (model)
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
ColorItem selectedUnfocused;
|
ColorItem selectedUnfocused;
|
||||||
|
|
||||||
inline vint64_t Compare(const ColorEntry& value)const
|
|
||||||
{
|
|
||||||
vint64_t result;
|
|
||||||
if ((result = normal.Compare(value.normal)) != 0) return result;
|
|
||||||
if ((result = selectedFocused.Compare(value.selectedFocused)) != 0) return result;
|
|
||||||
if ((result = selectedUnfocused.Compare(value.selectedUnfocused)) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(ColorEntry)
|
GUI_DEFINE_COMPARE_OPERATORS(ColorEntry)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -14295,7 +14199,6 @@ TextItemProvider
|
|||||||
~TextItem();
|
~TextItem();
|
||||||
|
|
||||||
bool operator==(const TextItem& value)const;
|
bool operator==(const TextItem& value)const;
|
||||||
bool operator!=(const TextItem& value)const;
|
|
||||||
|
|
||||||
/// <summary>Get the text of this item.</summary>
|
/// <summary>Get the text of this item.</summary>
|
||||||
/// <returns>The text of this item.</returns>
|
/// <returns>The text of this item.</returns>
|
||||||
@@ -20551,13 +20454,6 @@ Ribbon Gallery List
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vint Compare(const GalleryPos& value)const
|
|
||||||
{
|
|
||||||
vint result;
|
|
||||||
if ((result = group - value.group) != 0) return result;
|
|
||||||
if ((result = item - value.item) != 0) return result;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GUI_DEFINE_COMPARE_OPERATORS(GalleryPos)
|
GUI_DEFINE_COMPARE_OPERATORS(GalleryPos)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -25058,6 +24954,7 @@ GuiHostedController
|
|||||||
protected:
|
protected:
|
||||||
SharedCallbackService callbackService;
|
SharedCallbackService callbackService;
|
||||||
hosted_window_manager::WindowManager<GuiHostedWindow*>* wmManager = nullptr;
|
hosted_window_manager::WindowManager<GuiHostedWindow*>* wmManager = nullptr;
|
||||||
|
bool windowsUpdatedInLastFrame = false;
|
||||||
INativeController* nativeController = nullptr;
|
INativeController* nativeController = nullptr;
|
||||||
elements::GuiHostedGraphicsResourceManager* hostedResourceManager = nullptr;
|
elements::GuiHostedGraphicsResourceManager* hostedResourceManager = nullptr;
|
||||||
collections::SortedList<Ptr<GuiHostedWindow>> createdWindows;
|
collections::SortedList<Ptr<GuiHostedWindow>> createdWindows;
|
||||||
|
|||||||
+438
-463
File diff suppressed because it is too large
Load Diff
+177
-206
@@ -264,132 +264,120 @@ Licensed under https://github.com/vczh-libraries/License
|
|||||||
#define VCZH_PRESENTATION_INSTANCEQUERY_AST_AST
|
#define VCZH_PRESENTATION_INSTANCEQUERY_AST_AST
|
||||||
|
|
||||||
|
|
||||||
namespace vl
|
namespace vl::presentation::instancequery
|
||||||
{
|
{
|
||||||
namespace presentation
|
class GuiIqCascadeQuery;
|
||||||
|
class GuiIqPrimaryQuery;
|
||||||
|
class GuiIqQuery;
|
||||||
|
class GuiIqSetQuery;
|
||||||
|
|
||||||
|
enum class GuiIqNameOption
|
||||||
{
|
{
|
||||||
namespace instancequery
|
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
||||||
|
Specified = 0,
|
||||||
|
Any = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class GuiIqChildOption
|
||||||
|
{
|
||||||
|
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
||||||
|
Direct = 0,
|
||||||
|
Indirect = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class GuiIqBinaryOperator
|
||||||
|
{
|
||||||
|
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
||||||
|
ExclusiveOr = 0,
|
||||||
|
Intersect = 1,
|
||||||
|
Union = 2,
|
||||||
|
Substract = 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
class GuiIqQuery abstract : public vl::glr::ParsingAstBase, vl::reflection::Description<GuiIqQuery>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class IVisitor : public virtual vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
||||||
{
|
{
|
||||||
class GuiIqCascadeQuery;
|
public:
|
||||||
class GuiIqPrimaryQuery;
|
virtual void Visit(GuiIqPrimaryQuery* node) = 0;
|
||||||
class GuiIqQuery;
|
virtual void Visit(GuiIqCascadeQuery* node) = 0;
|
||||||
class GuiIqSetQuery;
|
virtual void Visit(GuiIqSetQuery* node) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
enum class GuiIqNameOption
|
virtual void Accept(GuiIqQuery::IVisitor* visitor) = 0;
|
||||||
{
|
|
||||||
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
|
||||||
Specified = 0,
|
|
||||||
Any = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class GuiIqChildOption
|
};
|
||||||
{
|
|
||||||
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
|
||||||
Direct = 0,
|
|
||||||
Indirect = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class GuiIqBinaryOperator
|
class GuiIqPrimaryQuery : public GuiIqQuery, vl::reflection::Description<GuiIqPrimaryQuery>
|
||||||
{
|
{
|
||||||
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
public:
|
||||||
ExclusiveOr = 0,
|
GuiIqChildOption childOption = GuiIqChildOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||||
Intersect = 1,
|
GuiIqNameOption attributeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||||
Union = 2,
|
vl::glr::ParsingToken attributeName;
|
||||||
Substract = 3,
|
GuiIqNameOption typeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||||
};
|
vl::glr::ParsingToken typeName;
|
||||||
|
vl::glr::ParsingToken referenceName;
|
||||||
|
|
||||||
class GuiIqQuery abstract : public vl::glr::ParsingAstBase, vl::reflection::Description<GuiIqQuery>
|
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
||||||
{
|
};
|
||||||
public:
|
|
||||||
class IVisitor : public virtual vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void Visit(GuiIqPrimaryQuery* node) = 0;
|
|
||||||
virtual void Visit(GuiIqCascadeQuery* node) = 0;
|
|
||||||
virtual void Visit(GuiIqSetQuery* node) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void Accept(GuiIqQuery::IVisitor* visitor) = 0;
|
class GuiIqCascadeQuery : public GuiIqQuery, vl::reflection::Description<GuiIqCascadeQuery>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
vl::Ptr<GuiIqQuery> parent;
|
||||||
|
vl::Ptr<GuiIqQuery> child;
|
||||||
|
|
||||||
};
|
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
||||||
|
};
|
||||||
|
|
||||||
class GuiIqPrimaryQuery : public GuiIqQuery, vl::reflection::Description<GuiIqPrimaryQuery>
|
class GuiIqSetQuery : public GuiIqQuery, vl::reflection::Description<GuiIqSetQuery>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GuiIqChildOption childOption = GuiIqChildOption::UNDEFINED_ENUM_ITEM_VALUE;
|
vl::Ptr<GuiIqQuery> first;
|
||||||
GuiIqNameOption attributeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
vl::Ptr<GuiIqQuery> second;
|
||||||
vl::glr::ParsingToken attributeName;
|
GuiIqBinaryOperator op = GuiIqBinaryOperator::UNDEFINED_ENUM_ITEM_VALUE;
|
||||||
GuiIqNameOption typeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
|
||||||
vl::glr::ParsingToken typeName;
|
|
||||||
vl::glr::ParsingToken referenceName;
|
|
||||||
|
|
||||||
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GuiIqCascadeQuery : public GuiIqQuery, vl::reflection::Description<GuiIqCascadeQuery>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
vl::Ptr<GuiIqQuery> parent;
|
|
||||||
vl::Ptr<GuiIqQuery> child;
|
|
||||||
|
|
||||||
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class GuiIqSetQuery : public GuiIqQuery, vl::reflection::Description<GuiIqSetQuery>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
vl::Ptr<GuiIqQuery> first;
|
|
||||||
vl::Ptr<GuiIqQuery> second;
|
|
||||||
GuiIqBinaryOperator op = GuiIqBinaryOperator::UNDEFINED_ENUM_ITEM_VALUE;
|
|
||||||
|
|
||||||
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
namespace vl
|
namespace vl::reflection::description
|
||||||
{
|
{
|
||||||
namespace reflection
|
|
||||||
{
|
|
||||||
namespace description
|
|
||||||
{
|
|
||||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqNameOption)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqNameOption)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqChildOption)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqChildOption)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqPrimaryQuery)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqPrimaryQuery)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqCascadeQuery)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqCascadeQuery)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqBinaryOperator)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqBinaryOperator)
|
||||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqSetQuery)
|
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqSetQuery)
|
||||||
|
|
||||||
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
|
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
|
||||||
|
|
||||||
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||||
void Visit(vl::presentation::instancequery::GuiIqPrimaryQuery* node) override
|
void Visit(vl::presentation::instancequery::GuiIqPrimaryQuery* node) override
|
||||||
{
|
{
|
||||||
INVOKE_INTERFACE_PROXY(Visit, node);
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
||||||
}
|
|
||||||
|
|
||||||
void Visit(vl::presentation::instancequery::GuiIqCascadeQuery* node) override
|
|
||||||
{
|
|
||||||
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Visit(vl::presentation::instancequery::GuiIqSetQuery* node) override
|
|
||||||
{
|
|
||||||
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
||||||
}
|
|
||||||
|
|
||||||
END_INTERFACE_PROXY(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
/// <summary>Load all reflectable AST types, only available when <b>VCZH_DEBUG_NO_REFLECTION</b> is off.</summary>
|
|
||||||
/// <returns>Returns true if this operation succeeded.</returns>
|
|
||||||
extern bool GuiInstanceQueryAstLoadTypes();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void Visit(vl::presentation::instancequery::GuiIqCascadeQuery* node) override
|
||||||
|
{
|
||||||
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Visit(vl::presentation::instancequery::GuiIqSetQuery* node) override
|
||||||
|
{
|
||||||
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
||||||
|
}
|
||||||
|
|
||||||
|
END_INTERFACE_PROXY(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
/// <summary>Load all reflectable AST types, only available when <b>VCZH_DEBUG_NO_REFLECTION</b> is off.</summary>
|
||||||
|
/// <returns>Returns true if this operation succeeded.</returns>
|
||||||
|
extern bool GuiInstanceQueryAstLoadTypes();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -874,51 +862,45 @@ Licensed under https://github.com/vczh-libraries/License
|
|||||||
#define VCZH_PRESENTATION_INSTANCEQUERY_AST_ASSEMBLER
|
#define VCZH_PRESENTATION_INSTANCEQUERY_AST_ASSEMBLER
|
||||||
|
|
||||||
|
|
||||||
namespace vl
|
namespace vl::presentation::instancequery
|
||||||
{
|
{
|
||||||
namespace presentation
|
enum class GuiInstanceQueryClasses : vl::vint32_t
|
||||||
{
|
{
|
||||||
namespace instancequery
|
CascadeQuery = 0,
|
||||||
{
|
PrimaryQuery = 1,
|
||||||
enum class GuiInstanceQueryClasses : vl::vint32_t
|
Query = 2,
|
||||||
{
|
SetQuery = 3,
|
||||||
CascadeQuery = 0,
|
};
|
||||||
PrimaryQuery = 1,
|
|
||||||
Query = 2,
|
|
||||||
SetQuery = 3,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class GuiInstanceQueryFields : vl::vint32_t
|
enum class GuiInstanceQueryFields : vl::vint32_t
|
||||||
{
|
{
|
||||||
CascadeQuery_child = 0,
|
CascadeQuery_child = 0,
|
||||||
CascadeQuery_parent = 1,
|
CascadeQuery_parent = 1,
|
||||||
PrimaryQuery_attributeName = 2,
|
PrimaryQuery_attributeName = 2,
|
||||||
PrimaryQuery_attributeNameOption = 3,
|
PrimaryQuery_attributeNameOption = 3,
|
||||||
PrimaryQuery_childOption = 4,
|
PrimaryQuery_childOption = 4,
|
||||||
PrimaryQuery_referenceName = 5,
|
PrimaryQuery_referenceName = 5,
|
||||||
PrimaryQuery_typeName = 6,
|
PrimaryQuery_typeName = 6,
|
||||||
PrimaryQuery_typeNameOption = 7,
|
PrimaryQuery_typeNameOption = 7,
|
||||||
SetQuery_first = 8,
|
SetQuery_first = 8,
|
||||||
SetQuery_op = 9,
|
SetQuery_op = 9,
|
||||||
SetQuery_second = 10,
|
SetQuery_second = 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const wchar_t* GuiInstanceQueryTypeName(GuiInstanceQueryClasses type);
|
extern const wchar_t* GuiInstanceQueryTypeName(GuiInstanceQueryClasses type);
|
||||||
extern const wchar_t* GuiInstanceQueryCppTypeName(GuiInstanceQueryClasses type);
|
extern const wchar_t* GuiInstanceQueryCppTypeName(GuiInstanceQueryClasses type);
|
||||||
extern const wchar_t* GuiInstanceQueryFieldName(GuiInstanceQueryFields field);
|
extern const wchar_t* GuiInstanceQueryFieldName(GuiInstanceQueryFields field);
|
||||||
extern const wchar_t* GuiInstanceQueryCppFieldName(GuiInstanceQueryFields field);
|
extern const wchar_t* GuiInstanceQueryCppFieldName(GuiInstanceQueryFields field);
|
||||||
|
|
||||||
class GuiInstanceQueryAstInsReceiver : public vl::glr::AstInsReceiverBase
|
class GuiInstanceQueryAstInsReceiver : public vl::glr::AstInsReceiverBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
vl::Ptr<vl::glr::ParsingAstBase> CreateAstNode(vl::vint32_t type) override;
|
vl::Ptr<vl::glr::ParsingAstBase> CreateAstNode(vl::vint32_t type) override;
|
||||||
void SetField(vl::glr::ParsingAstBase* object, vl::vint32_t field, vl::Ptr<vl::glr::ParsingAstBase> value) override;
|
void SetField(vl::glr::ParsingAstBase* object, vl::vint32_t field, vl::Ptr<vl::glr::ParsingAstBase> value) override;
|
||||||
void SetField(vl::glr::ParsingAstBase* object, vl::vint32_t field, const vl::regex::RegexToken& token, vl::vint32_t tokenIndex) override;
|
void SetField(vl::glr::ParsingAstBase* object, vl::vint32_t field, const vl::regex::RegexToken& token, vl::vint32_t tokenIndex) override;
|
||||||
void SetField(vl::glr::ParsingAstBase* object, vl::vint32_t field, vl::vint32_t enumItem, bool weakAssignment) override;
|
void SetField(vl::glr::ParsingAstBase* object, vl::vint32_t field, vl::vint32_t enumItem, bool weakAssignment) override;
|
||||||
vl::Ptr<vl::glr::ParsingAstBase> ResolveAmbiguity(vl::vint32_t type, vl::collections::Array<vl::Ptr<vl::glr::ParsingAstBase>>& candidates) override;
|
vl::Ptr<vl::glr::ParsingAstBase> ResolveAmbiguity(vl::vint32_t type, vl::collections::Array<vl::Ptr<vl::glr::ParsingAstBase>>& candidates) override;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -935,37 +917,31 @@ Licensed under https://github.com/vczh-libraries/License
|
|||||||
#define VCZH_PRESENTATION_INSTANCEQUERY_LEXER
|
#define VCZH_PRESENTATION_INSTANCEQUERY_LEXER
|
||||||
|
|
||||||
|
|
||||||
namespace vl
|
namespace vl::presentation::instancequery
|
||||||
{
|
{
|
||||||
namespace presentation
|
enum class GuiInstanceQueryTokens : vl::vint32_t
|
||||||
{
|
{
|
||||||
namespace instancequery
|
INDIRECT = 0,
|
||||||
{
|
DIRECT = 1,
|
||||||
enum class GuiInstanceQueryTokens : vl::vint32_t
|
NAME = 2,
|
||||||
{
|
WILDCARD_INTERSECT = 3,
|
||||||
INDIRECT = 0,
|
OPEN = 4,
|
||||||
DIRECT = 1,
|
CLOSE = 5,
|
||||||
NAME = 2,
|
XOR = 6,
|
||||||
WILDCARD_INTERSECT = 3,
|
UNION = 7,
|
||||||
OPEN = 4,
|
SUBSTRACT = 8,
|
||||||
CLOSE = 5,
|
ATTRIBUTE = 9,
|
||||||
XOR = 6,
|
COLON = 10,
|
||||||
UNION = 7,
|
DOT = 11,
|
||||||
SUBSTRACT = 8,
|
SPACE = 12,
|
||||||
ATTRIBUTE = 9,
|
};
|
||||||
COLON = 10,
|
|
||||||
DOT = 11,
|
|
||||||
SPACE = 12,
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr vl::vint GuiInstanceQueryTokenCount = 13;
|
constexpr vl::vint GuiInstanceQueryTokenCount = 13;
|
||||||
extern bool GuiInstanceQueryTokenDeleter(vl::vint token);
|
extern bool GuiInstanceQueryTokenDeleter(vl::vint token);
|
||||||
extern const wchar_t* GuiInstanceQueryTokenId(GuiInstanceQueryTokens token);
|
extern const wchar_t* GuiInstanceQueryTokenId(GuiInstanceQueryTokens token);
|
||||||
extern const wchar_t* GuiInstanceQueryTokenDisplayText(GuiInstanceQueryTokens token);
|
extern const wchar_t* GuiInstanceQueryTokenDisplayText(GuiInstanceQueryTokens token);
|
||||||
extern const wchar_t* GuiInstanceQueryTokenRegex(GuiInstanceQueryTokens token);
|
extern const wchar_t* GuiInstanceQueryTokenRegex(GuiInstanceQueryTokens token);
|
||||||
extern void GuiInstanceQueryLexerData(vl::stream::IStream& outputStream);
|
extern void GuiInstanceQueryLexerData(vl::stream::IStream& outputStream);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -982,41 +958,36 @@ Licensed under https://github.com/vczh-libraries/License
|
|||||||
#define VCZH_PRESENTATION_INSTANCEQUERY_PARSER_SYNTAX
|
#define VCZH_PRESENTATION_INSTANCEQUERY_PARSER_SYNTAX
|
||||||
|
|
||||||
|
|
||||||
namespace vl
|
namespace vl::presentation::instancequery
|
||||||
{
|
{
|
||||||
namespace presentation
|
enum class ParserStates
|
||||||
{
|
{
|
||||||
namespace instancequery
|
QPrimaryFragment = 0,
|
||||||
{
|
QPrimaryAttributed = 8,
|
||||||
enum class ParserStates
|
QPrimary = 15,
|
||||||
{
|
Query0 = 24,
|
||||||
QPrimaryFragment = 0,
|
Query1 = 29,
|
||||||
QPrimaryAttributed = 8,
|
Query2 = 38,
|
||||||
QPrimary = 15,
|
QueryRoot = 47,
|
||||||
Query0 = 24,
|
};
|
||||||
Query1 = 29,
|
|
||||||
Query2 = 38,
|
|
||||||
QueryRoot = 47,
|
|
||||||
};
|
|
||||||
|
|
||||||
const wchar_t* ParserRuleName(vl::vint index);
|
const wchar_t* ParserRuleName(vl::vint index);
|
||||||
const wchar_t* ParserStateLabel(vl::vint index);
|
const wchar_t* ParserStateLabel(vl::vint index);
|
||||||
extern void GuiInstanceQueryParserData(vl::stream::IStream& outputStream);
|
extern void GuiInstanceQueryParserData(vl::stream::IStream& outputStream);
|
||||||
|
|
||||||
class Parser
|
class Parser
|
||||||
: public vl::glr::ParserBase<GuiInstanceQueryTokens, ParserStates, GuiInstanceQueryAstInsReceiver>
|
: public vl::glr::ParserBase<GuiInstanceQueryTokens, ParserStates, GuiInstanceQueryAstInsReceiver>
|
||||||
, protected vl::glr::automaton::IExecutor::ITypeCallback
|
, protected vl::glr::automaton::IExecutor::ITypeCallback
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
vl::vint32_t FindCommonBaseClass(vl::vint32_t class1, vl::vint32_t class2) const override;
|
vl::WString GetClassName(vl::vint32_t classIndex) const override;
|
||||||
public:
|
vl::vint32_t FindCommonBaseClass(vl::vint32_t class1, vl::vint32_t class2) const override;
|
||||||
Parser();
|
public:
|
||||||
|
Parser();
|
||||||
|
|
||||||
vl::Ptr<vl::presentation::instancequery::GuiIqQuery> ParseQueryRoot(const vl::WString& input, vl::vint codeIndex = -1) const;
|
vl::Ptr<vl::presentation::instancequery::GuiIqQuery> ParseQueryRoot(const vl::WString& input, vl::vint codeIndex = -1) const;
|
||||||
vl::Ptr<vl::presentation::instancequery::GuiIqQuery> ParseQueryRoot(vl::collections::List<vl::regex::RegexToken>& tokens, vl::vint codeIndex = -1) const;
|
vl::Ptr<vl::presentation::instancequery::GuiIqQuery> ParseQueryRoot(vl::collections::List<vl::regex::RegexToken>& tokens, vl::vint codeIndex = -1) const;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -3453,6 +3453,8 @@ Type Declaration
|
|||||||
ENUM_CLASS_ITEM(RenderTargetChanged)
|
ENUM_CLASS_ITEM(RenderTargetChanged)
|
||||||
ENUM_CLASS_ITEM(ParentLineChanged)
|
ENUM_CLASS_ITEM(ParentLineChanged)
|
||||||
ENUM_CLASS_ITEM(ServiceAdded)
|
ENUM_CLASS_ITEM(ServiceAdded)
|
||||||
|
ENUM_CLASS_ITEM(UpdateRequested)
|
||||||
|
ENUM_CLASS_ITEM(UpdateFullfilled)
|
||||||
END_ENUM_ITEM(ControlSignal)
|
END_ENUM_ITEM(ControlSignal)
|
||||||
|
|
||||||
BEGIN_CLASS_MEMBER(GuiControlSignalEventArgs)
|
BEGIN_CLASS_MEMBER(GuiControlSignalEventArgs)
|
||||||
|
|||||||
+1429
-1780
File diff suppressed because it is too large
Load Diff
+2360
-2208
File diff suppressed because it is too large
Load Diff
+752
-877
File diff suppressed because it is too large
Load Diff
+4180
-4225
File diff suppressed because it is too large
Load Diff
+1332
-1462
File diff suppressed because it is too large
Load Diff
@@ -406,9 +406,6 @@ Utilities
|
|||||||
, length(_length)
|
, length(_length)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const BufferPair& pair) { return false; }
|
|
||||||
bool operator!=(const BufferPair& pair) { return true; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool HttpQuery(const HttpRequest& request, HttpResponse& response)
|
bool HttpQuery(const HttpRequest& request, HttpResponse& response)
|
||||||
|
|||||||
@@ -62,11 +62,6 @@ FilePath
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
vint FilePath::Compare(const FilePath& a, const FilePath& b)
|
|
||||||
{
|
|
||||||
return (vint)WString::Compare(a.fullPath, b.fullPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
FilePath FilePath::operator/(const WString& relativePath)const
|
FilePath FilePath::operator/(const WString& relativePath)const
|
||||||
{
|
{
|
||||||
if (IsRoot())
|
if (IsRoot())
|
||||||
@@ -449,10 +444,6 @@ Locale
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Locale::~Locale()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const WString& Locale::GetName()const
|
const WString& Locale::GetName()const
|
||||||
{
|
{
|
||||||
return localeName;
|
return localeName;
|
||||||
|
|||||||
+13
-15
@@ -175,15 +175,18 @@ namespace vl
|
|||||||
/// In Windows, the specified locale need to be installed in order to take effect.
|
/// In Windows, the specified locale need to be installed in order to take effect.
|
||||||
/// In Linux and macOS, only en-US is supported.
|
/// In Linux and macOS, only en-US is supported.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
Locale(const WString& _localeName=WString::Empty);
|
Locale() = default;
|
||||||
~Locale();
|
Locale(const Locale&) = default;
|
||||||
|
Locale(Locale&&) = default;
|
||||||
|
~Locale() = default;
|
||||||
|
|
||||||
bool operator==(const Locale& value)const { return localeName==value.localeName; }
|
Locale& operator=(const Locale&) = default;
|
||||||
bool operator!=(const Locale& value)const { return localeName!=value.localeName; }
|
Locale& operator=(Locale&&) = default;
|
||||||
bool operator<(const Locale& value)const { return localeName<value.localeName; }
|
|
||||||
bool operator<=(const Locale& value)const { return localeName<=value.localeName; }
|
Locale(const WString& _localeName);
|
||||||
bool operator>(const Locale& value)const { return localeName>value.localeName; }
|
|
||||||
bool operator>=(const Locale& value)const { return localeName>=value.localeName; }
|
std::strong_ordering operator<=>(const Locale& locale)const { return localeName <=> locale.localeName; }
|
||||||
|
bool operator==(const Locale& locale)const { return localeName == locale.localeName; }
|
||||||
|
|
||||||
/// <summary>Get the invariant locale. An invariant locale is neutral, it is not awared of any language specified thing.</summary>
|
/// <summary>Get the invariant locale. An invariant locale is neutral, it is not awared of any language specified thing.</summary>
|
||||||
/// <returns>The invariant locale.</returns>
|
/// <returns>The invariant locale.</returns>
|
||||||
@@ -1918,13 +1921,8 @@ namespace vl
|
|||||||
FilePath(const FilePath& _filePath);
|
FilePath(const FilePath& _filePath);
|
||||||
~FilePath() = default;
|
~FilePath() = default;
|
||||||
|
|
||||||
static vint Compare(const FilePath& a, const FilePath& b);
|
std::strong_ordering operator<=>(const FilePath& path)const { return fullPath <=> path.fullPath; }
|
||||||
bool operator==(const FilePath& filePath)const{ return Compare(*this, filePath) == 0; }
|
bool operator==(const FilePath& path)const { return fullPath == path.fullPath; }
|
||||||
bool operator!=(const FilePath& filePath)const{ return Compare(*this, filePath) != 0; }
|
|
||||||
bool operator< (const FilePath& filePath)const{ return Compare(*this, filePath) < 0; }
|
|
||||||
bool operator<=(const FilePath& filePath)const{ return Compare(*this, filePath) <= 0; }
|
|
||||||
bool operator> (const FilePath& filePath)const{ return Compare(*this, filePath) > 0; }
|
|
||||||
bool operator>=(const FilePath& filePath)const{ return Compare(*this, filePath) >= 0; }
|
|
||||||
|
|
||||||
/// <summary>Concat an absolute path and a relative path.</summary>
|
/// <summary>Concat an absolute path and a relative path.</summary>
|
||||||
/// <returns>The result absolute path.</returns>
|
/// <returns>The result absolute path.</returns>
|
||||||
|
|||||||
+36
-34
@@ -3740,7 +3740,7 @@ GenerateTable
|
|||||||
i1 > i2 ? ParsingTable::TransitionItem::WrongOrder :
|
i1 > i2 ? ParsingTable::TransitionItem::WrongOrder :
|
||||||
ParsingTable::TransitionItem::SameOrder
|
ParsingTable::TransitionItem::SameOrder
|
||||||
;
|
;
|
||||||
return ParsingTable::TransitionItem::Compare(t1, t2, defaultOrder);
|
return ParsingTable::TransitionItem::Compare(t1, t2, defaultOrder) <=> 0;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// build look ahead inside a transition
|
// build look ahead inside a transition
|
||||||
@@ -4225,38 +4225,44 @@ IsMergableCandidate
|
|||||||
RearrangeState
|
RearrangeState
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#define COMPARE_SYMBOL(S1, S2)\
|
std::strong_ordering CompareParsingSymbol(ParsingSymbol* s1, ParsingSymbol* s2)
|
||||||
if (S1 && S2)\
|
|
||||||
{\
|
|
||||||
if (S1->GetType() < S2->GetType()) return -1;\
|
|
||||||
if (S1->GetType() > S2->GetType()) return 1;\
|
|
||||||
if (S1->GetName() < S2->GetName()) return -1;\
|
|
||||||
if (S1->GetName() > S2->GetName()) return 1;\
|
|
||||||
}\
|
|
||||||
else if (S1)\
|
|
||||||
{\
|
|
||||||
return 1;\
|
|
||||||
}\
|
|
||||||
else if (S2)\
|
|
||||||
{\
|
|
||||||
return -1;\
|
|
||||||
}\
|
|
||||||
|
|
||||||
vint CompareTransitionForRearranging(Transition* t1, Transition* t2)
|
|
||||||
{
|
{
|
||||||
if (t1->transitionType < t2->transitionType) return -1;
|
if (s1 && s2)
|
||||||
if (t1->transitionType > t2->transitionType) return 1;
|
{
|
||||||
COMPARE_SYMBOL(t1->transitionSymbol, t2->transitionSymbol);
|
std::strong_ordering
|
||||||
return 0;
|
result = s1->GetType() <=> s2->GetType(); if (result != 0) return result;
|
||||||
|
result = s1->GetName() <=> s2->GetName(); if (result != 0) return result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else if (s1)
|
||||||
|
{
|
||||||
|
return std::strong_ordering::greater;
|
||||||
|
}
|
||||||
|
else if (s2)
|
||||||
|
{
|
||||||
|
return std::strong_ordering::less;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return std::strong_ordering::equal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vint CompareActionForRearranging(Ptr<Action> a1, Ptr<Action> a2)
|
std::strong_ordering CompareTransitionForRearranging(Transition* t1, Transition* t2)
|
||||||
{
|
{
|
||||||
if(a1->actionType<a2->actionType) return -1;
|
std::strong_ordering
|
||||||
if(a1->actionType>a2->actionType) return 1;
|
result = t1->transitionType <=> t2->transitionType; if (result != 0) return result;
|
||||||
COMPARE_SYMBOL(a1->actionSource, a2->actionSource);
|
result = CompareParsingSymbol(t1->transitionSymbol, t2->transitionSymbol); if (result != 0) return result;
|
||||||
COMPARE_SYMBOL(a1->actionTarget, a2->actionTarget);
|
return result;
|
||||||
return 0;
|
}
|
||||||
|
|
||||||
|
std::strong_ordering CompareActionForRearranging(Ptr<Action> a1, Ptr<Action> a2)
|
||||||
|
{
|
||||||
|
std::strong_ordering
|
||||||
|
result = a1->actionType <=> a2->actionType; if (result != 0) return result;
|
||||||
|
result = CompareParsingSymbol(a1->actionSource, a2->actionSource); if (result != 0) return result;
|
||||||
|
result = CompareParsingSymbol(a1->actionTarget, a2->actionTarget); if (result != 0) return result;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef COMPARE_SYMBOL
|
#undef COMPARE_SYMBOL
|
||||||
@@ -8540,10 +8546,6 @@ namespace vl
|
|||||||
|
|
||||||
namespace parsing
|
namespace parsing
|
||||||
{
|
{
|
||||||
vint CompareTextRange(Ptr<ParsingTreeNode> r1, Ptr<ParsingTreeNode> r2)
|
|
||||||
{
|
|
||||||
return ParsingTextPos::Compare(r1->GetCodeRange().start, r2->GetCodeRange().start);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
ParsingTreeNode::TraversalVisitor
|
ParsingTreeNode::TraversalVisitor
|
||||||
@@ -8719,7 +8721,7 @@ ParsingTreeNode
|
|||||||
const auto& range = node->GetCodeRange();
|
const auto& range = node->GetCodeRange();
|
||||||
return !range.start.IsInvalid() && !range.end.IsInvalid();
|
return !range.start.IsInvalid() && !range.end.IsInvalid();
|
||||||
})
|
})
|
||||||
.OrderBy(&CompareTextRange)
|
.OrderByKey([](auto&& node) { return node->GetCodeRange().start; })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-26
@@ -74,47 +74,45 @@ Location
|
|||||||
return index < 0 && row < 0 && column < 0;
|
return index < 0 && row < 0 && column < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static vint Compare(const ParsingTextPos& a, const ParsingTextPos& b)
|
friend std::strong_ordering operator<=>(const ParsingTextPos& a, const ParsingTextPos& b)
|
||||||
{
|
{
|
||||||
if (a.IsInvalid() && b.IsInvalid())
|
if (a.IsInvalid() && b.IsInvalid())
|
||||||
{
|
{
|
||||||
return 0;
|
return std::strong_ordering::equal;
|
||||||
}
|
}
|
||||||
else if (a.IsInvalid())
|
else if (a.IsInvalid())
|
||||||
{
|
{
|
||||||
return -1;
|
return std::strong_ordering::less;
|
||||||
}
|
}
|
||||||
else if (b.IsInvalid())
|
else if (b.IsInvalid())
|
||||||
{
|
{
|
||||||
return 1;
|
return std::strong_ordering::greater;
|
||||||
}
|
}
|
||||||
else if (a.index >= 0 && b.index >= 0)
|
else if (a.index >= 0 && b.index >= 0)
|
||||||
{
|
{
|
||||||
return a.index - b.index;
|
return a.index <=> b.index;
|
||||||
}
|
}
|
||||||
else if (a.row >= 0 && a.column >= 0 && b.row >= 0 && b.column >= 0)
|
else if (a.row >= 0 && a.column >= 0 && b.row >= 0 && b.column >= 0)
|
||||||
{
|
{
|
||||||
if (a.row == b.row)
|
if (a.row == b.row)
|
||||||
{
|
{
|
||||||
return a.column - b.column;
|
return a.column <=> b.column;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return a.row - b.row;
|
return a.row <=> b.row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
return std::strong_ordering::equal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ParsingTextPos& pos)const{return Compare(*this, pos)==0;}
|
friend bool operator==(const ParsingTextPos& a, const ParsingTextPos& b)
|
||||||
bool operator!=(const ParsingTextPos& pos)const{return Compare(*this, pos)!=0;}
|
{
|
||||||
bool operator<(const ParsingTextPos& pos)const{return Compare(*this, pos)<0;}
|
return (a <=> b) == 0;
|
||||||
bool operator<=(const ParsingTextPos& pos)const{return Compare(*this, pos)<=0;}
|
}
|
||||||
bool operator>(const ParsingTextPos& pos)const{return Compare(*this, pos)>0;}
|
|
||||||
bool operator>=(const ParsingTextPos& pos)const{return Compare(*this, pos)>=0;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>A type representing text range.</summary>
|
/// <summary>A type representing text range.</summary>
|
||||||
@@ -1124,21 +1122,18 @@ DefinitionTypeScopePair
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
vint Compare(const DefinitionTypeScopePair& pair)const
|
std::strong_ordering operator<=>(const DefinitionTypeScopePair& pair)const
|
||||||
{
|
{
|
||||||
if(type<pair.type) return -1;
|
std::strong_ordering
|
||||||
if(type>pair.type) return 1;
|
result = type <=> pair.type; if (result != 0) return result;
|
||||||
if(scope<pair.scope) return -1;
|
result = scope <=> pair.scope; if (result != 0) return result;
|
||||||
if(scope>pair.scope) return 1;
|
return result;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator== (const DefinitionTypeScopePair& pair)const {return Compare(pair)==0;}
|
bool operator==(const DefinitionTypeScopePair& pair)const
|
||||||
bool operator!= (const DefinitionTypeScopePair& pair)const {return Compare(pair)!=0;}
|
{
|
||||||
bool operator> (const DefinitionTypeScopePair& pair)const {return Compare(pair)>0;}
|
return (*this <=> pair) == 0;
|
||||||
bool operator>= (const DefinitionTypeScopePair& pair)const {return Compare(pair)>=0;}
|
}
|
||||||
bool operator< (const DefinitionTypeScopePair& pair)const {return Compare(pair)<0;}
|
|
||||||
bool operator<= (const DefinitionTypeScopePair& pair)const {return Compare(pair)<=0;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|||||||
+120
-134
@@ -2350,140 +2350,6 @@ description::Value
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
vint Value::Compare(const Value& a, const Value& b)const
|
|
||||||
{
|
|
||||||
switch (a.GetValueType())
|
|
||||||
{
|
|
||||||
case Value::RawPtr:
|
|
||||||
case Value::SharedPtr:
|
|
||||||
switch (b.GetValueType())
|
|
||||||
{
|
|
||||||
case Value::RawPtr:
|
|
||||||
case Value::SharedPtr:
|
|
||||||
{
|
|
||||||
auto pa = a.GetRawPtr();
|
|
||||||
auto pb = b.GetRawPtr();
|
|
||||||
if (pa < pb) return -1;
|
|
||||||
if (pa > pb) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
case Value::BoxedValue:
|
|
||||||
return -1;
|
|
||||||
default:
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
case Value::BoxedValue:
|
|
||||||
switch (b.GetValueType())
|
|
||||||
{
|
|
||||||
case Value::RawPtr:
|
|
||||||
case Value::SharedPtr:
|
|
||||||
return 1;
|
|
||||||
case Value::BoxedValue:
|
|
||||||
{
|
|
||||||
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
|
|
||||||
auto aSt = a.GetTypeDescriptor()->GetSerializableType();
|
|
||||||
auto bSt = b.GetTypeDescriptor()->GetSerializableType();
|
|
||||||
if (aSt)
|
|
||||||
{
|
|
||||||
if (bSt)
|
|
||||||
{
|
|
||||||
auto aSt = a.GetTypeDescriptor()->GetSerializableType();
|
|
||||||
auto bSt = b.GetTypeDescriptor()->GetSerializableType();
|
|
||||||
|
|
||||||
WString aText;
|
|
||||||
WString bText;
|
|
||||||
aSt->Serialize(a, aText);
|
|
||||||
bSt->Serialize(b, bText);
|
|
||||||
if (aText < bText) return -1;
|
|
||||||
if (aText > bText) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (bSt)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (a.GetTypeDescriptor() != b.GetTypeDescriptor())
|
|
||||||
{
|
|
||||||
auto aText = a.GetTypeDescriptor()->GetTypeName();
|
|
||||||
auto bText = b.GetTypeDescriptor()->GetTypeName();
|
|
||||||
if (aText < bText) return -1;
|
|
||||||
if (aText > bText) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (a.GetTypeDescriptor()->GetTypeDescriptorFlags())
|
|
||||||
{
|
|
||||||
case TypeDescriptorFlags::Struct:
|
|
||||||
{
|
|
||||||
auto td = a.GetTypeDescriptor();
|
|
||||||
vint count = td->GetPropertyCount();
|
|
||||||
for (vint i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
auto prop = td->GetProperty(i);
|
|
||||||
auto ap = prop->GetValue(a);
|
|
||||||
auto bp = prop->GetValue(b);
|
|
||||||
vint result = Compare(ap, bp);
|
|
||||||
if (result != 0)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
case TypeDescriptorFlags::FlagEnum:
|
|
||||||
case TypeDescriptorFlags::NormalEnum:
|
|
||||||
{
|
|
||||||
auto ai = a.GetTypeDescriptor()->GetEnumType()->FromEnum(a);
|
|
||||||
auto bi = a.GetTypeDescriptor()->GetEnumType()->FromEnum(b);
|
|
||||||
if (ai < bi) return -1;
|
|
||||||
if (ai > bi) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
auto pa = a.GetBoxedValue();
|
|
||||||
auto pb = b.GetBoxedValue();
|
|
||||||
switch (pa->ComparePrimitive(pb))
|
|
||||||
{
|
|
||||||
case IBoxedValue::Smaller: return -1;
|
|
||||||
case IBoxedValue::Greater: return 1;
|
|
||||||
case IBoxedValue::Equal: return 0;
|
|
||||||
default:;
|
|
||||||
}
|
|
||||||
if (pa.Obj() < pb.Obj()) return -1;
|
|
||||||
if (pa.Obj() > pb.Obj()) return 1;
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
switch (b.GetValueType())
|
|
||||||
{
|
|
||||||
case Value::RawPtr:
|
|
||||||
case Value::SharedPtr:
|
|
||||||
case Value::BoxedValue:
|
|
||||||
return -1;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Value::Value()
|
Value::Value()
|
||||||
:valueType(Null)
|
:valueType(Null)
|
||||||
,rawPtr(0)
|
,rawPtr(0)
|
||||||
@@ -2516,6 +2382,126 @@ description::Value
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::strong_ordering operator<=>(const Value& a, const Value& b)
|
||||||
|
{
|
||||||
|
switch (a.GetValueType())
|
||||||
|
{
|
||||||
|
case Value::RawPtr:
|
||||||
|
case Value::SharedPtr:
|
||||||
|
switch (b.GetValueType())
|
||||||
|
{
|
||||||
|
case Value::RawPtr:
|
||||||
|
case Value::SharedPtr:
|
||||||
|
{
|
||||||
|
auto pa = a.GetRawPtr();
|
||||||
|
auto pb = b.GetRawPtr();
|
||||||
|
return pa <=> pb;
|
||||||
|
}
|
||||||
|
case Value::BoxedValue:
|
||||||
|
return std::strong_ordering::less;
|
||||||
|
default:
|
||||||
|
return std::strong_ordering::greater;
|
||||||
|
}
|
||||||
|
case Value::BoxedValue:
|
||||||
|
switch (b.GetValueType())
|
||||||
|
{
|
||||||
|
case Value::RawPtr:
|
||||||
|
case Value::SharedPtr:
|
||||||
|
return std::strong_ordering::greater;
|
||||||
|
case Value::BoxedValue:
|
||||||
|
{
|
||||||
|
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
|
||||||
|
auto aSt = a.GetTypeDescriptor()->GetSerializableType();
|
||||||
|
auto bSt = b.GetTypeDescriptor()->GetSerializableType();
|
||||||
|
if (aSt)
|
||||||
|
{
|
||||||
|
if (bSt)
|
||||||
|
{
|
||||||
|
auto aSt = a.GetTypeDescriptor()->GetSerializableType();
|
||||||
|
auto bSt = b.GetTypeDescriptor()->GetSerializableType();
|
||||||
|
|
||||||
|
WString aText;
|
||||||
|
WString bText;
|
||||||
|
aSt->Serialize(a, aText);
|
||||||
|
bSt->Serialize(b, bText);
|
||||||
|
return aText <=> bText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return std::strong_ordering::greater;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bSt)
|
||||||
|
{
|
||||||
|
return std::strong_ordering::less;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (a.GetTypeDescriptor() != b.GetTypeDescriptor())
|
||||||
|
{
|
||||||
|
auto aText = a.GetTypeDescriptor()->GetTypeName();
|
||||||
|
auto bText = b.GetTypeDescriptor()->GetTypeName();
|
||||||
|
return aText <=> bText;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (a.GetTypeDescriptor()->GetTypeDescriptorFlags())
|
||||||
|
{
|
||||||
|
case TypeDescriptorFlags::Struct:
|
||||||
|
{
|
||||||
|
auto td = a.GetTypeDescriptor();
|
||||||
|
vint count = td->GetPropertyCount();
|
||||||
|
for (vint i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
auto prop = td->GetProperty(i);
|
||||||
|
auto ap = prop->GetValue(a);
|
||||||
|
auto bp = prop->GetValue(b);
|
||||||
|
return ap <=> bp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return std::strong_ordering::equal;
|
||||||
|
case TypeDescriptorFlags::FlagEnum:
|
||||||
|
case TypeDescriptorFlags::NormalEnum:
|
||||||
|
{
|
||||||
|
auto ai = a.GetTypeDescriptor()->GetEnumType()->FromEnum(a);
|
||||||
|
auto bi = a.GetTypeDescriptor()->GetEnumType()->FromEnum(b);
|
||||||
|
return ai <=> bi;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return std::strong_ordering::equal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
auto pa = a.GetBoxedValue();
|
||||||
|
auto pb = b.GetBoxedValue();
|
||||||
|
switch (pa->ComparePrimitive(pb))
|
||||||
|
{
|
||||||
|
case IBoxedValue::Smaller: return std::strong_ordering::less;
|
||||||
|
case IBoxedValue::Greater: return std::strong_ordering::greater;
|
||||||
|
case IBoxedValue::Equal: return std::strong_ordering::equal;
|
||||||
|
default:;
|
||||||
|
}
|
||||||
|
return pa.Obj() <=> pb.Obj();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return std::strong_ordering::greater;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
switch (b.GetValueType())
|
||||||
|
{
|
||||||
|
case Value::RawPtr:
|
||||||
|
case Value::SharedPtr:
|
||||||
|
case Value::BoxedValue:
|
||||||
|
return std::strong_ordering::less;
|
||||||
|
default:
|
||||||
|
return std::strong_ordering::equal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Value::ValueType Value::GetValueType()const
|
Value::ValueType Value::GetValueType()const
|
||||||
{
|
{
|
||||||
return valueType;
|
return valueType;
|
||||||
|
|||||||
@@ -827,19 +827,14 @@ Value
|
|||||||
Value(DescriptableObject* value);
|
Value(DescriptableObject* value);
|
||||||
Value(Ptr<DescriptableObject> value);
|
Value(Ptr<DescriptableObject> value);
|
||||||
Value(Ptr<IBoxedValue> value, ITypeDescriptor* associatedTypeDescriptor);
|
Value(Ptr<IBoxedValue> value, ITypeDescriptor* associatedTypeDescriptor);
|
||||||
|
|
||||||
vint Compare(const Value& a, const Value& b)const;
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Create a null value.</summary>
|
/// <summary>Create a null value.</summary>
|
||||||
Value();
|
Value();
|
||||||
Value(const Value& value);
|
Value(const Value& value);
|
||||||
Value& operator=(const Value& value);
|
Value& operator=(const Value& value);
|
||||||
bool operator==(const Value& value)const { return Compare(*this, value) == 0; }
|
|
||||||
bool operator!=(const Value& value)const { return Compare(*this, value) != 0; }
|
friend std::strong_ordering operator<=>(const Value& a, const Value& b);
|
||||||
bool operator<(const Value& value)const { return Compare(*this, value)<0; }
|
friend bool operator==(const Value& a, const Value& b) { return (a <=> b) == 0; }
|
||||||
bool operator<=(const Value& value)const { return Compare(*this, value) <= 0; }
|
|
||||||
bool operator>(const Value& value)const { return Compare(*this, value)>0; }
|
|
||||||
bool operator>=(const Value& value)const { return Compare(*this, value) >= 0; }
|
|
||||||
|
|
||||||
/// <summary>Find out how the value is stored.</summary>
|
/// <summary>Find out how the value is stored.</summary>
|
||||||
/// <returns>Returns How the value is stored.</returns>
|
/// <returns>Returns How the value is stored.</returns>
|
||||||
|
|||||||
@@ -1622,11 +1622,6 @@ Data Structures for Backtracking
|
|||||||
StateSaver(const StateSaver&) = default;
|
StateSaver(const StateSaver&) = default;
|
||||||
StateSaver& operator=(const StateSaver&) = default;
|
StateSaver& operator=(const StateSaver&) = default;
|
||||||
|
|
||||||
bool operator==(const StateSaver& saver)const
|
|
||||||
{
|
|
||||||
CHECK_FAIL(L"This function is only created to satisfy List<T>.");
|
|
||||||
}
|
|
||||||
|
|
||||||
void RestoreReaderTo(StateSaver<TChar>& saver)
|
void RestoreReaderTo(StateSaver<TChar>& saver)
|
||||||
{
|
{
|
||||||
saver.reader = reader;
|
saver.reader = reader;
|
||||||
@@ -1653,11 +1648,6 @@ Data Structures for Backtracking
|
|||||||
ExtensionSaver(const ExtensionSaver&) = default;
|
ExtensionSaver(const ExtensionSaver&) = default;
|
||||||
ExtensionSaver& operator=(const ExtensionSaver&) = default;
|
ExtensionSaver& operator=(const ExtensionSaver&) = default;
|
||||||
|
|
||||||
bool operator==(const ExtensionSaver& saver)const
|
|
||||||
{
|
|
||||||
CHECK_FAIL(L"This function is only created to satisfy List<T>.");
|
|
||||||
}
|
|
||||||
|
|
||||||
void RestoreReaderTo(StateSaver<TChar>& saver)
|
void RestoreReaderTo(StateSaver<TChar>& saver)
|
||||||
{
|
{
|
||||||
saver.reader = reader;
|
saver.reader = reader;
|
||||||
@@ -1717,14 +1707,6 @@ Data Structures for Backtracking
|
|||||||
|
|
||||||
namespace regex_internal
|
namespace regex_internal
|
||||||
{
|
{
|
||||||
/***********************************************************************
|
|
||||||
CaptureRecord
|
|
||||||
***********************************************************************/
|
|
||||||
|
|
||||||
bool CaptureRecord::operator==(const CaptureRecord& record)const
|
|
||||||
{
|
|
||||||
return capture == record.capture && start == record.start && length == record.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
RichInterpretor
|
RichInterpretor
|
||||||
|
|||||||
+11
-49
@@ -1375,65 +1375,29 @@ CharRange
|
|||||||
CharRange() = default;
|
CharRange() = default;
|
||||||
CharRange(char32_t _begin, char32_t _end) : begin(_begin), end(_end) {}
|
CharRange(char32_t _begin, char32_t _end) : begin(_begin), end(_end) {}
|
||||||
|
|
||||||
bool operator<(CharRange item) const
|
std::partial_ordering operator<=>(const CharRange& cr)const
|
||||||
{
|
{
|
||||||
return end < item.begin;
|
if (end < cr.begin) return std::partial_ordering::less;
|
||||||
|
if (cr.end < begin) return std::partial_ordering::greater;
|
||||||
|
return *this == cr ? std::partial_ordering::equivalent : std::partial_ordering::unordered;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator<=(CharRange item) const
|
bool operator==(const CharRange& cr)const
|
||||||
{
|
{
|
||||||
return *this < item || *this == item;
|
return begin == cr.begin && end == cr.end;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator>(CharRange item) const
|
std::strong_ordering operator<=>(char32_t item)const
|
||||||
{
|
{
|
||||||
return item.end < begin;
|
if (end < item) return std::strong_ordering::less;
|
||||||
|
if (begin > item) return std::strong_ordering::greater;
|
||||||
|
return std::strong_ordering::equal;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator>=(CharRange item) const
|
bool operator==(char32_t item)const
|
||||||
{
|
|
||||||
return *this > item || *this == item;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(CharRange item) const
|
|
||||||
{
|
|
||||||
return begin == item.begin && end == item.end;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=(CharRange item) const
|
|
||||||
{
|
|
||||||
return begin != item.begin || item.end != end;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<(char32_t item) const
|
|
||||||
{
|
|
||||||
return end < item;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<=(char32_t item) const
|
|
||||||
{
|
|
||||||
return begin <= item;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator>(char32_t item) const
|
|
||||||
{
|
|
||||||
return item < begin;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator>=(char32_t item) const
|
|
||||||
{
|
|
||||||
return item <= end;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(char32_t item) const
|
|
||||||
{
|
{
|
||||||
return begin <= item && item <= end;
|
return begin <= item && item <= end;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(char32_t item) const
|
|
||||||
{
|
|
||||||
return item < begin || end < item;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2092,8 +2056,6 @@ namespace vl
|
|||||||
vint capture;
|
vint capture;
|
||||||
vint start;
|
vint start;
|
||||||
vint length;
|
vint length;
|
||||||
|
|
||||||
bool operator==(const CaptureRecord& record)const;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13484
-13529
File diff suppressed because it is too large
Load Diff
+4300
-4347
File diff suppressed because it is too large
Load Diff
@@ -2826,9 +2826,9 @@ WfDebugger BreakPoints
|
|||||||
PropertyKey key1(breakPoint.thisObject, breakPoint.propertyInfo);
|
PropertyKey key1(breakPoint.thisObject, breakPoint.propertyInfo);
|
||||||
MethodKey key2(breakPoint.thisObject, breakPoint.propertyInfo->GetGetter());
|
MethodKey key2(breakPoint.thisObject, breakPoint.propertyInfo->GetGetter());
|
||||||
TEST(true, key1, getPropertyBreakPoints);
|
TEST(true, key1, getPropertyBreakPoints);
|
||||||
TEST(key2.f1, key2, invokeMethodBreakPoints);
|
TEST(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||||
SET(key1, getPropertyBreakPoints);
|
SET(key1, getPropertyBreakPoints);
|
||||||
SETC(key2.f1, key2, invokeMethodBreakPoints);
|
SETC(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WfBreakPoint::SetProperty:
|
case WfBreakPoint::SetProperty:
|
||||||
@@ -2836,9 +2836,9 @@ WfDebugger BreakPoints
|
|||||||
PropertyKey key1(breakPoint.thisObject, breakPoint.propertyInfo);
|
PropertyKey key1(breakPoint.thisObject, breakPoint.propertyInfo);
|
||||||
MethodKey key2(breakPoint.thisObject, breakPoint.propertyInfo->GetSetter());
|
MethodKey key2(breakPoint.thisObject, breakPoint.propertyInfo->GetSetter());
|
||||||
TEST(true, key1, setPropertyBreakPoints);
|
TEST(true, key1, setPropertyBreakPoints);
|
||||||
TEST(key2.f1, key2, invokeMethodBreakPoints);
|
TEST(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||||
SET(key1, setPropertyBreakPoints);
|
SET(key1, setPropertyBreakPoints);
|
||||||
SETC(key2.f1, key2, invokeMethodBreakPoints);
|
SETC(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WfBreakPoint::AttachEvent:
|
case WfBreakPoint::AttachEvent:
|
||||||
|
|||||||
@@ -29,11 +29,9 @@ void CollectConditions(
|
|||||||
vint index = conditions.Keys().IndexOf(file);
|
vint index = conditions.Keys().IndexOf(file);
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
const auto& tuples = conditions.GetByIndex(index);
|
for (auto [condition, path] : conditions.GetByIndex(index))
|
||||||
for (vint i = 0; i < tuples.Count(); i++)
|
|
||||||
{
|
{
|
||||||
auto condition = tuples[i].f0;
|
auto includeFile = inputFileToOutputFiles[path];
|
||||||
auto includeFile = inputFileToOutputFiles[tuples[i].f1];
|
|
||||||
if (!categorizedConditions.Contains(condition, includeFile))
|
if (!categorizedConditions.Contains(condition, includeFile))
|
||||||
{
|
{
|
||||||
categorizedConditions.Add(condition, includeFile);
|
categorizedConditions.Add(condition, includeFile);
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ int main(int argc, char* argv[])
|
|||||||
CopyFrom(
|
CopyFrom(
|
||||||
categorizedOutput,
|
categorizedOutput,
|
||||||
XmlGetElements(XmlGetElement(config->rootElement, L"output"), L"codepair")
|
XmlGetElements(XmlGetElement(config->rootElement, L"output"), L"codepair")
|
||||||
.Select([&](Ptr<XmlElement> e)->Pair<WString, Tuple<WString, bool>>
|
.Select([&](Ptr<XmlElement> e)
|
||||||
{
|
{
|
||||||
return {
|
return Pair(
|
||||||
XmlGetAttribute(e, L"category")->value.value,
|
XmlGetAttribute(e, L"category")->value.value,
|
||||||
{
|
Tuple(
|
||||||
XmlGetAttribute(e, L"filename")->value.value,
|
XmlGetAttribute(e, L"filename")->value.value,
|
||||||
XmlGetAttribute(e, L"generate")->value.value == L"true"
|
XmlGetAttribute(e, L"generate")->value.value == L"true"
|
||||||
}
|
)
|
||||||
};
|
);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ int main(int argc, char* argv[])
|
|||||||
Dictionary<WString, FilePath> skippedImportFiles; // file name -> file path
|
Dictionary<WString, FilePath> skippedImportFiles; // file name -> file path
|
||||||
for (vint i = 0; i < categorizedOutput.Count(); i++)
|
for (vint i = 0; i < categorizedOutput.Count(); i++)
|
||||||
{
|
{
|
||||||
if (!categorizedOutput.Values()[i].f1)
|
if (!categorizedOutput.Values()[i].get<1>())
|
||||||
{
|
{
|
||||||
auto category = categorizedOutput.Keys()[i];
|
auto category = categorizedOutput.Keys()[i];
|
||||||
for (auto skippedImportFile : categorizedHeaderFiles[category])
|
for (auto skippedImportFile : categorizedHeaderFiles[category])
|
||||||
@@ -206,7 +206,7 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
auto key = inputFileToCategories.Keys()[i];
|
auto key = inputFileToCategories.Keys()[i];
|
||||||
auto value = inputFileToCategories.Values()[i];
|
auto value = inputFileToCategories.Values()[i];
|
||||||
inputFileToOutputFiles.Add(key, categorizedOutput[value].f0);
|
inputFileToOutputFiles.Add(key, categorizedOutput[value].get<0>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ int main(int argc, char* argv[])
|
|||||||
})
|
})
|
||||||
.Select([&](vint nodeIndex)
|
.Select([&](vint nodeIndex)
|
||||||
{
|
{
|
||||||
return categorizedOutput[componentToCategoryNames[popCategories.nodes[nodeIndex].component][0]].f0 + L".h";
|
return categorizedOutput[componentToCategoryNames[popCategories.nodes[nodeIndex].component][0]].get<0>() + L".h";
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -243,13 +243,13 @@ int main(int argc, char* argv[])
|
|||||||
for (vint i = 0; i < popCategories.components.Count(); i++)
|
for (vint i = 0; i < popCategories.components.Count(); i++)
|
||||||
{
|
{
|
||||||
auto categoryName = componentToCategoryNames[i][0];
|
auto categoryName = componentToCategoryNames[i][0];
|
||||||
auto outputPath = outputFolder / (categorizedOutput[categoryName].f0 + L".h");
|
auto outputPath = outputFolder / (categorizedOutput[categoryName].get<0>() + L".h");
|
||||||
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].f0 + L".h");
|
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].get<0>() + L".h");
|
||||||
|
|
||||||
auto systemIncludes = Ptr(new SortedList<WString>);
|
auto systemIncludes = Ptr(new SortedList<WString>);
|
||||||
categorizedSystemIncludes.Add(categoryName, systemIncludes);
|
categorizedSystemIncludes.Add(categoryName, systemIncludes);
|
||||||
|
|
||||||
if (categorizedOutput[categoryName].f1)
|
if (categorizedOutput[categoryName].get<1>())
|
||||||
{
|
{
|
||||||
vint headerIndex = categorizedHeaderFiles.Keys().IndexOf(categoryName);
|
vint headerIndex = categorizedHeaderFiles.Keys().IndexOf(categoryName);
|
||||||
if (headerIndex == -1) continue;
|
if (headerIndex == -1) continue;
|
||||||
@@ -272,13 +272,13 @@ int main(int argc, char* argv[])
|
|||||||
for (vint i = 0; i < popCategories.components.Count(); i++)
|
for (vint i = 0; i < popCategories.components.Count(); i++)
|
||||||
{
|
{
|
||||||
auto categoryName = componentToCategoryNames[i][0];
|
auto categoryName = componentToCategoryNames[i][0];
|
||||||
if (categorizedOutput[categoryName].f1)
|
if (categorizedOutput[categoryName].get<1>())
|
||||||
{
|
{
|
||||||
WString outputHeader[] = { categorizedOutput[categoryName].f0 + L".h" };
|
WString outputHeader[] = { categorizedOutput[categoryName].get<0>() + L".h"};
|
||||||
vint headerIndex = categorizedHeaderFiles.Keys().IndexOf(categoryName);
|
vint headerIndex = categorizedHeaderFiles.Keys().IndexOf(categoryName);
|
||||||
|
|
||||||
auto outputPath = outputFolder / (categorizedOutput[categoryName].f0 + L".cpp");
|
auto outputPath = outputFolder / (categorizedOutput[categoryName].get<0>() + L".cpp");
|
||||||
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].f0 + L".cpp");
|
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].get<0>() + L".cpp");
|
||||||
Combine(
|
Combine(
|
||||||
inputFileToOutputFiles,
|
inputFileToOutputFiles,
|
||||||
skippedImportFiles,
|
skippedImportFiles,
|
||||||
|
|||||||
@@ -321,39 +321,6 @@ int main(int argc, char* argv[])
|
|||||||
syntaxManager.BuildAutomaton(lexerManager.Tokens().Count(), executable, metadata);
|
syntaxManager.BuildAutomaton(lexerManager.Tokens().Count(), executable, metadata);
|
||||||
EXIT_IF_COMPILE_FAIL(global);
|
EXIT_IF_COMPILE_FAIL(global);
|
||||||
|
|
||||||
for (auto elementExport : XmlGetElements(elementSyntax, L"Export"))
|
|
||||||
{
|
|
||||||
WString rule;
|
|
||||||
READ_ATTRIBUTE(rule, elementExport, L"rule", L"/Parser/Syntax@file[@name=\"" + name + L"\"]/Export@rule");
|
|
||||||
|
|
||||||
vint index = syntaxManager.Rules().Keys().IndexOf(rule);
|
|
||||||
if (index == -1)
|
|
||||||
{
|
|
||||||
EXIT_ERROR(L"Rule \"" + rule + L"\" is not defined in the syntax.");
|
|
||||||
}
|
|
||||||
|
|
||||||
auto ruleSymbol = syntaxManager.Rules().Values()[index];
|
|
||||||
syntaxManager.parsableRules.Add(ruleSymbol);
|
|
||||||
|
|
||||||
if (auto attType = XmlGetAttribute(elementExport, L"type"))
|
|
||||||
{
|
|
||||||
syntaxManager.ruleTypes.Add(ruleSymbol, attType->value.value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto classSymbol = ruleSymbol->ruleType;
|
|
||||||
auto classFile = classSymbol->Owner();
|
|
||||||
auto type =
|
|
||||||
From(classFile->cppNss)
|
|
||||||
.Reverse()
|
|
||||||
.Aggregate(
|
|
||||||
classFile->classPrefix + classSymbol->Name(),
|
|
||||||
[](auto&& a, auto&& b) { return b + L"::" + a; }
|
|
||||||
);
|
|
||||||
syntaxManager.ruleTypes.Add(ruleSymbol, type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GenerateSyntaxFileNames(syntaxManager, output);
|
GenerateSyntaxFileNames(syntaxManager, output);
|
||||||
WriteSyntaxFiles(syntaxManager, executable, metadata, output, files);
|
WriteSyntaxFiles(syntaxManager, executable, metadata, output, files);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user