mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-21 04:31:33 +08:00
Update release
This commit is contained in:
+204
-146
File diff suppressed because it is too large
Load Diff
+296
-157
File diff suppressed because it is too large
Load Diff
@@ -243,16 +243,30 @@ Type Declaration
|
||||
STRUCT_MEMBER(column)
|
||||
END_STRUCT_MEMBER(GridPos)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(NativeCoordinate)
|
||||
STRUCT_MEMBER(value)
|
||||
END_STRUCT_MEMBER(NativeCoordinate)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(Point)
|
||||
STRUCT_MEMBER(x)
|
||||
STRUCT_MEMBER(y)
|
||||
END_STRUCT_MEMBER(Point)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(NativePoint)
|
||||
STRUCT_MEMBER(x)
|
||||
STRUCT_MEMBER(y)
|
||||
END_STRUCT_MEMBER(NativePoint)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(Size)
|
||||
STRUCT_MEMBER(x)
|
||||
STRUCT_MEMBER(y)
|
||||
END_STRUCT_MEMBER(Size)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(NativeSize)
|
||||
STRUCT_MEMBER(x)
|
||||
STRUCT_MEMBER(y)
|
||||
END_STRUCT_MEMBER(NativeSize)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(Rect)
|
||||
STRUCT_MEMBER(x1)
|
||||
STRUCT_MEMBER(y1)
|
||||
@@ -260,6 +274,13 @@ Type Declaration
|
||||
STRUCT_MEMBER(y2)
|
||||
END_STRUCT_MEMBER(Rect)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(NativeRect)
|
||||
STRUCT_MEMBER(x1)
|
||||
STRUCT_MEMBER(y1)
|
||||
STRUCT_MEMBER(x2)
|
||||
STRUCT_MEMBER(y2)
|
||||
END_STRUCT_MEMBER(NativeRect)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(Margin)
|
||||
STRUCT_MEMBER(left)
|
||||
STRUCT_MEMBER(top)
|
||||
@@ -267,6 +288,13 @@ Type Declaration
|
||||
STRUCT_MEMBER(bottom)
|
||||
END_STRUCT_MEMBER(Margin)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(NativeMargin)
|
||||
STRUCT_MEMBER(left)
|
||||
STRUCT_MEMBER(top)
|
||||
STRUCT_MEMBER(right)
|
||||
STRUCT_MEMBER(bottom)
|
||||
END_STRUCT_MEMBER(NativeMargin)
|
||||
|
||||
BEGIN_STRUCT_MEMBER(FontProperties)
|
||||
STRUCT_MEMBER(fontFamily)
|
||||
STRUCT_MEMBER(size)
|
||||
@@ -412,6 +440,8 @@ Type Declaration
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(Bounds);
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(ClientBounds);
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(Name);
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(ScalingX);
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(ScalingY);
|
||||
|
||||
CLASS_MEMBER_METHOD(IsPrimary, NO_PARAMETER)
|
||||
END_INTERFACE_MEMBER(INativeScreen)
|
||||
@@ -2224,7 +2254,7 @@ Type Declaration (Class)
|
||||
CLASS_MEMBER_PROPERTY_FAST(EnabledActivate)
|
||||
CLASS_MEMBER_PROPERTY_FAST(TopMost)
|
||||
CLASS_MEMBER_PROPERTY_FAST(ClientSize)
|
||||
CLASS_MEMBER_PROPERTY_FAST(Bounds)
|
||||
CLASS_MEMBER_PROPERTY_FAST(Location)
|
||||
CLASS_MEMBER_PROPERTY_FAST(ShortcutKeyManager)
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(RelatedScreen)
|
||||
|
||||
@@ -2234,6 +2264,7 @@ Type Declaration (Class)
|
||||
CLASS_MEMBER_METHOD(SetFocused, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(GetActivated, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(SetActivated, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(SetBounds, {L"location" _ L"size"})
|
||||
CLASS_MEMBER_METHOD(Show, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(ShowDeactivated, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(ShowRestored, NO_PARAMETER)
|
||||
@@ -2269,7 +2300,7 @@ Type Declaration (Class)
|
||||
CLASS_MEMBER_BASE(GuiWindow)
|
||||
CONTROL_CONSTRUCTOR_CONTROLT_TEMPLATE(GuiPopup)
|
||||
|
||||
CLASS_MEMBER_METHOD_OVERLOAD(ShowPopup, {L"location" _ L"screen"}, void(GuiPopup::*)(Point _ INativeScreen*))
|
||||
CLASS_MEMBER_METHOD_OVERLOAD(ShowPopup, {L"location" _ L"screen"}, void(GuiPopup::*)(NativePoint _ INativeScreen*))
|
||||
CLASS_MEMBER_METHOD_OVERLOAD(ShowPopup, {L"control" _ L"bounds" _ L"preferredTopBottomSide"}, void(GuiPopup::*)(GuiControl* _ Rect _ bool))
|
||||
CLASS_MEMBER_METHOD_OVERLOAD(ShowPopup, {L"control" _ L"location"}, void(GuiPopup::*)(GuiControl* _ Point))
|
||||
CLASS_MEMBER_METHOD_OVERLOAD(ShowPopup, {L"control" _ L"preferredTopBottomSide"}, void(GuiPopup::*)(GuiControl* _ bool))
|
||||
|
||||
@@ -102,10 +102,15 @@ Type List (Basic)
|
||||
F(presentation::AxisDirection)\
|
||||
F(presentation::TextPos)\
|
||||
F(presentation::GridPos)\
|
||||
F(presentation::NativeCoordinate)\
|
||||
F(presentation::Point)\
|
||||
F(presentation::NativePoint)\
|
||||
F(presentation::Size)\
|
||||
F(presentation::NativeSize)\
|
||||
F(presentation::Rect)\
|
||||
F(presentation::NativeRect)\
|
||||
F(presentation::Margin)\
|
||||
F(presentation::NativeMargin)\
|
||||
F(presentation::FontProperties)\
|
||||
F(presentation::VKEY)\
|
||||
F(presentation::GlobalStringKey)\
|
||||
|
||||
+386
-157
File diff suppressed because it is too large
Load Diff
+47
-6
@@ -500,6 +500,44 @@ namespace vl
|
||||
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
.\NATIVEWINDOW\WINDOWS\WINNATIVEDPIAWARENESS.H
|
||||
***********************************************************************/
|
||||
/***********************************************************************
|
||||
Vczh Library++ 3.0
|
||||
Developer: Zihan Chen(vczh)
|
||||
GacUI::Native Window::Windows Implementation
|
||||
|
||||
Interfaces:
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef VCZH_PRESENTATION_WINDOWS_WINNATIVEDPIAWARENESS
|
||||
#define VCZH_PRESENTATION_WINDOWS_WINNATIVEDPIAWARENESS
|
||||
|
||||
#include <Windows.h>
|
||||
#include <ShellScalingApi.h>
|
||||
|
||||
namespace vl
|
||||
{
|
||||
namespace presentation
|
||||
{
|
||||
namespace windows
|
||||
{
|
||||
/***********************************************************************
|
||||
DPI Awareness Functions
|
||||
***********************************************************************/
|
||||
|
||||
extern void InitDpiAwareness(bool dpiAware);
|
||||
extern void DpiAwared_GetDpiForMonitor(HMONITOR monitor, UINT* x, UINT* y);
|
||||
extern void DpiAwared_GetDpiForWindow(HWND handle, UINT* x, UINT* y);
|
||||
extern void DpiAwared_AdjustWindowRect(LPRECT rect, HWND handle, UINT dpi);
|
||||
extern int DpiAwared_GetSystemMetrics(int index, UINT dpi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
.\NATIVEWINDOW\WINDOWS\GDI\WINGDI.H
|
||||
***********************************************************************/
|
||||
@@ -564,7 +602,6 @@ Comments:
|
||||
#ifndef VCZH_PRESENTATION_WINDOWS_GDI_WINGDI
|
||||
#define VCZH_PRESENTATION_WINDOWS_GDI_WINGDI
|
||||
|
||||
#include<windows.h>
|
||||
|
||||
namespace vl
|
||||
{
|
||||
@@ -2140,13 +2177,16 @@ namespace vl
|
||||
friend class WindowsScreenService;
|
||||
protected:
|
||||
HMONITOR monitor;
|
||||
|
||||
public:
|
||||
WindowsScreen();
|
||||
|
||||
Rect GetBounds()override;
|
||||
Rect GetClientBounds()override;
|
||||
NativeRect GetBounds()override;
|
||||
NativeRect GetClientBounds()override;
|
||||
WString GetName()override;
|
||||
bool IsPrimary()override;
|
||||
double GetScalingX()override;
|
||||
double GetScalingY()override;
|
||||
};
|
||||
|
||||
class WindowsScreenService : public Object, public INativeScreenService
|
||||
@@ -2155,12 +2195,13 @@ namespace vl
|
||||
protected:
|
||||
collections::List<Ptr<WindowsScreen>> screens;
|
||||
HandleRetriver handleRetriver;
|
||||
|
||||
public:
|
||||
|
||||
struct MonitorEnumProcData
|
||||
{
|
||||
WindowsScreenService* screenService;
|
||||
vint currentScreen;
|
||||
WindowsScreenService* screenService;
|
||||
vint currentScreen;
|
||||
};
|
||||
|
||||
WindowsScreenService(HandleRetriver _handleRetriver);
|
||||
@@ -2209,7 +2250,7 @@ namespace vl
|
||||
bool InstallListener(INativeControllerListener* listener)override;
|
||||
bool UninstallListener(INativeControllerListener* listener)override;
|
||||
|
||||
void InvokeMouseHook(WPARAM message, Point location);
|
||||
void InvokeMouseHook(WPARAM message, NativePoint location);
|
||||
void InvokeGlobalTimer();
|
||||
void InvokeClipboardUpdated();
|
||||
void InvokeNativeWindowCreated(INativeWindow* window);
|
||||
|
||||
+1
-1
@@ -7015,7 +7015,7 @@ Tokenizer
|
||||
/// <returns>The internal state.</returns>
|
||||
InternalState GetInternalState();
|
||||
/// <summary>Restore the colorizer to a internal state.</summary>
|
||||
/// <param name="value">The internal state.</param>
|
||||
/// <param name="state">The internal state.</param>
|
||||
void SetInternalState(InternalState state);
|
||||
/// <summary>Step forward by one character.</summary>
|
||||
/// <param name="input">The input character.</param>
|
||||
|
||||
@@ -24159,6 +24159,8 @@ namespace vl
|
||||
typedef WfInstruction Ins;
|
||||
|
||||
#define INSTRUCTION(X) context.AddInstruction(node, X)
|
||||
#define FILL_LABEL_TO_INS(LABEL, INS) context.assembly->instructions[LABEL].indexParameter = INS
|
||||
#define FILL_LABEL_TO_CURRENT(LABEL) FILL_LABEL_TO_INS(LABEL, context.assembly->instructions.Count())
|
||||
|
||||
/***********************************************************************
|
||||
GenerateTypeCastInstructions
|
||||
@@ -24168,6 +24170,17 @@ GenerateTypeCastInstructions
|
||||
{
|
||||
if (expectedType->GetTypeDescriptor() != GetTypeDescriptor<Value>())
|
||||
{
|
||||
vint fillElseIndex = -1;
|
||||
vint fillEndIndex = -1;
|
||||
|
||||
if (expectedType->GetDecorator() == ITypeInfo::Nullable)
|
||||
{
|
||||
INSTRUCTION(Ins::Duplicate(0));
|
||||
INSTRUCTION(Ins::LoadValue(Value()));
|
||||
INSTRUCTION(Ins::CompareReference());
|
||||
fillElseIndex = INSTRUCTION(Ins::JumpIf(-1));
|
||||
}
|
||||
|
||||
if (strongCast)
|
||||
{
|
||||
switch (expectedType->GetDecorator())
|
||||
@@ -24202,6 +24215,14 @@ GenerateTypeCastInstructions
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fillElseIndex != -1)
|
||||
{
|
||||
fillEndIndex = INSTRUCTION(Ins::Jump(-1));
|
||||
FILL_LABEL_TO_CURRENT(fillElseIndex);
|
||||
INSTRUCTION(Ins::LoadValue(Value()));
|
||||
FILL_LABEL_TO_CURRENT(fillEndIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24236,7 +24257,7 @@ GetInstructionTypeArgument
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
GenerateTypeCastInstructions
|
||||
GetInstructionTypeArgument
|
||||
***********************************************************************/
|
||||
|
||||
runtime::WfInsType GetInstructionTypeArgument(Ptr<reflection::description::ITypeInfo> expectedType)
|
||||
@@ -24373,6 +24394,8 @@ GenerateAssembly
|
||||
}
|
||||
|
||||
#undef CALLBACK
|
||||
#undef FILL_LABEL_TO_CURRENT
|
||||
#undef FILL_LABEL_TO_INS
|
||||
#undef INSTRUCTION
|
||||
|
||||
/***********************************************************************
|
||||
@@ -24987,6 +25010,8 @@ namespace vl
|
||||
typedef WfInstruction Ins;
|
||||
|
||||
#define INSTRUCTION(X) context.AddInstruction(node, X)
|
||||
#define FILL_LABEL_TO_INS(LABEL, INS) context.assembly->instructions[LABEL].indexParameter = INS
|
||||
#define FILL_LABEL_TO_CURRENT(LABEL) FILL_LABEL_TO_INS(LABEL, context.assembly->instructions.Count())
|
||||
|
||||
/***********************************************************************
|
||||
GenerateInstructions(Expression)
|
||||
@@ -25461,10 +25486,10 @@ GenerateInstructions(Expression)
|
||||
INSTRUCTION(Ins::UninstallTry(1));
|
||||
vint finishInstruction = INSTRUCTION(Ins::Jump(-1));
|
||||
|
||||
context.assembly->instructions[trapInstruction].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(trapInstruction);
|
||||
GenerateExpressionInstructions(context, node->second, result.type);
|
||||
|
||||
context.assembly->instructions[finishInstruction].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(finishInstruction);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -25617,9 +25642,9 @@ GenerateInstructions(Expression)
|
||||
vint fillTrueIndex = INSTRUCTION(Ins::JumpIf(-1));
|
||||
GenerateExpressionInstructions(context, node->falseBranch, result.type);
|
||||
vint fillEndIndex = INSTRUCTION(Ins::Jump(-1));
|
||||
context.assembly->instructions[fillTrueIndex].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(fillTrueIndex);
|
||||
GenerateExpressionInstructions(context, node->trueBranch, result.type);
|
||||
context.assembly->instructions[fillEndIndex].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(fillEndIndex);
|
||||
}
|
||||
|
||||
void Visit(WfRangeExpression* node)override
|
||||
@@ -26123,6 +26148,8 @@ GenerateInstructions(Expression)
|
||||
}
|
||||
};
|
||||
|
||||
#undef FILL_LABEL_TO_CURRENT
|
||||
#undef FILL_LABEL_TO_INS
|
||||
#undef INSTRUCTION
|
||||
|
||||
Ptr<reflection::description::ITypeInfo> GenerateExpressionInstructions(WfCodegenContext& context, Ptr<WfExpression> expression, Ptr<reflection::description::ITypeInfo> expectedType)
|
||||
@@ -26433,6 +26460,8 @@ namespace vl
|
||||
typedef WfInstruction Ins;
|
||||
|
||||
#define INSTRUCTION(X) context.AddInstruction(node, X)
|
||||
#define FILL_LABEL_TO_INS(LABEL, INS) context.assembly->instructions[LABEL].indexParameter = INS
|
||||
#define FILL_LABEL_TO_CURRENT(LABEL) FILL_LABEL_TO_INS(LABEL, context.assembly->instructions.Count())
|
||||
#define EXIT_CODE(X) context.AddExitInstruction(node, X)
|
||||
|
||||
/***********************************************************************
|
||||
@@ -26577,13 +26606,13 @@ GenerateInstructions(Statement)
|
||||
INSTRUCTION(Ins::StoreLocalVar(variableIndex));
|
||||
}
|
||||
vint fillEndIndex = INSTRUCTION(Ins::Jump(-1));
|
||||
context.assembly->instructions[fillElseIndex].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(fillElseIndex);
|
||||
|
||||
if (node->falseBranch)
|
||||
{
|
||||
GenerateStatementInstructions(context, node->falseBranch);
|
||||
}
|
||||
context.assembly->instructions[fillEndIndex].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(fillEndIndex);
|
||||
}
|
||||
|
||||
void Visit(WfWhileStatement* node)override
|
||||
@@ -26604,11 +26633,11 @@ GenerateInstructions(Statement)
|
||||
|
||||
FOREACH(vint, index, loopContext->continueInstructions)
|
||||
{
|
||||
context.assembly->instructions[index].indexParameter = continueLabelIndex;
|
||||
FILL_LABEL_TO_INS(index, continueLabelIndex);
|
||||
}
|
||||
FOREACH(vint, index, loopContext->breakInstructions)
|
||||
{
|
||||
context.assembly->instructions[index].indexParameter = breakLabelIndex;
|
||||
FILL_LABEL_TO_INS(index, breakLabelIndex);
|
||||
}
|
||||
context.functionContext->PopScopeContext();
|
||||
}
|
||||
@@ -26655,7 +26684,7 @@ GenerateInstructions(Statement)
|
||||
|
||||
void GenerateTrap(WfTryStatement* node, vint variableIndex, Pair<vint, vint> trap)
|
||||
{
|
||||
context.assembly->instructions[trap.key].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(trap.key);
|
||||
INSTRUCTION(Ins::LoadException());
|
||||
INSTRUCTION(Ins::StoreLocalVar(variableIndex));
|
||||
}
|
||||
@@ -26697,10 +26726,10 @@ GenerateInstructions(Statement)
|
||||
}
|
||||
|
||||
// finally
|
||||
context.assembly->instructions[trap1.value].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(trap1.value);
|
||||
if (trap2.value != -1)
|
||||
{
|
||||
context.assembly->instructions[trap2.value].indexParameter = context.assembly->instructions.Count();
|
||||
FILL_LABEL_TO_CURRENT(trap2.value);
|
||||
}
|
||||
if (node->finallyStatement)
|
||||
{
|
||||
@@ -26726,7 +26755,7 @@ GenerateInstructions(Statement)
|
||||
vint breakLabelIndex = context.assembly->instructions.Count();
|
||||
FOREACH(vint, index, blockContext->breakInstructions)
|
||||
{
|
||||
context.assembly->instructions[index].indexParameter = breakLabelIndex;
|
||||
FILL_LABEL_TO_INS(index, breakLabelIndex);
|
||||
}
|
||||
context.functionContext->PopScopeContext();
|
||||
}
|
||||
@@ -26774,6 +26803,8 @@ GenerateInstructions(Statement)
|
||||
};
|
||||
|
||||
#undef EXIT_CODE
|
||||
#undef FILL_LABEL_TO_CURRENT
|
||||
#undef FILL_LABEL_TO_INS
|
||||
#undef INSTRUCTION
|
||||
|
||||
void GenerateStatementInstructions(WfCodegenContext& context, Ptr<WfStatement> statement)
|
||||
|
||||
@@ -63,7 +63,7 @@ Instruction
|
||||
TestType, // flag, typeDescriptor : Value -> <bool> ;
|
||||
GetType, // : Value -> <ITypeDescriptor*> ;
|
||||
Jump, // label : () -> () ;
|
||||
JumpIf, // label : () -> () ;
|
||||
JumpIf, // label : <bool> -> () ;
|
||||
Invoke, // function, count : Value-1, ..., Value-n -> Value ;
|
||||
InvokeWithContext, // function, count : Value-1, ..., Value-n -> Value ;
|
||||
GetProperty, // IPropertyInfo* : Value-this -> Value ;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user