aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-06-15 17:14:31 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2017-06-15 17:14:31 +0200
commit00ec9b28641b9bdce0b072665c32d2db4a9d9609 (patch)
tree13376aa3935f58503b8641cf466c5a68c91a4094
parent60ab9840d644f806cb010f9e4f385107a6f51ebf (diff)
work in progressTestC
-rw-r--r--Crow.sln1
-rw-r--r--MDEmbedTest/Makefile2
-rwxr-xr-xMDEmbedTest/libcrow.sobin62792 -> 62664 bytes
-rw-r--r--Tests/BasicTests.cs25
-rw-r--r--Tests/CrowWindow.cs6
-rw-r--r--Tests/InterfaceControler.cs2
-rw-r--r--Tests/Tests.csproj6
-rw-r--r--src/Crow.Native/LibCrow.cs2
-rw-r--r--src/GraphicObjects/GraphicObject.cs7
-rw-r--r--src/Interface.cs10
10 files changed, 38 insertions, 23 deletions
diff --git a/Crow.sln b/Crow.sln
index 72677865..19e78ad8 100644
--- a/Crow.sln
+++ b/Crow.sln
@@ -35,6 +35,7 @@ Global
{6CD55032-B8D6-4238-AA91-F9145E1217D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CD55032-B8D6-4238-AA91-F9145E1217D4}.Release|Any CPU.Build.0 = Release|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.Build.0 = Release|Any CPU
{A37A7E14-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
diff --git a/MDEmbedTest/Makefile b/MDEmbedTest/Makefile
index 53da377d..279fc03e 100644
--- a/MDEmbedTest/Makefile
+++ b/MDEmbedTest/Makefile
@@ -29,4 +29,4 @@ clean:
.PHONY: run
run:
- -./${TARGET} ../build/Debug/testDrm.exe
+ -./${TARGET} ../build/Debug/Tests.exe
diff --git a/MDEmbedTest/libcrow.so b/MDEmbedTest/libcrow.so
index e151c8a1..01d6f3f8 100755
--- a/MDEmbedTest/libcrow.so
+++ b/MDEmbedTest/libcrow.so
Binary files differ
diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs
index d48364e8..0f9447a9 100644
--- a/Tests/BasicTests.cs
+++ b/Tests/BasicTests.cs
@@ -148,19 +148,20 @@ namespace Tests
//testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" };
//testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
- testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ testFiles = new string [] { "#Tests.Interfaces.GraphicObject.0.crow" };
//testFiles = new string [] { @"#Tests.Interfaces.perfMsr.crow" };
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
+// testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
object tc = Color.AirForceBlueRaf;
Load (testFiles [idx]).DataSource = this;
diff --git a/Tests/CrowWindow.cs b/Tests/CrowWindow.cs
index a578fa64..e1dd5375 100644
--- a/Tests/CrowWindow.cs
+++ b/Tests/CrowWindow.cs
@@ -182,11 +182,11 @@ namespace Crow
if (ifaceControl.Count == 0)//create default orthogonal interface
addInterfaceControler (new InterfaceControler (
new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height)));
- ifaceControl [interfaceIdx].CrowInterface.AddWidget (g);
+ ifaceControl [interfaceIdx].CrowInterface.AddChild (g);
return g;
}
public void DeleteWidget (GraphicObject g, int interfaceIdx = 0){
- ifaceControl [interfaceIdx].CrowInterface.DeleteWidget (g);
+ ifaceControl [interfaceIdx].CrowInterface.RemoveChild (g);
}
public GraphicObject Load (string path, int interfaceIdx = 0){
if (ifaceControl.Count == 0)//create default orthogonal interface
@@ -203,7 +203,7 @@ namespace Crow
return null;
}
public void ClearInterface (int interfaceIdx = 0){
- ifaceControl [interfaceIdx].CrowInterface.ClearInterface ();
+ ifaceControl [interfaceIdx].CrowInterface.ClearChildren ();
}
/// <summary>Override this method for your OpenGL rendering calls</summary>
public virtual void OnRender(FrameEventArgs e)
diff --git a/Tests/InterfaceControler.cs b/Tests/InterfaceControler.cs
index 869c3896..264ebd21 100644
--- a/Tests/InterfaceControler.cs
+++ b/Tests/InterfaceControler.cs
@@ -162,7 +162,7 @@ namespace Crow
while (true) {
CrowInterface.Update ();
- Thread.Sleep (3);
+ Thread.Sleep (1000);
}
}
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 9eb845a1..b6c705c5 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -85,9 +85,6 @@
<None Include="Interfaces\tmpDirItem.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\GraphicObject\0.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\GraphicObject\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -356,6 +353,9 @@
<EmbeddedResource Include="Interfaces\CheckBox2.imlt" />
<EmbeddedResource Include="Interfaces\perfMsr.crow" />
<EmbeddedResource Include="ui\showcase.crow" />
+ <EmbeddedResource Include="Interfaces\GraphicObject\0.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Crow.csproj">
diff --git a/src/Crow.Native/LibCrow.cs b/src/Crow.Native/LibCrow.cs
index 28994f02..865c8400 100644
--- a/src/Crow.Native/LibCrow.cs
+++ b/src/Crow.Native/LibCrow.cs
@@ -60,6 +60,8 @@ namespace Crow.Native
unsafe internal static extern byte crow_object_do_layout (crow_object_t* go, LayoutingType layout);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
unsafe internal static extern byte crow_object_register_layouting (crow_object_t* go, LayoutingType layout);
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ unsafe internal static extern void crow_object_register_repaint (crow_object_t* go);
[DllImport(lib, CallingConvention = CallingConvention.Cdecl)]
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 4b81ed28..7422abed 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -888,7 +888,7 @@ namespace Crow
if (Width.IsFit || Height.IsFit)
RegisterForLayouting (LayoutingType.Sizing);
else if (RegisteredLayoutings == LayoutingType.None)
- CurrentInterface.EnqueueForRepaint (this);
+ LibCrow.crow_object_register_repaint (nativeHnd);
}
/// <summary> query an update of the content, a redraw </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -896,7 +896,7 @@ namespace Crow
{
IsDirty = true;
if (RegisteredLayoutings == LayoutingType.None)
- CurrentInterface.EnqueueForRepaint (this);
+ LibCrow.crow_object_register_repaint (nativeHnd);
}
#endregion
@@ -912,7 +912,8 @@ namespace Crow
}
unsafe public virtual void RegisterForLayouting(LayoutingType layoutType){
- LibCrow.crow_object_register_layouting (this.nativeHnd, layoutType);
+ lock (CurrentInterface.LayoutMutex)
+ LibCrow.crow_object_register_layouting (this.nativeHnd, layoutType);
}
/// <summary> trigger dependant sizing component update </summary>
diff --git a/src/Interface.cs b/src/Interface.cs
index 7d5eed13..5c581554 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -382,6 +382,16 @@ namespace Crow
}
#endregion
+ public override void AddChild (GraphicObject g)
+ {
+ lock(RenderMutex)
+ base.AddChild (g);
+ }
+ public override void RemoveChild (GraphicObject child)
+ {
+ lock(RenderMutex)
+ base.RemoveChild (child);
+ }
#region UPDATE Loops
/// <summary>Enqueue Graphic object for Repaint, DrawingQueue is locked because