]> O.S.I.I.S - jp/crow.git/commitdiff
* GOLib.csproj: removed unused WinForm ref, add readme
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 15 Sep 2015 13:20:28 +0000 (15:20 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 15 Sep 2015 13:20:28 +0000 (15:20 +0200)
* README.md:
* Tests.csproj:
* Listbox.goml:
* tmpMembers.goml:
* test_Listbox.goml:
* testTypeViewer.goml:
* CompilerServices.cs: debug

GOLib.csproj
README.md
Templates/Listbox.goml
Tests/GOLIBTest_deviceOffset.cs [new file with mode: 0644]
Tests/Interfaces/testTypeViewer.goml
Tests/Interfaces/test_Listbox.goml
Tests/Interfaces/tmpMembers.goml
Tests/Tests.csproj
src/CompilerServices/CompilerServices.cs

index 8fcc21bb7150a4910474705f69decdd866e78496..dc6912a6b8262836280d850362fecb138af38884 100644 (file)
     <Reference Include="System" />\r
     <Reference Include="System.Data" />\r
     <Reference Include="System.Drawing" />\r
-    <Reference Include="System.Windows.Forms" />\r
     <Reference Include="System.Xml" />\r
     <Reference Include="rsvg2-sharp, Version=2.18.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">\r
       <Package>rsvg2-sharp-2.0</Package>\r
     <None Include="Images\Icons\Cursors\hand" />\r
     <None Include="Images\Icons\Cursors\help" />\r
     <None Include="Images\Icons\Cursors\move" />\r
+    <None Include="README.md" />\r
   </ItemGroup>\r
 </Project>\r
index 4dcf1202a15bb9dd8a7a59972f4ce30336a4635b..d0c339a953cff65be095cf1876431b155a231ed0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,14 +1,47 @@
-#GOLib
+GOLib
+=====
 
-Graphic Object Library: custom widget library c# version.
+GOLib stands for 'Graphic Object Library' which is a pure c# widget toolkit with templates and bindings.
+Running under Mono, With multi-platform libraries (Cairo, OpenTK) it should run on any target.
+
+The main advantage of this toolkit is it's simplicity and it's coherence. Thanks to the job done by 
+OpenTK team on linux drm/kms support, GOLib may run without a X server directely in console.
+
+Graphic Rendering stack could easily be changed by implementing IGOLibHost, and a custom (and lighter) opengl rendering replacement for cairo is on the stack.
+
+FEATURES
+========
 
 - Use OpenTK as top container for device abstraction layer by default, (other container: GTK, GDK)
-- Allow easy creation of XAML like interface under linux directely in console mode, without X
-  It only required Mono,Mesa,GBM and DRM libraries.
-- Templated controls, with dynamic binding
-- inlined delegate in XML
 - Curent drawing routines use Mono.Cairo
-
+- Allow easy creation of XAML like interface under linux directely in console mode, without X
+  It only required Mono with cairo libraries, OpenTK, Mesa, GBM and DRM libraries.
+- Templated controls, with dynamic binding.
+- Inlined delegate in XML
+
+Building
+========
+
+#####Build latest OpenTK:
+```
+git clone https://github.com/opentk/opentk   # Download source code from git
+cd opentk                                    # Enter the source directory
+msbuild /p:Configuration=Release OpenTK.sln  # Build on .Net (Windows)
+xbuild  /p:Configuration=Release OpenTK.sln  # Build on Mono (Linux / Mac OS X)
+```
+#####Install Cairo and RSVG cli bindings
+######On Debian:
+
+```
+sudo apt-get install libmono-cairo4.0-cil libglib3.0-cil librsvg2-2.18-cil
+```
+#####Build GOLib
+```
+git clone https://github.com/jpbruyere/GOLib.git       # Download source code from git
+cd GOLib                                               # Enter the source directory
+msbuild /p:Configuration=Release GOLib.sln             # Build on .Net (Windows)
+xbuild  /p:Configuration=Release GOLib.sln             # Build on Mono (Linux / Mac OS X)
+```
 #####GOLib in action
 
 ![GOLib in action](/screenshot1.png?raw=true "golib")
@@ -17,12 +50,4 @@ Graphic Object Library: custom widget library c# version.
 
 ![GOLib in action](/magic3d.png?raw=true "Magic3d")
 
-RoadMap:
 
-       - TreeView (templated)
-         Menu, Combobox, PangoLayouting controls, Improved editor
-       - Monodevelop addin
-       - improve inline delegates to handle all conversion and graphic tree parsing with directory navigation syntax
-       - Make an easyly compilable example of complete application (3d mesh editor for example)
-       - inlined SVG with binding and c# scripting for animation
-       - simplified Image subElement.
index 0e5f70b657232cbd543f3869611a1ed1b43a0ec9..ee903bc384dd6cade30ac24b71276cc1e9161f38 100755 (executable)
@@ -1,4 +1,10 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
+<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
        <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+</Border>-->\r
+<Border BorderWidth="1" Margin="1" MinimumSize="100;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
+       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
+               Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
+               <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+       </Scroller>\r
 </Border>
\ No newline at end of file
diff --git a/Tests/GOLIBTest_deviceOffset.cs b/Tests/GOLIBTest_deviceOffset.cs
new file mode 100644 (file)
index 0000000..a41cdb4
--- /dev/null
@@ -0,0 +1,88 @@
+#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
+\r
+\r
+namespace test6\r
+{\r
+       class GOLIBTest_0 : OpenTKGameWindow\r
+       {\r
+               public GOLIBTest_0 ()\r
+                       : base(1024, 600,"test")\r
+               {}\r
+\r
+               GraphicObject g;\r
+               Label l;\r
+\r
+               protected override void OnLoad (EventArgs e)\r
+               {\r
+                       base.OnLoad (e);\r
+                       g = LoadInterface("Interfaces/test0.goml");\r
+                       l = g.FindByName ("labCpt") as Label;\r
+               }\r
+\r
+               void onUp (object sender, MouseButtonEventArgs e)\r
+               {\r
+                       decimal tmp = 0;\r
+                       if (!decimal.TryParse (l.Text, out tmp))\r
+                               return;\r
+                       \r
+                       tmp += 1;\r
+                       l.Text = tmp.ToString ();\r
+               }\r
+               void onDown (object sender, MouseButtonEventArgs e)\r
+               {\r
+                       decimal tmp = 0;\r
+                       if (!decimal.TryParse (l.Text, out tmp))\r
+                               return;\r
+\r
+                       tmp -= 1;\r
+                       l.Text = tmp.ToString ();\r
+               }\r
+\r
+               protected override void OnKeyDown (KeyboardKeyEventArgs e)\r
+               {\r
+                       switch (e.Key) {\r
+                       case Key.Left:\r
+                               g.Left++;\r
+                               break;\r
+                       case Key.Right:\r
+                               g.Left--;\r
+                               break;\r
+                       case Key.Up:\r
+                               g.Top--;\r
+                               break;\r
+                       case Key.Down:\r
+                               g.Top++;\r
+                               break;\r
+                       default:\r
+                               break;\r
+                       }\r
+               }\r
+               protected override void OnUpdateFrame (FrameEventArgs e)\r
+               {\r
+                       base.OnUpdateFrame (e);\r
+               }\r
+\r
+               [STAThread]\r
+               static void Main ()\r
+               {\r
+                       Console.WriteLine ("starting example");\r
+\r
+                       using (GOLIBTest_0 win = new GOLIBTest_0( )) {\r
+                               win.Run (30.0);\r
+                       }\r
+               }\r
+       }\r
+}
\ No newline at end of file
index aea7ca077befd6eca8a916d9a2f2705e86db84ea..8055d5028b745b4cc54567b67291f2692c9792cc 100755 (executable)
@@ -5,17 +5,6 @@
                        <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>
index 600a03171a4acce44e76c274094c0931d77964eb..b132a87e47b1227f1360e90a95dbde9731222246 100755 (executable)
@@ -1,17 +1,21 @@
 <?xml version="1.0"?>\r
 <!--<ListBox Data="{TestList}" Focusable="true"/>-->\r
 <ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"\r
-                        HorizontalAlignment="Left">\r
+                        HorizontalAlignment="Left" Width="0" Height="0" Margin="50">\r
+<!--   <Template>\r
+               <Border BorderWidth="1" Margin="1" MinimumSize="100;100" Width="0" Height="0" >\r
+                       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true" \r
+                               Height="0" Width="0">\r
+                               <VerticalStack Height="-1" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+                       </Scroller>\r
+               </Border>\r
+       </Template>-->\r
        <Template>\r
-               <Border BorderWidth="1" Margin="1" MinimumSize="0;100" >\r
-                       <HorizontalStack>\r
-                               <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true" \r
-                                                       ScrollY="{../scrollbar1.Scroll}">\r
-                                       <VerticalStack Height="-1" Name="List" Margin="0" VerticalAlignment="Top"/>\r
-                               </Scroller>\r
-                               <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
-                                       Orientation="Vertical" Width="10" />\r
-                       </HorizontalStack>\r
+               <Border BorderWidth="1" Margin="1" MinimumSize="100;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
+                       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true" \r
+                               Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
+                               <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+                       </Scroller>\r
                </Border>\r
        </Template>\r
 </ListBox>\r
index 9b24ae33eec38be92ae393ecd771be662f1e829d..4c823e720138bc39174230c485fef2c26c5e2cd7 100755 (executable)
@@ -2,8 +2,8 @@
        <HorizontalStack Width="0" Height="-1" Focusable="true" \r
                        MouseEnter="{Background=Red}"\r
                        MouseLeave="{Background=Transparent}">\r
-               <Label Text="{Name}" Width="0" Height="-1" Margin="2" Background="Gray"/>\r
-               <Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>\r
                <Image Width="8" Height="8" Path="#go.Images.Icons.member.svg" SvgSub="{GetIcon}"/>\r
+               <Label Text="{Name}" Width="0" Height="-1" Margin="2"/>\r
+               <Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>\r
        </HorizontalStack>\r
 \r
index ce5f48b7397f01fa6d9433c9b84eaa2d946e775d..6e504bad637e6d1ce830d7bb21076b7ed4002378 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>test.GOLIBTests</StartupObject>
+    <StartupObject>test.GOLIBTest_TypeViewer</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <OutputPath>..\bin\$(configuration)</OutputPath>
     <IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Drawing" />
     <Reference Include="OpenTK">
       <HintPath>..\..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>
     </Reference>
+    <Reference Include="Mono.Cairo" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="GOLIBTest_5.cs" />
index 06867c016da378d3c2860cbac32b6bb2d2279c68..4dd6519537e12292742cfc05deb9143487cccc12 100644 (file)
@@ -212,7 +212,7 @@ namespace go
                                }else
                                        throw new Exception ("unandled source member type for binding");
                        }
-                       if (miSrc != null){
+//                     if (miSrc != null){
                                if (miDst.MemberType == MemberTypes.Property) {
                                        PropertyInfo piDst = miDst as PropertyInfo;
                                        //TODO: handle other dest type conversions
@@ -228,7 +228,7 @@ namespace go
                                        fiDst.SetValue (binding.Source, srcVal );
                                }else
                                        throw new Exception("unandled destination member type for binding");
-                       }
+//                     }
                        #endregion
 
                        #region Retrieve EventHandler parameter type