From 7b8ff62e3ee75e19d9eeeabd31bedef371215554 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Mon, 27 Apr 2015 14:58:27 +0200 Subject: [PATCH] Layouting queue --- GOLib.csproj | 8 ++ Tests/GOLIBTest_1.1.cs | 55 ++++++++++++ Tests/GOLIBTest_1.2.cs | 55 ++++++++++++ Tests/Interfaces/test0.goml | 4 +- Tests/Interfaces/test1.1.goml | 15 ++++ Tests/Interfaces/test1.2.goml | 18 ++++ Tests/Interfaces/test1.goml | 15 ++-- Tests/Tests.csproj | 20 ++++- src/GraphicObjects/Container.cs | 60 ++++++------- src/GraphicObjects/GenericStack.cs | 103 +++++---------------- src/GraphicObjects/GraphicObject.cs | 135 ++++++++++++++-------------- src/GraphicObjects/Group.cs | 93 +++++++++---------- src/GraphicObjects/ILayoutable.cs | 9 +- src/GraphicObjects/Scroller.cs | 28 +++--- src/Interface.cs | 2 + src/LayoutingQueue.cs | 40 +++++++++ src/LayoutingQueueItem.cs | 70 +++++++++++++++ src/OpenTKGameWindow.cs | 27 ++++-- 18 files changed, 490 insertions(+), 267 deletions(-) create mode 100644 Tests/GOLIBTest_1.1.cs create mode 100644 Tests/GOLIBTest_1.2.cs create mode 100755 Tests/Interfaces/test1.1.goml create mode 100755 Tests/Interfaces/test1.2.goml create mode 100644 src/LayoutingQueue.cs create mode 100644 src/LayoutingQueueItem.cs diff --git a/GOLib.csproj b/GOLib.csproj index 4aad6152..567b61c5 100644 --- a/GOLib.csproj +++ b/GOLib.csproj @@ -231,6 +231,14 @@ + + + + + + + + diff --git a/Tests/GOLIBTest_1.1.cs b/Tests/GOLIBTest_1.1.cs new file mode 100644 index 00000000..b9cbdf65 --- /dev/null +++ b/Tests/GOLIBTest_1.1.cs @@ -0,0 +1,55 @@ +#define MONO_CAIRO_DEBUG_DISPOSE + + +using System; +using System.Runtime.InteropServices; +using OpenTK; +using OpenTK.Graphics.OpenGL; +using OpenTK.Input; + +using System.Diagnostics; + +//using GGL; +using go; +using System.Threading; + + +namespace test +{ + class GOLIBTest_1_1 : OpenTKGameWindow + { + public GOLIBTest_1_1 () + : base(1024, 600,"test") + {} + + Group g; + + protected override void OnLoad (EventArgs e) + { + base.OnLoad (e); + LoadInterface("Interfaces/test1.1.goml", out g); + + } + protected override void OnRenderFrame (FrameEventArgs e) + { + GL.Clear (ClearBufferMask.ColorBufferBit); + base.OnRenderFrame (e); + SwapBuffers (); + } + + protected override void OnUpdateFrame (FrameEventArgs e) + { + base.OnUpdateFrame (e); + } + + [STAThread] + static void Main () + { + Console.WriteLine ("starting example"); + + using (GOLIBTest_1_1 win = new GOLIBTest_1_1( )) { + win.Run (30.0); + } + } + } +} \ No newline at end of file diff --git a/Tests/GOLIBTest_1.2.cs b/Tests/GOLIBTest_1.2.cs new file mode 100644 index 00000000..629b2995 --- /dev/null +++ b/Tests/GOLIBTest_1.2.cs @@ -0,0 +1,55 @@ +#define MONO_CAIRO_DEBUG_DISPOSE + + +using System; +using System.Runtime.InteropServices; +using OpenTK; +using OpenTK.Graphics.OpenGL; +using OpenTK.Input; + +using System.Diagnostics; + +//using GGL; +using go; +using System.Threading; + + +namespace test +{ + class GOLIBTest_1_2 : OpenTKGameWindow + { + public GOLIBTest_1_2 () + : base(1024, 600,"test") + {} + + VerticalStack g; + + protected override void OnLoad (EventArgs e) + { + base.OnLoad (e); + LoadInterface("Interfaces/test1.2.goml", out g); + + } + protected override void OnRenderFrame (FrameEventArgs e) + { + GL.Clear (ClearBufferMask.ColorBufferBit); + base.OnRenderFrame (e); + SwapBuffers (); + } + + protected override void OnUpdateFrame (FrameEventArgs e) + { + base.OnUpdateFrame (e); + } + + [STAThread] + static void Main () + { + Console.WriteLine ("starting example"); + + using (GOLIBTest_1_2 win = new GOLIBTest_1_2( )) { + win.Run (30.0); + } + } + } +} \ No newline at end of file diff --git a/Tests/Interfaces/test0.goml b/Tests/Interfaces/test0.goml index 3163cc9a..102c1cac 100755 --- a/Tests/Interfaces/test0.goml +++ b/Tests/Interfaces/test0.goml @@ -1,5 +1,5 @@  diff --git a/Tests/Interfaces/test1.1.goml b/Tests/Interfaces/test1.1.goml new file mode 100755 index 00000000..6ccf2c1c --- /dev/null +++ b/Tests/Interfaces/test1.1.goml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/test1.2.goml b/Tests/Interfaces/test1.2.goml new file mode 100755 index 00000000..c41135c9 --- /dev/null +++ b/Tests/Interfaces/test1.2.goml @@ -0,0 +1,18 @@ + + +