-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryIcon.cpp
More file actions
1175 lines (1097 loc) · 43.2 KB
/
LibraryIcon.cpp
File metadata and controls
1175 lines (1097 loc) · 43.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// LottieGen version:
// 8.0.280224.1+42b1fb4fd6
//
// Command:
// LottieGen -GenerateColorBindings -Language Cppwinrt -Namespace SuiteInstaller
// -WinUIVersion 3.0 -InputFile libraryIcon.json
//
// Input file:
// libraryIcon.json (14508 bytes created 11:43+02:00 Nov 22 2024)
//
// LottieGen source:
// http://aka.ms/Lottie
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// ____________________________________
// | Object stats | Count |
// |__________________________|_______|
// | All CompositionObjects | 125 |
// |--------------------------+-------|
// | Expression animators | 17 |
// | KeyFrame animators | 25 |
// | Reference parameters | 14 |
// | Expression operations | 8 |
// |--------------------------+-------|
// | Animated brushes | 2 |
// | Animated gradient stops | - |
// | ExpressionAnimations | 3 |
// | PathKeyFrameAnimations | - |
// |--------------------------+-------|
// | ContainerVisuals | 1 |
// | ShapeVisuals | 1 |
// |--------------------------+-------|
// | ContainerShapes | 1 |
// | CompositionSpriteShapes | 6 |
// |--------------------------+-------|
// | Brushes | 2 |
// | Gradient stops | - |
// | CompositionVisualSurface | - |
// ------------------------------------
#include "stdafx.h"
#include "LibraryIcon.h"
#if __has_include("LibraryIcon.g.cpp")
#include "LibraryIcon.g.cpp"
#endif
#include "d2d1.h"
#include <Windows.Graphics.Interop.h>
#include <d2d1_1.h>
#include <d2d1helper.h>
#include <winrt/Microsoft.UI.Composition.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.Metadata.h>
#ifdef BUILD_WINDOWS
namespace ABI
{
#include <Windows.Graphics.Effects.Interop.h>
}
#else
#include <Windows.Graphics.Effects.Interop.h>
#endif
#include <winrt/Windows.Graphics.Effects.h>
using namespace winrt::Microsoft::UI;
using namespace winrt::Microsoft::UI::Composition;
using namespace winrt::Microsoft::UI::Xaml::Controls;
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Numerics;
using namespace winrt::Windows::Graphics;
using Color = winrt::Windows::UI::Color;
using CompositionPropertySet = winrt::Microsoft::UI::Composition::CompositionPropertySet;
using TimeSpan = winrt::Windows::Foundation::TimeSpan;
namespace winrt::SuiteInstaller::implementation
{
class CanvasGeometry
: public winrt::implements<CanvasGeometry,
IGeometrySource2D,
::ABI::Windows::Graphics::IGeometrySource2DInterop>
{
winrt::com_ptr<ID2D1Geometry> _geometry{ nullptr };
public:
CanvasGeometry(winrt::com_ptr<ID2D1Geometry> geometry)
: _geometry{ geometry }
{
}
// IGeometrySource2D.
winrt::com_ptr<ID2D1Geometry> Geometry() { return _geometry; }
// IGeometrySource2DInterop.
IFACEMETHODIMP GetGeometry(ID2D1Geometry ** value) noexcept(true) override
{
_geometry.copy_to(value);
return S_OK;
}
// IGeometrySource2DInterop.
IFACEMETHODIMP TryGetGeometryUsingFactory(ID2D1Factory *,
ID2D1Geometry **) noexcept(true) override
{
return E_NOTIMPL;
}
};
class LibraryIcon_AnimatedVisual
: public winrt::implements<LibraryIcon_AnimatedVisual,
winrt::Microsoft::UI::Xaml::Controls::IAnimatedVisual2,
winrt::Microsoft::UI::Xaml::Controls::IAnimatedVisual,
IClosable>
{
winrt::com_ptr<ID2D1Factory> _d2dFactory{ nullptr };
static constexpr int64_t c_durationTicks{ 20000000L };
Compositor const _c{ nullptr };
ExpressionAnimation const _reusableExpressionAnimation{ nullptr };
CompositionPropertySet const _themeProperties{ nullptr };
AnimationController _animationController_0{ nullptr };
CompositionColorBrush _themeColor_Foreground{ nullptr };
CompositionColorBrush _themeColor_AccentColor{ nullptr };
CompositionContainerShape _containerShape{ nullptr };
CompositionPathGeometry _pathGeometry_1{ nullptr };
CompositionPathGeometry _pathGeometry_3{ nullptr };
CompositionSpriteShape _spriteShape_0{ nullptr };
CompositionSpriteShape _spriteShape_1{ nullptr };
CompositionSpriteShape _spriteShape_2{ nullptr };
CompositionSpriteShape _spriteShape_3{ nullptr };
CompositionSpriteShape _spriteShape_4{ nullptr };
CompositionSpriteShape _spriteShape_5{ nullptr };
ContainerVisual _root{ nullptr };
CubicBezierEasingFunction _cubicBezierEasingFunction_0{ nullptr };
CubicBezierEasingFunction _cubicBezierEasingFunction_1{ nullptr };
CubicBezierEasingFunction _cubicBezierEasingFunction_2{ nullptr };
CubicBezierEasingFunction _cubicBezierEasingFunction_3{ nullptr };
CubicBezierEasingFunction _cubicBezierEasingFunction_4{ nullptr };
ScalarKeyFrameAnimation _rotationAngleInDegreesScalarAnimation_0_to_0{ nullptr };
ScalarKeyFrameAnimation _rotationAngleInDegreesScalarAnimation_m14_to_m14{ nullptr };
ScalarKeyFrameAnimation _strokeThicknessScalarAnimation_3_to_3{ nullptr };
StepEasingFunction _holdThenStepEasingFunction{ nullptr };
StepEasingFunction _stepThenHoldEasingFunction{ nullptr };
Vector2KeyFrameAnimation _offsetVector2Animation_0{ nullptr };
Vector2KeyFrameAnimation _offsetVector2Animation_1{ nullptr };
Vector2KeyFrameAnimation _offsetVector2Animation_2{ nullptr };
Vector2KeyFrameAnimation _scaleVector2Animation_0{ nullptr };
Vector2KeyFrameAnimation _scaleVector2Animation_1{ nullptr };
void BindProperty(CompositionObject target,
winrt::hstring animatedPropertyName,
winrt::hstring expression,
winrt::hstring referenceParameterName,
CompositionObject referencedObject)
{
_reusableExpressionAnimation.ClearAllParameters();
_reusableExpressionAnimation.Expression(expression);
_reusableExpressionAnimation.SetReferenceParameter(referenceParameterName, referencedObject);
target.StartAnimation(animatedPropertyName, _reusableExpressionAnimation);
}
void BindProperty2(CompositionObject target,
winrt::hstring animatedPropertyName,
winrt::hstring expression,
winrt::hstring referenceParameterName0,
CompositionObject referencedObject0,
winrt::hstring referenceParameterName1,
CompositionObject referencedObject1)
{
_reusableExpressionAnimation.ClearAllParameters();
_reusableExpressionAnimation.Expression(expression);
_reusableExpressionAnimation.SetReferenceParameter(referenceParameterName0, referencedObject0);
_reusableExpressionAnimation.SetReferenceParameter(referenceParameterName1, referencedObject1);
target.StartAnimation(animatedPropertyName, _reusableExpressionAnimation);
}
ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation(
float initialProgress, float initialValue, CompositionEasingFunction initialEasingFunction)
{
const auto result = _c.CreateScalarKeyFrameAnimation();
result.Duration(TimeSpan{ c_durationTicks });
result.InsertKeyFrame(initialProgress, initialValue, initialEasingFunction);
return result;
}
Vector2KeyFrameAnimation CreateVector2KeyFrameAnimation(
float initialProgress, float2 initialValue, CompositionEasingFunction initialEasingFunction)
{
const auto result = _c.CreateVector2KeyFrameAnimation();
result.Duration(TimeSpan{ c_durationTicks });
result.InsertKeyFrame(initialProgress, initialValue, initialEasingFunction);
return result;
}
CompositionSpriteShape CreateSpriteShape(CompositionGeometry geometry, float3x2 transformMatrix)
{
const auto result = _c.CreateSpriteShape(geometry);
result.TransformMatrix(transformMatrix);
return result;
}
CompositionSpriteShape CreateSpriteShape(CompositionGeometry geometry,
float3x2 transformMatrix,
CompositionBrush fillBrush)
{
const auto result = _c.CreateSpriteShape(geometry);
result.TransformMatrix(transformMatrix);
result.FillBrush(fillBrush);
return result;
}
AnimationController AnimationController_0()
{
if (_animationController_0 != nullptr)
{
return _animationController_0;
}
const auto result = _animationController_0 = _c.CreateAnimationController();
result.Pause();
BindProperty(_animationController_0, L"Progress", L"_.Progress", L"_", _root);
return result;
}
// - - - Layer aggregator
// - - Offset:<27.556, 38>
winrt::com_ptr<CanvasGeometry> Geometry_0()
{
winrt::com_ptr<ID2D1PathGeometry> path{ nullptr };
winrt::check_hresult(_d2dFactory->CreatePathGeometry(path.put()));
winrt::com_ptr<ID2D1GeometrySink> sink{ nullptr };
winrt::check_hresult(path->Open(sink.put()));
sink->BeginFigure({ 2.625F, -20.0F }, D2D1_FIGURE_BEGIN_FILLED);
sink->AddBezier({ { 3.17499995F, -20.0F }, { 3.625F, -19.5499992F }, { 3.625F, -19.0F } });
sink->AddLine({ 3.625F, 19.0F });
sink->AddBezier({ { 3.625F, 19.5499992F }, { 3.17499995F, 20.0F }, { 2.625F, 20.0F } });
sink->AddLine({ -2.625F, 20.0F });
sink->AddBezier({ { -3.17499995F, 20.0F }, { -3.625F, 19.5499992F }, { -3.625F, 19.0F } });
sink->AddLine({ -3.625F, -19.0F });
sink->AddBezier({ { -3.625F, -19.5499992F }, { -3.17499995F, -20.0F }, { -2.625F, -20.0F } });
sink->AddLine({ 2.625F, -20.0F });
sink->EndFigure(D2D1_FIGURE_END_CLOSED);
winrt::check_hresult(sink->Close());
auto result = winrt::make_self<CanvasGeometry>(path);
return result;
}
winrt::com_ptr<CanvasGeometry> Geometry_1()
{
winrt::com_ptr<ID2D1PathGeometry> path{ nullptr };
winrt::check_hresult(_d2dFactory->CreatePathGeometry(path.put()));
winrt::com_ptr<ID2D1GeometrySink> sink{ nullptr };
winrt::check_hresult(path->Open(sink.put()));
sink->BeginFigure({ 2.625F, -22.0F }, D2D1_FIGURE_BEGIN_FILLED);
sink->AddBezier({ { 3.17499995F, -22.0F }, { 3.625F, -21.5499992F }, { 3.625F, -21.0F } });
sink->AddLine({ 3.625F, 21.0F });
sink->AddBezier({ { 3.625F, 21.5499992F }, { 3.17499995F, 22.0F }, { 2.625F, 22.0F } });
sink->AddLine({ -2.625F, 22.0F });
sink->AddBezier({ { -3.17499995F, 22.0F }, { -3.625F, 21.5499992F }, { -3.625F, 21.0F } });
sink->AddLine({ -3.625F, -21.0F });
sink->AddBezier({ { -3.625F, -21.5499992F }, { -3.17499995F, -22.0F }, { -2.625F, -22.0F } });
sink->AddLine({ 2.625F, -22.0F });
sink->EndFigure(D2D1_FIGURE_END_CLOSED);
winrt::check_hresult(sink->Close());
auto result = winrt::make_self<CanvasGeometry>(path);
return result;
}
// - - - - Layer aggregator
// - - - Layer: fillIcon
// - - Offset:<27.556, 38>
winrt::com_ptr<CanvasGeometry> Geometry_2()
{
winrt::com_ptr<ID2D1PathGeometry> path{ nullptr };
winrt::check_hresult(_d2dFactory->CreatePathGeometry(path.put()));
winrt::com_ptr<ID2D1GeometrySink> sink{ nullptr };
winrt::check_hresult(path->Open(sink.put()));
sink->SetFillMode(D2D1_FILL_MODE_WINDING);
sink->BeginFigure({ 1.125F, -20.0F }, D2D1_FIGURE_BEGIN_FILLED);
sink->AddBezier({ { 2.5F, -20.0F }, { 3.625F, -18.875F }, { 3.625F, -17.5F } });
sink->AddLine({ 3.625F, 17.5F });
sink->AddBezier({ { 3.625F, 18.875F }, { 2.5F, 20.0F }, { 1.125F, 20.0F } });
sink->AddLine({ -1.125F, 20.0F });
sink->AddBezier({ { -2.5F, 20.0F }, { -3.625F, 18.875F }, { -3.625F, 17.5F } });
sink->AddLine({ -3.625F, -17.5F });
sink->AddBezier({ { -3.625F, -18.875F }, { -2.5F, -20.0F }, { -1.125F, -20.0F } });
sink->AddLine({ 1.125F, -20.0F });
sink->EndFigure(D2D1_FIGURE_END_CLOSED);
winrt::check_hresult(sink->Close());
auto result = winrt::make_self<CanvasGeometry>(path);
return result;
}
winrt::com_ptr<CanvasGeometry> Geometry_3()
{
winrt::com_ptr<ID2D1PathGeometry> path{ nullptr };
winrt::check_hresult(_d2dFactory->CreatePathGeometry(path.put()));
winrt::com_ptr<ID2D1GeometrySink> sink{ nullptr };
winrt::check_hresult(path->Open(sink.put()));
sink->SetFillMode(D2D1_FILL_MODE_WINDING);
sink->BeginFigure({ 1.125F, -22.0F }, D2D1_FIGURE_BEGIN_FILLED);
sink->AddBezier({ { 2.5F, -22.0F }, { 3.625F, -20.875F }, { 3.625F, -19.5F } });
sink->AddLine({ 3.625F, 19.5F });
sink->AddBezier({ { 3.625F, 20.875F }, { 2.5F, 22.0F }, { 1.125F, 22.0F } });
sink->AddLine({ -1.125F, 22.0F });
sink->AddBezier({ { -2.5F, 22.0F }, { -3.625F, 20.875F }, { -3.625F, 19.5F } });
sink->AddLine({ -3.625F, -19.5F });
sink->AddBezier({ { -3.625F, -20.875F }, { -2.5F, -22.0F }, { -1.125F, -22.0F } });
sink->AddLine({ 1.125F, -22.0F });
sink->EndFigure(D2D1_FIGURE_END_CLOSED);
winrt::check_hresult(sink->Close());
auto result = winrt::make_self<CanvasGeometry>(path);
return result;
}
// Color bound to theme property value: Foreground
CompositionColorBrush ThemeColor_Foreground()
{
if (_themeColor_Foreground != nullptr)
{
return _themeColor_Foreground;
}
const auto result = _themeColor_Foreground = _c.CreateColorBrush();
BindProperty(_themeColor_Foreground, L"Color",
L"ColorRGB(_theme.Foreground.W,_theme.Foreground.X,_theme.Foreground.Y,_"
L"theme.Foreground.Z)",
L"_theme", _themeProperties);
return result;
}
// Color bound to theme property value: AccentColor
CompositionColorBrush ThemeColor_AccentColor()
{
if (_themeColor_AccentColor != nullptr)
{
return _themeColor_AccentColor;
}
const auto result = _themeColor_AccentColor = _c.CreateColorBrush();
const auto propertySet = result.Properties();
propertySet.InsertScalar(L"Opacity0", 0.0F);
BindProperty2(
_themeColor_AccentColor, L"Color",
L"ColorRGB(_theme.AccentColor.W*my.Opacity0,_theme.AccentColor.X,_theme.AccentColor"
L".Y,_theme.AccentColor.Z)",
L"_theme", _themeProperties, L"my", propertySet);
return result;
}
// Layer aggregator
// Layer: fillIcon
CompositionContainerShape ContainerShape()
{
if (_containerShape != nullptr)
{
return _containerShape;
}
const auto result = _containerShape = _c.CreateContainerShape();
result.Scale({ 0.0F, 0.0F });
const auto shapes = result.Shapes();
// Offset:<27.556, 38>
shapes.Append(SpriteShape_3());
// Offset:<27.556, 38>
shapes.Append(SpriteShape_4());
// Offset:<27.556, 38>
shapes.Append(SpriteShape_5());
return result;
}
// - Layer aggregator
// Offset:<27.556, 38>
CompositionPathGeometry PathGeometry_0()
{
return _c.CreatePathGeometry(CompositionPath(CanvasGeometryToIGeometrySource2D(Geometry_0())));
}
CompositionPathGeometry PathGeometry_1()
{
return (_pathGeometry_1 == nullptr) ? _pathGeometry_1 = _c.CreatePathGeometry(CompositionPath(
CanvasGeometryToIGeometrySource2D(Geometry_1())))
: _pathGeometry_1;
}
// - - Layer aggregator
// - Layer: fillIcon
// Offset:<27.556, 38>
CompositionPathGeometry PathGeometry_2()
{
return _c.CreatePathGeometry(CompositionPath(CanvasGeometryToIGeometrySource2D(Geometry_2())));
}
CompositionPathGeometry PathGeometry_3()
{
return (_pathGeometry_3 == nullptr) ? _pathGeometry_3 = _c.CreatePathGeometry(CompositionPath(
CanvasGeometryToIGeometrySource2D(Geometry_3())))
: _pathGeometry_3;
}
// Layer aggregator
// Book3Path
CompositionSpriteShape SpriteShape_0()
{
// Offset:<27.556, 38>
if (_spriteShape_0 != nullptr)
{
return _spriteShape_0;
}
const auto result = _spriteShape_0 =
CreateSpriteShape(PathGeometry_0(), { 1.0F, 0.0F, 0.0F, 1.0F, 27.5559998F, 38.0F });
;
result.StrokeBrush(ThemeColor_Foreground());
result.StrokeMiterLimit(2.0F);
return result;
}
// Layer aggregator
// Book2Path
CompositionSpriteShape SpriteShape_1()
{
// Offset:<27.556, 38>
if (_spriteShape_1 != nullptr)
{
return _spriteShape_1;
}
const auto result = _spriteShape_1 =
CreateSpriteShape(PathGeometry_1(), { 1.0F, 0.0F, 0.0F, 1.0F, 27.5559998F, 38.0F });
;
result.StrokeBrush(ThemeColor_Foreground());
result.StrokeMiterLimit(2.0F);
return result;
}
// Layer aggregator
// Book1Path
CompositionSpriteShape SpriteShape_2()
{
// Offset:<27.556, 38>
if (_spriteShape_2 != nullptr)
{
return _spriteShape_2;
}
const auto result = _spriteShape_2 =
CreateSpriteShape(PathGeometry_1(), { 1.0F, 0.0F, 0.0F, 1.0F, 27.5559998F, 38.0F });
;
result.StrokeBrush(ThemeColor_Foreground());
result.StrokeMiterLimit(2.0F);
return result;
}
// - Layer aggregator
// Layer: fillIcon
// Book3Path
CompositionSpriteShape SpriteShape_3()
{
// Offset:<27.556, 38>
const auto geometry = PathGeometry_2();
if (_spriteShape_3 != nullptr)
{
return _spriteShape_3;
}
const auto result = _spriteShape_3 = CreateSpriteShape(
geometry, { 1.0F, 0.0F, 0.0F, 1.0F, 27.5559998F, 38.0F }, ThemeColor_AccentColor());
;
return result;
}
// - Layer aggregator
// Layer: fillIcon
// Book2Path
CompositionSpriteShape SpriteShape_4()
{
// Offset:<27.556, 38>
const auto geometry = PathGeometry_3();
if (_spriteShape_4 != nullptr)
{
return _spriteShape_4;
}
const auto result = _spriteShape_4 = CreateSpriteShape(
geometry, { 1.0F, 0.0F, 0.0F, 1.0F, 27.5559998F, 38.0F }, ThemeColor_AccentColor());
;
return result;
}
// - Layer aggregator
// Layer: fillIcon
// Book1Path
CompositionSpriteShape SpriteShape_5()
{
// Offset:<27.556, 38>
const auto geometry = PathGeometry_3();
if (_spriteShape_5 != nullptr)
{
return _spriteShape_5;
}
const auto result = _spriteShape_5 = CreateSpriteShape(
geometry, { 1.0F, 0.0F, 0.0F, 1.0F, 27.5559998F, 38.0F }, ThemeColor_AccentColor());
;
return result;
}
// The root of the composition.
ContainerVisual Root()
{
if (_root != nullptr)
{
return _root;
}
const auto result = _root = _c.CreateContainerVisual();
const auto propertySet = result.Properties();
propertySet.InsertScalar(L"Progress", 0.0F);
propertySet.InsertScalar(L"t0", 0.0F);
propertySet.InsertScalar(L"t1", 0.0F);
propertySet.InsertScalar(L"t2", 0.0F);
propertySet.InsertScalar(L"t3", 0.0F);
// Layer aggregator
result.Children().InsertAtTop(ShapeVisual_0());
return result;
}
CubicBezierEasingFunction CubicBezierEasingFunction_0()
{
return (_cubicBezierEasingFunction_0 == nullptr)
? _cubicBezierEasingFunction_0 = _c.CreateCubicBezierEasingFunction(
{ 0.166999996F, 0.166999996F }, { 0.833000004F, 0.833000004F })
: _cubicBezierEasingFunction_0;
}
CubicBezierEasingFunction CubicBezierEasingFunction_1()
{
return (_cubicBezierEasingFunction_1 == nullptr)
? _cubicBezierEasingFunction_1 =
_c.CreateCubicBezierEasingFunction({ 0.860000014F, 0.0F }, { 0.48300001F, 1.0F })
: _cubicBezierEasingFunction_1;
}
CubicBezierEasingFunction CubicBezierEasingFunction_2()
{
return (_cubicBezierEasingFunction_2 == nullptr)
? _cubicBezierEasingFunction_2 =
_c.CreateCubicBezierEasingFunction({ 0.602999985F, 0.0F }, { 0.666999996F, 1.0F })
: _cubicBezierEasingFunction_2;
}
CubicBezierEasingFunction CubicBezierEasingFunction_3()
{
return (_cubicBezierEasingFunction_3 == nullptr)
? _cubicBezierEasingFunction_3 = _c.CreateCubicBezierEasingFunction(
{ 0.626999974F, 0.0260000005F }, { 0.372999996F, 0.973999977F })
: _cubicBezierEasingFunction_3;
}
CubicBezierEasingFunction CubicBezierEasingFunction_4()
{
return (_cubicBezierEasingFunction_4 == nullptr)
? _cubicBezierEasingFunction_4 =
_c.CreateCubicBezierEasingFunction({ 0.86500001F, 0.0F }, { 0.666999996F, 1.0F })
: _cubicBezierEasingFunction_4;
}
// Opacity0
ScalarKeyFrameAnimation Opacity0ScalarAnimation_0_to_0()
{
// Frame 0.
const auto result = CreateScalarKeyFrameAnimation(0.0F, 0.0F, StepThenHoldEasingFunction());
// Frame 14.
result.InsertKeyFrame(0.233333334F, 0.0F, HoldThenStepEasingFunction());
// Frame 15.
result.InsertKeyFrame(0.25F, 1.0F, CubicBezierEasingFunction_0());
// Frame 49.
result.InsertKeyFrame(0.816666663F, 1.0F, CubicBezierEasingFunction_0());
// Frame 50.
result.InsertKeyFrame(0.833333313F, 0.0F, CubicBezierEasingFunction_0());
return result;
}
// Rotation
ScalarKeyFrameAnimation RotationAngleInDegreesScalarAnimation_0_to_0()
{
// Frame 0.
if (_rotationAngleInDegreesScalarAnimation_0_to_0 != nullptr)
{
return _rotationAngleInDegreesScalarAnimation_0_to_0;
}
const auto result = _rotationAngleInDegreesScalarAnimation_0_to_0 =
CreateScalarKeyFrameAnimation(0.0F, 0.0F, HoldThenStepEasingFunction());
// Frame 8.
result.InsertKeyFrame(
0.13333334F, -7.0F,
_c.CreateCubicBezierEasingFunction({ 0.626999974F, 0.0F }, { 0.358999997F, 0.98299998F }));
// Frame 16.
result.InsertKeyFrame(0.266666681F, 3.0F, CubicBezierEasingFunction_4());
// Frame 29.
result.InsertKeyFrame(
0.483333319F, 0.0F,
_c.CreateCubicBezierEasingFunction({ 0.598999977F, 0.0F }, { 0.177000001F, 0.702000022F }));
// Frame 46.
result.InsertKeyFrame(
0.766666651F, 0.0F,
_c.CreateCubicBezierEasingFunction({ 0.166999996F, 0.0F }, { 0.833000004F, 1.0F }));
// Frame 51.
result.InsertKeyFrame(
0.850000024F, 3.0F,
_c.CreateCubicBezierEasingFunction({ 0.823000014F, 0.114F }, { 0.400999993F, 1.0F }));
// Frame 60.
result.InsertKeyFrame(
1.0F, 0.0F,
_c.CreateCubicBezierEasingFunction({ 0.333000004F, 0.0F }, { 0.372999996F, 0.95599997F }));
return result;
}
// Rotation
ScalarKeyFrameAnimation RotationAngleInDegreesScalarAnimation_m14_to_m14()
{
// Frame 0.
if (_rotationAngleInDegreesScalarAnimation_m14_to_m14 != nullptr)
{
return _rotationAngleInDegreesScalarAnimation_m14_to_m14;
}
const auto result = _rotationAngleInDegreesScalarAnimation_m14_to_m14 =
CreateScalarKeyFrameAnimation(0.0F, -14.0F, HoldThenStepEasingFunction());
// Frame 8.
result.InsertKeyFrame(
0.13333334F, -1.0F,
_c.CreateCubicBezierEasingFunction({ 0.626999974F, 0.00899999961F }, { 0.358999997F, 1.0F }));
// Frame 16.
result.InsertKeyFrame(
0.266666681F, -19.2859993F,
_c.CreateCubicBezierEasingFunction({ 0.86500001F, 0.0320000015F }, { 0.666999996F, 1.0F }));
// Frame 29.
result.InsertKeyFrame(
0.483333319F, -14.0F,
_c.CreateCubicBezierEasingFunction({ 0.598999977F, 0.0410000011F }, { 0.666999996F, 1.0F }));
// Frame 46.
result.InsertKeyFrame(0.766666651F, -14.0F, CubicBezierEasingFunction_0());
// Frame 51.
result.InsertKeyFrame(
0.850000024F, -19.2859993F,
_c.CreateCubicBezierEasingFunction({ 0.333000004F, 0.0F }, { 0.400999993F, 0.984000027F }));
// Frame 60.
result.InsertKeyFrame(
1.0F, -14.0F,
_c.CreateCubicBezierEasingFunction({ 0.333000004F, 0.0F }, { 0.372999996F, 1.0F }));
return result;
}
// StrokeThickness
ScalarKeyFrameAnimation StrokeThicknessScalarAnimation_3_to_3()
{
// Frame 0.
if (_strokeThicknessScalarAnimation_3_to_3 != nullptr)
{
return _strokeThicknessScalarAnimation_3_to_3;
}
const auto result = _strokeThicknessScalarAnimation_3_to_3 =
CreateScalarKeyFrameAnimation(0.0F, 3.0F, StepThenHoldEasingFunction());
// Frame 14.
result.InsertKeyFrame(0.233333334F, 3.0F, HoldThenStepEasingFunction());
// Frame 15.
result.InsertKeyFrame(0.25F, 0.0F, CubicBezierEasingFunction_0());
// Frame 49.
result.InsertKeyFrame(0.816666663F, 0.0F, CubicBezierEasingFunction_0());
// Frame 50.
result.InsertKeyFrame(0.833333313F, 3.0F, CubicBezierEasingFunction_0());
return result;
}
ScalarKeyFrameAnimation t0ScalarAnimation_0_to_1()
{
// Frame 8.
const auto result =
CreateScalarKeyFrameAnimation(0.133333355F, 0.0F, StepThenHoldEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 16.
result.InsertKeyFrame(0.266666651F, 1.0F, CubicBezierEasingFunction_4());
// Frame 16.
result.InsertKeyFrame(0.266666681F, 0.0F, StepThenHoldEasingFunction());
// Frame 29.
result.InsertKeyFrame(
0.48333329F, 1.0F,
_c.CreateCubicBezierEasingFunction({ 0.598999977F, 0.0260000005F }, { 0.432999998F, 1.0F }));
return result;
}
ScalarKeyFrameAnimation t1ScalarAnimation_0_to_1()
{
// Frame 8.
const auto result =
CreateScalarKeyFrameAnimation(0.133333355F, 0.0F, StepThenHoldEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 16.
result.InsertKeyFrame(
0.266666651F, 1.0F,
_c.CreateCubicBezierEasingFunction({ 0.86500001F, 0.00200000009F }, { 0.666999996F, 1.0F }));
// Frame 16.
result.InsertKeyFrame(0.266666681F, 0.0F, StepThenHoldEasingFunction());
// Frame 28.
result.InsertKeyFrame(
0.466666639F, 1.0F,
_c.CreateCubicBezierEasingFunction({ 0.598999977F, 0.0199999996F }, { 0.470999986F, 1.0F }));
return result;
}
ScalarKeyFrameAnimation t2ScalarAnimation_0_to_1()
{
// Frame 0.
const auto result = CreateScalarKeyFrameAnimation(0.0F, 0.0F, StepThenHoldEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 8.
result.InsertKeyFrame(
0.133333325F, 1.0F,
_c.CreateCubicBezierEasingFunction({ 0.626999974F, 0.0130000003F }, { 0.358999997F, 1.0F }));
// Frame 8.
result.InsertKeyFrame(0.13333334F, 0.0F, StepThenHoldEasingFunction());
// Frame 16.
result.InsertKeyFrame(0.266666651F, 1.0F, CubicBezierEasingFunction_4());
return result;
}
ScalarKeyFrameAnimation t3ScalarAnimation_0_to_1()
{
// Frame 16.
const auto result =
CreateScalarKeyFrameAnimation(0.266666681F, 0.0F, StepThenHoldEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 29.
result.InsertKeyFrame(
0.48333329F, 1.0F,
_c.CreateCubicBezierEasingFunction({ 0.598999977F, 0.0270000007F }, { 0.177000001F, 1.0F }));
return result;
}
// Layer aggregator
ShapeVisual ShapeVisual_0()
{
const auto result = _c.CreateShapeVisual();
result.Size({ 70.0F, 80.0F });
const auto shapes = result.Shapes();
// Offset:<27.556, 38>
shapes.Append(SpriteShape_0());
// Offset:<27.556, 38>
shapes.Append(SpriteShape_1());
// Offset:<27.556, 38>
shapes.Append(SpriteShape_2());
// Layer: fillIcon
shapes.Append(ContainerShape());
return result;
}
StepEasingFunction HoldThenStepEasingFunction()
{
if (_holdThenStepEasingFunction != nullptr)
{
return _holdThenStepEasingFunction;
}
const auto result = _holdThenStepEasingFunction = _c.CreateStepEasingFunction();
result.IsFinalStepSingleFrame(true);
return result;
}
StepEasingFunction StepThenHoldEasingFunction()
{
if (_stepThenHoldEasingFunction != nullptr)
{
return _stepThenHoldEasingFunction;
}
const auto result = _stepThenHoldEasingFunction = _c.CreateStepEasingFunction();
result.IsInitialStepSingleFrame(true);
return result;
}
// Offset
Vector2KeyFrameAnimation OffsetVector2Animation_0()
{
// Frame 0.
if (_offsetVector2Animation_0 != nullptr)
{
return _offsetVector2Animation_0;
}
const auto result = _offsetVector2Animation_0 =
CreateVector2KeyFrameAnimation(0.0F, { 23.125F, 3.75F }, HoldThenStepEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 8.
result.InsertKeyFrame(
0.13333334F, { 29.125F, -4.25F },
_c.CreateCubicBezierEasingFunction({ 0.626999974F, 0.0120000001F }, { 0.358999997F, 1.0F }));
// Frame 16.
result.InsertExpressionKeyFrame(
0.266666651F,
L"Pow(1-_.t0,3)*Vector2(29.125,-4.25)+(3*Square(1-_.t0)*_.t0*Vector2(29.125,-4.25))+(3*(1-_."
L"t0)*Square(_.t0)*Vector2(25.432,10.943))+(Pow(_.t0,3)*Vector2(24.519,11.856))",
StepThenHoldEasingFunction());
// Frame 29.
result.InsertExpressionKeyFrame(
0.48333329F,
L"Pow(1-_.t0,3)*Vector2(24.519,11.856)+(3*Square(1-_.t0)*_.t0*Vector2(24.23,12.145))+(3*(1-_."
L"t0)*Square(_.t0)*Vector2(22.899,4.893))+(Pow(_.t0,3)*Vector2(23.125,3.75))",
StepThenHoldEasingFunction());
// Frame 29.
result.InsertKeyFrame(0.483333319F, { 23.125F, 3.75F }, StepThenHoldEasingFunction());
// Frame 46.
result.InsertKeyFrame(0.766666651F, { 23.125F, 3.75F }, CubicBezierEasingFunction_0());
// Frame 51.
result.InsertKeyFrame(
0.850000024F, { 23.125F, 8.75F },
_c.CreateCubicBezierEasingFunction({ 0.725000024F, 0.0F }, { 0.372999996F, 0.985000014F }));
// Frame 60.
result.InsertKeyFrame(1.0F, { 23.125F, 3.75F }, CubicBezierEasingFunction_3());
return result;
}
// Offset
Vector2KeyFrameAnimation OffsetVector2Animation_1()
{
// Frame 0.
if (_offsetVector2Animation_1 != nullptr)
{
return _offsetVector2Animation_1;
}
const auto result = _offsetVector2Animation_1 =
CreateVector2KeyFrameAnimation(0.0F, { 2.125F, 2.0F }, HoldThenStepEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 8.
result.InsertKeyFrame(
0.13333334F, { 5.125F, -13.0F },
_c.CreateCubicBezierEasingFunction({ 0.626999974F, 0.00800000038F }, { 0.358999997F, 1.0F }));
// Frame 16.
result.InsertExpressionKeyFrame(
0.266666651F,
L"Pow(1-_.t1,3)*Vector2(5.125,-13)+(3*Square(1-_.t1)*_.t1*Vector2(5.125,-13))+(3*(1-_.t1)*"
L"Square(_.t1)*Vector2(2.643,7.758))+(Pow(_.t1,3)*Vector2(2.339,11.713))",
StepThenHoldEasingFunction());
// Frame 28.
result.InsertExpressionKeyFrame(
0.466666639F,
L"Pow(1-_.t1,3)*Vector2(2.339,11.713)+(3*Square(1-_.t1)*_.t1*Vector2(2.243,12.961))+(3*(1-_."
L"t1)*Square(_.t1)*Vector2(2.161,3.619))+(Pow(_.t1,3)*Vector2(2.125,2))",
StepThenHoldEasingFunction());
// Frame 28.
result.InsertKeyFrame(0.466666669F, { 2.125F, 2.0F }, StepThenHoldEasingFunction());
// Frame 46.
result.InsertKeyFrame(0.766666651F, { 2.125F, 2.0F }, CubicBezierEasingFunction_0());
// Frame 51.
result.InsertKeyFrame(
0.850000024F, { 2.125F, 8.0F },
_c.CreateCubicBezierEasingFunction({ 0.60799998F, 0.0F }, { 0.372999996F, 0.987999976F }));
// Frame 60.
result.InsertKeyFrame(1.0F, { 2.125F, 2.0F },
_c.CreateCubicBezierEasingFunction({ 0.626999974F, 0.0219999999F },
{ 0.372999996F, 0.977999985F }));
return result;
}
// Offset
Vector2KeyFrameAnimation OffsetVector2Animation_2()
{
// Frame 0.
if (_offsetVector2Animation_2 != nullptr)
{
return _offsetVector2Animation_2;
}
const auto result = _offsetVector2Animation_2 =
CreateVector2KeyFrameAnimation(0.0F, { -13.875F, 2.0F }, HoldThenStepEasingFunction());
result.SetReferenceParameter(L"_", _root);
// Frame 8.
result.InsertExpressionKeyFrame(
0.133333325F,
L"Pow(1-_.t2,3)*Vector2(-13.875,2)+(3*Square(1-_.t2)*_.t2*Vector2(-14.375,0.6670001))+(3*(1-_"
L".t2)*Square(_.t2)*Vector2(-16.708,-7.25))+(Pow(_.t2,3)*Vector2(-16.875,-6))",
StepThenHoldEasingFunction());
// Frame 16.
result.InsertExpressionKeyFrame(
0.266666651F,
L"Pow(1-_.t2,3)*Vector2(-16.875,-6)+(3*Square(1-_.t2)*_.t2*Vector2(-17.042,-4.75))+(3*(1-_."
L"t2)*Square(_.t2)*Vector2(-15.375,8.167))+(Pow(_.t2,3)*Vector2(-14.875,9.5))",
StepThenHoldEasingFunction());
// Frame 29.
result.InsertExpressionKeyFrame(
0.48333329F,
L"Pow(1-_.t3,3)*Vector2(-14.875,9.5)+(3*Square(1-_.t3)*_.t3*Vector2(-14.375,10.833))+(3*(1-_."
L"t3)*Square(_.t3)*Vector2(-14.042,3.25))+(Pow(_.t3,3)*Vector2(-13.875,2))",
StepThenHoldEasingFunction());
// Frame 29.
result.InsertKeyFrame(0.483333319F, { -13.875F, 2.0F }, StepThenHoldEasingFunction());
// Frame 46.
result.InsertKeyFrame(0.766666651F, { -13.875F, 2.0F }, CubicBezierEasingFunction_0());
// Frame 51.
result.InsertKeyFrame(
0.850000024F, { -13.875F, 7.0F },
_c.CreateCubicBezierEasingFunction({ 0.823000014F, 0.0F }, { 0.372999996F, 0.985000014F }));
// Frame 60.
result.InsertKeyFrame(1.0F, { -13.875F, 2.0F }, CubicBezierEasingFunction_3());
return result;
}
// Scale
Vector2KeyFrameAnimation ScaleVector2Animation_0()
{
// Frame 0.
if (_scaleVector2Animation_0 != nullptr)
{
return _scaleVector2Animation_0;
}
const auto result = _scaleVector2Animation_0 =
CreateVector2KeyFrameAnimation(0.0F, { 1.0F, 1.0F }, StepThenHoldEasingFunction());
// Frame 8.
result.InsertKeyFrame(0.13333334F, { 1.0F, 1.0F }, HoldThenStepEasingFunction());
// Frame 16.
result.InsertKeyFrame(0.266666681F, { 1.20000005F, 1.20000005F },
CubicBezierEasingFunction_1());
// Frame 47.
result.InsertKeyFrame(0.783333361F, { 1.20000005F, 1.20000005F }, HoldThenStepEasingFunction());
// Frame 51.
result.InsertKeyFrame(0.850000024F, { 1.0F, 1.0F }, CubicBezierEasingFunction_2());
return result;
}
// Scale
Vector2KeyFrameAnimation ScaleVector2Animation_1()
{
// Frame 0.
if (_scaleVector2Animation_1 != nullptr)
{
return _scaleVector2Animation_1;
}
const auto result = _scaleVector2Animation_1 =
CreateVector2KeyFrameAnimation(0.0F, { 1.0F, 1.0F }, StepThenHoldEasingFunction());
// Frame 8.
result.InsertKeyFrame(0.13333334F, { 1.0F, 1.0F }, HoldThenStepEasingFunction());
// Frame 16.
result.InsertKeyFrame(0.266666681F, { 1.20000005F, 1.20000005F },
CubicBezierEasingFunction_1());
// Frame 47.
result.InsertKeyFrame(0.783333361F, { 1.20000005F, 1.20000005F }, HoldThenStepEasingFunction());
// Frame 51.
result.InsertKeyFrame(0.850000024F, { 1.0F, 1.0F }, CubicBezierEasingFunction_2());
// Frame 60.
result.InsertKeyFrame(
1.0F, { 1.0F, 1.0F },
_c.CreateCubicBezierEasingFunction({ 0.166999996F, 0.0F }, { 0.372999996F, 1.0F }));
return result;
}
// - Layer aggregator
// Layer: fillIcon
Vector2KeyFrameAnimation ShapeVisibilityAnimation()
{
// Frame 0.
const auto result =
CreateVector2KeyFrameAnimation(0.0F, { 0.0F, 0.0F }, HoldThenStepEasingFunction());
// Frame 15.
result.InsertKeyFrame(0.25F, { 1.0F, 1.0F }, HoldThenStepEasingFunction());
// Frame 49.
result.InsertKeyFrame(0.816666663F, { 0.0F, 0.0F }, HoldThenStepEasingFunction());
return result;
}
static IGeometrySource2D CanvasGeometryToIGeometrySource2D(winrt::com_ptr<CanvasGeometry> geo)
{
return geo.as<IGeometrySource2D>();
}
public:
LibraryIcon_AnimatedVisual(Compositor compositor, CompositionPropertySet themeProperties)
: _c{ compositor }
, _themeProperties{ themeProperties }
, _reusableExpressionAnimation(compositor.CreateExpressionAnimation())
{
winrt::check_hresult(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, _d2dFactory.put()));
const auto _ = Root();
}
void Close()
{
if (_root)
{
_root.Close();
}
}
TimeSpan Duration() const { return TimeSpan{ c_durationTicks }; }
Visual RootVisual() const { return _root; }
float2 Size() const { return { 70.0F, 80.0F }; }
void CreateAnimations()
{
_themeColor_AccentColor.Properties().StartAnimation(
L"Opacity0", Opacity0ScalarAnimation_0_to_0(), AnimationController_0());
_containerShape.StartAnimation(L"Scale", ShapeVisibilityAnimation(), AnimationController_0());
_spriteShape_0.StartAnimation(L"StrokeThickness", StrokeThicknessScalarAnimation_3_to_3(),
AnimationController_0());
_spriteShape_0.StartAnimation(L"RotationAngleInDegrees",
RotationAngleInDegreesScalarAnimation_m14_to_m14(),
AnimationController_0());
_spriteShape_0.StartAnimation(L"Scale", ScaleVector2Animation_0(), AnimationController_0());
_spriteShape_0.StartAnimation(L"Offset", OffsetVector2Animation_0(), AnimationController_0());
_spriteShape_1.StartAnimation(L"StrokeThickness", StrokeThicknessScalarAnimation_3_to_3(),
AnimationController_0());
_spriteShape_1.StartAnimation(L"Scale", ScaleVector2Animation_0(), AnimationController_0());
_spriteShape_1.StartAnimation(L"Offset", OffsetVector2Animation_1(), AnimationController_0());