aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
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 /src
parent60ab9840d644f806cb010f9e4f385107a6f51ebf (diff)
work in progressTestC
Diffstat (limited to 'src')
-rw-r--r--src/Crow.Native/LibCrow.cs2
-rw-r--r--src/GraphicObjects/GraphicObject.cs7
-rw-r--r--src/Interface.cs10
3 files changed, 16 insertions, 3 deletions
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