From 63e0f0e6ffa2703ba128409b967dfe7b1135d6c4 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 15 Sep 2015 15:20:28 +0200 Subject: [PATCH] * GOLib.csproj: removed unused WinForm ref, add readme * README.md: * Tests.csproj: * Listbox.goml: * tmpMembers.goml: * test_Listbox.goml: * testTypeViewer.goml: * CompilerServices.cs: debug --- GOLib.csproj | 2 +- README.md | 55 +++++++++++---- Templates/Listbox.goml | 8 ++- Tests/GOLIBTest_deviceOffset.cs | 88 ++++++++++++++++++++++++ Tests/Interfaces/testTypeViewer.goml | 13 +--- Tests/Interfaces/test_Listbox.goml | 24 ++++--- Tests/Interfaces/tmpMembers.goml | 4 +- Tests/Tests.csproj | 4 +- src/CompilerServices/CompilerServices.cs | 4 +- 9 files changed, 157 insertions(+), 45 deletions(-) create mode 100644 Tests/GOLIBTest_deviceOffset.cs diff --git a/GOLib.csproj b/GOLib.csproj index 8fcc21bb..dc6912a6 100644 --- a/GOLib.csproj +++ b/GOLib.csproj @@ -124,7 +124,6 @@ - rsvg2-sharp-2.0 @@ -203,5 +202,6 @@ + diff --git a/README.md b/README.md index 4dcf1202..d0c339a9 100644 --- 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. diff --git a/Templates/Listbox.goml b/Templates/Listbox.goml index 0e5f70b6..ee903bc3 100755 --- a/Templates/Listbox.goml +++ b/Templates/Listbox.goml @@ -1,4 +1,10 @@  - + + + + + \ No newline at end of file diff --git a/Tests/GOLIBTest_deviceOffset.cs b/Tests/GOLIBTest_deviceOffset.cs new file mode 100644 index 00000000..a41cdb41 --- /dev/null +++ b/Tests/GOLIBTest_deviceOffset.cs @@ -0,0 +1,88 @@ +#define MONO_CAIRO_DEBUG_DISPOSE + + +using System; +using System.Runtime.InteropServices; +using OpenTK; +using OpenTK.Graphics.OpenGL; +using OpenTK.Input; + +using System.Diagnostics; + +//using GGL; +using go; +using System.Threading; + + +namespace test6 +{ + class GOLIBTest_0 : OpenTKGameWindow + { + public GOLIBTest_0 () + : base(1024, 600,"test") + {} + + GraphicObject g; + Label l; + + protected override void OnLoad (EventArgs e) + { + base.OnLoad (e); + g = LoadInterface("Interfaces/test0.goml"); + l = g.FindByName ("labCpt") as Label; + } + + void onUp (object sender, MouseButtonEventArgs e) + { + decimal tmp = 0; + if (!decimal.TryParse (l.Text, out tmp)) + return; + + tmp += 1; + l.Text = tmp.ToString (); + } + void onDown (object sender, MouseButtonEventArgs e) + { + decimal tmp = 0; + if (!decimal.TryParse (l.Text, out tmp)) + return; + + tmp -= 1; + l.Text = tmp.ToString (); + } + + protected override void OnKeyDown (KeyboardKeyEventArgs e) + { + switch (e.Key) { + case Key.Left: + g.Left++; + break; + case Key.Right: + g.Left--; + break; + case Key.Up: + g.Top--; + break; + case Key.Down: + g.Top++; + break; + default: + break; + } + } + protected override void OnUpdateFrame (FrameEventArgs e) + { + base.OnUpdateFrame (e); + } + + [STAThread] + static void Main () + { + Console.WriteLine ("starting example"); + + using (GOLIBTest_0 win = new GOLIBTest_0( )) { + win.Run (30.0); + } + } + } +} \ No newline at end of file diff --git a/Tests/Interfaces/testTypeViewer.goml b/Tests/Interfaces/testTypeViewer.goml index aea7ca07..8055d502 100755 --- a/Tests/Interfaces/testTypeViewer.goml +++ b/Tests/Interfaces/testTypeViewer.goml @@ -5,17 +5,6 @@ - + diff --git a/Tests/Interfaces/test_Listbox.goml b/Tests/Interfaces/test_Listbox.goml index 600a0317..b132a87e 100755 --- a/Tests/Interfaces/test_Listbox.goml +++ b/Tests/Interfaces/test_Listbox.goml @@ -1,17 +1,21 @@  + HorizontalAlignment="Left" Width="0" Height="0" Margin="50"> + diff --git a/Tests/Interfaces/tmpMembers.goml b/Tests/Interfaces/tmpMembers.goml index 9b24ae33..4c823e72 100755 --- a/Tests/Interfaces/tmpMembers.goml +++ b/Tests/Interfaces/tmpMembers.goml @@ -2,8 +2,8 @@ - diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index ce5f48b7..6e504bad 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -8,7 +8,7 @@ Exe Tests Tests - test.GOLIBTests + test.GOLIBTest_TypeViewer v4.5 ..\bin\$(configuration) obj\$(configuration) @@ -37,11 +37,11 @@ - ..\..\opentk\Binaries\OpenTK\Release\OpenTK.dll + diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index 06867c01..4dd65195 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -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 -- 2.47.3