]> O.S.I.I.S - jp/crow.git/commitdiff
:book: use own compiled opentk and remove nuget config
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 3 Feb 2018 05:38:35 +0000 (06:38 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 3 Feb 2018 05:38:35 +0000 (06:38 +0100)
56 files changed:
.nuget/NuGet.config [deleted file]
.nuget/packages.config [deleted file]
Crow.csproj
Crow.dll.config
Images/Icons/expandable.svg
Properties/AssemblyInfo.cs
README.md
Templates/DirectoryView.template
Templates/Expandable.template
Templates/Popper.template
Tests/BasicTests.cs
Tests/CrowWindow.cs
Tests/Hello3D.cs
Tests/HelloCube.cs
Tests/OpenGL/Shader.cs
Tests/Showcase.cs
Tests/Tests.csproj
libs/OpenTK.dll [new file with mode: 0644]
libs/OpenTK.dll.config [new file with mode: 0644]
src/BubblingMouseButtonEventArgs.cs
src/Colors.cs
src/Command.cs
src/CompilerServices/CompilerServices.cs
src/Configuration.cs
src/Fill/Fill.cs
src/GraphicObjects/Button.cs
src/GraphicObjects/CheckBox.cs
src/GraphicObjects/ColorPicker.cs
src/GraphicObjects/ColorSelector.cs
src/GraphicObjects/ComboBox.cs
src/GraphicObjects/Container.cs
src/GraphicObjects/DirectoryView.cs
src/GraphicObjects/FileDialog.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/GroupBox.cs
src/GraphicObjects/HorizontalStack.cs
src/GraphicObjects/Image.cs
src/GraphicObjects/MenuItem.cs
src/GraphicObjects/SaturationValueSelector.cs
src/GraphicObjects/ScrollBar.cs
src/GraphicObjects/Scroller.cs
src/GraphicObjects/ScrollingObject.cs
src/GraphicObjects/Slider.cs
src/GraphicObjects/Spinner.cs
src/GraphicObjects/Splitter.cs
src/GraphicObjects/TabItem.cs
src/GraphicObjects/TemplatedGroup.cs
src/GraphicObjects/VerticalStack.cs
src/GraphicObjects/Window.cs
src/GraphicObjects/Wrapper.cs
src/IML/BindingMember.cs
src/Instantiator.cs
src/Interface.cs
src/ItemTemplate.cs

diff --git a/.nuget/NuGet.config b/.nuget/NuGet.config
deleted file mode 100644 (file)
index 9724103..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-       <config>
-               <add key="repositoryPath" value="../packages" />
-       </config>
-</configuration>
diff --git a/.nuget/packages.config b/.nuget/packages.config
deleted file mode 100644 (file)
index 16ef9b1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-       <package id="OpenTK" version="2.0.0" targetFramework="net45" />
-</packages>
index 4edb707b05714f81a3ecb9c5411f78e77024b426..3a8228ef97dcff3fdd8f70c296a121b7c0058d36 100644 (file)
     <Compile Include="src\GraphicObjects\Menu.cs" />
     <Compile Include="src\Command.cs" />
     <Compile Include="src\GraphicObjects\DataSourceChangeEventArgs.cs" />
-    <Compile Include="src\IML\Context.cs" />
     <Compile Include="src\IML\NodeAddress.cs" />
     <Compile Include="src\IML\Node.cs" />
     <Compile Include="src\IML\MemberAddress.cs" />
     <Compile Include="src\Mono.Cairo\Win32Surface.cs" />
     <Compile Include="src\Mono.Cairo\XcbSurface.cs" />
     <Compile Include="src\Mono.Cairo\XlibSurface.cs" />
+    <Compile Include="src\GraphicObjects\DocksView.cs" />
+    <Compile Include="src\GraphicObjects\DockingView.cs" />
+    <Compile Include="src\IML\IMLContext.cs" />
+    <Compile Include="src\Mono.Cairo\MeshPattern.cs" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
     <EmbeddedResource Include="Icons\folder.svg" />
     <EmbeddedResource Include="Icons\file.svg" />
     <EmbeddedResource Include="Icons\level-up.svg" />
+    <EmbeddedResource Include="Templates\DockingView.template">
+      <LogicalName>Crow.DockingView.template</LogicalName>
+    </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
     <None Include="Crow.dll.config">
index ef7562ac47aa7b4d9008d121bdc494f83e312639..6341771d7872a7360ecdb8a8c0a4f14c4745d998 100644 (file)
@@ -6,6 +6,7 @@
   <dllmap os="!windows,osx" dll="libgdk-3-0.dll" target="libgdk-3.so.0"/>
   <dllmap os="!windows,osx" dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0.so.0"/>
   <dllmap os="!windows,osx" dll="rsvg-2" target="librsvg-2.so.2"/>
+  <dllmap os="!windows,osx" dll="libinput" target="libinput.so.10"/>
 
   
   <dllmap os="windows" dll="rsvg-2" target="librsvg-2-2.dll"/>
index f8ceb32243536f84ed2b6a24feedaf8bd8831494..134d02e8ac20d4c7a782107a22a4941b9baf5673 100644 (file)
@@ -1,61 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   version="1.1"
-   id="svg2"
-   viewBox="0 0 64 64.000002"
-   height="64"
-   width="64">
-  <defs
-     id="defs4" />
-  <metadata
-     id="metadata7">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="False">
-    <rect
-       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:8.89073467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1"
-       id="rect4136"
-       width="55.122551"
-       height="55.122551"
-       x="4.4468598"
-       y="4.3914709"
-       ry="8.8907347" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8.89073467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="m 32.008136,12.393132 0,39.11923"
-       id="path4177" />
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8.89073467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="m 12.448521,31.952746 39.119231,0"
-       id="path4181" />
-  </g>
-  <g
-     id="True">
-    <rect
-       ry="8.8907347"
-       y="4.3914709"
-       x="4.4468598"
-       height="55.122551"
-       width="55.122551"
-       id="rect4190"
-       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:8.89073467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1" />
-    <path
-       id="path4194"
-       d="m 12.448521,31.952746 39.119231,0"
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8.89073467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-  </g>
-</svg>
+<svg width="9" height="9" xmlns="http://www.w3.org/2000/svg">
+ <g id="False">
+  <rect height="8" width="8" y="0.5" x="0.5" stroke="#000" fill="#fff" stroke-width="1"/>
+  <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="4.5" x2="7" y1="4.5" x1="2" stroke="#000" fill="none"/>
+  <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_3" y2="7" x2="4.5" y1="2" x1="4.5" stroke="#000" fill="none"/>
+ </g>
+ <g id="True">
+  <rect height="8" width="8" y="0.5" x="0.5" stroke="#000" fill="#fff" stroke-width="1"/>
+  <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="4.5" x2="7" y1="4.5" x1="2" stroke="#000" fill="none"/>
+ </g>
+</svg>
\ No newline at end of file
index f057bc1d725ec673f519b515b2a62a0349fe5c69..b83b6e284ecc3853f46698461a4421fd8022519e 100755 (executable)
@@ -35,9 +35,9 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyConfiguration ("")]
 [assembly: AssemblyCompany ("Grand Tetra Software")]
 [assembly: AssemblyProduct ("Crow")]
-[assembly: AssemblyCopyright ("Copyright (c) 2016 - Jean-Philippe Bruyère <jp_bruyere@hotmail.com>")]
+[assembly: AssemblyCopyright ("Copyright (c) 2018 - Jean-Philippe Bruyère <jp_bruyere@hotmail.com>")]
 [assembly: AssemblyTrademark ("")]
-[assembly: AssemblyCulture ("en-US")]
+[assembly: AssemblyCulture ("")]
 
 // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
 // The form "{Major}.{Minor}.*" will automatically update the build and revision,
index 31893653142b0da69ced17410646884b350e8a95..8d0bc2afe57b8facd28173fa60afb08b6de9e1b6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -36,26 +36,32 @@ for easy c# code linking.
   </a>
 </p>
 
-You can visit the [Wiki](https://github.com/jpbruyere/Crow/wiki) or the [Project Site](https://jpbruyere.github.io/Crow/)
-for documentation and tutorials.
+For **documentation** and **tutorials** visit the [Wiki](https://github.com/jpbruyere/Crow/wiki)
+or the [Project Site](https://jpbruyere.github.io/Crow/).
 
 Please report bugs and issues on [GitHub](https://github.com/jpbruyere/Crow/issues)
 
 ## Getting Start
+
 ### Requirements
-- [mono > 4.5](http://www.mono-project.com/)
+- [mono > 4.5](http://www.mono-project.com/download/)
 - [Cairo Graphic Library](https://cairographics.org/) >= 1.10 
 - [rsvg library](https://developer.gnome.org/rsvg/) for svg rendering
 - [nuget](https://www.nuget.org/).
+
 ### Building from source
+
 _[Git](https://git-scm.com) has to be installed._
+
 ```bash
 git clone https://github.com/jpbruyere/Crow.git     # Download source code from github
 cd Crow                                             # Enter the source directory
 nuget restore Crow.sln                              # Restore nuget packages
 xbuild  /p:Configuration=Release Crow.sln           # Build with Mono 
 ```
+
 ### Using nuget
+
 * add [Crow.OpenTK NuGet package](https://www.nuget.org/packages/Crow.OpenTK/) to your project.
 * Derive **CrowWindow** class.
 * Load some widget in the **OnLoad** override with `CrowWindow.Load` .
index bf3a6f46bfa3cdfe57ce1bb89c5a2bdc1e244017..148a7570d3417979ae2111a780b632fe414ec9df 100755 (executable)
@@ -21,7 +21,7 @@
                                                        MouseEnter="{Foreground=DimGray}"
                                                        MouseLeave="{Foreground=Transparent}">
                                                <HorizontalStack Spacing="1">
-                                                       <Image Margin="1" Width="10" Height="10" Focusable="true" MouseClick="./onClickForExpand"
+                                                       <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
                                                                Path="{./Image}"
                                                                Visible="{./IsExpandable}"
                                                                SvgSub="{./IsExpanded}"
index 2360063a2d4d832df52a140a84ce7846570bf301..610caf5c10040e5dc71db3e67000442f218637d3 100755 (executable)
@@ -2,7 +2,7 @@
 <Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
        <VerticalStack>
                <HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand">
-                       <Container Margin="1" Width="10" Height="10" Focusable="true" MouseClick="./onClickForExpand"
+                       <Container Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
                                                                                                                MouseEnter="{Background=LightGray}"
                                                                                                                MouseLeave="{Background=Transparent}">
                                <Image
index c473cecb291dab267410ba5fdf37ddce0af1a9e3..0bc7c741405bc5bea8375e4a26afbdd114a3d51a 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <Border Background="{./Background}" BorderWidth="1" Foreground="{./Foreground}" Height="Fit">
        <HorizontalStack Spacing="1" Height="Fit">
-               <Image Style="Icon" Margin="2"
+               <Image Style="Icon" Margin="1" Width="9" Height="9"
                                Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsPopped}"/>
                <Label Text="{./Caption}" />
        </HorizontalStack>
index 6adabf6cc25aab615e3d8fa68c83f7bcb06283a1..9d8764f48ca5b6c31e82cd302ad1fa045e91499c 100644 (file)
@@ -39,7 +39,7 @@ namespace Tests
        class BasicTests : CrowWindow
        {
                public BasicTests ()
-                       : base(800, 600,"test: press <F3> to toogle test files")
+                       : base(1280, 800,"test: press <F3> to toogle test files")
                {
                }
 
@@ -141,7 +141,7 @@ namespace Tests
 
                        //testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" };
                        //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
-                       testFiles = new string [] { @"Interfaces/TemplatedContainer/testTabView.crow" };
+                       testFiles = new string [] { @"Interfaces/Divers/welcome.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 ();
@@ -246,10 +246,13 @@ namespace Tests
                [STAThread]
                static void Main ()
                {
+                       TextWriterTraceListener listener = new TextWriterTraceListener ("listen.txt");
+                       Debug.Listeners.Add (listener);
                        Console.WriteLine ("starting example");
                        BasicTests win = new BasicTests ();
                        win.VSync = OpenTK.VSyncMode.Adaptive;
                        win.Run (30);
+                       listener.Dispose ();
                }
                protected override void OnUpdateFrame (OpenTK.FrameEventArgs e)
                {
index 5e26c0df22a07aa5055855abf6055deca7d3ef55..9ef774832daf7268cc2b0be7eff955a4aadfd905 100644 (file)
@@ -185,13 +185,13 @@ namespace Crow
 
                #region Events
                //those events are raised only if mouse isn't in a graphic object
-               public event EventHandler<OpenTK.Input.MouseWheelEventArgs> MouseWheelChanged;
-               public event EventHandler<OpenTK.Input.MouseButtonEventArgs> MouseButtonUp;
-               public event EventHandler<OpenTK.Input.MouseButtonEventArgs> MouseButtonDown;
-               public event EventHandler<OpenTK.Input.MouseButtonEventArgs> MouseClick;
-               public event EventHandler<OpenTK.Input.MouseMoveEventArgs> MouseMove;
-               public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> KeyboardKeyDown;
-               public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> KeyboardKeyUp;
+               public event EventHandler<OpenTK.Input.MouseWheelEventArgs> CrowMouseWheel;
+               public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseUp;
+               public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseDown;
+               public event EventHandler<OpenTK.Input.MouseButtonEventArgs> CrowMouseClick;
+               public event EventHandler<OpenTK.Input.MouseMoveEventArgs> CrowMouseMove;
+               public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> CrowKeyDown;
+               public event EventHandler<OpenTK.Input.KeyboardKeyEventArgs> CrowKeyUp;
 
                #endregion
 
@@ -244,12 +244,13 @@ namespace Crow
                        base.OnLoad(e);
 
                        this.KeyPress += new EventHandler<OpenTK.KeyPressEventArgs>(OpenTKGameWindow_KeyPress);
-                       Keyboard.KeyDown += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyDown);
-                       Keyboard.KeyUp += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyUp);
-                       Mouse.WheelChanged += new EventHandler<OpenTK.Input.MouseWheelEventArgs>(GL_Mouse_WheelChanged);
-                       Mouse.ButtonDown += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonDown);
-                       Mouse.ButtonUp += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonUp);
-                       Mouse.Move += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(GL_Mouse_Move);
+                       KeyDown += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyDown);
+                       KeyUp += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyUp);
+
+                       MouseWheel += new EventHandler<OpenTK.Input.MouseWheelEventArgs>(GL_Mouse_WheelChanged);
+                       MouseDown += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonDown);
+                       MouseUp += new EventHandler<OpenTK.Input.MouseButtonEventArgs>(GL_Mouse_ButtonUp);
+                       MouseMove += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(GL_Mouse_Move);
 
                        #if DEBUG
                        Console.WriteLine("\n\n*************************************");
@@ -331,7 +332,7 @@ namespace Crow
                                return;
                        }
                        if (focusedIdx < 0)
-                               MouseMove.Raise (sender, otk_e);
+                               CrowMouseMove.Raise (sender, otk_e);
         }
                protected virtual void GL_Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs otk_e)
         {
@@ -340,7 +341,7 @@ namespace Crow
                                if (ifaceControl [focusedIdx].ProcessMouseButtonUp ((int)otk_e.Button))
                                        return;
                        }
-                       MouseButtonUp.Raise (sender, otk_e);
+                       CrowMouseUp.Raise (sender, otk_e);
         }
                protected virtual void GL_Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs otk_e)
                {
@@ -349,7 +350,7 @@ namespace Crow
                                if (ifaceControl [focusedIdx].ProcessMouseButtonDown ((int)otk_e.Button))
                                        return;
                        }
-                       MouseButtonDown.Raise (sender, otk_e);
+                       CrowMouseDown.Raise (sender, otk_e);
         }
                protected virtual void GL_Mouse_WheelChanged(object sender, OpenTK.Input.MouseWheelEventArgs otk_e)
         {
@@ -357,7 +358,7 @@ namespace Crow
                                if (ifaceControl [focusedIdx].ProcessMouseWheelChanged (otk_e.DeltaPrecise))
                                        return;
                        }
-                       MouseWheelChanged.Raise (sender, otk_e);
+                       CrowMouseWheel.Raise (sender, otk_e);
         }
 
                protected virtual void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e)
@@ -366,7 +367,7 @@ namespace Crow
                                if (ifaceControl [focusedIdx].ProcessKeyDown((int)otk_e.Key))
                                        return;
                        }
-                       KeyboardKeyDown.Raise (this, otk_e);
+                       CrowKeyDown.Raise (this, otk_e);
         }
                protected virtual void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e)
                {
@@ -374,7 +375,7 @@ namespace Crow
                                if (ifaceControl [focusedIdx].ProcessKeyUp((int)otk_e.Key))
                                        return;
                        }
-                       KeyboardKeyUp.Raise (this, otk_e);
+                       CrowKeyUp.Raise (this, otk_e);
                }
                protected virtual void OpenTKGameWindow_KeyPress (object sender, OpenTK.KeyPressEventArgs e)
                {
index c14a586e9d9432d36522bb52474557c4aaddf6c9..48b95c5ce04b1174414ecef8365e3d30b1b619c3 100644 (file)
@@ -66,7 +66,7 @@ namespace Tests
                void initGL(){
                        GL.Enable (EnableCap.CullFace);
                        GL.Enable (EnableCap.Blend);
-                       GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
+                       GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
 
                        cube = vaoMesh.CreateCube ();
                        texture = new Texture ("image/textest.png");
@@ -76,8 +76,8 @@ namespace Tests
                {
                        base.OnLoad (e);
 
-                       MouseMove += HelloCube_MouseMove;
-                       MouseWheelChanged += Hello3D_MouseWheelChanged;
+                       CrowMouseMove += HelloCube_MouseMove;
+                       CrowMouseWheel += Hello3D_MouseWheelChanged;
 
                        iface3D = Add3DInterface (800, 800,
                                Matrix4.CreateScale (6f) *
@@ -140,8 +140,8 @@ namespace Tests
                void Hello3D_MouseWheelChanged (object sender, OpenTK.Input.MouseWheelEventArgs e)
                {
                        float speed = ZoomSpeed;
-                       if (Keyboard[OpenTK.Input.Key.ControlLeft])
-                               speed *= 20.0f;
+                       //if (Keyboard[OpenTK.Input.Key.ControlLeft])
+                       //      speed *= 20.0f;
 
                        eyeDist -= e.Delta * speed;
                        if (eyeDist < zNear)
index d44a9bfff71fa0898b6089596a2919e6169c4bbc..c616acb3cf715309c6697f0c4afa3b329dcd188e 100644 (file)
@@ -52,7 +52,7 @@ namespace Tests
                void initGL(){
                        GL.Enable (EnableCap.CullFace);
                        GL.Enable (EnableCap.Blend);
-                       GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
+                       GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
 
                        cube = vaoMesh.CreateCube ();
                        texture = new Texture ("image/textest.png");
index 6ae99b8910b3d47d6f94d8114176df738982ef8e..f91a982c764a61ee5cdada1a7d9ae8da36fc99ba 100644 (file)
@@ -51,7 +51,7 @@ namespace Crow
                                                GeomSourcePath;
                #region Sources
                protected string _vertSource = @"
-                       #version 330
+                       #version 300 es
                        precision lowp float;
 
                        uniform mat4 mvp;
@@ -68,7 +68,7 @@ namespace Crow
                        }";
 
                protected string _fragSource = @"
-                       #version 330
+                       #version 300 es
                        precision lowp float;
 
                        uniform sampler2D tex;
index 67ef5eef15bc2fa9c19087037cf56f90786c41c5..95df6a2723f105dd9145ac904c583585f11409eb 100644 (file)
@@ -56,6 +56,7 @@ namespace Tests
                {
                        base.OnLoad (e);
 
+                       this.CrowKeyDown += Showcase_CrowKeyDown;
                        GraphicObject g = Load ("#Tests.ui.showcase.crow");
                        g.DataSource = this;
                        crowContainer = g.FindByName ("CrowContainer") as Container;
@@ -65,6 +66,14 @@ namespace Tests
                        hideError ();
                }
 
+               void Showcase_CrowKeyDown (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
+               {
+                       if (e.Key == OpenTK.Input.Key.Escape) {
+                               Quit (null, null);
+                               return;
+                       }
+               }
+
                void Dv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
                {
                        FileSystemInfo fi = e.NewValue as FileSystemInfo;
index 38152f0b9acd42bee1cc780f4d9303c503ad4df3..2994acbad3b35d0ff4b350dab68ea4bf003c1dc7 100644 (file)
@@ -45,7 +45,7 @@
     <Reference Include="System.Xml" />
     <Reference Include="System.Drawing" />
     <Reference Include="OpenTK">
-      <HintPath>$(SolutionDir)packages\OpenTK.2.0.0\lib\net20\OpenTK.dll</HintPath>
+      <HintPath>$(SolutionDir)libs\OpenTK.dll</HintPath>
     </Reference>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
     <None Include="Interfaces\Splitter\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="OpenTK.dll.config" />
     <None Include="image\textest.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\Divers\welcome.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="packages.config" />
     <None Include="Interfaces\Unsorted\testTypeViewer.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
diff --git a/libs/OpenTK.dll b/libs/OpenTK.dll
new file mode 100644 (file)
index 0000000..370a45e
Binary files /dev/null and b/libs/OpenTK.dll differ
diff --git a/libs/OpenTK.dll.config b/libs/OpenTK.dll.config
new file mode 100644 (file)
index 0000000..7098d39
--- /dev/null
@@ -0,0 +1,25 @@
+<configuration>
+  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
+  <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
+  <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
+  <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
+  <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
+  <dllmap os="linux" dll="libX11" target="libX11.so.6"/>
+  <dllmap os="linux" dll="libXi" target="libXi.so.6"/>
+  <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
+  <dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
+  <dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
+  <dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
+  <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
+  <dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
+  <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
+  <dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
+  <dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
+  <!-- XQuartz compatibility (X11 on Mac) -->
+  <dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
+  <dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
+  <dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
+  <dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
+  <dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
+  <dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
+</configuration>
index 0c8afd26cd607c9a8b959e8010cdfcdd044cd4f8..749396209506593d216d7e06c31e2241cdefab8f 100644 (file)
@@ -28,12 +28,13 @@ using System;
 
 namespace Crow
 {
+       /// <summary>
+       /// Store focused widget while bubbling mouse down event to the top
+       /// </summary>
        public class BubblingMouseButtonEventArg: MouseButtonEventArgs
        {
                public GraphicObject Focused;
-               public BubblingMouseButtonEventArg(MouseButtonEventArgs mbe) : base(mbe){
-                       
-               }
+               public BubblingMouseButtonEventArg(MouseButtonEventArgs mbe) : base(mbe){}
        }
 }
 
index 7317516dc79f849070c91587c436223597ba8e0a..e62abb7511b4fc24cc7dab6cc64350ee35907f71 100644 (file)
@@ -63,6 +63,9 @@ namespace Crow
                }
                #endregion
 
+               /// <summary>
+               /// color names dictionary
+               /// </summary>
                public static Dictionary<string, Color> ColorDic = new Dictionary<string, Color>();
 
                internal string Name;
@@ -154,7 +157,9 @@ namespace Crow
                }
                #endregion
 
-
+               /// <summary>
+               /// compute the hue of the color
+               /// </summary>
                public double Hue {
                        get {
                                double min = Math.Min (R, Math.Min (G, B));     //Min. value of RGB
@@ -185,11 +190,18 @@ namespace Crow
                                return h;
                        }
                }
+               /// <summary>
+               /// compute the saturation of the color
+               /// </summary>
                public double Saturation {
                        get {
                                return Math.Max (R, Math.Max (G, B));   //Max. value of RGB
                        }
                }
+               /// <summary>
+               /// compute the RGB intensity of the color
+               /// </summary>
+               /// <value>The value.</value>
                public double Value {
                        get {
                                double min = Math.Min (R, Math.Min (G, B));     //Min. value of RGB
@@ -203,6 +215,11 @@ namespace Crow
                {
                        get { return new float[]{ (float)R, (float)G, (float)B, (float)A }; }
                }
+               /// <summary>
+               /// return a copy of the color with the alpha component modified
+               /// </summary>
+               /// <returns>new modified color</returns>
+               /// <param name="_A">normalized alpha component</param>
                public Color AdjustAlpha(double _A)
                {
                        return new Color (this.R, this.G, this.B, _A);
index b3f31ff00ebf74592e4672de06e9d33171488bad..ba95acc9af9012f5a26a2b72f9ba9bd58f5b41a5 100644 (file)
@@ -30,6 +30,9 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// helper class to bind in one step icon, caption, action, and validity tests to a controls 
+       /// </summary>
        public class Command : IValueChange
        {
                #region IValueChange implementation
@@ -41,6 +44,10 @@ namespace Crow
                #endregion
 
                #region CTOR
+               /// <summary>
+               /// Initializes a new instance of Command with the action pass as argument.
+               /// </summary>
+               /// <param name="_executeAction">action to excecute when command is triggered</param>
                public Command (Action _executeAction)
                {
                        execute = _executeAction;
@@ -54,6 +61,9 @@ namespace Crow
                bool canExecute = true;
 
                #region Public properties
+               /// <summary>
+               /// if true, action defined in this command may be executed,
+               /// </summary>
                [XmlAttributeAttribute][DefaultValue(true)]
                public virtual bool CanExecute {
                        get { return canExecute; }
@@ -64,6 +74,9 @@ namespace Crow
                                NotifyValueChanged ("CanExecute", canExecute);
                        }
                }
+               /// <summary>
+               /// label to display in the bound control
+               /// </summary>
                [XmlAttributeAttribute][DefaultValue("Unamed Command")]
                public virtual string Caption {
                        get { return caption; }
@@ -75,6 +88,9 @@ namespace Crow
 
                        }
                }
+               /// <summary>
+               /// Icon to display in the bound control
+               /// </summary>
                [XmlAttributeAttribute]
                public Picture Icon {
                        get { return icon; }
@@ -87,6 +103,9 @@ namespace Crow
                }
                #endregion
 
+               /// <summary>
+               /// trigger the execution of the command
+               /// </summary>
                public void Execute(){
                        if (execute != null && CanExecute)
                                execute ();
index 000562d772dbf96b487644c7b8725009232f1cec..cb8b75b54124fd2261a79865f226289aad8065fe 100644 (file)
@@ -35,7 +35,7 @@ using System.Xml;
 using Crow.IML;
 
 
-namespace Crow
+namespace Crow.IML
 {
        public static class CompilerServices
        {
index 8f89dbfc321d8d6eb565c1e53d3e846fa81c9db8..39c3c9cb9c11e3b3e3baf15329c179f04bf27d97 100644 (file)
@@ -32,6 +32,9 @@ using System.Threading;
 
 namespace Crow
 {
+       /// <summary>
+       /// single element of configuration
+       /// </summary>
        public class ConfigItem {
                Type type;
                internal object curVal;
@@ -59,8 +62,26 @@ namespace Crow
                }
        }
        /// <summary>
-       /// Application wide Configuration utility
+       /// Application wide Configuration store utility
+       /// 
+       /// configuration files are automatically stored in **_user/.config/appname/app.config_** on close and every minutes
+       /// if some items have changed.
+       /// New items are automaticaly added on first use. Configuration class expose one templated Get and one Templated Set, so
+       /// creating, storing and retrieving config items is simple as:
+       /// 
+       /// ```csharp\n
+       ///     //storing\n
+       ///     Configuration.Set ("Option1", 42);\n
+       ///     //loading\n
+       ///     int op1 = Configuration.Get<int> ("Option1");\n
+       /// ```\n
        /// </summary>
+       /// 
+       /// **.config**  file are simple text files with per line, a key/value pair of the form `option=value`. Keys have to be unique
+       /// in the application scope.
+       /// 
+       /// When running the application for the first time, some default options may be necessary. Their can be defined
+       /// in a special embedded resource text file with the key '**appname.default.config**'
        public static class Configuration
        {
                volatile static bool isDirty = false;
@@ -118,10 +139,19 @@ namespace Crow
                                Thread.Sleep (1000);
                        }
                }
+               /// <summary>
+               /// retrive the value of the configuration key given in parameter
+               /// </summary>
+               /// <param name="key">option name</param>
                public static T Get<T>(string key)
                {
                        return !items.ContainsKey (key) ? default(T) : items [key].GetValue<T> ();
                }
+               /// <summary>
+               /// store the value of the configuration key given in parameter
+               /// </summary>
+               /// <param name="key">option name</param>
+               /// <param name="value">value for that option</param>
                public static void Set<T>(string key, T value)
                {
                        if (!items.ContainsKey (key)) {
index 06f248cc54cad606a12fec8c405e6b145db26cf6..d0a14f602e064b5be4c512b621ed5534a0f87546 100644 (file)
@@ -29,8 +29,16 @@ using System.Collections.Generic;
 
 namespace Crow
 {
+       /// <summary>
+       /// base class for drawing content to paint on backend
+       /// </summary>
        public abstract class Fill
        {
+               /// <summary>
+               /// set content of fill as source for drawing operations on the backend context
+               /// </summary>
+               /// <param name="ctx">backend context</param>
+               /// <param name="bounds">drawing operation bounding box</param>
                public abstract void SetAsSource (Cairo.Context ctx, Rectangle bounds = default(Rectangle));
                public static object Parse (string s){
                        if (string.IsNullOrEmpty (s))
index f8697f913ba07ba402afa771912a2b88eb855d12..5967d94e7490927df9acf65f0090e4c73eeaa9f3 100644 (file)
@@ -38,6 +38,9 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated button control
+       /// </summary>
     public class Button : TemplatedContainer
     {
                #region CTOR
index 3a63ba2c57b2eec79fd64c49180fbd71eff168fc..8ff06a30145e425e78943a32fee87e816622b628 100644 (file)
@@ -30,6 +30,9 @@ using System.Xml.Serialization;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated checkbox control
+       /// </summary>
        public class CheckBox : TemplatedControl
        {
                #region CTOR
index b47e8ffcf17f070e477e64840a5a91f3ef7edd04..b6165c05ef5a5a6e756e50aac63fd0cf83348b4b 100644 (file)
@@ -30,6 +30,9 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated color selector control
+       /// </summary>
        public class ColorPicker : TemplatedControl
        {
                #region CTOR
index 4dfc68f6f6ce603d65c7a740380e61477f6b8562..cb33d5024a1022a2067573737959e31c50327389 100644 (file)
@@ -30,6 +30,9 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// simple squarred rgb color selector
+       /// </summary>
        public class ColorSelector : GraphicObject
        {
                #region CTOR
index 85a04608d3601d550ae8a804ad1e698211b5e3fe..fbb4b953d8f58f19ade8d5ba06661a9baa93ae7b 100644 (file)
@@ -29,6 +29,9 @@ using System.Xml.Serialization;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated control for selecting value in a pop up list
+       /// </summary>
        public class ComboBox : ListBox
     {
                #region CTOR
index c7dfd78b3665baa8e520ed403ba5e8b71975d11e..05d63012d6ef70cc88904de96cd5d2f3e6f4f0e5 100644 (file)
@@ -33,6 +33,9 @@ using System.Threading;
 
 namespace Crow
 {
+       /// <summary>
+       /// simple container accepting one child
+       /// </summary>
     public class Container : PrivateContainer
     {
                #region CTOR
index ab5d4aba53ecbae451d69a8043b518265d47985e..9b876d91b4985a094f0224777cf69ebbf530aafe 100644 (file)
@@ -31,6 +31,9 @@ using System.IO;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated directory viewer
+       /// </summary>
        public class DirectoryView : TemplatedControl
        {
                #region CTOR
index 550e2eaf80ccc6026c129d2fd54de1bbd47d4949..76a5a9ee2645575e820fa48eeaae7ab3f01b4eb1 100644 (file)
@@ -35,6 +35,9 @@ using System.Text.RegularExpressions;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated control for selecting files
+       /// </summary>
        public class FileDialog: Window
        {
                #region CTOR
index e52485ac8f8263c262ea9465ae1f64de8810c42c..f65447b13353c7af33f948e2acae1d324908a8d3 100644 (file)
@@ -31,6 +31,9 @@ using System;
 
 namespace Crow
 {
+       /// <summary>
+       /// group container that stacked its children horizontally or vertically
+       /// </summary>
        public class GenericStack : Group
     {
                #region CTOR
index feea75207e0e4861ba34d3125c9acb0d461ee8d4..2523810ef23c81ba99dc2bc61e00e69fb7c6c11c 100644 (file)
@@ -32,9 +32,8 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 using Cairo;
-using System.Linq;
 using System.Diagnostics;
-using System.IO;
+using Crow.IML;
 
 namespace Crow
 {
@@ -188,6 +187,10 @@ namespace Crow
                protected object dataSource;
                string style;
                object tag;
+               bool isDragged;
+               bool allowDrag;
+               bool allowDrop;
+
                #endregion
 
                #region public fields
@@ -308,6 +311,8 @@ namespace Crow
                public event EventHandler Enabled;
                /// <summary>Occurs when the enabled state this object is set to false</summary>
                public event EventHandler Disabled;
+               public event EventHandler Dragged;
+               public event EventHandler Dropped;
                /// <summary>Occurs when one part of the rendering slot changed</summary>
                public event EventHandler<LayoutingEventArgs> LayoutChanged;
                /// <summary>Occurs when DataSource changed</summary>
@@ -1008,6 +1013,77 @@ namespace Crow
                        return false;
                }
 
+               #region Drag&Drop
+               [XmlAttributeAttribute][DefaultValue(false)]
+               public virtual bool AllowDrag {
+                       get { return allowDrag; }
+                       set {
+                               if (allowDrag == value)
+                                       return;
+                               allowDrag = value;
+                               NotifyValueChanged ("AllowDrag", allowDrag);
+                       }
+               }
+               [XmlAttributeAttribute][DefaultValue(false)]
+               public virtual bool AllowDrop {
+                       get { return allowDrop; }
+                       set {
+                               if (allowDrop == value)
+                                       return;
+                               allowDrop = value;
+                               NotifyValueChanged ("AllowDrop", allowDrop);
+                       }
+               }
+
+//             public List<Type> AllowedDroppedTypes;
+//             public void AddAllowedDroppedType (Type newType){
+//                     if (AllowedDroppedTypes == null)
+//                             AllowedDroppedTypes = new List<Type> ();
+//                     AllowedDroppedTypes.Add (newType);
+//                     NotifyValueChanged ("AllowDrop", AllowDrop);
+//             }
+//             [XmlIgnore]public virtual bool AllowDrop {
+//                     get { return AllowedDroppedTypes?.Count>0; }
+//             }
+               [XmlIgnore]public virtual bool IsDragged {
+                       get { return isDragged; }
+                       set {
+                               if (isDragged == value)
+                                       return;
+                               isDragged = value;
+
+                               if (isDragged) {
+                                       CurrentInterface.HoverWidget = null;
+                                       onStartDrag (this, null);
+                               }
+
+                               NotifyValueChanged ("IsDrag", IsDragged);
+                       }
+               }
+               /// <summary>
+               /// start dragging
+               /// </summary>
+               protected virtual void onStartDrag (object sender, EventArgs e){
+                       Debug.WriteLine("DRAG => " + this.ToString());
+                       Dragged.Raise (this, null);
+               }
+               /// <summary>
+               ///  Occured when dragging ends without dropping
+               /// </summary>
+               protected virtual void onEndDrag (object sender, EventArgs e){
+                       IsDragged = false;
+                       Debug.WriteLine("END DRAG => " + this.ToString());
+               }
+               /// <summary>
+               /// Dragging end with a dropping
+               /// </summary>
+               protected virtual void onDrop (object sender, EventArgs e){
+                       IsDragged = false;
+                       Debug.WriteLine("DROPPED => " + this.ToString());
+                       Dropped.Raise (this, null);
+               }
+               #endregion
+
                #region Queuing
                /// <summary>
                /// Register old and new slot for clipping
@@ -1299,7 +1375,7 @@ namespace Crow
 
                #region Rendering
                /// <summary> This is the common overridable drawing routine to create new widget </summary>
-               protected virtual void onDraw(Context gr)
+               protected virtual void onDraw(Cairo.Context gr)
                {
                        #if DEBUG_UPDATE
                        Debug.WriteLine (string.Format("OnDraw -> {0}", this.ToString ()));
@@ -1324,13 +1400,13 @@ namespace Crow
                        if (bmp != null)
                                bmp.Dispose ();
                        bmp = new ImageSurface (Format.Argb32, Slot.Width, Slot.Height);
-                       using (Context gr = new Context (bmp)) {
+                       using (Cairo.Context gr = new Cairo.Context (bmp)) {
                                gr.Antialias = Interface.Antialias;
                                onDraw (gr);
                        }
                        bmp.Flush ();
                }
-               protected virtual void UpdateCache(Context ctx){
+               protected virtual void UpdateCache(Cairo.Context ctx){
                        #if DEBUG_UPDATE
                        Debug.WriteLine (string.Format("UpdateCache -> {0}", this.ToString ()));
                        #endif
@@ -1349,7 +1425,7 @@ namespace Crow
                }
                /// <summary> Chained painting routine on the parent context of the actual cached version
                /// of the widget </summary>
-               public virtual void Paint (ref Context ctx)
+               public virtual void Paint (ref Cairo.Context ctx)
                {
                        #if DEBUG_UPDATE
                        Debug.WriteLine (string.Format("Paint -> {0}", this.ToString ()));
@@ -1385,7 +1461,7 @@ namespace Crow
                                LastPaintedSlot = Slot;
                        }
                }
-               void paintDisabled(Context gr, Rectangle rb){
+               void paintDisabled(Cairo.Context gr, Rectangle rb){
                        gr.Operator = Operator.Xor;
                        gr.SetSourceRGBA (0.6, 0.6, 0.6, 0.3);
                        gr.Rectangle (rb);
@@ -1410,7 +1486,7 @@ namespace Crow
                public virtual bool MouseIsIn(Point m)
                {
                        try {
-                               if (!(Visible & isEnabled))
+                               if (!(Visible & isEnabled)||IsDragged)
                                        return false;
                                if (ScreenCoordinates (Slot).ContainsOrIsEqual (m)) {
                                        Scroller scr = Parent as Scroller;
@@ -1437,6 +1513,9 @@ namespace Crow
                }
                public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
                {
+                       if (AllowDrag & !IsDragged & IsActive)
+                               IsDragged = true;
+
                        //bubble event to the top
                        GraphicObject p = Parent as GraphicObject;
                        if (p != null)
@@ -1468,6 +1547,18 @@ namespace Crow
                        MouseDown.Raise (this, e);
                }
                public virtual void onMouseUp(object sender, MouseButtonEventArgs e){
+                       if (IsDragged){
+                               bool dropOK = false;
+                               if (CurrentInterface.HoverWidget!=null) {
+                                       if (CurrentInterface.HoverWidget.AllowDrop)
+                                               dropOK = true;
+                               }
+                               if (dropOK)
+                                       onDrop (this, null);
+                               else
+                                       onEndDrag (this, null);
+                       }
+
                        //bubble event to the top
                        GraphicObject p = Parent as GraphicObject;
                        if (p != null)
index 551db8892dbbae92a7ec5b053dfe7150b0b8df05..2cfa377486b953153b5a377aeef459910a04ae55 100644 (file)
@@ -70,7 +70,7 @@ namespace Crow
                        g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
                        g.LayoutChanged += OnChildLayoutChanges;
                }
-        public virtual void RemoveChild(GraphicObject child)        
+        public virtual void RemoveChild(GraphicObject child)
                {
                        child.LayoutChanged -= OnChildLayoutChanges;
                        //check if HoverWidget is removed from Tree
@@ -87,7 +87,7 @@ namespace Crow
                                searchLargestChild ();
                        if (child == tallestChild && Height == Measure.Fit)
                                searchTallestChild ();
-                       
+
                        this.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
         }
                public virtual void ClearChildren()
@@ -107,26 +107,26 @@ namespace Crow
                        ChildrenCleared.Raise (this, new EventArgs ());
                }
 
-//             public void putWidgetOnTop(GraphicObject w)
-//             {
-//                     if (Children.Contains(w))
-//                     {
-//                             lock (children) {
-//                                     Children.Remove (w);
-//                                     Children.Add (w);
-//                             }
-//                     }
-//             }
-//             public void putWidgetOnBottom(GraphicObject w)
-//             {
-//                     if (Children.Contains(w))
-//                     {
-//                             lock (children) {
-//                                     Children.Remove (w);
-//                                     Children.Insert (0, w);
-//                             }
-//                     }
-//             }
+               public void putWidgetOnTop(GraphicObject w)
+               {
+                       if (Children.Contains(w))
+                       {
+                               lock (children) {
+                                       Children.Remove (w);
+                                       Children.Add (w);
+                               }
+                       }
+               }
+               public void putWidgetOnBottom(GraphicObject w)
+               {
+                       if (Children.Contains(w))
+                       {
+                               lock (children) {
+                                       Children.Remove (w);
+                                       Children.Insert (0, w);
+                               }
+                       }
+               }
 
                #region GraphicObject overrides
                public override void OnDataSourceChanged (object sender, DataSourceChangeEventArgs e)
@@ -185,7 +185,7 @@ namespace Crow
                        }
                        return base.measureRawSize (lt);
                }
-                       
+
                public override void OnLayoutChanges (LayoutingType layoutType)
                {
                        base.OnLayoutChanges (layoutType);
@@ -345,7 +345,7 @@ namespace Crow
                        }
                }
 
-       
+
                #region Mouse handling
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
index d843f9931a9c47c9ea3356226f7c01ccca48edc7..e5a170ae9ee5fd02fc9c90b68d86bfc48db5d517 100644 (file)
@@ -30,6 +30,9 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated container accepting one child
+       /// </summary>
     public class GroupBox : TemplatedContainer
     {          
                #region CTOR
index 13ed4cb5295667ba6d909eff04ae93c3fb1d1165..74e46e9c529e9450e2f4929e1c16bc14b6410acb 100644 (file)
@@ -32,6 +32,9 @@ using System.Xml.Serialization;
 
 namespace Crow
 {
+       /// <summary>
+       /// group control stacking its children horizontally
+       /// </summary>
     public class HorizontalStack : GenericStack
     {
                #region CTOR
index 3ec49d37dbe3a214c0ebcd8cc426b2131a913830..622fa714223ae915a0f1d9a7f88009bb58998bbd 100644 (file)
@@ -140,7 +140,7 @@ namespace Crow
                        else
                                pic = new BmpPicture ();
 
-                       pic.LoadImage (path);
+                       pic.Load (path);
                        pic.Scaled = scaled;
                        pic.KeepProportions = keepProps;
 
index 5565ace3ac652ada353f7e7daefb60e3c86898b3..cd2a54a8aebb730014779025bce8c6ff9a320c40 100644 (file)
@@ -156,7 +156,7 @@ namespace Crow
                }
                public override bool MouseIsIn (Point m)
                {
-                       return IsEnabled ? base.MouseIsIn (m) || child.MouseIsIn (m) : false;
+                       return IsEnabled && !IsDragged ? base.MouseIsIn (m) || child.MouseIsIn (m) : false;
                }
                public override void onMouseEnter (object sender, MouseMoveEventArgs e)
                {
index fb3cbf4802244bac37a1bd706010dc68050472f4..8d72668508d49eea472253da1c902dec0d4b2c69 100644 (file)
@@ -89,6 +89,7 @@ namespace Crow
                        grad.SetAsSource (gr, r);
                        CairoHelpers.CairoRectangle (gr, r, CornerRadius);
                        gr.Fill();
+
                }
 
                public override void Paint (ref Context ctx)
index 75a3b2dbe9bd95f9b4e644fa4d8379da979d9b8e..586ebbbeb4786c7e4623be833ab84357dc0b8c0d 100644 (file)
@@ -30,8 +30,13 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// templeted numeric control
+       /// </summary>
        public class ScrollBar : NumericControl
        {
+               //TODO:could be replaced by a template for a Slider
+
                Orientation _orientation;
 
                #region CTOR
index 7f7bd5dec0e4647ad8f4d6c8604507647dcb4c80..b68335f6154289eb7928781e4e977a37e953be9d 100644 (file)
@@ -32,6 +32,9 @@ using Cairo;
 
 namespace Crow
 {
+       /// <summary>
+       /// scrolling surface, to be contained in a smaller container in which it will be scrolled
+       /// </summary>
        public class Scroller : Container
        {
                #region CTOR
index 3d8c942cd16f3d832b481628f27b57e69e764336..7e61c392b3208c965ebd546a829ec99652a09333 100644 (file)
@@ -33,6 +33,9 @@ using Cairo;
 
 namespace Crow
 {
+       /// <summary>
+       /// generic class to build scrolling control in both directions
+       /// </summary>
        public class ScrollingObject : GraphicObject
        {
                #region CTOR
index bf43f2fa027c0770005eb78b367717dc560db867..bc879a9682832b4441844fa4dbeec74480a95eb1 100644 (file)
@@ -32,6 +32,10 @@ using System.Diagnostics;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated numeric control to select a value
+       /// by slidding a cursor
+       /// </summary>
        public class Slider : NumericControl
     {
                #region CTOR
index c29a2b2753d9de77d5608cbf3c35abc8811f66dc..69924a039123ad24e5106b78a02bf2b1977f00ca 100644 (file)
@@ -28,6 +28,10 @@ using System;
 
 namespace Crow
 {
+       /// <summary>
+       /// templated control for selecting a numeric value by clicking on
+       /// up and down buttons
+       /// </summary>
        public class Spinner : NumericControl
        {
                #region CTOR
index dab3937bf7008d79302bf8341be9f767f03c9f72..1258012eb642d8b88cb351c57789d7b49576276b 100644 (file)
@@ -30,6 +30,10 @@ using System.ComponentModel;
 
 namespace Crow
 {
+       /// <summary>
+       /// control to add between children of a Stack to allow them to be resized
+       /// with the pointer
+       /// </summary>
        public class Splitter : GraphicObject
        {
                #region CTOR
index afafb0f191d4efe7da873266b2be37f46ad843c9..2fdc3802bb0a0b4144d626b8db7c39ba79351dee 100644 (file)
@@ -140,7 +140,7 @@ namespace Crow
                #region Mouse Handling
                public override bool MouseIsIn (Point m)
                {
-                       if (!Visible)
+                       if (!(Visible & IsEnabled) || IsDragged)
                                return false;
 
                        bool mouseIsInTitle = TabTitle.ScreenCoordinates (TabTitle.Slot).ContainsOrIsEqual (m);
index dda03119623ef907c3885e1db95dd3232c18e004..aaeb77f64965e735d9581c0893ea432980df2daf 100644 (file)
@@ -33,6 +33,7 @@ using System.ComponentModel;
 using System.Collections;
 using System.Threading;
 using System.Linq;
+using Crow.IML;
 
 namespace Crow
 {
index 23271624cf8b3cf2a9e3ad29523c260824bc4502..d0122373966347cf2ebe3ff91bc6285d6e0d371f 100644 (file)
@@ -31,6 +31,9 @@ using System.Text;
 
 namespace Crow
 {
+       /// <summary>
+       /// group control stacking its children vertically
+       /// </summary>
     public class VerticalStack : GenericStack
     {
                public VerticalStack() : base(){}
index 336784e29fba7ad51f5a76b5e17942ad40eb496b..d1f3437483c4f7a550572667fde44014b3d846d3 100644 (file)
@@ -33,7 +33,7 @@ namespace Crow
 {
        public class Window : TemplatedContainer
        {
-               enum Direction
+               protected enum Direction
                {
                        None,
                        N,
@@ -49,7 +49,7 @@ namespace Crow
                string _icon;
                bool _resizable;
                bool _movable;
-               bool hoverBorder = false;
+               protected bool hoverBorder = false;
                bool alwaysOnTop = false;
 
                Rectangle savedBounds;
@@ -369,13 +369,13 @@ namespace Crow
 
                        Minimize.Raise (sender, e);
                }
-               protected void onBorderMouseLeave (object sender, MouseMoveEventArgs e)
+               protected virtual void onBorderMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        hoverBorder = false;
                        currentDirection = Direction.None;
                        CurrentInterface.MouseCursor = XCursor.Default;
                }
-               protected void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
+               protected virtual void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
                {
                        hoverBorder = true;
                }
index 81dce15405fb2ae402de5d38a132ed4a69f6dd63..cfa1736f928ead74e396cecc7afdf4cd1e8ccb2f 100644 (file)
@@ -28,6 +28,10 @@ using System;
 
 namespace Crow
 {
+       /// <summary>
+       /// group control that arrange its children in a direction and jump to
+       /// the next line or row when no room is left
+       /// </summary>
        public class Wrapper : GenericStack
        {
                #region CTOR
index ddeccbd94816d6fb945a15687abff390d4cb7980..7aaa851cbb8d0ebf17df8ba0e4dabfa7cd0b18bf 100644 (file)
 using System;
 using System.Reflection.Emit;
 
-namespace Crow
+namespace Crow.IML
 {
        /// <summary>
-       /// Expression token, a variable, a string constant or a parsable constant (having a static Parse method)
-       /// '../' => 1 level up in graphic tree
-       /// './' or '/' => template root level
-       /// '.Name1.Name2' current level properties
-       /// 'name.prop' named descendant in graphic tree, search with 'FindByName' method of GraphicObject
+       /// Binding expression parser.
+       /// 
+       /// Valid tokens in binding expression:
+       /// - '../' => 1 level up in graphic tree
+       /// - './' or '/' => template root level
+       /// - '.Name1.Name2' current level properties
+       /// - 'name.prop' named descendant in graphic tree, search with 'FindByName' method of GraphicObject
        /// </summary>
        public class BindingMember
        {
@@ -71,7 +73,14 @@ namespace Crow
                public bool IsSingleName { get { return LevelsUp == 0 && Tokens.Length == 1; }}
 
                #region CTOR
+               /// <summary>
+               /// Initializes a new instance of BindingMember.
+               /// </summary>
                public BindingMember (){}
+               /// <summary>
+               /// Initializes a new instance of BindingMember by parsing the string passed as argument
+               /// </summary>
+               /// <param name="expression">binding expression</param>
                public BindingMember (string expression){
                        if (string.IsNullOrEmpty (expression))
                                return;
@@ -104,6 +113,11 @@ namespace Crow
                }
                #endregion
 
+               /// <summary>
+               /// Emits the MSIL instructions to get the target of the binding expression
+               /// </summary>
+               /// <param name="il">current MSIL generator</param>
+               /// <param name="cancel">cancel branching in MSIL if something go wrong</param>
                public void emitGetTarget(ILGenerator il, System.Reflection.Emit.Label cancel){
 
                        if (IsTemplateBinding) {
@@ -145,6 +159,11 @@ namespace Crow
                                il.Emit (OpCodes.Brfalse, cancel);
                        }
                }
+               /// <summary>
+               /// Emit the MSIL instructions to get the target property of the binding expression
+               /// </summary>
+               /// <param name="il">current MSIL generator</param>
+               /// <param name="cancel">cancel branching in MSIL if something go wrong</param>
                public void emitGetProperty(ILGenerator il, System.Reflection.Emit.Label cancel) {
                        System.Reflection.Emit.Label miOK = il.DefineLabel ();
                        il.Emit (OpCodes.Dup);//duplicate instance
@@ -157,6 +176,10 @@ namespace Crow
                        il.MarkLabel (miOK);
                        il.Emit (OpCodes.Call, CompilerServices.miGetValWithRefx);
                }
+               /// <summary>
+               /// Emit the MSIL instructions to set the target property of the binding expression
+               /// </summary>
+               /// <param name="il">current MSIL generator</param>
                public void emitSetProperty(ILGenerator il) {
                        il.Emit (OpCodes.Ldstr, Tokens [Tokens.Length -1]);//load member name
                        il.Emit (OpCodes.Call, CompilerServices.miSetValWithRefx);
index ed3a4f07c18fd067012776b6b78b0a4f47f7b439..a1012e2b339b7d75a6d715c5836184c67f85502e 100644 (file)
@@ -137,7 +137,7 @@ namespace Crow
                /// Parses IML and build a dynamic method that will be used to instanciate one or multiple occurence of the IML file or fragment
                /// </summary>
                void parseIML (XmlTextReader reader) {
-                       Context ctx = new Context (findRootType (reader));
+                       IMLContext ctx = new IMLContext (findRootType (reader));
 
                        ctx.nodesStack.Push (new Node (ctx.RootType));
                        emitLoader (reader, ctx);
@@ -175,7 +175,7 @@ namespace Crow
                                throw new Exception ("IML parsing error: undefined root type (" + root + ")");
                        return t;
                }
-               void emitLoader (XmlTextReader reader, Context ctx)
+               void emitLoader (XmlTextReader reader, IMLContext ctx)
                {
                        string tmpXml = reader.ReadOuterXml ();
 
@@ -192,7 +192,7 @@ namespace Crow
                /// </summary>
                /// <param name="ctx">Loading Context</param>
                /// <param name="tmpXml">xml fragment</param>
-               void emitTemplateLoad (Context ctx, string tmpXml) {
+               void emitTemplateLoad (IMLContext ctx, string tmpXml) {
                        //if its a template, first read template elements
                        using (XmlTextReader reader = new XmlTextReader (tmpXml, XmlNodeType.Element, null)) {
                                List<string[]> itemTemplateIds = new List<string[]> ();
@@ -278,7 +278,7 @@ namespace Crow
                /// </summary>
                /// <param name="ctx">parsing context</param>
                /// <param name="tmpXml">xml fragment</param>
-               void emitGOLoad (Context ctx, string tmpXml) {
+               void emitGOLoad (IMLContext ctx, string tmpXml) {
                        using (XmlTextReader reader = new XmlTextReader (tmpXml, XmlNodeType.Element, null)) {
                                reader.Read ();
 
@@ -340,7 +340,7 @@ namespace Crow
                /// <summary>
                /// Parse child node an generate corresponding msil
                /// </summary>
-               void readChildren (XmlTextReader reader, Context ctx, int startingIdx = 0)
+               void readChildren (XmlTextReader reader, IMLContext ctx, int startingIdx = 0)
                {
                        bool endTagReached = false;
                        int nodeIdx = startingIdx;
@@ -392,7 +392,7 @@ namespace Crow
                }
                #endregion
 
-               void readPropertyBinding (Context ctx, string sourceMember, string expression)
+               void readPropertyBinding (IMLContext ctx, string sourceMember, string expression)
                {
                        NodeAddress sourceNA = ctx.CurrentNodeAddress;
                        BindingDefinition bindingDef = sourceNA.GetBindingDef (sourceMember, expression);
@@ -439,7 +439,7 @@ namespace Crow
                /// Compile events expression in IML attributes, and store the result in the instanciator
                /// Those handlers will be bound when instatiing
                /// </summary>
-               void compileAndStoreDynHandler (Context ctx, EventInfo sourceEvent, string expression)
+               void compileAndStoreDynHandler (IMLContext ctx, EventInfo sourceEvent, string expression)
                {
                        //store event handler dynamic method in instanciator
                        int dmIdx = cachedDelegates.Count;
@@ -447,7 +447,7 @@ namespace Crow
                        ctx.emitCachedDelegateHandlerAddition(dmIdx, sourceEvent);
                }
                /// <summary> Emits handler method bindings </summary>
-               void emitHandlerBinding (Context ctx, EventInfo sourceEvent, string expression){
+               void emitHandlerBinding (IMLContext ctx, EventInfo sourceEvent, string expression){
                        NodeAddress currentNode = ctx.CurrentNodeAddress;
                        BindingDefinition bindingDef = currentNode.GetBindingDef (sourceEvent.Name, expression);
 
@@ -526,7 +526,7 @@ namespace Crow
                /// those delegates uses grtree functions to set destination value so they don't
                /// need to be bound to destination instance as in the ancient system.
                /// </summary>
-               void emitBindingDelegates(Context ctx){
+               void emitBindingDelegates(IMLContext ctx){
                        foreach (KeyValuePair<NodeAddress,Dictionary<string, List<MemberAddress>>> bindings in ctx.Bindings ) {
                                if (bindings.Key.Count == 0)//template binding
                                        emitTemplateBindings (ctx, bindings.Value);
@@ -534,7 +534,7 @@ namespace Crow
                                        emitPropertyBindings (ctx,  bindings.Key, bindings.Value);
                        }
                }
-               void emitPropertyBindings(Context ctx, NodeAddress origine, Dictionary<string, List<MemberAddress>> bindings){
+               void emitPropertyBindings(IMLContext ctx, NodeAddress origine, Dictionary<string, List<MemberAddress>> bindings){
                        Type origineNodeType = origine.NodeType;
 
                        //value changed dyn method
@@ -634,7 +634,7 @@ namespace Crow
                        #endif
 
                }
-               void emitTemplateBindings(Context ctx, Dictionary<string, List<MemberAddress>> bindings){
+               void emitTemplateBindings(IMLContext ctx, Dictionary<string, List<MemberAddress>> bindings){
                        //value changed dyn method
                        DynamicMethod dm = new DynamicMethod ("dyn_tmpValueChanged",
                                typeof (void), CompilerServices.argsValueChange, true);
@@ -786,7 +786,7 @@ namespace Crow
                /// <summary>
                /// create the valuechanged handler, the datasourcechanged handler and emit event handling
                /// </summary>
-               void emitDataSourceBindings(Context ctx, BindingDefinition bindingDef){
+               void emitDataSourceBindings(IMLContext ctx, BindingDefinition bindingDef){
                        DynamicMethod dm = null;
                        ILGenerator il = null;
                        int dmVC = 0;
index 7d6911523d8afb6e255cafd47514d08b93bd2333..15c6de35493585934aadc20a8bdb236ace6c9dd0 100644 (file)
@@ -749,7 +749,8 @@ namespace Crow
                                //TODO, ensure object is still in the graphic tree
                                //send move evt even if mouse move outside bounds
                                ActiveWidget.onMouseMove (this, e);
-                               return true;
+                               if (!ActiveWidget.IsDragged)//if active is dragged, process mouse move as it was not visible.
+                                       return true;
                        }
 
                        if (HoverWidget != null) {
index fc7d90638ddce89aeba66058eb9cdc12f1b9b403..d866bc192e3c11dde9ea785b7b041fa0a5790343 100644 (file)
@@ -34,6 +34,7 @@ using System.Xml;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using Crow.IML;
 
 namespace Crow
 {