Update protocol

This commit is contained in:
vczh
2026-03-03 02:35:22 -08:00
parent 746a489379
commit 5b24f005f5
25 changed files with 3827 additions and 2950 deletions
+11 -10
View File
@@ -34,9 +34,9 @@ namespace gaclib_controls
const WString DomProp::PropertyName = WString::Unmanaged(L"DomID");
/***********************************************************************
Helper Functions
***********************************************************************/
/***********************************************************************
Helper Functions
***********************************************************************/
Alignment GetAlignment(remoteprotocol::ElementHorizontalAlignment alignment)
{
@@ -82,9 +82,9 @@ namespace gaclib_controls
return element;
}
/***********************************************************************
GuiGraphicsParagraphWrapperElement
***********************************************************************/
/***********************************************************************
GuiGraphicsParagraphWrapperElement
***********************************************************************/
class GuiGraphicsParagraphWrapperElement
: public Object
@@ -191,6 +191,7 @@ namespace gaclib_controls
properties.size = inlineProp.size;
properties.baseline = inlineProp.baseline;
properties.breakCondition = inlineProp.breakCondition;
properties.backgroundColor = inlineProp.backgroundColor;
properties.callbackId = inlineProp.callbackId;
if (inlineProp.backgroundElementId != -1)
{
@@ -207,7 +208,7 @@ namespace gaclib_controls
if (desc.caret)
{
auto& caret = desc.caret.Value();
paragraph->OpenCaret(caret.caret, caret.caretColor, caret.frontSide);
paragraph->EnableCaret(caret.caret, caret.caretColor, caret.frontSide);
}
}
paragraph->Render(bounds);
@@ -475,9 +476,9 @@ namespace gaclib_controls
return focusComposition;
}
/***********************************************************************
UnitTestSnapshotViewerAppWindow
***********************************************************************/
/***********************************************************************
UnitTestSnapshotViewerAppWindow
***********************************************************************/
void UnitTestSnapshotViewerAppWindow::Highlight(GuiBoundsComposition*& target, remoteprotocol::RenderingDom& renderingDom, Color color)
{
+396 -126
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -724,6 +724,7 @@ DocumentParagraphState
double width; // Character width
vint lineIndex; // Which line this character belongs to
vint height; // Character height (font size or inline object height)
vint length; // Character length in text (1 for normal characters, more for inline objects)
vint baseline; // Distance from top to baseline (for alignment)
bool isInlineObject; // True if this position is part of an inline object
};
@@ -749,7 +750,8 @@ DocumentParagraphState
elements::DocumentInlineObjectRunPropertyMap inlineObjectRuns;
elements::DocumentRunPropertyMap mergedRuns;
collections::List<DocumentParagraphCharLayout> characterLayouts;
collections::Dictionary<vint, DocumentParagraphCharLayout> caretLayouts;
collections::SortedList<vint> caretLayoutKeys;
collections::List<DocumentParagraphLineInfo> lines;
Size cachedSize;
collections::Dictionary<vint, Rect> cachedInlineObjectBounds;
@@ -894,7 +896,7 @@ IGuiRemoteProtocolMessages (Elements - Document)
void Impl_DocumentParagraph_GetCaret(vint id, const remoteprotocol::GetCaretRequest& arguments);
void Impl_DocumentParagraph_GetCaretBounds(vint id, const remoteprotocol::GetCaretBoundsRequest& arguments);
void Impl_DocumentParagraph_GetInlineObjectFromPoint(vint id, const remoteprotocol::GetInlineObjectFromPointRequest & arguments);
void Impl_DocumentParagraph_GetNearestCaretFromTextPos(vint id, const remoteprotocol::GetCaretBoundsRequest& arguments);
void Impl_DocumentParagraph_GetNearestCaretFromTextPos(vint id, const remoteprotocol::GetNearestCaretFromTextPosRequest& arguments);
void Impl_DocumentParagraph_IsValidCaret(vint id, const remoteprotocol::IsValidCaretRequest& arguments);
void Impl_DocumentParagraph_OpenCaret(const remoteprotocol::OpenCaretRequest& arguments);
void Impl_DocumentParagraph_CloseCaret(const vint& arguments);
@@ -903,6 +905,7 @@ IGuiRemoteProtocolMessages (Elements - Document)
#endif
/***********************************************************************
.\GUIUNITTESTPROTOCOL.H
***********************************************************************/
+130 -96
View File
@@ -3074,7 +3074,7 @@ WindowsDirect2DElementInlineObject
}
}
Color color=rendererCallback->GetBackgroundColor(start);
Color color = properties.backgroundColor;
if(color.a!=0)
{
color.a/=2;
@@ -3435,7 +3435,7 @@ WindowsDirect2DParagraph (Initialization)
~WindowsDirect2DParagraph()
{
CloseCaret();
DisableCaret();
for (auto color : usedColors)
{
renderTarget->DestroyDirect2DBrush(color);
@@ -3712,23 +3712,37 @@ WindowsDirect2DParagraph (IRenderingCallback)
WindowsDirect2DParagraph (Rendering)
***********************************************************************/
bool OpenCaret(vint _caret, Color _color, bool _frontSide)override
bool EnableCaret(vint _caret, Color _color, bool _frontSide)override
{
if(!IsValidCaret(_caret)) return false;
if(caret!=-1) CloseCaret();
caret=_caret;
caretColor=_color;
caretFrontSide=_frontSide;
caretBrush=renderTarget->CreateDirect2DBrush(caretColor);
if (!IsValidCaret(_caret)) return false;
if (caret != -1) DisableCaret();
caret = _caret;
caretColor = _color;
caretFrontSide = _frontSide;
caretBrush = renderTarget->CreateDirect2DBrush(caretColor);
return true;
}
bool CloseCaret()override
void DisableCaret()override
{
if(caret==-1) return false;
caret=-1;
if (caret == -1) return;
caret = -1;
renderTarget->DestroyDirect2DBrush(caretColor);
caretBrush=0;
caretBrush = nullptr;
}
bool BlinkCaret()override
{
if (caret == -1) return false;
if (caretBrush)
{
renderTarget->DestroyDirect2DBrush(caretColor);
caretBrush = nullptr;
}
else
{
caretBrush = renderTarget->CreateDirect2DBrush(caretColor);
}
return true;
}
@@ -3841,7 +3855,7 @@ WindowsDirect2DParagraph (Rendering)
defaultTextColor,
D2D1_DRAW_TEXT_OPTIONS_NO_SNAP);
if (caret != -1)
if (caret != -1 && caretBrush)
{
Rect caretBounds = GetCaretBounds(caret, caretFrontSide);
vint x = caretBounds.x1 + bounds.x1;
@@ -8502,7 +8516,7 @@ WindowsGDIParagraph
~WindowsGDIParagraph()
{
CloseCaret();
DisableCaret();
}
IGuiGraphicsLayoutProvider* GetProvider()override
@@ -8672,23 +8686,37 @@ WindowsGDIParagraph
paragraph->bounds.Height());
}
bool OpenCaret(vint _caret, Color _color, bool _frontSide)override
bool EnableCaret(vint _caret, Color _color, bool _frontSide)override
{
if(!IsValidCaret(_caret)) return false;
if(caret!=-1) CloseCaret();
caret=_caret;
caretColor=_color;
caretFrontSide=_frontSide;
caretPen=GetWindowsGDIResourceManager()->CreateGdiPen(caretColor);
if (!IsValidCaret(_caret)) return false;
if (caret != -1) DisableCaret();
caret = _caret;
caretColor = _color;
caretFrontSide = _frontSide;
caretPen = GetWindowsGDIResourceManager()->CreateGdiPen(caretColor);
return true;
}
bool CloseCaret()override
void DisableCaret()override
{
if(caret==-1) return false;
caret=-1;
if (caret == -1) return;
caret = -1;
GetWindowsGDIResourceManager()->DestroyGdiPen(caretColor);
caretPen=0;
caretPen = {};
}
bool BlinkCaret()override
{
if (caret == -1) return false;
if (caretPen)
{
GetWindowsGDIResourceManager()->DestroyGdiPen(caretColor);
caretPen = {};
}
else
{
caretPen = GetWindowsGDIResourceManager()->CreateGdiPen(caretColor);
}
return true;
}
@@ -8728,7 +8756,7 @@ WindowsGDIParagraph
paragraph->Render(this, false);
paragraphDC = 0;
if (caret != -1)
if (caret != -1 && caretPen)
{
Rect caretBounds = GetCaretBounds(caret, caretFrontSide);
vint x = caretBounds.x1 + bounds.x1;
@@ -10522,7 +10550,10 @@ UniscribeEmbeddedObjectRun
vint UniscribeEmbeddedObjectRun::SumWidth(vint charStart, vint charLength)
{
#define ERROR_MESSAGE_PREFIX L"vl::presentation::elements_windows_gdi::UniscribeEmbeddedObjectRun::SumWidth(...)#"
CHECK_ERROR(charStart == 0 && charLength == length, ERROR_MESSAGE_PREFIX L"Object can't split.");
return properties.size.x;
#undef ERROR_MESSAGE_PREFIX
}
vint UniscribeEmbeddedObjectRun::SumHeight()
@@ -10537,9 +10568,11 @@ UniscribeEmbeddedObjectRun
void UniscribeEmbeddedObjectRun::SearchForLineBreak(vint tempStart, bool wrapLine, vint maxWidth, bool firstRun, vint& charLength, vint& charAdvances)
{
#define ERROR_MESSAGE_PREFIX L"vl::presentation::elements_windows_gdi::UniscribeEmbeddedObjectRun::SearchForLineBreak(...)#"
CHECK_ERROR(tempStart == 0, ERROR_MESSAGE_PREFIX L"Object can't split.");
if (firstRun || !wrapLine || properties.size.x <= maxWidth)
{
charLength = length - tempStart;
charLength = length;
charAdvances = properties.size.x;
}
else
@@ -10547,6 +10580,7 @@ UniscribeEmbeddedObjectRun
charLength = 0;
charAdvances = 0;
}
#undef ERROR_MESSAGE_PREFIX
}
void UniscribeEmbeddedObjectRun::Render(IRendererCallback* callback, vint fragmentBoundsIndex, vint offsetX, vint offsetY, bool renderBackground)
@@ -10561,7 +10595,7 @@ UniscribeEmbeddedObjectRun
rect.right=(int)(fragment.bounds.Right()+offsetX)+2;
rect.bottom=(int)(fragment.bounds.Bottom()+offsetY)+2;
Color backgroundColor=documentFragment->colors.Values()[0].backgroundColor;
Color backgroundColor = properties.backgroundColor;
if(backgroundColor.a>0)
{
@@ -10824,62 +10858,65 @@ UniscribeLine
}
// render this line into lines with auto line wrapping
vint startRun = 0;
vint startRunOffset = 0;
vint lastRun = 0;
vint lastRunOffset = 0;
vint beginRun = 0;
vint beginRunOffset = 0;
vint endRun = 0;
vint endRunOffset = 0;
vint currentWidth = 0;
while (startRun < scriptRuns.Count())
while (beginRun < scriptRuns.Count())
{
vint lastCompletedRunOffset = 0;
vint currentWidth = 0;
bool firstRun = true;
// search for a range to fit in the given width
for (vint i = startRun; i < scriptRuns.Count(); i++)
while (endRun < scriptRuns.Count())
{
vint charLength = 0;
vint charAdvances = 0;
UniscribeRun* run = scriptRuns[i].Obj();
run->SearchForLineBreak(lastRunOffset, wrapLine, availableWidth - currentWidth, firstRun, charLength, charAdvances);
UniscribeRun* run = scriptRuns[endRun].Obj();
run->SearchForLineBreak(endRunOffset, wrapLine, availableWidth - currentWidth, firstRun, charLength, charAdvances);
firstRun = false;
if (charLength == run->length - lastRunOffset)
if (charLength == run->length - endRunOffset)
{
lastCompletedRunOffset = lastRunOffset;
lastRun = i + 1;
lastRunOffset = 0;
currentWidth += charAdvances;
}
else
{
if (lastRunOffset == 0 && charLength == 0)
if (endRun == scriptRuns.Count() - 1)
{
lastRun--;
lastRunOffset = lastCompletedRunOffset;
endRunOffset = run->length;
currentWidth += charAdvances;
break;
}
else
{
lastRun = i;
lastRunOffset = lastRunOffset + charLength;
endRun++;
endRunOffset = 0;
currentWidth += charAdvances;
}
}
else
{
if (endRunOffset == 0 && charLength == 0)
{
endRun--;
endRunOffset = scriptRuns[endRun]->length;
}
else
{
endRunOffset = endRunOffset + charLength;
currentWidth += charAdvances;
}
break;
}
}
// if the range is empty, than this should be the end of line, ignore it
if (startRun < lastRun || (startRun == lastRun && startRunOffset < lastRunOffset))
if (beginRun < endRun || (beginRun == endRun && beginRunOffset < endRunOffset))
{
// calculate the max line height in this range;
vint availableLastRun = lastRun < scriptRuns.Count() - 1 ? lastRun : scriptRuns.Count() - 1;
vint maxHeight = 0;
vint maxTextHeight = 0;
for (vint i = startRun; i <= availableLastRun; i++)
for (vint i = beginRun; i <= endRun; i++)
{
if (i == lastRun && lastRunOffset == 0)
{
break;
}
{
vint size = scriptRuns[i]->SumHeight();
if (maxHeight < size) maxHeight = size;
@@ -10891,40 +10928,37 @@ UniscribeLine
}
// determine the rendering order for all runs inside this range
Array<BYTE> levels(availableLastRun - startRun + 1);
Array<BYTE> levels(endRun - beginRun + 1);
Array<int> runVisualToLogical(levels.Count());
Array<int> runLogicalToVisual(levels.Count());
for (vint i = startRun; i <= availableLastRun; i++)
for (vint i = beginRun; i <= endRun; i++)
{
levels[i - startRun] = scriptRuns[i]->scriptItem->scriptItem.a.s.uBidiLevel;
levels[i - beginRun] = scriptRuns[i]->scriptItem->scriptItem.a.s.uBidiLevel;
}
ScriptLayout((int)levels.Count(), &levels[0], &runVisualToLogical[0], &runLogicalToVisual[0]);
// render all runs inside this range
vint startRunFragmentCount = -1;
for (vint i = startRun; i <= availableLastRun; i++)
vint beginRunFirstFragment = scriptRuns[beginRun]->fragmentBounds.Count();
for (vint i = 0; i < levels.Count(); i++)
{
vint runIndex = runVisualToLogical[i - startRun] + startRun;
vint runIndex = runVisualToLogical[i] + beginRun;
UniscribeRun* run = scriptRuns[runIndex].Obj();
vint start = runIndex == startRun ? startRunOffset : 0;
vint end = runIndex == lastRun ? lastRunOffset : run->length;
vint start = runIndex == beginRun ? beginRunOffset : 0;
vint end = runIndex == endRun ? endRunOffset : run->length;
vint length = end - start;
if (runIndex == startRun)
{
startRunFragmentCount = run->fragmentBounds.Count();
}
vint runWidth = run->SumWidth(start, length);
vint runHeight = run->SumHeight();
UniscribeRun::RunFragmentBounds fragmentBounds;
fragmentBounds.startFromRun = start;
fragmentBounds.length = length;
fragmentBounds.bounds = Rect(
Point(cx, cy + maxHeight - run->SumHeight()),
Size(run->SumWidth(start, length), run->SumHeight())
Point(cx, cy + maxHeight - runHeight),
Size(runWidth, runHeight)
);
run->fragmentBounds.Add(fragmentBounds);
cx += run->SumWidth(start, length);
cx += runWidth;
}
// adjust alignment
@@ -10942,10 +10976,10 @@ UniscribeLine
// shift all bounds using alignment
if (cxOffset != 0)
{
for (vint i = startRun; i <= availableLastRun; i++)
for (vint i = beginRun; i <= endRun; i++)
{
UniscribeRun* run = scriptRuns[i].Obj();
for (vint j = (i == startRun ? startRunFragmentCount : 0); j < run->fragmentBounds.Count(); j++)
for (vint j = (i == beginRun ? beginRunFirstFragment : 0); j < run->fragmentBounds.Count(); j++)
{
UniscribeRun::RunFragmentBounds& fragmentBounds = run->fragmentBounds[j];
fragmentBounds.bounds.x1 += cxOffset;
@@ -10957,11 +10991,10 @@ UniscribeLine
// create a virtual line
{
auto virtualLine = Ptr(new UniscribeVirtualLine);
virtualLine->firstRunIndex = startRun;
virtualLine->firstRunBoundsIndex = startRunFragmentCount;
virtualLine->lastRunIndex = availableLastRun;
virtualLine->lastRunBoundsIndex = scriptRuns[availableLastRun]->fragmentBounds.Count() - 1;
virtualLine->firstRunIndex = beginRun;
virtualLine->firstRunBoundsIndex = beginRunFirstFragment;
virtualLine->lastRunIndex = endRun;
virtualLine->lastRunBoundsIndex = scriptRuns[endRun]->fragmentBounds.Count() - 1;
UniscribeRun* firstRun = scriptRuns[virtualLine->firstRunIndex].Obj();
UniscribeRun* lastRun = scriptRuns[virtualLine->lastRunIndex].Obj();
UniscribeRun::RunFragmentBounds& firstBounds = firstRun->fragmentBounds[virtualLine->firstRunBoundsIndex];
@@ -10972,10 +11005,10 @@ UniscribeLine
virtualLine->runText = lineText.Buffer() + virtualLine->startFromLine;
bool updateBounds = false;
for (vint i = startRun; i <= availableLastRun; i++)
for (vint i = beginRun; i <= endRun; i++)
{
UniscribeRun* run = scriptRuns[i].Obj();
for (vint j = (i == startRun ? startRunFragmentCount : 0); j < run->fragmentBounds.Count(); j++)
for (vint j = (i == beginRun ? beginRunFirstFragment : 0); j < run->fragmentBounds.Count(); j++)
{
UniscribeRun::RunFragmentBounds& fragmentBounds = run->fragmentBounds[j];
if (updateBounds)
@@ -10999,8 +11032,14 @@ UniscribeLine
cy += (vint)(maxHeight + maxTextHeight * 0.5);
}
startRun = lastRun;
startRunOffset = lastRunOffset;
// prepare for the next virtual line
if (endRunOffset == scriptRuns[endRun]->length)
{
endRun++;
endRunOffset = 0;
}
beginRun = endRun;
beginRunOffset = endRunOffset;
}
// calculate line bounds
@@ -11014,7 +11053,7 @@ UniscribeLine
{
Rect bounds = fragmentBounds.bounds;
if (minX > bounds.Left()) minX = bounds.Left();
if (minY > bounds.Top()) minX = bounds.Top();
if (minY > bounds.Top()) minY = bounds.Top();
if (maxX < bounds.Right()) maxX = bounds.Right();
if (maxY < bounds.Bottom()) maxY = bounds.Bottom();
}
@@ -11064,7 +11103,6 @@ UniscribeParagraph (Initialization)
fragment->fontObject=0;
}
lines.Clear();
lastAvailableWidth=-1;
}
bool UniscribeParagraph::BuildUniscribeData(WinDC* dc)
@@ -11155,10 +11193,6 @@ UniscribeParagraph (Initialization)
void UniscribeParagraph::Layout(bool wrapLine, vint availableWidth, Alignment alignment)
{
if (lastWrapLine == wrapLine && lastAvailableWidth == availableWidth && paragraphAlignment == alignment)
{
return;
}
lastWrapLine = wrapLine;
lastAvailableWidth = availableWidth;
paragraphAlignment = alignment;
@@ -11183,7 +11217,7 @@ UniscribeParagraph (Initialization)
{
Rect bounds = line->bounds;
if (minX > bounds.Left()) minX = bounds.Left();
if (minY > bounds.Top()) minX = bounds.Top();
if (minY > bounds.Top()) minY = bounds.Top();
if (maxX < bounds.Right()) maxX = bounds.Right();
if (maxY < bounds.Bottom()) maxY = bounds.Bottom();
}
@@ -11345,11 +11379,11 @@ UniscribeParagraph (Formatting Helper)
f2=fe;
fe++;
vint length=fragmentEnd->text.Length();
Ptr<UniscribeFragment> leftFragment=fragmentStart->Copy(0, se);
Ptr<UniscribeFragment> leftFragment= fragmentEnd->Copy(0, se);
Ptr<UniscribeFragment> rightFragment=fragmentEnd->Copy(se, length-se);
documentFragments.RemoveAt(fe);
documentFragments.Insert(fe, leftFragment);
documentFragments.Insert(fe+1, rightFragment);
documentFragments.RemoveAt(fe-1);
documentFragments.Insert(fe-1, leftFragment);
documentFragments.Insert(fe, rightFragment);
}
}
return true;
+3
View File
@@ -1314,6 +1314,9 @@ UniscribeParagraph
void Layout(bool wrapLine, vint availableWidth, Alignment alignment);
void Render(UniscribeRun::IRendererCallback* callback, bool renderBackground);
// fs, fe: range in fragment index
// ss, se: range in char index in each fragment
// f1, f2: after cutting, the range is complete fragments from f1 to f2
void SearchFragment(vint start, vint length, vint& fs, vint& ss, vint& fe, vint& se);
bool CutFragment(vint fs, vint ss, vint fe, vint se, vint& f1, vint& f2);
void CutFragmentColors(vint fs, vint ss, vint fe, vint se, Color UniscribeColor::* colorField, Color color);
+1109 -762
View File
File diff suppressed because it is too large Load Diff
+137 -57
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -2579,6 +2579,8 @@ Type Declaration (Class)
CLASS_MEMBER_METHOD(Hide, NO_PARAMETER)
CLASS_MEMBER_METHOD(Close, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetOpening, NO_PARAMETER)
CLASS_MEMBER_METHOD(NotifyUpdateDisplayFont, NO_PARAMETER)
END_CLASS_MEMBER(GuiControlHost)
BEGIN_CLASS_MEMBER(GuiWindow)
@@ -3364,6 +3366,7 @@ Type Declaration (Class)
CLASS_MEMBER_PROPERTY_FAST(CaretVisible)
CLASS_MEMBER_PROPERTY_FAST(CaretColor)
CLASS_MEMBER_METHOD(BlinkCaret, NO_PARAMETER)
CLASS_MEMBER_METHOD(IsCaretEndPreferFrontSide, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetCaret, {L"begin" _ L"end" _ L"frontSide"})
CLASS_MEMBER_METHOD(CalculateCaret, {L"comparingCaret" _ L"position" _ L"preferFrontSide"})
+150 -131
View File
@@ -898,6 +898,22 @@
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [{
"$ast": "Attribute",
"cppType": "",
"name": "@DropRepeat"
}],
"name": "WindowNotifySetCaret",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "NativePoint"
}
},
"response": null
}, {
"$ast": "EventDecl",
"attributes": [{
@@ -1811,102 +1827,6 @@
}
}],
"type": "Struct"
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_SolidBorder",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_SolidBorder"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_SinkBorder",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_SinkBorder"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_SinkSplitter",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_SinkSplitter"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_SolidBackground",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_SolidBackground"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_GradientBackground",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_GradientBackground"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_InnerShadow",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_InnerShadow"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_Polygon",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_Polygon"
}
},
"response": null
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_SolidLabel",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_SolidLabel"
}
},
"response": null
}, {
"$ast": "EnumDecl",
"attributes": [{
@@ -2112,18 +2032,6 @@
}
}],
"type": "Struct"
}, {
"$ast": "MessageDecl",
"attributes": [],
"name": "RendererUpdateElement_ImageFrame",
"request": {
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "ElementDesc_ImageFrame"
}
},
"response": null
}, {
"$ast": "EnumDecl",
"attributes": [{
@@ -2235,6 +2143,13 @@
"$ast": "ReferenceType",
"name": "BreakCondition"
}
}, {
"$ast": "StructMember",
"name": "backgroundColor",
"type": {
"$ast": "PrimitiveType",
"type": "Color"
}
}, {
"$ast": "StructMember",
"name": "backgroundElementId",
@@ -2374,20 +2289,6 @@
"$ast": "ReferenceType",
"name": "Size"
}
}, {
"$ast": "StructMember",
"name": "inlineObjectBounds",
"type": {
"$ast": "MapType",
"element": {
"$ast": "ReferenceType",
"name": "Rect"
},
"keyType": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}
}],
"type": "Struct"
}, {
@@ -2466,19 +2367,31 @@
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "GetCaretBoundsResponse",
"members": [{
"$ast": "StructMember",
"name": "caret",
"name": "frontSideBounds",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "Rect"
}
}
}, {
"$ast": "StructMember",
"name": "frontSide",
"name": "backSideBounds",
"type": {
"$ast": "PrimitiveType",
"type": "Boolean"
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "Rect"
}
}
}],
"type": "Struct"
@@ -2502,6 +2415,33 @@
}
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "GetNearestCaretFromTextPosRequest",
"members": [{
"$ast": "StructMember",
"name": "id",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "textPos",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "frontSide",
"type": {
"$ast": "PrimitiveType",
"type": "Boolean"
}
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
@@ -2589,7 +2529,7 @@
"$ast": "MessageResponse",
"type": {
"$ast": "ReferenceType",
"name": "Rect"
"name": "GetCaretBoundsResponse"
}
}
}, {
@@ -2621,7 +2561,7 @@
"$ast": "MessageRequest",
"type": {
"$ast": "ReferenceType",
"name": "GetCaretBoundsRequest"
"name": "GetNearestCaretFromTextPosRequest"
}
},
"response": {
@@ -2784,6 +2724,38 @@
}
},
"response": null
}, {
"$ast": "UnionDecl",
"attributes": [],
"name": "OrdinaryElementDescVariant",
"members": [{
"$ast": "UnionMember",
"name": "ElementDesc_SolidBorder"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SinkBorder"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SinkSplitter"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SolidBackground"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_GradientBackground"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_InnerShadow"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_Polygon"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_SolidLabel"
}, {
"$ast": "UnionMember",
"name": "ElementDesc_ImageFrame"
}]
}, {
"$ast": "StructDecl",
"attributes": [],
@@ -2795,6 +2767,16 @@
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "updatedElements",
"type": {
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "OrdinaryElementDescVariant"
}
}
}],
"type": "Struct"
}, {
@@ -2918,6 +2900,33 @@
}
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
"name": "ElementMeasuring_InlineObjectBounds",
"members": [{
"$ast": "StructMember",
"name": "elementId",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "callbackId",
"type": {
"$ast": "PrimitiveType",
"type": "Integer"
}
}, {
"$ast": "StructMember",
"name": "bounds",
"type": {
"$ast": "ReferenceType",
"name": "Rect"
}
}],
"type": "Struct"
}, {
"$ast": "StructDecl",
"attributes": [],
@@ -2952,6 +2961,16 @@
"name": "ImageMetadata"
}
}
}, {
"$ast": "StructMember",
"name": "inlineObjectBounds",
"type": {
"$ast": "ArrayType",
"element": {
"$ast": "ReferenceType",
"name": "ElementMeasuring_InlineObjectBounds"
}
}
}],
"type": "Struct"
}, {
@@ -82,6 +82,7 @@ struct WindowShowing
[@DropRepeat] message WindowNotifyActivate {}
[@DropRepeat] message WindowNotifyShow { request: WindowShowing; }
[@DropRepeat] message WindowNotifyMinSize { request: NativeSize; }
[@DropRepeat] message WindowNotifySetCaret { request: NativePoint; }
[@DropRepeat] event WindowBoundsUpdated { request: WindowSizingConfig; }
[@DropRepeat] event WindowActivatedUpdated { request: bool; }
@@ -23,9 +23,23 @@ struct RendererCreation
message RendererCreated { request: RendererCreation[]; }
message RendererDestroyed { request: int[]; }
union OrdinaryElementDescVariant
{
ElementDesc_SolidBorder,
ElementDesc_SinkBorder,
ElementDesc_SinkSplitter,
ElementDesc_SolidBackground,
ElementDesc_GradientBackground,
ElementDesc_InnerShadow,
ElementDesc_Polygon,
ElementDesc_SolidLabel,
ElementDesc_ImageFrame,
}
struct ElementBeginRendering
{
var frameId : int;
var updatedElements : OrdinaryElementDescVariant[];
}
struct ElementRendering
@@ -57,15 +71,23 @@ struct ElementMeasuring_ElementMinSize
var minSize : Size;
}
struct ElementMeasuring_InlineObjectBounds
{
var elementId : int;
var callbackId : int;
var bounds : Rect;
}
struct ElementMeasurings
{
var fontHeights : ElementMeasuring_FontHeight[];
var minSizes : ElementMeasuring_ElementMinSize[];
var createdImages : ImageMetadata[];
var inlineObjectBounds : ElementMeasuring_InlineObjectBounds[];
}
message RendererBeginRendering { request: ElementBeginRendering; }
message RendererBeginBoundary { request: ElementBoundary; }
message RendererRenderElement { request: ElementRendering; }
message RendererEndBoundary {}
message RendererEndRendering { response: ElementMeasurings; }
message RendererEndRendering { response: ElementMeasurings; }
@@ -122,11 +122,3 @@ struct ElementDesc_SolidLabel
var measuringRequest : ElementSolidLabelMeasuringRequest?;
}
message RendererUpdateElement_SolidBorder { request: ElementDesc_SolidBorder; }
message RendererUpdateElement_SinkBorder { request: ElementDesc_SinkBorder; }
message RendererUpdateElement_SinkSplitter { request: ElementDesc_SinkSplitter; }
message RendererUpdateElement_SolidBackground { request: ElementDesc_SolidBackground; }
message RendererUpdateElement_GradientBackground { request: ElementDesc_GradientBackground; }
message RendererUpdateElement_InnerShadow { request: ElementDesc_InnerShadow; }
message RendererUpdateElement_Polygon { request: ElementDesc_Polygon; }
message RendererUpdateElement_SolidLabel { request: ElementDesc_SolidLabel; }
@@ -33,6 +33,7 @@ struct DocumentInlineObjectRunProperty
var size : Size;
var baseline : int;
var breakCondition : BreakCondition;
var backgroundColor : color;
var backgroundElementId : int;
var callbackId : int;
}
@@ -65,7 +66,6 @@ struct ElementDesc_DocumentParagraph
struct UpdateElement_DocumentParagraphResponse
{
var documentSize : Size;
var inlineObjectBounds : Rect[int];
}
message RendererUpdateElement_DocumentParagraph { request: ElementDesc_DocumentParagraph; response: UpdateElement_DocumentParagraphResponse; }
@@ -86,8 +86,12 @@ struct GetCaretResponse
struct GetCaretBoundsRequest
{
var id : int;
var caret : int;
var frontSide : bool;
}
struct GetCaretBoundsResponse
{
var frontSideBounds : Rect[];
var backSideBounds : Rect[];
}
struct GetInlineObjectFromPointRequest
@@ -96,6 +100,13 @@ struct GetInlineObjectFromPointRequest
var point : Point;
}
struct GetNearestCaretFromTextPosRequest
{
var id : int;
var textPos : int;
var frontSide : bool;
}
struct IsValidCaretRequest
{
var id : int;
@@ -111,9 +122,9 @@ struct OpenCaretRequest
}
message DocumentParagraph_GetCaret { request: GetCaretRequest; response: GetCaretResponse; }
message DocumentParagraph_GetCaretBounds { request: GetCaretBoundsRequest; response: Rect; }
message DocumentParagraph_GetCaretBounds { request: GetCaretBoundsRequest; response: GetCaretBoundsResponse; }
message DocumentParagraph_GetInlineObjectFromPoint { request: GetInlineObjectFromPointRequest; response: DocumentRun?; }
message DocumentParagraph_GetNearestCaretFromTextPos { request: GetCaretBoundsRequest; response: int; }
message DocumentParagraph_GetNearestCaretFromTextPos { request: GetNearestCaretFromTextPosRequest; response: int; }
message DocumentParagraph_IsValidCaret { request: IsValidCaretRequest; response: bool; }
message DocumentParagraph_OpenCaret { request: OpenCaretRequest; }
message DocumentParagraph_CloseCaret { request: int; }
@@ -46,4 +46,3 @@ struct ElementDesc_ImageFrame
var imageCreation : ImageCreation?;
}
message RendererUpdateElement_ImageFrame { request: ElementDesc_ImageFrame; }
+4 -3
View File
@@ -3349,11 +3349,12 @@ namespace vl
}
}
/// <summary>Remove a value associated to a specified key.</summary>
/// <summary>
/// Remove a value associated to a specified key.
/// If this value is associated to the key for multiple times, only the first one will be removed.
/// </summary>
/// <returns>
/// Returns true if the value is removed.
/// If this value is associated to the key for jultiple times, only the first one will be removed.
/// If this value is associated to the key for jultiple times, only the first one will be removed.
/// </returns>
/// <param name="key">The key to find.</param>
/// <param name="value">The value to remove.</param>
Binary file not shown.
Binary file not shown.
@@ -186,13 +186,6 @@
var counter : int = 0;
]]>
</ref.Members>
<ref.Ctor>
<![CDATA[
{
self.AddAnimation(WaitingAnimation(animationBackground));
}
]]>
</ref.Ctor>
<TabPage ref.Name="self" Text="Animation">
<Tab>
<att.BoundsComposition-set AlignmentToParent="left:5 top:5 right:5 bottom:5"/>
@@ -241,9 +234,31 @@
</TabPage>
<TabPage Text="Complex Animation">
<BoundsComposition ref.Name="animationBackground" AlignmentToParent="left:10 top:10 right:-1 bottom:-1" PreferredMinSize="x:200 y:200">
<SolidBackground Color="#FFC929"/>
</BoundsComposition>
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5" MinSizeLimitation="LimitToElementAndChildren">
<att.Rows>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:1.0</_>
</att.Columns>
<Cell Site="row:0 column:0">
<Button Text="Start Animation" ref.Name="buttonStartAnimation">
<ev.Clicked-eval>
<![CDATA[{
buttonStartAnimation.Enabled = false;
self.AddAnimation(AnimationTabPage::WaitingAnimation(animationBackground));
}]]></ev.Clicked-eval>
</Button>
</Cell>
<Cell Site="row:1 column:0">
<BoundsComposition ref.Name="animationBackground" AlignmentToParent="left:0 top:0 right:-1 bottom:-1" PreferredMinSize="x:200 y:200">
<SolidBackground Color="#FFC929"/>
</BoundsComposition>
</Cell>
</Table>
</TabPage>
</att.Pages>
</Tab>
File diff suppressed because it is too large Load Diff
@@ -27,7 +27,7 @@ namespace demo
{
class DocumentEditorRibbon : public ::demo::DocumentEditorBase, public ::demo::DocumentEditorRibbonConstructor, public ::vl::reflection::Description<DocumentEditorRibbon>
{
friend struct ::vl_workflow_global::__vwsnf222_Demo_demo_DocumentEditorRibbon___vwsn_instance_ctor__;
friend struct ::vl_workflow_global::__vwsnf223_Demo_demo_DocumentEditorRibbon___vwsn_instance_ctor__;
friend class ::demo::DocumentEditorRibbonConstructor;
friend class ::vl_workflow_global::__vwsnc100_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc101_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize__vl_reflection_description_IValueSubscription;
@@ -38,7 +38,6 @@ namespace demo
friend class ::vl_workflow_global::__vwsnc106_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc98_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc99_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf207_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
friend struct ::vl_workflow_global::__vwsnf208_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
friend struct ::vl_workflow_global::__vwsnf209_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
friend struct ::vl_workflow_global::__vwsnf210_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
@@ -53,6 +52,7 @@ namespace demo
friend struct ::vl_workflow_global::__vwsnf219_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
friend struct ::vl_workflow_global::__vwsnf220_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
friend struct ::vl_workflow_global::__vwsnf221_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
friend struct ::vl_workflow_global::__vwsnf222_Demo_demo_DocumentEditorRibbonConstructor___vwsn_demo_DocumentEditorRibbon_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<DocumentEditorRibbon>;
#endif
@@ -86,8 +86,8 @@ namespace demo
friend class ::demo::DocumentEditorToolstripConstructor;
friend class ::vl_workflow_global::__vwsnc110_Demo_demo_DocumentEditorToolstripConstructor___vwsn_demo_DocumentEditorToolstrip_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc111_Demo_demo_DocumentEditorToolstripConstructor___vwsn_demo_DocumentEditorToolstrip_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf226_Demo_demo_DocumentEditorToolstripConstructor___vwsn_demo_DocumentEditorToolstrip_Initialize_;
friend struct ::vl_workflow_global::__vwsnf227_Demo_demo_DocumentEditorToolstripConstructor___vwsn_demo_DocumentEditorToolstrip_Initialize_;
friend struct ::vl_workflow_global::__vwsnf228_Demo_demo_DocumentEditorToolstripConstructor___vwsn_demo_DocumentEditorToolstrip_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<DocumentEditorToolstrip>;
#endif
@@ -155,7 +155,6 @@ namespace vl
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiTabPage)
CLASS_MEMBER_BASE(::demo::AnimationTabPageConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::AnimationTabPage*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_STATIC_METHOD(BallAnimation, { L"container" _ L"ball" })
CLASS_MEMBER_STATIC_METHOD(BallAnimationWithDelay, { L"container" _ L"ball" _ L"delay" })
CLASS_MEMBER_METHOD(PerformGradientAnimation, { L"target" })
@@ -182,6 +181,9 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_18)
CLASS_MEMBER_FIELD(__vwsn_precompile_19)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_20)
CLASS_MEMBER_FIELD(__vwsn_precompile_21)
CLASS_MEMBER_FIELD(__vwsn_precompile_22)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
CLASS_MEMBER_FIELD(__vwsn_precompile_5)
@@ -190,6 +192,7 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_8)
CLASS_MEMBER_FIELD(__vwsn_precompile_9)
CLASS_MEMBER_FIELD(animationBackground)
CLASS_MEMBER_FIELD(buttonStartAnimation)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::demo::AnimationTabPageConstructor)
@@ -57,7 +57,6 @@ namespace demo
friend class ::vl_workflow_global::__vwsnc95_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc96_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize__vl_reflection_description_IValueSubscription;
friend class ::vl_workflow_global::__vwsnc97_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize__vl_reflection_description_IValueSubscription;
friend struct ::vl_workflow_global::__vwsnf148_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf149_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf150_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf151_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
@@ -80,8 +79,8 @@ namespace demo
friend struct ::vl_workflow_global::__vwsnf168_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf169_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf170_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf171_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize__;
friend struct ::vl_workflow_global::__vwsnf172_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf171_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf172_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize__;
friend struct ::vl_workflow_global::__vwsnf173_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf174_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf175_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
@@ -116,6 +115,7 @@ namespace demo
friend struct ::vl_workflow_global::__vwsnf204_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf205_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf206_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
friend struct ::vl_workflow_global::__vwsnf207_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<DocumentEditorBase>;
#endif
Binary file not shown.
Binary file not shown.