├── .github
├── FUNDING.yml
└── workflows
│ └── main.yml
├── assets
├── lovelace.jpg
└── core.css
├── doc
└── contributing_widgets
│ └── vs_release.PNG
├── NuGet.config
├── src
├── Elementa
│ ├── Elementa.csproj
│ ├── StatefulRegion.cs
│ ├── CSSUtils.cs
│ ├── Enum.cs
│ └── Attributes.cs
├── NUnitTests
│ └── src
│ │ ├── UnitTests.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── NUnitTests.csproj
│ │ └── PatchTests.cs
└── Elementa.sln
├── deployment
└── Elementa.nuspec
├── LICENCE.md
├── README.md
├── vl
├── Component
│ └── VL.Elementa.Component.Overlay.vl
├── VL.Elementa.LayoutNodes.vl
├── VL.Elementa.Components.vl
├── VL.Elementa.Widgets.vl
└── Widget
│ ├── VL.Elementa.Widget.Utils.vl
│ └── VL.Elementa.Widget.Tabs.vl
├── .gitattributes
├── help
├── help.xml
└── Topics
│ ├── Widgets
│ ├── HowTo Check if any widget is being edited.vl
│ ├── HowTo Use an Image.vl
│ ├── HowTo Use Tabs.vl
│ └── HowTo Use a DropdownEnum.vl
│ ├── Components
│ └── HowTo Add a text tooltip to a widget.vl
│ └── Style
│ ├── HowTo Apply style to a Layout Operator.vl
│ └── HowTo Use Style Presets.vl
├── .gitignore
├── sandbox
├── wip Transformation.vl
└── wip ScrollableValue.vl
├── CHANGELOG.md
└── tests
└── tests.vl
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: vvvv-dottore
2 |
--------------------------------------------------------------------------------
/assets/lovelace.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/natan-sinigaglia/VL.Elementa/HEAD/assets/lovelace.jpg
--------------------------------------------------------------------------------
/doc/contributing_widgets/vs_release.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/natan-sinigaglia/VL.Elementa/HEAD/doc/contributing_widgets/vs_release.PNG
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Elementa/Elementa.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | ..\..\lib\
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/NUnitTests/src/UnitTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using NUnit.Framework.Internal;
3 |
4 | namespace MyTests
5 | {
6 | public class UnitTests
7 | {
8 | [SetUp]
9 | public void Setup()
10 | {
11 | }
12 |
13 | //[Test]
14 | //public void Test1()
15 | //{
16 | // Assert.AreEqual(1 + 1, 2, "An old contract people tell their kids about just failed. Math is useless from now on.");
17 | //}
18 | }
19 | }
--------------------------------------------------------------------------------
/src/NUnitTests/src/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System.Runtime.InteropServices;
3 | using System.Threading;
4 |
5 | // Setting ComVisible to false makes the types in this assembly not visible
6 | // to COM components. If you need to access a type in this assembly from
7 | // COM, set the ComVisible attribute to true on that type.
8 | [assembly: ComVisible(false)]
9 |
10 | // The following GUID is for the ID of the typelib if this project is exposed to COM
11 | [assembly: Guid("2707f9b1-1b67-488c-9e08-37eb274ca43a")]
12 |
13 | [assembly: Apartment(ApartmentState.STA)]
--------------------------------------------------------------------------------
/assets/core.css:
--------------------------------------------------------------------------------
1 | .Columns{
2 | background-color:#3d405b;
3 | }
4 | Rotary, Vector2D, Slider2D, TextField{
5 | background-color:#81b29a;
6 | color:#f4f1de;
7 | }
8 | Rotary:nth-child(3), .border{
9 | border-color:#171822;
10 | }
11 | #myRotary{
12 | font-size:15pt;
13 | background-color:#E07A5F;
14 | color:#F2CC8F;
15 | }
16 | #myRotary:hover{
17 | font-size:25px;
18 | }
19 | TextField{
20 | text-align:center;
21 | vertical-align:middle;
22 | font-size:18px;
23 | color:#3d405b;
24 | }
25 | TextField:nth-last-child(2){
26 | text-align:left;
27 | vertical-align:top;
28 | }
29 | TextField:last-child{
30 | color:#f4f1de;
31 | font-size:26px;
32 | text-align:right;
33 | vertical-align:bottom;
34 | }
35 | Rotary:hover, Vector2D:hover, Slider2D:hover, TextField:hover{
36 | background-color:#E07A5F;
37 | font-size:15px;
38 | color:#F2CC8F;
39 | }
40 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: push_nuget
2 |
3 | # on push on master
4 | on:
5 | push:
6 | branches:
7 | - master
8 | # - 5.0.0
9 | paths-ignore:
10 | - README.md
11 |
12 | jobs:
13 | build:
14 | runs-on: windows-latest
15 | steps:
16 | - name: Git Checkout
17 | uses: actions/checkout@master
18 |
19 | - name: Setup MSBuild.exe
20 | uses: microsoft/setup-msbuild@v1.0.2
21 |
22 | - name: Setup Nuget.exe
23 | uses: nuget/setup-nuget@v1
24 |
25 | - name: Setup .NET Core SDK
26 | uses: actions/setup-dotnet@v1.4.0
27 |
28 | - name: Build
29 | run: msbuild src\Elementa\Elementa.csproj /t:Build /v:m /m /restore /p:Configuration=Release
30 |
31 | - name: Nuget Pack
32 | run: nuget pack ./deployment/Elementa.nuspec -Symbols -SymbolPackageFormat snupkg
33 |
34 | - name: Nuget Push
35 | run: nuget push *.nupkg ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
--------------------------------------------------------------------------------
/deployment/Elementa.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | VL.Elementa
5 | 6.0.0-preview01
6 | VL.Elementa
7 | natan.sinigaglia
8 | natan.sinigaglia
9 | https://github.com/vvvv-dottore/VL.Elementa
10 | false
11 | UI widget library for VL
12 | UI widget library for VL
13 | Copyright © 2019 by Natan Sinigaglia. All rights reserved.
14 | VL
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENCE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [2020] [Natan Sinigaglia http://natansinigaglia.com/]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/src/NUnitTests/src/NUnitTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net472
5 | ..\
6 | $(AssemblyName)
7 | Test for my library
8 | true
9 | true
10 | win-x64
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | PreserveNewest
24 |
25 |
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # VL.Elementa
2 |
3 | [](https://matrix.to/#/!ozhuuBcieNoMbRkvVj:matrix.org?via=matrix.org)
4 | [](https://www.nuget.org/packages/VL.Elementa/)
5 |
6 | A node based UI widgets library made in VL for Skia rendering.
7 |
8 | The library includes:
9 | - A collection of ready to use widgets to handle the most common value types in vvvv Gamma
10 | - A set of Layout nodes to easily arrange your widgets and create responsive UIs
11 | - A bunch of utilities and help patches
12 |
13 |
14 | ## Installing
15 |
16 | To use the latest stable version:
17 | 1. Go to Gamma's Quad menu > Manage Nugets > Commandline and type:
18 |
19 | ```
20 | nuget install VL.Elementa
21 | ```
22 | 2. Press Enter and wait the ending of the installation process
23 |
24 | ## Contributing to the development
25 |
26 | 1. Clone the repository
27 | 2. Build the solution located in the `src` folder in `Release` mode.
28 | 3. You can then start contributing to the lib.
29 |
30 | ### Contributing new widgets
31 |
32 | Read [this wiki page](https://github.com/vvvv-dottore/VL.Elementa/wiki/Contributing-new-widgets) to get specific guidelines on how to contribute new widgets.
33 |
34 |
35 | ## Licencing
36 |
37 | MIT License - You're free to use VL.Elementa in your creative & commercial projects.
38 |
39 | [Natan Sinigaglia](http://natansinigaglia.com/)
40 |
--------------------------------------------------------------------------------
/vl/Component/VL.Elementa.Component.Overlay.vl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Elementa.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30204.135
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elementa", "Elementa\Elementa.csproj", "{2FA67B37-61A1-4043-9D7E-4F8E7F6D8EE3}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnitTests", "NUnitTests\src\NUnitTests.csproj", "{73DE3C85-7476-44B3-ABE1-0BD75101F1A6}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {2FA67B37-61A1-4043-9D7E-4F8E7F6D8EE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {2FA67B37-61A1-4043-9D7E-4F8E7F6D8EE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {2FA67B37-61A1-4043-9D7E-4F8E7F6D8EE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {2FA67B37-61A1-4043-9D7E-4F8E7F6D8EE3}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {73DE3C85-7476-44B3-ABE1-0BD75101F1A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {73DE3C85-7476-44B3-ABE1-0BD75101F1A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {73DE3C85-7476-44B3-ABE1-0BD75101F1A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {73DE3C85-7476-44B3-ABE1-0BD75101F1A6}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {28C0FD8A-D9C3-4EC7-AD44-A97D5295E688}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/src/Elementa/StatefulRegion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Elementa
4 | {
5 | public class StatefulRegion : IDisposable
6 | where TState : class
7 | {
8 | Func create;
9 | Func init;
10 | Func> update;
11 | Func> notify;
12 | TState state;
13 |
14 | public void Update(
15 | Func create,
16 | Func init,
17 | Func> update,
18 | Func> notify)
19 | {
20 | this.create = create;
21 | this.init = init;
22 | this.update = update;
23 | this.notify = notify;
24 |
25 | if (this.state is null)
26 | this.state = create();
27 | }
28 |
29 | public void InvokeInit(TInitIn input)
30 | {
31 | var newState = init(state, input);
32 | state = newState;
33 | }
34 |
35 | public TUpdateOut InvokeUpdate()
36 | {
37 | var (newState, output) = update(state);
38 | state = newState;
39 | return output;
40 | }
41 |
42 | public TNotifyOut InvokeNotify(TNotifyIn input)
43 | {
44 | var (newState, output) = notify(state, input);
45 | state = newState;
46 | return output;
47 | }
48 |
49 | public void Reset()
50 | {
51 | if (state is IDisposable d)
52 | d.Dispose();
53 | state = create();
54 | }
55 |
56 | public void Dispose()
57 | {
58 | if (state is IDisposable d)
59 | d.Dispose();
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/Elementa/CSSUtils.cs:
--------------------------------------------------------------------------------
1 | namespace Elementa
2 | {
3 | public static class CSSUtils
4 | {
5 | public static StyleProperties? CSSToElementaProperty(string propertyName)
6 | {
7 | StyleProperties? result = null;
8 | switch (propertyName)
9 | {
10 | case "background-color":
11 | result = StyleProperties.Background_Color;
12 | break;
13 | case "border-color":
14 | case "border-top-color":
15 | case "border-righ-color":
16 | case "border-bottom-color":
17 | case "border-left-color":
18 | result = StyleProperties.Background_Stroke_Color;
19 | break;
20 | case "color":
21 | result = StyleProperties.Text_Color;
22 | break;
23 | case "font-family":
24 | result = StyleProperties.Text_FamilyName;
25 | break;
26 | case "font-size":
27 | result = StyleProperties.Text_Size;
28 | break;
29 | case "font-style":
30 | result = StyleProperties.Text_Style;
31 | break;
32 | case "line-height":
33 | result = StyleProperties.Text_LineHeight;
34 | break;
35 | case "padding":
36 | case "padding-top":
37 | case "padding-right":
38 | case "padding-bottom":
39 | case "padding-left":
40 | result = StyleProperties.Text_Padding;
41 | break;
42 | case "text-align":
43 | result = StyleProperties.Text_HorizonalAlignment;
44 | break;
45 | case "vertical-align":
46 | result = StyleProperties.Text_VerticalAlignment;
47 | break;
48 | default:
49 | break;
50 | }
51 | return result;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/vl/VL.Elementa.LayoutNodes.vl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
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 |
--------------------------------------------------------------------------------
/src/Elementa/Enum.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Elementa
4 | {
5 | public enum MouseEventKind
6 | {
7 | Down, Up, Pressed, Move, DoubleClick, IsLost
8 | }
9 |
10 | public enum KeyboardEventKind
11 | {
12 | Down, Up, Pressed
13 | }
14 |
15 | public enum ElementumState
16 | {
17 | Idle, Hovered, Selected, Focused
18 | }
19 |
20 | public enum LabelPlacement
21 | {
22 | Left, Right, Top, Bottom
23 | }
24 |
25 | public enum KnownWidget
26 | {
27 | Bang, Press, Toggle, Integer, IntegerUpDown, Value, Value64, Slider, Rotary, Vector2D, Slider2D, Range, Vector3D, Vector4D, Color, TextField, Dropdown, NavigateToButton
28 | }
29 |
30 | public enum Orientation
31 | {
32 | Horizontal, Vertical
33 | }
34 |
35 | public enum GroupExposureKind
36 | {
37 | Flat, Nested, Stacked
38 | }
39 |
40 | public enum LayoutMode
41 | {
42 | None, Stack, Distribute, Allocate
43 | }
44 |
45 | public enum VerticalAlignment
46 | {
47 | None, Left, Center, Right
48 | }
49 |
50 | public enum HorizontalAlignment
51 | {
52 | None, Top, Middle, Bottom
53 | }
54 |
55 | public enum AxisConstraint
56 | {
57 | NoConstraint, Horizontal, Vertical
58 | }
59 |
60 | public enum RectangleAlign
61 | {
62 | Left, Center, Right, Top, Middle, Bottom
63 | }
64 |
65 | public enum HandlersOffset
66 | {
67 | Internal, OnEdge, External
68 | }
69 |
70 | public enum ValueEditingMode
71 | {
72 | Absolute, Relative, Sticky
73 | }
74 |
75 | public enum TooltipPosition
76 | {
77 | MiddleLeft, MiddleTop, MiddleRight, MiddleBottom
78 | }
79 |
80 |
81 | public enum StyleProperties
82 | {
83 | Background_Enabled,
84 | Background_Paint,
85 | Background_Color,
86 | Background_Padding,
87 | Background_Stroke_Enabled,
88 | Background_Stroke_Paint,
89 | Background_Stroke_Color,
90 |
91 | Foreground_Enabled,
92 | Foreground_Paint,
93 | Foreground_Color,
94 | Foreground_Highlight_Color,
95 | Foreground_Padding,
96 | Foreground_Stroke_Enabled,
97 | Foreground_Stroke_Paint,
98 | Foreground_Stroke_Color,
99 |
100 | Text_Enabled,
101 | Text_FamilyName,
102 | Text_Style,
103 | Text_Size,
104 | Text_Color,
105 | Text_LineHeight,
106 | Text_HorizonalAlignment,
107 | Text_VerticalAlignment,
108 | Text_Padding
109 | }
110 | }
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/vl/VL.Elementa.Components.vl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
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 |
--------------------------------------------------------------------------------
/src/Elementa/Attributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Elementa.Attributes
6 | {
7 | [AttributeUsage(AttributeTargets.Class)]
8 | public class SuppressAllAttribute : Attribute
9 | {
10 | }
11 | public class ExposeAttribute : Attribute
12 | {
13 | }
14 | public class SuppressAttribute : Attribute
15 | {
16 | }
17 |
18 | public class KnownWidgetAttribute : Attribute
19 | {
20 | public KnownWidgetAttribute(KnownWidget widget)
21 | {
22 | Widget = widget;
23 | }
24 |
25 | public KnownWidget Widget { get; }
26 | }
27 |
28 | public class WidgetOrientationAttribute : Attribute
29 | {
30 | public WidgetOrientationAttribute(Orientation widgetOrientation)
31 | {
32 | WidgetOrientation = widgetOrientation;
33 | }
34 |
35 | public Orientation WidgetOrientation { get; }
36 | }
37 |
38 | public class GroupExposureKindAttribute : Attribute
39 | {
40 | public GroupExposureKindAttribute(GroupExposureKind groupExposureKind)
41 | {
42 | GroupExposureKind = groupExposureKind;
43 | }
44 |
45 | public GroupExposureKind GroupExposureKind { get; }
46 | }
47 |
48 | public class CustomOSCAddressAttribute : Attribute
49 | {
50 | public CustomOSCAddressAttribute(string customOSCAddress)
51 | {
52 | CustomOSCAddress = customOSCAddress;
53 | }
54 |
55 | public string CustomOSCAddress { get; }
56 | }
57 |
58 | public class LayoutPriorityAttribute : Attribute
59 | {
60 | public LayoutPriorityAttribute(UInt32 layoutPriorityAttribute)
61 | {
62 | LayoutPriority = layoutPriorityAttribute;
63 | }
64 |
65 | public UInt32 LayoutPriority { get; }
66 | }
67 |
68 | // =======================================================================================
69 | // VALUE RELATED ATTRIBUTES:
70 |
71 | // Allowed types are bool, float, etc. string, enums, System.Type and array of previous OR object
72 |
73 | public class DefaultValueAttribute : Attribute
74 | {
75 |
76 | public DefaultValueAttribute(object defaultValue)
77 | {
78 | DefaultValue = defaultValue;
79 | }
80 |
81 | public object DefaultValue { get; }
82 | }
83 |
84 | public class MininumValueAttribute : Attribute
85 | {
86 | public MininumValueAttribute(object minimumValue)
87 | {
88 | MinimumValue = minimumValue;
89 | }
90 |
91 | public object MinimumValue { get; }
92 | }
93 |
94 | public class MaximumValueAttribute : Attribute
95 | {
96 | public MaximumValueAttribute(object maximumValue)
97 | {
98 | MaximumValue = maximumValue;
99 | }
100 |
101 | public object MaximumValue { get; }
102 | }
103 |
104 | public class IsCyclicAttribute : Attribute
105 | {
106 | }
107 |
108 | public class StepSizeAttribute : Attribute
109 | {
110 | public StepSizeAttribute(object stepSize)
111 | {
112 | StepSize = StepSize;
113 | }
114 |
115 | public object StepSize { get; }
116 | }
117 |
118 | public class DisplayTextAttribute : Attribute
119 | {
120 | public DisplayTextAttribute(String text)
121 | {
122 | Text = text;
123 | }
124 |
125 | public String Text { get; }
126 |
127 | }
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/help/help.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/vl/VL.Elementa.Widgets.vl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
262 | *.vl.dll
263 | /lib/*
264 |
--------------------------------------------------------------------------------
/src/NUnitTests/src/PatchTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using NUnit.Framework.Interfaces;
3 | using NUnit.Framework.Internal;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Reflection;
9 | using System.Threading;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 | using VL.Core;
13 | using VL.Lang;
14 | using VL.Lang.Symbols;
15 | using VL.Model;
16 | using VL.TestLib;
17 | using VVVV.NuGetAssemblyLoader;
18 |
19 | namespace MyTests
20 | {
21 | enum SaveDocCondition { Never, WhenGreen, Always };
22 |
23 | [TestFixture]
24 | public class PatchTests
25 | {
26 | static string[] Packs = new string[]{
27 | @"C:\Program Files\vvvv\vvvv_gamma_2021.4.0\lib\packs",
28 | };
29 |
30 |
31 |
32 | // ------------------------------------------------------------
33 | // Troubleshooting red tests that shouldn't be red:
34 | //
35 | // - use "Release" build
36 | //
37 | // - The vvvv gamma version mentioned above should be the same as the NuGet versions of all VL packages.
38 | // So either
39 | // * install the vvvv gamma version specified above
40 | // OR
41 | // * fix this line to match your installed vvvv gamma version and
42 | // fix the package references in Elementa.csproj and NUnitTests.csproj to match the version
43 | //
44 | // - build Solution
45 | //
46 | // - run tests
47 | // ------------------------------------------------------------
48 |
49 |
50 |
51 | // DO YOU WANT TO SAVE THE VL DOCS TO DISK?
52 | static SaveDocCondition SaveDocCondition = SaveDocCondition.WhenGreen;
53 |
54 | ///
55 | /// Yield all vl documents of your library, including those that have tests
56 | ///
57 | public static IEnumerable AllVLDocuments()
58 | {
59 | // Yield all your VL docs
60 | foreach (var file in Directory.GetFiles(MainLibPath, "*.vl", SearchOption.AllDirectories))
61 | yield return file;
62 | }
63 |
64 | ///
65 | /// Yield all test patches that shall be executed and shall be checked for assertions
66 | ///
67 | static IEnumerable AllVLDocumentsThatHaveTests()
68 | {
69 | // Yield all your VL docs that contain tests
70 | foreach (var file in Directory.GetFiles(LibTestsPath, "*.vl", SearchOption.AllDirectories))
71 | yield return file;
72 | }
73 |
74 |
75 | public static readonly VLSession Session;
76 | public static string MainLibPath;
77 | public static string LibTestsPath;
78 | public static string RepositoriesPath;
79 |
80 | static PatchTests()
81 | {
82 | var currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
83 | MainLibPath = Path.GetFullPath(Path.Combine(currentDirectory, @"..\..\..\..\..\..\.."));
84 | LibTestsPath = Path.Combine(MainLibPath, "tests");
85 | RepositoriesPath = Path.GetFullPath(Path.Combine(MainLibPath, @".."));
86 |
87 | foreach (var pack in Packs)
88 | AssemblyLoader.AddPackageRepositories(pack);
89 |
90 | // Also add the "vl-libs" folder. The folder that contains our library.
91 | AssemblyLoader.AddPackageRepositories(RepositoriesPath);
92 |
93 |
94 | if (SynchronizationContext.Current == null)
95 | SynchronizationContext.SetSynchronizationContext(new WindowsFormsSynchronizationContext());
96 |
97 |
98 | Session = new VLSession("gamma", includeUserPackages: false)
99 | {
100 | CheckSolution = false,
101 | IgnoreDynamicEnumErrors = true,
102 | NoCache = true,
103 | KeepTargetCode = false
104 | };
105 | }
106 |
107 |
108 |
109 |
110 |
111 | static Solution FCompiledSolution;
112 |
113 |
114 | ///
115 | /// Checks if the document comes with compile time errors (e.g. red nodes). Doesn't actually run the patches.
116 | ///
117 | ///
118 | [TestCaseSource(nameof(AllVLDocuments))]
119 | public static void IsntRed(string filePath)
120 | {
121 | var solution = FCompiledSolution ?? (FCompiledSolution = Compile(AllVLDocuments()));
122 | var document = solution.GetOrAddDocument(filePath);
123 |
124 | // Check document structure
125 | Assert.True(document.IsValid);
126 |
127 | // Check dependenices
128 | foreach (var dep in document.GetDocSymbols().Dependencies)
129 | Assert.IsFalse(dep.RemoteSymbolSource is Dummy, $"Couldn't find dependency {dep}");
130 |
131 | // Check all containers and process node definitions, including application entry point
132 | CompileTimeTests.CheckNodes(solution.Compilation, document.AllTopLevelDefinitions);
133 |
134 | if (SaveDocCondition == SaveDocCondition.Always || (SaveDocCondition == SaveDocCondition.WhenGreen && Success()))
135 | document.Save(isTrusted: false); // TODO: discuss when this can be turned on.
136 | }
137 |
138 | private static bool Success()
139 | {
140 | var thisTest = TestExecutionContext.CurrentContext.CurrentTest;
141 | var testResult = thisTest.MakeTestResult();
142 | var resultState = testResult.ResultState;
143 | return resultState == ResultState.Success || resultState == ResultState.Inconclusive;
144 | }
145 |
146 | static Solution Compile(IEnumerable docs)
147 | {
148 | Session.TaskFactory.Run(() => Session.LoadDocuments(docs));
149 | return Session.CurrentSolution;
150 | }
151 |
152 |
153 |
154 | [TestCaseSource(nameof(TestNodes))]
155 | public void ActualTestPatches(Node testNode)
156 | {
157 | RuntimeTests.RunTest(Session, testNode);
158 | }
159 |
160 | ///
161 | /// Yield all test patches that shall run
162 | ///
163 | static IEnumerable TestNodes()
164 | {
165 | var solution = FCompiledSolution ?? (FCompiledSolution = Compile(AllVLDocuments()));
166 | foreach (var file in Directory.GetFiles(LibTestsPath, "*.vl", SearchOption.AllDirectories))
167 | {
168 | var document = solution.GetOrAddDocument(file, createNew: false, loadDependencies: false);
169 | foreach (var definition in document.AllTopLevelDefinitions.Where(n => !n.IsGeneric && n.IsNodeDefinition))
170 | {
171 | var name = definition.Name.NamePart;
172 | if (name.EndsWith("Test") || name.EndsWith("Tests"))
173 | yield return definition;
174 | }
175 | }
176 | }
177 | }
178 | }
179 |
--------------------------------------------------------------------------------
/sandbox/wip Transformation.vl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ### 6.0.0
4 | _No stable release yet_
5 |
6 | - If a Panel is only horizontally constrained, you don't have to press CTRL anymore to scroll it (by @lasalillo)
7 | - New DropdownScrollable widget that lets you scroll through dropdown entries
8 |
9 | ### 5.1.3
10 |
11 | - Fixes PathDialog's _Initial Directory_ pin not being taken into account. This made the _Use Last Directory_ toggle not working. See [forum thread](https://discourse.vvvv.org/t/elementa-pathdialog-cant-set-initial-directory/21642).
12 |
13 | ### 5.1.2
14 |
15 | - Fixes little performance issue in `GetActiveStates` by turning a cached LINQ query into a spread. Came up while profiling the patch posted [here](https://discourse.vvvv.org/t/elementa-frame-rate-issues/20798) (by @azeno)
16 |
17 | ### 5.1.1
18 |
19 | - Makes IsSelectable public
20 |
21 | ### 5.1.0
22 |
23 | - Adds a new SaveDialog widget
24 |
25 | ### 5.0.13
26 |
27 | - Fixes LocalStyle eating massive amounts of CPU
28 |
29 | - Adds a new help patch showing how to apply style to a Layout Operator
30 |
31 | - Fixes description of Flexibility in its help patch
32 |
33 | ### 5.0.11
34 |
35 | - Fix in the Group (Layout) node. flexible widgets now managed correctcly
36 |
37 | ### 5.0.10
38 |
39 | - Various fixes and improvements
40 |
41 | ### 5.0.9
42 |
43 | - Fixes bang's boolean output acting like a toggle
44 |
45 | ### 5.0.8
46 |
47 | - Added FUNDING.yml file
48 |
49 | ### 5.0.7
50 |
51 | - Fixes wrong assignment of two nodes inside Dropdown node - bug surfaces in new vvvv preview builds
52 |
53 | ### 5.0.5
54 |
55 | #### New
56 |
57 | - Added enable option for default stroke for selected widgets in the selectableProcessorSettings
58 |
59 | ### 5.0.3
60 |
61 | #### New
62 |
63 | - Added MinResizeableSize setting in Transformation component
64 |
65 | #### Fixes
66 |
67 | - Fixed selection by single click over selectable widget
68 | - Renamed ForceStartSelectionFunc in SelectableComponentProcessorSettings to EnableSelectionCondition
69 | - Quick fix for label being clipped
70 |
71 | ### 5.0.2
72 |
73 | #### Fixes
74 |
75 | - added Flexibility Input pin in MenuEntry and MenuFolder
76 |
77 | ### 5.0.1
78 |
79 | #### New
80 |
81 | - Panel widget has a new optional pin for space transformation
82 |
83 | #### Fixes
84 |
85 | - fixes in `Panel` widget (got rid of the internal group elementum)
86 | - fix in `TextWithBackground` not updating text when output assigned to create
87 |
88 | ### 5.0.0
89 |
90 | #### New
91 |
92 | - `AnyEditing` node in the `Getters` category
93 | - Layout operators' helper now also shows widget's bounds
94 | - Elementa node now has a `Viewport` input
95 | - `ScrollableValue` component allowing to modify a widget's value using mouse scroll. Comes with help patches
96 |
97 | #### Changed
98 |
99 | - The first widget connected to the Elementa node can use Flexibility to stretch to the viewport
100 | - All nodes now live under the `Elementa` category, instead of `VL.Elementa`
101 | - Layout operator widget alignment option is now "Widgets self alignment" (no more horizontal/vertical)
102 | - All widgets and layout operators are now fragmented
103 | - Default style is now more wireframe-ish
104 | - Default font is now SegoeUI
105 | - Panel now only allows for vertical and horizontal scrolls
106 | - Tooltip is now using Tasks internally and can be drawn anywhere around the widget it's connected to
107 | - Padding is now expressed as a spread of floats instead of a string
108 | - Overlay system total revamp. Any number of overlays can now be opened on top of each other
109 |
110 | #### Fixed
111 |
112 | - Polar widgets got added to `Widgets In Action` and `Widget Overview` help patches
113 | - Dropdown widgets now behave correctly
114 |
115 | ### 4.0.5
116 |
117 | #### Fixes
118 |
119 | - NUnit project builds again
120 |
121 | ### 4.0.4
122 |
123 | #### New
124 |
125 | - Massive documentation update : many new help patches, pin and nodes descriptions
126 | - New widgets :
127 | - DropdownGrid
128 | - DropdownGridEnum
129 | - IntegerPolar
130 | - ValuePolar
131 | - IntegerPolarUpDown
132 | - New StylePresets : readymade stylesheets you can plug to your Elementa graph. Contribute your own!
133 | - AnyHovered : tells you if any widget of your graph is hovered. Comes with its help patch
134 |
135 | #### Changed/Updated
136 |
137 | - Changed pin names in Layout nodes. `Inherit Size From Children` and all similar names are now `Auto Size`
138 | - Masked irrelevant pins for some Layout nodes
139 | - Layout nodes now have an optionnal pin to that draws a helper stroke to visualize them more easily
140 | - Boolean widgets (bang, toggle, press) now have a new default drawer making it more obvious if they're true or not
141 |
142 | #### Fixed
143 |
144 | - Layer Objects are now stroked when selected
145 |
146 | ### 3.0.0
147 |
148 | - NEW Style system. there's no StyleSheet property anymore in IElementum interface (everything gets managed by the Styleable component, already implemented within every widget)
149 | - NEW "Selector" utility library to validate conditions within an entity-component tree graph (used for the style system)
150 | - NEW css file parser (builds an Elementa StyleSheet)
151 | - NEW ClientBounds, ElementaContextReceiver and UndoRedo utility widget nodes
152 | - NEW DisplayText optional input pin for Toggle, Bang, Press widgets
153 | - NEW sticky behaviour for slider widget (and all widgets that internally use slider behaviour)
154 | - NEW Formattable component
155 | - NEW Grid layout node
156 | - NEW Root architecture with pluggable component processors
157 | - NEW EditBehaviour options for some widgets: AbsoluteEditing/RelativeEditing/StickyEditing
158 | - FIX in ToSkiaLayer (in Root): disabled skia rendering in the first frame to avoid UI flickering (due to frame delays in retrieving the bounds from renderer)
159 | - FIX in IntegerUpDown behaviour (wasn't updating Min and Max values in idle)
160 | - Refactoring of Layour nodes: proper cached mechanism that improves a lot performances and better modularization of the internal components.
161 | - Layout nodes come just with a Spectral version (no pingroup version anymore)
162 | - All widgets now come with a Spectral version (that expect a component spread as input, not using pingroup)
163 | - Styleable component now as advanced, not meant to be plugged to the widgets to customize their style
164 | - Taggable component reworked: now it simply contains an `HashSet