]> O.S.I.I.S - jp/crow.git/commitdiff
code cleaning
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 9 Sep 2015 07:47:45 +0000 (09:47 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 9 Sep 2015 07:47:45 +0000 (09:47 +0200)
Images/Icons/exit2.svg [new file with mode: 0644]
Tests/GOLIBTest_DirViewer.cs [new file with mode: 0644]
Tests/Interfaces/testDirViewer.goml [new file with mode: 0755]
Tests/Interfaces/tmpDirItem.goml [new file with mode: 0755]
src/Size.cs

diff --git a/Images/Icons/exit2.svg b/Images/Icons/exit2.svg
new file mode 100644 (file)
index 0000000..2361ba8
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<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"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="64"
+   height="64"
+   viewBox="0 0 64 64.000002"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="exit.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.6992188"
+     inkscape:cx="-80.264621"
+     inkscape:cy="63.946457"
+     inkscape:document-units="px"
+     inkscape:current-layer="svg2"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="1280"
+     inkscape:window-height="1009"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1" />
+  <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 />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <path
+     style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:9;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+     d="m 13.884262,15.143117 c 24.231966,13.49131 34.18672,34.186719 34.18672,34.186719"
+     id="path4175"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cc" />
+  <path
+     sodipodi:nodetypes="cc"
+     inkscape:connector-curvature="0"
+     id="path4177"
+     d="M 50.43178,15.408178 C 20.436536,37.282439 16.245061,49.594898 16.245061,49.594898"
+     style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:9;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+</svg>
diff --git a/Tests/GOLIBTest_DirViewer.cs b/Tests/GOLIBTest_DirViewer.cs
new file mode 100644 (file)
index 0000000..1980f58
--- /dev/null
@@ -0,0 +1,84 @@
+#define MONO_CAIRO_DEBUG_DISPOSE\r
+\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using OpenTK;\r
+using OpenTK.Graphics.OpenGL;\r
+using OpenTK.Input;\r
+\r
+using System.Diagnostics;\r
+\r
+//using GGL;\r
+using go;\r
+using System.Threading;\r
+using System.Reflection;\r
+using System.Linq;\r
+\r
+\r
+namespace test\r
+{\r
+       class GOLIBTest_TypeViewer : OpenTKGameWindow\r
+       {\r
+               public GOLIBTest_TypeViewer ()\r
+                       : base(1024, 600,"test")\r
+               {}\r
+\r
+               VerticalStack g;\r
+               TypeContainer type;\r
+\r
+               protected override void OnLoad (EventArgs e)\r
+               {\r
+                       base.OnLoad (e);\r
+                       type = new TypeContainer(typeof (GraphicObject));\r
+\r
+                       this.AddWidget(Interface.Load ("Interfaces/testTypeViewer.goml", type));\r
+                       //LoadInterface("Interfaces/testTypeViewer.goml", out g);\r
+               }\r
+\r
+               protected override void OnRenderFrame (FrameEventArgs e)\r
+               {\r
+                       GL.Clear (ClearBufferMask.ColorBufferBit);\r
+                       base.OnRenderFrame (e);\r
+                       SwapBuffers ();\r
+\r
+                       MemberInfo mi;\r
+\r
+\r
+               }\r
+\r
+               [STAThread]\r
+               static void Main ()\r
+               {\r
+                       Console.WriteLine ("starting example");\r
+\r
+                       using (GOLIBTest_TypeViewer win = new GOLIBTest_TypeViewer( )) {\r
+                               win.Run (30.0);\r
+                       }\r
+               }\r
+       }\r
+       public class TypeContainer\r
+       {\r
+               public Type Type;\r
+               public TypeContainer(Type _type){\r
+                       Type = _type;\r
+               }\r
+               public string Name {\r
+                       get { return Type.Name; }\r
+               }\r
+               public MemberInfo[] Members {\r
+                       get {\r
+                               MemberInfo[] mi = Properties.Cast<MemberInfo> ().Concat (Methods.Cast<MemberInfo> ()).ToArray(); \r
+                               return mi;\r
+                       }\r
+               }\r
+               public MethodInfo[] Methods {\r
+                       get { return Type.GetMethods (BindingFlags.Public | BindingFlags.Instance).Where (m => !m.IsSpecialName).ToArray(); }\r
+               }\r
+               public PropertyInfo[] Properties {\r
+                       get { return Type.GetProperties (); }\r
+               }\r
+                               \r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/Tests/Interfaces/testDirViewer.goml b/Tests/Interfaces/testDirViewer.goml
new file mode 100755 (executable)
index 0000000..aea7ca0
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+
+       <VerticalStack Height="-1" Width="250" Name="hstack" Margin="0" Spacing="0">
+               <Border Height="-1" Width="0" BorderWidth="2" CornerRadius="10">
+                       <Label Name="labName" Text="{Name}" Width="0" Height="-1"/>
+               </Border>
+               <ListBox Data="{Members}" Width="0" Height="400" ItemTemplate="Interfaces/tmpMembers.goml" Focusable="true">
+                       <Template>
+                               <Border Width="0" Height="0" BorderWidth="1" Margin="1" MinimumSize="0;100" >
+                                       <HorizontalStack Width="0" Height="0">
+                                               <Scroller  Name="scroller1" Height="0" Width="0"  
+                                                Margin="10" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
+                                                       <VerticalStack Width="0" Height="-1" Name="List" Margin="0" VerticalAlignment="Top"/>
+                                               </Scroller>
+                                               <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
+                                                       Orientation="Vertical" Width="10" />
+                                       </HorizontalStack>
+                               </Border>
+                       </Template>
+               </ListBox>
+       </VerticalStack>
diff --git a/Tests/Interfaces/tmpDirItem.goml b/Tests/Interfaces/tmpDirItem.goml
new file mode 100755 (executable)
index 0000000..12a2b75
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>\r
+       <HorizontalStack Width="0" Height="-1" Focusable="true" \r
+                       MouseEnter="{Background=Red}"\r
+                       MouseLeave="{Background=Transparent}">\r
+               <Image Width="8" Height="8" Path="#go.Images.Icons.member.svg" SvgSub="{GetIcon}"/>\r
+               <Label Text="{Name}" Width="0" Height="-1" Margin="0"/>\r
+               <Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>\r
+       </HorizontalStack>\r
+\r
index c22315768412b70e80dc2bbaa0923cb68ef517e6..e5d2c0f5e2d9e550385a18ee97deda5787c0bf29 100755 (executable)
@@ -33,6 +33,7 @@ namespace go
             get { return _height; }\r
             set { _height = value; }\r
         }\r
+\r
                #region operators\r
                public static implicit operator Rectangle(Size s)\r
                {\r