]> O.S.I.I.S - jp/crow.git/commitdiff
spinner template
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 3 Aug 2019 08:35:45 +0000 (10:35 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 3 Aug 2019 08:35:45 +0000 (10:35 +0200)
Crow.sln
Crow/Templates/DirectoryView.template
Crow/Templates/Spinner.template
Crow/src/GraphicObjects/Shape.cs
Samples/common/ui/Interfaces/Divers/testShape.crow
Samples/common/ui/Interfaces/GraphicObject/0.crow
spirv.targets [new file with mode: 0644]
spirv.xml [new file with mode: 0644]

index 2bb604eba91e6b98080e45bd059a8def5c877848..21bd2bd0cce1a895c54797bb88eb8b6a93d60384 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowCase", "Samples\ShowCas
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Samples\Tests\Tests.csproj", "{5B7CA5BD-AEE8-40EE-85B0-0CAADD19B43A}"
 EndProject
-Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "CrowIDE", "Samples\CrowIDE\CrowIDE.csproj", "{B10C0B1B-B827-45E0-B96D-DAB6A22CE776}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "Samples\CrowIDE\CrowIDE.csproj", "{348A1983-0794-445A-975C-CBBF68EAC810}"
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -35,8 +35,8 @@ Global
                {5B7CA5BD-AEE8-40EE-85B0-0CAADD19B43A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {5B7CA5BD-AEE8-40EE-85B0-0CAADD19B43A}.Release|Any CPU.Build.0 = Release|Any CPU
                {5B7CA5BD-AEE8-40EE-85B0-0CAADD19B43A}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {B10C0B1B-B827-45E0-B96D-DAB6A22CE776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {B10C0B1B-B827-45E0-B96D-DAB6A22CE776}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {348A1983-0794-445A-975C-CBBF68EAC810}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {348A1983-0794-445A-975C-CBBF68EAC810}.Release|Any CPU.ActiveCfg = Release|Any CPU
        EndGlobalSection
        GlobalSection(MonoDevelopProperties) = preSolution
                Policies = $0
@@ -81,6 +81,6 @@ Global
                {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
                {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
                {5B7CA5BD-AEE8-40EE-85B0-0CAADD19B43A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
-               {B10C0B1B-B827-45E0-B96D-DAB6A22CE776} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+               {348A1983-0794-445A-975C-CBBF68EAC810} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
        EndGlobalSection
 EndGlobal
index d2193338810f3639457e73fb7aba67a8a0ff2129..6f75ba739c36faab89737ef9466a921bc8dc6916 100755 (executable)
@@ -2,7 +2,7 @@
 <TreeView IsRoot="true" Name="treeView" Data="{./FileSystemEntries}" Background="{./Background}"
                SelectedItemChanged="./onSelectedItemChanged">
        <ItemTemplate DataType="System.IO.FileInfo">
-               <Border CornerRadius="2" Margin="0" Focusable="true"  Height="Fit" Width="Stretched" Foreground="Transparent"
+               <Border Margin="0" Focusable="true"  Height="Fit" Width="Stretched" Foreground="Transparent"
                                MouseEnter="{Foreground=DimGrey}"
                                MouseLeave="{Foreground=Transparent}">
                        <HorizontalStack>
@@ -16,7 +16,7 @@
                <Expandable Caption="{Name}" MouseDoubleClick="/onClickForExpand">
                        <Template>
                                <VerticalStack>
-                                       <Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
+                                       <Border Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
                                                        Foreground="Transparent"
                                                        MouseEnter="{Foreground=DimGrey}"
                                                        MouseLeave="{Foreground=Transparent}">
index 4d992da3661de368cf3363c58605ef0e776f1c00..69e6ca69cb96e8907cc3896f74292f9a9cbabe76 100755 (executable)
@@ -1,12 +1,11 @@
 <?xml version="1.0"?>
-<HorizontalStack MinimumSize="40,13" Name="hstack" Margin="0" Spacing="0">
-       <Border BorderWidth="1" Width="75%"  Background="White" 
-               Foreground="{./Foreground}" Margin="0">
-               <TextBox Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
+<Border BorderWidth="1" Background="White" Foreground="{./Foreground}" Margin="0" >
+       <HorizontalStack Height="Fit">
+               <TextBox MinimumSize = "30,0" Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
                        Text="{²./Value}" TextAlignment="Right" Margin="0"/>
-       </Border>
-       <VerticalStack MinimumSize="13,13" Width="25%" Height="Stretched" Spacing="0" Margin="0">
-               <Shape Style="ArrowBut" Size="11,11" Height="50%" MouseDown="./onUp" Path="M 5.5,0.5 L 10.5,6.5 L 0.5,6.5 Z"/>                  
-               <Shape Style="ArrowBut" Size="11,11" Height="50%" MouseDown="./onDown" Path="M 0.5,0.5 L 10.5,0.5 L 5.5,6.5 Z"/>                        
-       </VerticalStack>
-</HorizontalStack>
+               <VerticalStack MinimumSize="13,0" Width="Fit" Height="Fit" Spacing="2" Margin="1">                      
+                               <Shape Margin="0" Style="ArrowBut" Size="11,7" Height="5" MouseDown="./onUp" Path="M 5.5,0.5 L 10.5,6.5 L 0.5,6.5 Z"/>                                                                                          
+                               <Shape Margin="0" Style="ArrowBut"      Size="11,7" Height="5" MouseDown="./onDown" Path="M 0.5,0.5 L 10.5,0.5 L 5.5,6.5 Z"/>                                                                   
+               </VerticalStack>        
+       </HorizontalStack>
+</Border>
index d392c56d850a3794920913f43660fb3a64c09184..5bf747358f5aef545ea3150d84d35033d814b21f 100644 (file)
@@ -112,14 +112,12 @@ namespace Crow
 
             Rectangle r = ClientRectangle;
 
-
-            double sx = (double)r.Width / (double)(contentSize.Width == 0? size.Width : contentSize.Width);
+                       double sx = (double)r.Width / (double)(contentSize.Width == 0? size.Width : contentSize.Width);
             double sy = (double)r.Height / (double)(contentSize.Height == 0 ? size.Height : contentSize.Height);            
 
             gr.Translate(r.Left, r.Top);
             gr.Scale (sx,sy);
-
-
+            
                        executePath (gr);
 
                        Background.SetAsSource (gr, r);
@@ -173,21 +171,22 @@ namespace Crow
                protected override int measureRawSize (LayoutingType lt)
                {
                        //if ((lt == LayoutingType.Width && contentSize.Width == 0) || (lt == LayoutingType.Height && contentSize.Height == 0)) {
-   //             if (size != default(Size))
-   //                 contentSize = size;
-   //             else
-   //             {
-   //                 using (Surface drawing = new Surface(IFace.dev, 1, 1))
-   //                 {
-   //                     using (Context ctx = new Context(drawing))
-   //                     {
-   //                         executePath(ctx);
-   //                         Rectangle r = ctx.StrokeExtents();
-   //                         contentSize = new Size(r.Right, r.Bottom);
-   //                     }
-   //                 }
-   //             }
+                       //             if (size != default(Size))
+                       //                 contentSize = size;
+                       //             else
+                       //             {
+                       //                 using (Surface drawing = new Surface(IFace.dev, 1, 1))
+                       //                 {
+                       //                     using (Context ctx = new Context(drawing))
+                       //                     {
+                       //                         executePath(ctx);
+                       //                         Rectangle r = ctx.StrokeExtents();
+                       //                         contentSize = new Size(r.Right, r.Bottom);
+                       //                     }
+                       //                 }
+                       //             }
                        //}
+                       contentSize = size;
                        return lt == LayoutingType.Width ?
                                contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin;
                }
index d1f9f3cc5e75dc70c7f5fc78799e56382d65589f..99b89b07aca495fc575a250c54a50112d504cd40 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <Container Fit="true" Background="Red" Tooltip="test tooltip" >
-       <Shape Foreground="Transparent" Background="DimGrey" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"
+       <Shape Foreground="Transparent" Background="DimGrey" Size="11,11" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"
                MouseEnter="{Background=hgradient|0:DimGrey|0.5:RoyalBlue|1:Black}"
                MouseLeave="{Background=DimGrey}"/>
 </Container>
\ No newline at end of file
index 542e2ba47365b6477a0cd51f989e423cdcbc3f94..d786e6ae2872c5e66a5806db107e882a7f4e97cf 100755 (executable)
@@ -1,4 +1,5 @@
 <?xml version="1.0"?>
-
-    <Button CornerRadius="0" Background="Red"/>
-
+<VerticalStack Height="Fit" Width="20" Margin="1" Spacing="2" Background="White" >                     
+       <Widget Height="50" Background="Green"/>                                                
+       <Widget Height="50" Background="Red"/>                                          
+</VerticalStack>
diff --git a/spirv.targets b/spirv.targets
new file mode 100644 (file)
index 0000000..b2df443
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)spirv.xml" />
+    <AvailableItemName Include="GLSLShader">
+      <Targets>DXC</Targets>
+    </AvailableItemName>
+  </ItemGroup>
+       
+  <Target Name="DataCopy" AfterTargets="CoreBuild;Build">                      
+    <Copy SourceFiles="@(Datas)" DestinationFiles="@(Datas->'$(OutputPath)\data\%(RecursiveDir)%(Filename)%(Extension)')"/>
+  </Target>
+       
+       <Target Name="CompileShaders" BeforeTargets="BeforeBuild" Outputs="@(CompiledShaders)">
+               <Message Importance="High" Text="Compiling shaders to spirv with glslc" />
+               <MakeDir Directories="$(OutputPath)%(GLSLShader.RelativeDir)"/>
+               <Exec Command="glslc %(GLSLShader.Identity) -o $(OutputPath)%(RelativeDir)%(Filename)%(Extension).spv"
+                     ConsoleToMSBuild="true" EchoOff="true" Outputs="$(OutputPath)%(RelativeDir)%(Filename)%(Extension).spv">
+                   <Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
+               </Exec>
+               <CreateItem
+            Include="$(OutputPath)%(GLSLShader.RelativeDir)%(Filename)%(Extension).spv">                       
+               <Output
+               TaskParameter="Include"
+               ItemName="EmbeddedResource"/>
+        </CreateItem>          
+               <Message Importance="High" Text="Embedding $(OutputPath)%(GLSLShader.RelativeDir)%(Filename)%(Extension).spv" />
+       </Target>       
+</Project>
diff --git a/spirv.xml b/spirv.xml
new file mode 100644 (file)
index 0000000..9635ad6
--- /dev/null
+++ b/spirv.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ProjectSchemaDefinitions xmlns="http://schemas.microsoft.com/build/2009/properties">
+  <ItemType Name="GLSLShader" DisplayName="GLSL Shader" />
+  <ContentType Name="GLSLShader" ItemType="GLSLShader" DisplayName="GLSL Shader" />
+  <FileExtension Name=".comp" ContentType="GLSLShader" />
+  <FileExtension Name=".geom" ContentType="GLSLShader" />
+  <FileExtension Name=".frag" ContentType="GLSLShader" />
+  <FileExtension Name=".vert" ContentType="GLSLShader" />
+</ProjectSchemaDefinitions>