mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-26 01:35:31 +08:00
Update release
This commit is contained in:
@@ -3067,13 +3067,6 @@ WindowsDirect2DParagraph
|
||||
TextRange(){}
|
||||
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)
|
||||
};
|
||||
|
||||
|
||||
+1
-16
@@ -461,8 +461,7 @@ Renderers
|
||||
ColorItemResource selectedFocused;
|
||||
ColorItemResource selectedUnfocused;
|
||||
|
||||
bool operator==(const ColorEntryResource& value){return false;}
|
||||
bool operator!=(const ColorEntryResource& value){return true;}
|
||||
bool operator==(const ColorEntryResource& value) const { return false; }
|
||||
};
|
||||
|
||||
typedef collections::Array<ColorEntryResource> ColorArray;
|
||||
@@ -1057,13 +1056,6 @@ UniscribeColor
|
||||
UniscribeColorRange(){}
|
||||
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)
|
||||
};
|
||||
|
||||
@@ -1075,13 +1067,6 @@ UniscribeColor
|
||||
UniscribeColor(){}
|
||||
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)
|
||||
};
|
||||
}
|
||||
|
||||
+425
-291
File diff suppressed because it is too large
Load Diff
+52
-155
@@ -74,12 +74,8 @@ Enumerations
|
||||
};
|
||||
|
||||
#define GUI_DEFINE_COMPARE_OPERATORS(TYPE)\
|
||||
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; } \
|
||||
inline bool operator> (const TYPE& right)const { return Compare(right) > 0; } \
|
||||
inline bool operator>=(const TYPE& right)const { return Compare(right) >= 0; } \
|
||||
std::strong_ordering operator<=>(const TYPE&) const = default;\
|
||||
bool operator==(const TYPE&) const = default;\
|
||||
|
||||
/***********************************************************************
|
||||
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)
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
|
||||
@@ -180,7 +162,6 @@ Coordinate
|
||||
NativeCoordinate& operator=(const NativeCoordinate& _value) = default;
|
||||
NativeCoordinate& operator=(NativeCoordinate&& _value) = default;
|
||||
|
||||
inline vint Compare(NativeCoordinate c) const { return value - c.value; }
|
||||
GUI_DEFINE_COMPARE_OPERATORS(NativeCoordinate)
|
||||
|
||||
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>)
|
||||
};
|
||||
|
||||
@@ -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>)
|
||||
};
|
||||
|
||||
@@ -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>)
|
||||
|
||||
Point_<T> LeftTop()const
|
||||
@@ -536,11 +494,8 @@ Color
|
||||
{
|
||||
}
|
||||
|
||||
vint64_t Compare(Color color)const
|
||||
{
|
||||
return (vint64_t)value - (vint64_t)color.value;
|
||||
}
|
||||
GUI_DEFINE_COMPARE_OPERATORS(Color)
|
||||
std::strong_ordering operator<=>(const Color& c) const { return value <=> c.value; }
|
||||
bool operator==(const Color& c) const { return value == c.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>)
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
|
||||
@@ -2347,7 +2266,12 @@ INativeWindow
|
||||
/// </summary>
|
||||
/// <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>
|
||||
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>
|
||||
/// Called when the window becomes a non-main window in hosted mode.
|
||||
/// It requires MaximizedBox and MinimizedBox to be disabled.
|
||||
@@ -3707,6 +3631,10 @@ Predefined Events
|
||||
ParentLineChanged,
|
||||
/// <summary>Service added changed.</summary>
|
||||
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>
|
||||
@@ -4018,7 +3946,9 @@ Basic Construction
|
||||
|
||||
friend class controls::GuiControl;
|
||||
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:
|
||||
/// <summary>
|
||||
/// Minimum size limitation.
|
||||
@@ -4073,6 +4003,9 @@ Basic Construction
|
||||
void SetAssociatedControl(controls::GuiControl* control);
|
||||
void InvokeOnCompositionStateChanged();
|
||||
|
||||
virtual Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) = 0;
|
||||
virtual Rect GetPreferredBoundsInternal(bool considerPreferredMinSize) = 0;
|
||||
|
||||
static bool SharedPtrDestructorProc(DescriptableObject* obj, bool forceDisposing);
|
||||
public:
|
||||
GuiGraphicsComposition();
|
||||
@@ -4209,16 +4142,17 @@ Basic Construction
|
||||
virtual Rect GetClientArea();
|
||||
/// <summary>Force to calculate layout and size immediately</summary>
|
||||
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>
|
||||
/// <returns>Returns true if the size calculation is affected by the parent.</returns>
|
||||
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>
|
||||
/// <returns>The bounds.</returns>
|
||||
virtual Rect GetBounds()=0;
|
||||
@@ -4229,15 +4163,18 @@ Basic Construction
|
||||
/// </summary>
|
||||
class GuiGraphicsSite : public GuiGraphicsComposition, public Description<GuiGraphicsSite>
|
||||
{
|
||||
friend Rect InvokeGetBoundsInternal(GuiGraphicsSite* composition, Rect expectedBounds, bool considerPreferredMinSize);
|
||||
protected:
|
||||
Rect previousBounds;
|
||||
|
||||
/// <summary>Calculate the final bounds from an expected bounds.</summary>
|
||||
/// <returns>The final bounds according to some configuration like margin, minimum size, etc..</returns>
|
||||
/// <param name="expectedBounds">The expected bounds.</param>
|
||||
virtual Rect GetBoundsInternal(Rect expectedBounds);
|
||||
virtual Rect GetBoundsInternal(Rect expectedBounds, bool considerPreferredMinSize);
|
||||
|
||||
void UpdatePreviousBounds(Rect bounds);
|
||||
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||
Rect GetPreferredBoundsInternal(bool considerPreferredMinSize)override;
|
||||
public:
|
||||
GuiGraphicsSite();
|
||||
~GuiGraphicsSite();
|
||||
@@ -4246,8 +4183,6 @@ Basic Construction
|
||||
compositions::GuiNotifyEvent BoundsChanged;
|
||||
|
||||
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>
|
||||
/// <returns>The previous calculated bounds.</returns>
|
||||
@@ -4327,7 +4262,8 @@ Basic Compositions
|
||||
bool sizeAffectParent = true;
|
||||
Rect compositionBounds;
|
||||
Margin alignmentToParent{ -1,-1,-1,-1 };
|
||||
|
||||
|
||||
Rect GetPreferredBoundsInternal(bool considerPreferredMinSize)override;
|
||||
public:
|
||||
GuiBoundsComposition();
|
||||
~GuiBoundsComposition();
|
||||
@@ -4340,7 +4276,6 @@ Basic Compositions
|
||||
void SetSizeAffectParent(bool value);
|
||||
|
||||
bool IsSizeAffectParent()override;
|
||||
Rect GetPreferredBounds()override;
|
||||
Rect GetBounds()override;
|
||||
/// <summary>Set the expected bounds.</summary>
|
||||
/// <param name="value">The expected bounds.</param>
|
||||
@@ -4789,6 +4724,7 @@ Host
|
||||
HostRecord hostRecord;
|
||||
bool supressPaint = false;
|
||||
bool needRender = true;
|
||||
bool renderingTriggeredInLastFrame = false;
|
||||
ProcList afterRenderProcs;
|
||||
ProcMap afterRenderKeyedProcs;
|
||||
|
||||
@@ -4849,9 +4785,11 @@ Host
|
||||
void Char(const NativeWindowCharInfo& info)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;
|
||||
|
||||
elements::RenderTargetFailure Render(bool forceUpdate, bool handleFailure, bool& updated);
|
||||
|
||||
public:
|
||||
GuiGraphicsHost(controls::GuiControlHost* _controlHost, GuiGraphicsComposition* boundsComposition);
|
||||
~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>
|
||||
/// <returns>The main compositoin.</returns>
|
||||
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>
|
||||
void RequestRender();
|
||||
/// <summary>Invoke a specified function after rendering.</summary>
|
||||
@@ -5031,6 +4965,7 @@ Flow Compositions
|
||||
void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments);
|
||||
void OnChildInserted(GuiGraphicsComposition* child)override;
|
||||
void OnChildRemoved(GuiGraphicsComposition* child)override;
|
||||
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||
public:
|
||||
GuiFlowComposition();
|
||||
~GuiFlowComposition();
|
||||
@@ -5080,7 +5015,6 @@ Flow Compositions
|
||||
void SetAlignment(FlowAlignment value);
|
||||
|
||||
void ForceCalculateSizeImmediately()override;
|
||||
Size GetMinPreferredClientSize()override;
|
||||
Rect GetBounds()override;
|
||||
};
|
||||
|
||||
@@ -5106,6 +5040,8 @@ Flow Compositions
|
||||
double percentage = 0.0;
|
||||
/// <summary>The distance value.</summary>
|
||||
vint distance = 0;
|
||||
|
||||
bool operator==(const GuiFlowOption& value) const = default;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -5702,6 +5638,7 @@ Stack Compositions
|
||||
void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments);
|
||||
void OnChildInserted(GuiGraphicsComposition* child)override;
|
||||
void OnChildRemoved(GuiGraphicsComposition* child)override;
|
||||
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||
public:
|
||||
GuiStackComposition();
|
||||
~GuiStackComposition();
|
||||
@@ -5729,7 +5666,6 @@ Stack Compositions
|
||||
void SetPadding(vint value);
|
||||
|
||||
void ForceCalculateSizeImmediately()override;
|
||||
Size GetMinPreferredClientSize()override;
|
||||
Rect GetBounds()override;
|
||||
|
||||
/// <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){return true;}
|
||||
bool operator==(const GuiCellOption& value) const = default;
|
||||
|
||||
/// <summary>Creates an absolute sizing option</summary>
|
||||
/// <returns>The created option.</returns>
|
||||
@@ -6025,6 +5960,7 @@ Table Compositions
|
||||
);
|
||||
|
||||
void OnRenderContextChanged()override;
|
||||
Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override;
|
||||
public:
|
||||
GuiTableComposition();
|
||||
~GuiTableComposition();
|
||||
@@ -6085,7 +6021,6 @@ Table Compositions
|
||||
void UpdateCellBounds();
|
||||
|
||||
void ForceCalculateSizeImmediately()override;
|
||||
Size GetMinPreferredClientSize()override;
|
||||
Rect GetBounds()override;
|
||||
};
|
||||
|
||||
@@ -6488,16 +6423,14 @@ Helpers
|
||||
struct Package\
|
||||
{\
|
||||
TVALUE resource;\
|
||||
vint counter;\
|
||||
vint counter;\
|
||||
bool operator==(const Package& package)const{return false;}\
|
||||
bool operator!=(const Package& package)const{return true;}\
|
||||
};\
|
||||
struct DeadPackage\
|
||||
{\
|
||||
TKEY key;\
|
||||
TVALUE value;\
|
||||
bool operator==(const DeadPackage& package)const{return false;}\
|
||||
bool operator!=(const DeadPackage& package)const{return true;}\
|
||||
};\
|
||||
Dictionary<TKEY, Package> aliveResources;\
|
||||
List<DeadPackage> deadResources;\
|
||||
@@ -7659,7 +7592,6 @@ Global String Key
|
||||
vint key = -1;
|
||||
|
||||
public:
|
||||
inline vint Compare(GlobalStringKey value)const{ return key - value.key; }
|
||||
GUI_DEFINE_COMPARE_OPERATORS(GlobalStringKey)
|
||||
|
||||
static GlobalStringKey Get(const WString& string);
|
||||
@@ -7817,8 +7749,7 @@ Resource Structure
|
||||
GuiResourceLocation(const WString& _resourcePath, const WString& _filePath);
|
||||
GuiResourceLocation(Ptr<GuiResourceNodeBase> node);
|
||||
|
||||
bool operator==(const GuiResourceLocation& b)const { return resourcePath == b.resourcePath && filePath == b.filePath; }
|
||||
bool operator!=(const GuiResourceLocation& b)const { return !(*this == b); }
|
||||
GUI_DEFINE_COMPARE_OPERATORS(GuiResourceLocation)
|
||||
};
|
||||
|
||||
struct GuiResourceTextPos
|
||||
@@ -7830,8 +7761,7 @@ Resource Structure
|
||||
GuiResourceTextPos() = default;
|
||||
GuiResourceTextPos(GuiResourceLocation location, glr::ParsingTextPos position);
|
||||
|
||||
bool operator==(const GuiResourceTextPos& b)const { return originalLocation == b.originalLocation && row == b.row && column == b.column; }
|
||||
bool operator!=(const GuiResourceTextPos& b)const { return !(*this == b); }
|
||||
GUI_DEFINE_COMPARE_OPERATORS(GuiResourceTextPos)
|
||||
};
|
||||
|
||||
struct GuiResourceError
|
||||
@@ -7848,8 +7778,7 @@ Resource Structure
|
||||
GuiResourceError(GuiResourceLocation _location, 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; }
|
||||
bool operator!=(const GuiResourceError& b)const { return !(*this == b); }
|
||||
GUI_DEFINE_COMPARE_OPERATORS(GuiResourceError)
|
||||
|
||||
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);
|
||||
@@ -10533,15 +10462,7 @@ Rich Content Document (style)
|
||||
static DocumentFontSize Parse(const WString& value);
|
||||
WString ToString()const;
|
||||
|
||||
bool operator==(const DocumentFontSize& value)const
|
||||
{
|
||||
return size == value.size && relative == value.relative;
|
||||
}
|
||||
|
||||
bool operator!=(const DocumentFontSize& value)const
|
||||
{
|
||||
return size != value.size || relative != value.relative;
|
||||
}
|
||||
bool operator==(const DocumentFontSize& value) const = default;
|
||||
};
|
||||
|
||||
/// <summary>Represents a text style.</summary>
|
||||
@@ -10922,8 +10843,7 @@ Elements
|
||||
int radiusX = 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 { return !(*this == value); }
|
||||
bool operator==(const ElementShape& value) const = default;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -11915,8 +11835,7 @@ Colorized Plain Text (model)
|
||||
~TextLine();
|
||||
|
||||
static vint CalculateBufferLength(vint dataLength);
|
||||
bool operator==(const TextLine& value)const{return false;}
|
||||
bool operator!=(const TextLine& value)const{return true;}
|
||||
bool operator==(const TextLine& value) const { return false; }
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the <see cref="TextLine"/> instance to be an empty line.
|
||||
@@ -12266,13 +12185,6 @@ Colorized Plain Text (model)
|
||||
/// </summary>
|
||||
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)
|
||||
};
|
||||
|
||||
@@ -12294,14 +12206,6 @@ Colorized Plain Text (model)
|
||||
/// </summary>
|
||||
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)
|
||||
};
|
||||
}
|
||||
@@ -14295,7 +14199,6 @@ TextItemProvider
|
||||
~TextItem();
|
||||
|
||||
bool operator==(const TextItem& value)const;
|
||||
bool operator!=(const TextItem& value)const;
|
||||
|
||||
/// <summary>Get the text of this item.</summary>
|
||||
/// <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)
|
||||
};
|
||||
|
||||
@@ -25058,6 +24954,7 @@ GuiHostedController
|
||||
protected:
|
||||
SharedCallbackService callbackService;
|
||||
hosted_window_manager::WindowManager<GuiHostedWindow*>* wmManager = nullptr;
|
||||
bool windowsUpdatedInLastFrame = false;
|
||||
INativeController* nativeController = nullptr;
|
||||
elements::GuiHostedGraphicsResourceManager* hostedResourceManager = nullptr;
|
||||
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
|
||||
|
||||
|
||||
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;
|
||||
class GuiIqPrimaryQuery;
|
||||
class GuiIqQuery;
|
||||
class GuiIqSetQuery;
|
||||
public:
|
||||
virtual void Visit(GuiIqPrimaryQuery* node) = 0;
|
||||
virtual void Visit(GuiIqCascadeQuery* node) = 0;
|
||||
virtual void Visit(GuiIqSetQuery* node) = 0;
|
||||
};
|
||||
|
||||
enum class GuiIqNameOption
|
||||
{
|
||||
UNDEFINED_ENUM_ITEM_VALUE = -1,
|
||||
Specified = 0,
|
||||
Any = 1,
|
||||
};
|
||||
virtual void Accept(GuiIqQuery::IVisitor* visitor) = 0;
|
||||
|
||||
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 GuiIqPrimaryQuery : public GuiIqQuery, vl::reflection::Description<GuiIqPrimaryQuery>
|
||||
{
|
||||
public:
|
||||
GuiIqChildOption childOption = GuiIqChildOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||
GuiIqNameOption attributeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||
vl::glr::ParsingToken attributeName;
|
||||
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>
|
||||
{
|
||||
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;
|
||||
};
|
||||
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
||||
};
|
||||
|
||||
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>
|
||||
{
|
||||
public:
|
||||
GuiIqChildOption childOption = GuiIqChildOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||
GuiIqNameOption attributeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||
vl::glr::ParsingToken attributeName;
|
||||
GuiIqNameOption typeNameOption = GuiIqNameOption::UNDEFINED_ENUM_ITEM_VALUE;
|
||||
vl::glr::ParsingToken typeName;
|
||||
vl::glr::ParsingToken referenceName;
|
||||
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;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
}
|
||||
void Accept(GuiIqQuery::IVisitor* visitor) override;
|
||||
};
|
||||
}
|
||||
namespace vl
|
||||
namespace vl::reflection::description
|
||||
{
|
||||
namespace reflection
|
||||
{
|
||||
namespace description
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqNameOption)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqChildOption)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqPrimaryQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqCascadeQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqBinaryOperator)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqSetQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqNameOption)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqChildOption)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqPrimaryQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqCascadeQuery)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqBinaryOperator)
|
||||
DECL_TYPE_INFO(vl::presentation::instancequery::GuiIqSetQuery)
|
||||
|
||||
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
|
||||
|
||||
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||
void Visit(vl::presentation::instancequery::GuiIqPrimaryQuery* node) override
|
||||
{
|
||||
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();
|
||||
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::presentation::instancequery::GuiIqQuery::IVisitor)
|
||||
void Visit(vl::presentation::instancequery::GuiIqPrimaryQuery* node) override
|
||||
{
|
||||
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();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -874,51 +862,45 @@ Licensed under https://github.com/vczh-libraries/License
|
||||
#define VCZH_PRESENTATION_INSTANCEQUERY_AST_ASSEMBLER
|
||||
|
||||
|
||||
namespace vl
|
||||
namespace vl::presentation::instancequery
|
||||
{
|
||||
namespace presentation
|
||||
enum class GuiInstanceQueryClasses : vl::vint32_t
|
||||
{
|
||||
namespace instancequery
|
||||
{
|
||||
enum class GuiInstanceQueryClasses : vl::vint32_t
|
||||
{
|
||||
CascadeQuery = 0,
|
||||
PrimaryQuery = 1,
|
||||
Query = 2,
|
||||
SetQuery = 3,
|
||||
};
|
||||
CascadeQuery = 0,
|
||||
PrimaryQuery = 1,
|
||||
Query = 2,
|
||||
SetQuery = 3,
|
||||
};
|
||||
|
||||
enum class GuiInstanceQueryFields : vl::vint32_t
|
||||
{
|
||||
CascadeQuery_child = 0,
|
||||
CascadeQuery_parent = 1,
|
||||
PrimaryQuery_attributeName = 2,
|
||||
PrimaryQuery_attributeNameOption = 3,
|
||||
PrimaryQuery_childOption = 4,
|
||||
PrimaryQuery_referenceName = 5,
|
||||
PrimaryQuery_typeName = 6,
|
||||
PrimaryQuery_typeNameOption = 7,
|
||||
SetQuery_first = 8,
|
||||
SetQuery_op = 9,
|
||||
SetQuery_second = 10,
|
||||
};
|
||||
enum class GuiInstanceQueryFields : vl::vint32_t
|
||||
{
|
||||
CascadeQuery_child = 0,
|
||||
CascadeQuery_parent = 1,
|
||||
PrimaryQuery_attributeName = 2,
|
||||
PrimaryQuery_attributeNameOption = 3,
|
||||
PrimaryQuery_childOption = 4,
|
||||
PrimaryQuery_referenceName = 5,
|
||||
PrimaryQuery_typeName = 6,
|
||||
PrimaryQuery_typeNameOption = 7,
|
||||
SetQuery_first = 8,
|
||||
SetQuery_op = 9,
|
||||
SetQuery_second = 10,
|
||||
};
|
||||
|
||||
extern const wchar_t* GuiInstanceQueryTypeName(GuiInstanceQueryClasses type);
|
||||
extern const wchar_t* GuiInstanceQueryCppTypeName(GuiInstanceQueryClasses type);
|
||||
extern const wchar_t* GuiInstanceQueryFieldName(GuiInstanceQueryFields field);
|
||||
extern const wchar_t* GuiInstanceQueryCppFieldName(GuiInstanceQueryFields field);
|
||||
extern const wchar_t* GuiInstanceQueryTypeName(GuiInstanceQueryClasses type);
|
||||
extern const wchar_t* GuiInstanceQueryCppTypeName(GuiInstanceQueryClasses type);
|
||||
extern const wchar_t* GuiInstanceQueryFieldName(GuiInstanceQueryFields field);
|
||||
extern const wchar_t* GuiInstanceQueryCppFieldName(GuiInstanceQueryFields field);
|
||||
|
||||
class GuiInstanceQueryAstInsReceiver : public vl::glr::AstInsReceiverBase
|
||||
{
|
||||
protected:
|
||||
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, 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;
|
||||
vl::Ptr<vl::glr::ParsingAstBase> ResolveAmbiguity(vl::vint32_t type, vl::collections::Array<vl::Ptr<vl::glr::ParsingAstBase>>& candidates) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
class GuiInstanceQueryAstInsReceiver : public vl::glr::AstInsReceiverBase
|
||||
{
|
||||
protected:
|
||||
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, 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;
|
||||
vl::Ptr<vl::glr::ParsingAstBase> ResolveAmbiguity(vl::vint32_t type, vl::collections::Array<vl::Ptr<vl::glr::ParsingAstBase>>& candidates) override;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -935,37 +917,31 @@ Licensed under https://github.com/vczh-libraries/License
|
||||
#define VCZH_PRESENTATION_INSTANCEQUERY_LEXER
|
||||
|
||||
|
||||
namespace vl
|
||||
namespace vl::presentation::instancequery
|
||||
{
|
||||
namespace presentation
|
||||
enum class GuiInstanceQueryTokens : vl::vint32_t
|
||||
{
|
||||
namespace instancequery
|
||||
{
|
||||
enum class GuiInstanceQueryTokens : vl::vint32_t
|
||||
{
|
||||
INDIRECT = 0,
|
||||
DIRECT = 1,
|
||||
NAME = 2,
|
||||
WILDCARD_INTERSECT = 3,
|
||||
OPEN = 4,
|
||||
CLOSE = 5,
|
||||
XOR = 6,
|
||||
UNION = 7,
|
||||
SUBSTRACT = 8,
|
||||
ATTRIBUTE = 9,
|
||||
COLON = 10,
|
||||
DOT = 11,
|
||||
SPACE = 12,
|
||||
};
|
||||
INDIRECT = 0,
|
||||
DIRECT = 1,
|
||||
NAME = 2,
|
||||
WILDCARD_INTERSECT = 3,
|
||||
OPEN = 4,
|
||||
CLOSE = 5,
|
||||
XOR = 6,
|
||||
UNION = 7,
|
||||
SUBSTRACT = 8,
|
||||
ATTRIBUTE = 9,
|
||||
COLON = 10,
|
||||
DOT = 11,
|
||||
SPACE = 12,
|
||||
};
|
||||
|
||||
constexpr vl::vint GuiInstanceQueryTokenCount = 13;
|
||||
extern bool GuiInstanceQueryTokenDeleter(vl::vint token);
|
||||
extern const wchar_t* GuiInstanceQueryTokenId(GuiInstanceQueryTokens token);
|
||||
extern const wchar_t* GuiInstanceQueryTokenDisplayText(GuiInstanceQueryTokens token);
|
||||
extern const wchar_t* GuiInstanceQueryTokenRegex(GuiInstanceQueryTokens token);
|
||||
extern void GuiInstanceQueryLexerData(vl::stream::IStream& outputStream);
|
||||
}
|
||||
}
|
||||
constexpr vl::vint GuiInstanceQueryTokenCount = 13;
|
||||
extern bool GuiInstanceQueryTokenDeleter(vl::vint token);
|
||||
extern const wchar_t* GuiInstanceQueryTokenId(GuiInstanceQueryTokens token);
|
||||
extern const wchar_t* GuiInstanceQueryTokenDisplayText(GuiInstanceQueryTokens token);
|
||||
extern const wchar_t* GuiInstanceQueryTokenRegex(GuiInstanceQueryTokens token);
|
||||
extern void GuiInstanceQueryLexerData(vl::stream::IStream& outputStream);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -982,41 +958,36 @@ Licensed under https://github.com/vczh-libraries/License
|
||||
#define VCZH_PRESENTATION_INSTANCEQUERY_PARSER_SYNTAX
|
||||
|
||||
|
||||
namespace vl
|
||||
namespace vl::presentation::instancequery
|
||||
{
|
||||
namespace presentation
|
||||
enum class ParserStates
|
||||
{
|
||||
namespace instancequery
|
||||
{
|
||||
enum class ParserStates
|
||||
{
|
||||
QPrimaryFragment = 0,
|
||||
QPrimaryAttributed = 8,
|
||||
QPrimary = 15,
|
||||
Query0 = 24,
|
||||
Query1 = 29,
|
||||
Query2 = 38,
|
||||
QueryRoot = 47,
|
||||
};
|
||||
QPrimaryFragment = 0,
|
||||
QPrimaryAttributed = 8,
|
||||
QPrimary = 15,
|
||||
Query0 = 24,
|
||||
Query1 = 29,
|
||||
Query2 = 38,
|
||||
QueryRoot = 47,
|
||||
};
|
||||
|
||||
const wchar_t* ParserRuleName(vl::vint index);
|
||||
const wchar_t* ParserStateLabel(vl::vint index);
|
||||
extern void GuiInstanceQueryParserData(vl::stream::IStream& outputStream);
|
||||
const wchar_t* ParserRuleName(vl::vint index);
|
||||
const wchar_t* ParserStateLabel(vl::vint index);
|
||||
extern void GuiInstanceQueryParserData(vl::stream::IStream& outputStream);
|
||||
|
||||
class Parser
|
||||
: public vl::glr::ParserBase<GuiInstanceQueryTokens, ParserStates, GuiInstanceQueryAstInsReceiver>
|
||||
, protected vl::glr::automaton::IExecutor::ITypeCallback
|
||||
{
|
||||
protected:
|
||||
vl::vint32_t FindCommonBaseClass(vl::vint32_t class1, vl::vint32_t class2) const override;
|
||||
public:
|
||||
Parser();
|
||||
class Parser
|
||||
: public vl::glr::ParserBase<GuiInstanceQueryTokens, ParserStates, GuiInstanceQueryAstInsReceiver>
|
||||
, protected vl::glr::automaton::IExecutor::ITypeCallback
|
||||
{
|
||||
protected:
|
||||
vl::WString GetClassName(vl::vint32_t classIndex) const override;
|
||||
vl::vint32_t FindCommonBaseClass(vl::vint32_t class1, vl::vint32_t class2) const override;
|
||||
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(vl::collections::List<vl::regex::RegexToken>& tokens, 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;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3453,6 +3453,8 @@ Type Declaration
|
||||
ENUM_CLASS_ITEM(RenderTargetChanged)
|
||||
ENUM_CLASS_ITEM(ParentLineChanged)
|
||||
ENUM_CLASS_ITEM(ServiceAdded)
|
||||
ENUM_CLASS_ITEM(UpdateRequested)
|
||||
ENUM_CLASS_ITEM(UpdateFullfilled)
|
||||
END_ENUM_ITEM(ControlSignal)
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==(const BufferPair& pair) { return false; }
|
||||
bool operator!=(const BufferPair& pair) { return true; }
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
if (IsRoot())
|
||||
@@ -449,10 +444,6 @@ Locale
|
||||
{
|
||||
}
|
||||
|
||||
Locale::~Locale()
|
||||
{
|
||||
}
|
||||
|
||||
const WString& Locale::GetName()const
|
||||
{
|
||||
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 Linux and macOS, only en-US is supported.
|
||||
/// </remarks>
|
||||
Locale(const WString& _localeName=WString::Empty);
|
||||
~Locale();
|
||||
Locale() = default;
|
||||
Locale(const Locale&) = default;
|
||||
Locale(Locale&&) = default;
|
||||
~Locale() = default;
|
||||
|
||||
bool operator==(const Locale& value)const { return localeName==value.localeName; }
|
||||
bool operator!=(const Locale& value)const { return localeName!=value.localeName; }
|
||||
bool operator<(const Locale& value)const { return localeName<value.localeName; }
|
||||
bool operator<=(const Locale& value)const { return localeName<=value.localeName; }
|
||||
bool operator>(const Locale& value)const { return localeName>value.localeName; }
|
||||
bool operator>=(const Locale& value)const { return localeName>=value.localeName; }
|
||||
Locale& operator=(const Locale&) = default;
|
||||
Locale& operator=(Locale&&) = default;
|
||||
|
||||
Locale(const WString& _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>
|
||||
/// <returns>The invariant locale.</returns>
|
||||
@@ -1918,13 +1921,8 @@ namespace vl
|
||||
FilePath(const FilePath& _filePath);
|
||||
~FilePath() = default;
|
||||
|
||||
static vint Compare(const FilePath& a, const FilePath& b);
|
||||
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; }
|
||||
bool operator>=(const FilePath& filePath)const{ return Compare(*this, filePath) >= 0; }
|
||||
std::strong_ordering operator<=>(const FilePath& path)const { return fullPath <=> path.fullPath; }
|
||||
bool operator==(const FilePath& path)const { return fullPath == path.fullPath; }
|
||||
|
||||
/// <summary>Concat an absolute path and a relative path.</summary>
|
||||
/// <returns>The result absolute path.</returns>
|
||||
|
||||
+36
-34
@@ -3740,7 +3740,7 @@ GenerateTable
|
||||
i1 > i2 ? ParsingTable::TransitionItem::WrongOrder :
|
||||
ParsingTable::TransitionItem::SameOrder
|
||||
;
|
||||
return ParsingTable::TransitionItem::Compare(t1, t2, defaultOrder);
|
||||
return ParsingTable::TransitionItem::Compare(t1, t2, defaultOrder) <=> 0;
|
||||
}));
|
||||
|
||||
// build look ahead inside a transition
|
||||
@@ -4225,38 +4225,44 @@ IsMergableCandidate
|
||||
RearrangeState
|
||||
***********************************************************************/
|
||||
|
||||
#define COMPARE_SYMBOL(S1, 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)
|
||||
std::strong_ordering CompareParsingSymbol(ParsingSymbol* s1, ParsingSymbol* s2)
|
||||
{
|
||||
if (t1->transitionType < t2->transitionType) return -1;
|
||||
if (t1->transitionType > t2->transitionType) return 1;
|
||||
COMPARE_SYMBOL(t1->transitionSymbol, t2->transitionSymbol);
|
||||
return 0;
|
||||
if (s1 && s2)
|
||||
{
|
||||
std::strong_ordering
|
||||
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;
|
||||
if(a1->actionType>a2->actionType) return 1;
|
||||
COMPARE_SYMBOL(a1->actionSource, a2->actionSource);
|
||||
COMPARE_SYMBOL(a1->actionTarget, a2->actionTarget);
|
||||
return 0;
|
||||
std::strong_ordering
|
||||
result = t1->transitionType <=> t2->transitionType; if (result != 0) return result;
|
||||
result = CompareParsingSymbol(t1->transitionSymbol, t2->transitionSymbol); if (result != 0) return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
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
|
||||
@@ -8540,10 +8546,6 @@ namespace vl
|
||||
|
||||
namespace parsing
|
||||
{
|
||||
vint CompareTextRange(Ptr<ParsingTreeNode> r1, Ptr<ParsingTreeNode> r2)
|
||||
{
|
||||
return ParsingTextPos::Compare(r1->GetCodeRange().start, r2->GetCodeRange().start);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
ParsingTreeNode::TraversalVisitor
|
||||
@@ -8719,7 +8721,7 @@ ParsingTreeNode
|
||||
const auto& range = node->GetCodeRange();
|
||||
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;
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
return 0;
|
||||
return std::strong_ordering::equal;
|
||||
}
|
||||
else if (a.IsInvalid())
|
||||
{
|
||||
return -1;
|
||||
return std::strong_ordering::less;
|
||||
}
|
||||
else if (b.IsInvalid())
|
||||
{
|
||||
return 1;
|
||||
return std::strong_ordering::greater;
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (a.row == b.row)
|
||||
{
|
||||
return a.column - b.column;
|
||||
return a.column <=> b.column;
|
||||
}
|
||||
else
|
||||
{
|
||||
return a.row - b.row;
|
||||
return a.row <=> b.row;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return std::strong_ordering::equal;
|
||||
}
|
||||
}
|
||||
|
||||
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;}
|
||||
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;}
|
||||
friend bool operator==(const ParsingTextPos& a, const ParsingTextPos& b)
|
||||
{
|
||||
return (a <=> b) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
/// <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;
|
||||
if(type>pair.type) return 1;
|
||||
if(scope<pair.scope) return -1;
|
||||
if(scope>pair.scope) return 1;
|
||||
return 0;
|
||||
std::strong_ordering
|
||||
result = type <=> pair.type; if (result != 0) return result;
|
||||
result = scope <=> pair.scope; if (result != 0) return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
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;}
|
||||
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;}
|
||||
bool operator==(const DefinitionTypeScopePair& pair)const
|
||||
{
|
||||
return (*this <=> 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()
|
||||
:valueType(Null)
|
||||
,rawPtr(0)
|
||||
@@ -2516,6 +2382,126 @@ description::Value
|
||||
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
|
||||
{
|
||||
return valueType;
|
||||
|
||||
@@ -827,19 +827,14 @@ Value
|
||||
Value(DescriptableObject* value);
|
||||
Value(Ptr<DescriptableObject> value);
|
||||
Value(Ptr<IBoxedValue> value, ITypeDescriptor* associatedTypeDescriptor);
|
||||
|
||||
vint Compare(const Value& a, const Value& b)const;
|
||||
public:
|
||||
/// <summary>Create a null value.</summary>
|
||||
Value();
|
||||
Value(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; }
|
||||
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; }
|
||||
bool operator>=(const Value& value)const { return Compare(*this, value) >= 0; }
|
||||
|
||||
friend std::strong_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>
|
||||
/// <returns>Returns How the value is stored.</returns>
|
||||
|
||||
@@ -1622,11 +1622,6 @@ Data Structures for Backtracking
|
||||
StateSaver(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)
|
||||
{
|
||||
saver.reader = reader;
|
||||
@@ -1653,11 +1648,6 @@ Data Structures for Backtracking
|
||||
ExtensionSaver(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)
|
||||
{
|
||||
saver.reader = reader;
|
||||
@@ -1717,14 +1707,6 @@ Data Structures for Backtracking
|
||||
|
||||
namespace regex_internal
|
||||
{
|
||||
/***********************************************************************
|
||||
CaptureRecord
|
||||
***********************************************************************/
|
||||
|
||||
bool CaptureRecord::operator==(const CaptureRecord& record)const
|
||||
{
|
||||
return capture == record.capture && start == record.start && length == record.length;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
RichInterpretor
|
||||
|
||||
+11
-49
@@ -1375,65 +1375,29 @@ CharRange
|
||||
CharRange() = default;
|
||||
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
|
||||
{
|
||||
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
|
||||
bool operator==(char32_t item)const
|
||||
{
|
||||
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 start;
|
||||
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);
|
||||
MethodKey key2(breakPoint.thisObject, breakPoint.propertyInfo->GetGetter());
|
||||
TEST(true, key1, getPropertyBreakPoints);
|
||||
TEST(key2.f1, key2, invokeMethodBreakPoints);
|
||||
TEST(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||
SET(key1, getPropertyBreakPoints);
|
||||
SETC(key2.f1, key2, invokeMethodBreakPoints);
|
||||
SETC(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||
}
|
||||
break;
|
||||
case WfBreakPoint::SetProperty:
|
||||
@@ -2836,9 +2836,9 @@ WfDebugger BreakPoints
|
||||
PropertyKey key1(breakPoint.thisObject, breakPoint.propertyInfo);
|
||||
MethodKey key2(breakPoint.thisObject, breakPoint.propertyInfo->GetSetter());
|
||||
TEST(true, key1, setPropertyBreakPoints);
|
||||
TEST(key2.f1, key2, invokeMethodBreakPoints);
|
||||
TEST(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||
SET(key1, setPropertyBreakPoints);
|
||||
SETC(key2.f1, key2, invokeMethodBreakPoints);
|
||||
SETC(key2.get<1>(), key2, invokeMethodBreakPoints);
|
||||
}
|
||||
break;
|
||||
case WfBreakPoint::AttachEvent:
|
||||
|
||||
@@ -29,11 +29,9 @@ void CollectConditions(
|
||||
vint index = conditions.Keys().IndexOf(file);
|
||||
if (index != -1)
|
||||
{
|
||||
const auto& tuples = conditions.GetByIndex(index);
|
||||
for (vint i = 0; i < tuples.Count(); i++)
|
||||
for (auto [condition, path] : conditions.GetByIndex(index))
|
||||
{
|
||||
auto condition = tuples[i].f0;
|
||||
auto includeFile = inputFileToOutputFiles[tuples[i].f1];
|
||||
auto includeFile = inputFileToOutputFiles[path];
|
||||
if (!categorizedConditions.Contains(condition, includeFile))
|
||||
{
|
||||
categorizedConditions.Add(condition, includeFile);
|
||||
|
||||
@@ -40,15 +40,15 @@ int main(int argc, char* argv[])
|
||||
CopyFrom(
|
||||
categorizedOutput,
|
||||
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,
|
||||
{
|
||||
Tuple(
|
||||
XmlGetAttribute(e, L"filename")->value.value,
|
||||
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
|
||||
for (vint i = 0; i < categorizedOutput.Count(); i++)
|
||||
{
|
||||
if (!categorizedOutput.Values()[i].f1)
|
||||
if (!categorizedOutput.Values()[i].get<1>())
|
||||
{
|
||||
auto category = categorizedOutput.Keys()[i];
|
||||
for (auto skippedImportFile : categorizedHeaderFiles[category])
|
||||
@@ -206,7 +206,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
auto key = inputFileToCategories.Keys()[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)
|
||||
{
|
||||
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++)
|
||||
{
|
||||
auto categoryName = componentToCategoryNames[i][0];
|
||||
auto outputPath = outputFolder / (categorizedOutput[categoryName].f0 + L".h");
|
||||
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].f0 + L".h");
|
||||
auto outputPath = outputFolder / (categorizedOutput[categoryName].get<0>() + L".h");
|
||||
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].get<0>() + L".h");
|
||||
|
||||
auto systemIncludes = Ptr(new SortedList<WString>);
|
||||
categorizedSystemIncludes.Add(categoryName, systemIncludes);
|
||||
|
||||
if (categorizedOutput[categoryName].f1)
|
||||
if (categorizedOutput[categoryName].get<1>())
|
||||
{
|
||||
vint headerIndex = categorizedHeaderFiles.Keys().IndexOf(categoryName);
|
||||
if (headerIndex == -1) continue;
|
||||
@@ -272,13 +272,13 @@ int main(int argc, char* argv[])
|
||||
for (vint i = 0; i < popCategories.components.Count(); i++)
|
||||
{
|
||||
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);
|
||||
|
||||
auto outputPath = outputFolder / (categorizedOutput[categoryName].f0 + L".cpp");
|
||||
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].f0 + L".cpp");
|
||||
auto outputPath = outputFolder / (categorizedOutput[categoryName].get<0>() + L".cpp");
|
||||
auto outputIncludeOnlyPath = outputIncludeOnlyFolder / (categorizedOutput[categoryName].get<0>() + L".cpp");
|
||||
Combine(
|
||||
inputFileToOutputFiles,
|
||||
skippedImportFiles,
|
||||
|
||||
@@ -321,39 +321,6 @@ int main(int argc, char* argv[])
|
||||
syntaxManager.BuildAutomaton(lexerManager.Tokens().Count(), executable, metadata);
|
||||
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);
|
||||
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