From 4d1f3264dc4b4ddc211164712e0d2d654a913bb7 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 27 May 2017 18:35:01 +0200 Subject: c native GraphicObject implementation, work in progress --- src/LayoutingQueueItem.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/LayoutingQueueItem.cs') diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index 7f272d98..79140720 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -28,6 +28,7 @@ using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; namespace Crow { @@ -48,10 +49,11 @@ namespace Crow /// /// Element class of the LayoutingQueue /// + [StructLayout(LayoutKind.Sequential)] public struct LayoutingQueueItem { /// Instance of widget to be layouted - public ILayoutable Layoutable; + public GraphicObject Layoutable; /// Bitfield containing the element of the layout to performs (x|y|width|height) public LayoutingType LayoutType; /// Unsuccessfull UpdateLayout and requeueing count @@ -78,7 +80,7 @@ namespace Crow #endif #region CTOR - public LayoutingQueueItem (LayoutingType _layoutType, ILayoutable _graphicObject) + public LayoutingQueueItem (LayoutingType _layoutType, GraphicObject _graphicObject) { LayoutType = _layoutType; Layoutable = _graphicObject; @@ -116,7 +118,7 @@ namespace Crow #endif if (LayoutingTries < Interface.MaxLayoutingTries) { Layoutable.RegisteredLayoutings |= LayoutType; - (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this); + Layoutable.CurrentInterface.LayoutingQueue.Enqueue (this); } else if (DiscardCount < Interface.MaxDiscardCount) { #if DEBUG_LAYOUTING Debug.WriteLine ("\t\tDiscarded"); @@ -124,7 +126,7 @@ namespace Crow LayoutingTries = 0; DiscardCount++; Layoutable.RegisteredLayoutings |= LayoutType; - (Layoutable as GraphicObject).CurrentInterface.DiscardQueue.Enqueue (this); + Layoutable.CurrentInterface.DiscardQueue.Enqueue (this); } #if DEBUG_LAYOUTING else -- cgit v1.3.1-4-g156e