From d0b6e5a2b6b6ea2e22199f4f52ea4e65b461111e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Wed, 21 Aug 2019 16:03:14 +0200 Subject: [PATCH] Cairo namespace renamed to Crow.Cairo to avoid md addins fault --- Crow.sln | 3 +- Crow/Crow.csproj | 11 +- Crow/src/BmpPicture.cs | 2 +- Crow/src/CompilerServices/CompilerServices.cs | 3 +- Crow/src/Fill/Fill.cs | 2 +- Crow/src/Font.cs | 2 +- Crow/src/Gradient.cs | 2 +- Crow/src/GraphicObjects/Border.cs | 2 +- Crow/src/GraphicObjects/Button.cs | 2 +- Crow/src/GraphicObjects/GraduatedSlider.cs | 2 +- Crow/src/GraphicObjects/Group.cs | 2 +- Crow/src/GraphicObjects/HueSelector.cs | 2 +- Crow/src/GraphicObjects/Image.cs | 2 +- Crow/src/GraphicObjects/Label.cs | 2 +- Crow/src/GraphicObjects/PrivateContainer.cs | 2 +- Crow/src/GraphicObjects/ProgressBar.cs | 2 +- .../GraphicObjects/SaturationValueSelector.cs | 2 +- Crow/src/GraphicObjects/Scroller.cs | 2 +- Crow/src/GraphicObjects/ScrollingObject.cs | 2 +- Crow/src/GraphicObjects/Shape.cs | 2 +- Crow/src/GraphicObjects/Slider.cs | 2 +- Crow/src/GraphicObjects/TabItem.cs | 2 +- Crow/src/GraphicObjects/TabView.cs | 2 +- Crow/src/GraphicObjects/TemplatedControl.cs | 2 +- Crow/src/GraphicObjects/TemplatedGroup.cs | 101 ++-- Crow/src/GraphicObjects/TestCairoPatch.cs | 2 +- Crow/src/GraphicObjects/TextBox.cs | 2 +- Crow/src/GraphicObjects/TextRun.cs | 2 +- Crow/src/GraphicObjects/Trend.cs | 2 +- Crow/src/GraphicObjects/Widget.cs | 4 +- Crow/src/Interface.cs | 148 +++-- Crow/src/Mono.Cairo/Antialias.cs | 2 +- Crow/src/Mono.Cairo/Cairo.cs | 4 +- Crow/src/Mono.Cairo/CairoDebug.cs | 2 +- Crow/src/Mono.Cairo/Content.cs | 2 +- Crow/src/Mono.Cairo/Context.cs | 4 +- Crow/src/Mono.Cairo/DRMDevice.cs | 2 +- Crow/src/Mono.Cairo/DRMSurface.cs | 2 +- Crow/src/Mono.Cairo/Device.cs | 2 +- Crow/src/Mono.Cairo/DirectFBSurface.cs | 2 +- Crow/src/Mono.Cairo/Distance.cs | 2 +- Crow/src/Mono.Cairo/EGLDevice.cs | 2 +- Crow/src/Mono.Cairo/Extend.cs | 2 +- Crow/src/Mono.Cairo/FillRule.cs | 2 +- Crow/src/Mono.Cairo/Filter.cs | 2 +- Crow/src/Mono.Cairo/FontExtents.cs | 2 +- Crow/src/Mono.Cairo/FontFace.cs | 2 +- Crow/src/Mono.Cairo/FontOptions.cs | 2 +- Crow/src/Mono.Cairo/FontSlant.cs | 2 +- Crow/src/Mono.Cairo/FontType.cs | 2 +- Crow/src/Mono.Cairo/FontWeight.cs | 2 +- Crow/src/Mono.Cairo/Format.cs | 2 +- Crow/src/Mono.Cairo/GLSurface.cs | 4 +- Crow/src/Mono.Cairo/GLXDevice.cs | 2 +- Crow/src/Mono.Cairo/GlitzSurface.cs | 2 +- Crow/src/Mono.Cairo/Glyph.cs | 2 +- Crow/src/Mono.Cairo/Gradient.cs | 2 +- Crow/src/Mono.Cairo/HintMetrics.cs | 2 +- Crow/src/Mono.Cairo/HintStyle.cs | 2 +- Crow/src/Mono.Cairo/ImageSurface.cs | 4 +- Crow/src/Mono.Cairo/LineCap.cs | 2 +- Crow/src/Mono.Cairo/LineJoin.cs | 2 +- Crow/src/Mono.Cairo/LinearGradient.cs | 2 +- Crow/src/Mono.Cairo/Matrix.cs | 4 +- Crow/src/Mono.Cairo/MeshPattern.cs | 2 +- Crow/src/Mono.Cairo/NativeMethods.cs | 4 +- Crow/src/Mono.Cairo/Operator.cs | 2 +- Crow/src/Mono.Cairo/PSSurface.cs | 2 +- Crow/src/Mono.Cairo/Path.cs | 4 +- Crow/src/Mono.Cairo/Pattern.cs | 2 +- Crow/src/Mono.Cairo/PatternType.cs | 2 +- Crow/src/Mono.Cairo/PdfSurface.cs | 2 +- Crow/src/Mono.Cairo/Point.cs | 2 +- Crow/src/Mono.Cairo/PointD.cs | 2 +- Crow/src/Mono.Cairo/RadialGradient.cs | 2 +- Crow/src/Mono.Cairo/Region.cs | 2 +- Crow/src/Mono.Cairo/ScaledFont.cs | 2 +- Crow/src/Mono.Cairo/SolidPattern.cs | 2 +- Crow/src/Mono.Cairo/Status.cs | 2 +- Crow/src/Mono.Cairo/SubpixelOrder.cs | 2 +- Crow/src/Mono.Cairo/Surface.cs | 4 +- Crow/src/Mono.Cairo/SurfacePattern.cs | 2 +- Crow/src/Mono.Cairo/SurfaceType.cs | 2 +- Crow/src/Mono.Cairo/SvgSurface.cs | 2 +- Crow/src/Mono.Cairo/SvgVersion.cs | 2 +- Crow/src/Mono.Cairo/TextExtents.cs | 2 +- Crow/src/Mono.Cairo/WGLDevice.cs | 2 +- Crow/src/Mono.Cairo/Win32Surface.cs | 2 +- Crow/src/Mono.Cairo/XcbSurface.cs | 2 +- Crow/src/Mono.Cairo/XlibSurface.cs | 4 +- Crow/src/Picture.cs | 2 +- Crow/src/SolidColor.cs | 2 +- Crow/src/SvgPicture.cs | 2 +- Crow/src/backends/win32/WinBackend.cs | 0 Crow/src/debug/DbgEventTypeColors.cs | 2 +- Crow/src/debug/DbgLogViewer.cs | 2 +- Crow/src/debug/DebugLogger.cs | 2 +- Crow/src/rsvg/Handle.cs | 6 +- CrowIDE/CrowIDE.csproj | 17 +- CrowIDE/IDE.style | 7 +- CrowIDE/src/CrowIDE.cs | 20 +- CrowIDE/src/DesignInterface.cs | 20 +- CrowIDE/src/Editors/CodeBuffer/TextEditor.cs | 2 +- CrowIDE/src/Editors/ImlVisualEditor.cs | 2 +- CrowIDE/src/Editors/SourceEditor.cs | 2 +- CrowIDE/src/Editors/SvgEditor.cs | 2 +- CrowIDE/src/GraphicObjectDesignContainer.cs | 2 +- CrowIDE/src/MemberView/MembersView.cs | 2 +- CrowIDE/src/MemberView/PropertyContainer.cs | 3 +- CrowIDE/src/Project.cs | 562 ++++++++---------- CrowIDE/src/ProjectTree/ProjectFile.cs | 13 +- CrowIDE/src/ProjectTree/ProjectItem.cs | 13 +- CrowIDE/src/ProjectTree/ProjectReference.cs | 7 +- CrowIDE/src/{Solution.cs => Workspace.cs} | 242 ++------ Samples/HelloWorld/main.cs | 33 +- Samples/ShowCase/main.cs | 18 +- Samples/common/ui/Interfaces/Container/1.crow | 4 +- Samples/common/ui/Interfaces/Container/3.crow | 4 +- .../ui/Interfaces/Divers/testBind0.crow | 2 +- .../TemplatedContainer/test_Listbox.crow | 2 +- .../TemplatedControl/testCombobox.crow | 2 +- 121 files changed, 652 insertions(+), 803 deletions(-) mode change 100755 => 100644 Crow/src/backends/win32/WinBackend.cs rename CrowIDE/src/{Solution.cs => Workspace.cs} (54%) diff --git a/Crow.sln b/Crow.sln index 37f1d7b1..465d115b 100644 --- a/Crow.sln +++ b/Crow.sln @@ -37,7 +37,7 @@ Global GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.StandardHeader = $1 - $1.Text = @\n${FileName}\n \nAuthor:\n ${AuthorName} <${AuthorEmail}>\n\nCopyright (c) 2013-2017 Jean-Philippe Bruyère\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. + $1.Text = @Copyright (c) ${Year} ${AuthorName} <${AuthorEmail}>\n\nThis code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) $0.DotNetNamingPolicy = $2 $0.TextStylePolicy = $3 $3.EolMarker = Unix @@ -69,7 +69,6 @@ Global $6.LastFilePostfix = "@:\n " $6.LineAlign = 0 $6.Wrap = False - $5.inheritsSet = Mono description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n version = 0.8.0 EndGlobalSection diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index 7a133093..857a24e9 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -1,10 +1,10 @@ - net471;netstandard2.0 + net461;net471;netstandard2.0 Crow - 0.8.1 + 0.8.3.2 C.R.O.W. is a widget toolkit and rendering engine entirely developed in C# with templates, styles, compositing, and bindings. true @@ -24,17 +24,18 @@ https://jpbruyere.github.io/Crow/images/crow.png Copyright 2013-2019 xcb backend - https://github.com/jpbruyere/Crow + https://github.com/jpbruyere/Crow + + 7.2 $(SolutionDir)build\$(Configuration)\ DESIGN_MODE - 0.8.0 full TRACE;DESIGN_MODE;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;_DEBUG_DRAGNDROP;DEBUG;NETFRAMEWORK;NET471 - true + true diff --git a/Crow/src/BmpPicture.cs b/Crow/src/BmpPicture.cs index 98c2a016..540087dc 100644 --- a/Crow/src/BmpPicture.cs +++ b/Crow/src/BmpPicture.cs @@ -26,7 +26,7 @@ using System; using System.IO; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/CompilerServices/CompilerServices.cs b/Crow/src/CompilerServices/CompilerServices.cs index d57cb7b5..8819e86d 100644 --- a/Crow/src/CompilerServices/CompilerServices.cs +++ b/Crow/src/CompilerServices/CompilerServices.cs @@ -920,7 +920,8 @@ namespace Crow.IML foreach (Type expT in a.GetExportedTypes ()) { if (expT.Name != strDataType) continue; - knownTypes.Add (strDataType, expT); + if (!knownTypes.ContainsKey(strDataType)) + knownTypes.Add (strDataType, expT); return expT; } } diff --git a/Crow/src/Fill/Fill.cs b/Crow/src/Fill/Fill.cs index 0c0bdf5b..7d521045 100644 --- a/Crow/src/Fill/Fill.cs +++ b/Crow/src/Fill/Fill.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/Font.cs b/Crow/src/Font.cs index 16353d70..06df4a88 100644 --- a/Crow/src/Font.cs +++ b/Crow/src/Font.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/Gradient.cs b/Crow/src/Gradient.cs index 2630c42a..e76be7b6 100644 --- a/Crow/src/Gradient.cs +++ b/Crow/src/Gradient.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/Border.cs b/Crow/src/GraphicObjects/Border.cs index 9379c26a..e5a16ec8 100644 --- a/Crow/src/GraphicObjects/Border.cs +++ b/Crow/src/GraphicObjects/Border.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/Button.cs b/Crow/src/GraphicObjects/Button.cs index 30612512..8b15c2ea 100644 --- a/Crow/src/GraphicObjects/Button.cs +++ b/Crow/src/GraphicObjects/Button.cs @@ -33,7 +33,7 @@ using System.Text; using System.Diagnostics; using System.Xml.Serialization; -using Cairo; +using Crow.Cairo; using System.ComponentModel; namespace Crow diff --git a/Crow/src/GraphicObjects/GraduatedSlider.cs b/Crow/src/GraphicObjects/GraduatedSlider.cs index e1d4dd46..71bbff11 100644 --- a/Crow/src/GraphicObjects/GraduatedSlider.cs +++ b/Crow/src/GraphicObjects/GraduatedSlider.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Cairo; +using Crow.Cairo; using System.Xml.Serialization; namespace Crow diff --git a/Crow/src/GraphicObjects/Group.cs b/Crow/src/GraphicObjects/Group.cs index 26a5084d..a0ae35b2 100644 --- a/Crow/src/GraphicObjects/Group.cs +++ b/Crow/src/GraphicObjects/Group.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Xml.Serialization; -using Cairo; +using Crow.Cairo; using System.Diagnostics; using System.Reflection; using System.Threading; diff --git a/Crow/src/GraphicObjects/HueSelector.cs b/Crow/src/GraphicObjects/HueSelector.cs index d8218fee..e9a31dfb 100644 --- a/Crow/src/GraphicObjects/HueSelector.cs +++ b/Crow/src/GraphicObjects/HueSelector.cs @@ -27,7 +27,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/Image.cs b/Crow/src/GraphicObjects/Image.cs index 388abb1b..98f86e58 100644 --- a/Crow/src/GraphicObjects/Image.cs +++ b/Crow/src/GraphicObjects/Image.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; diff --git a/Crow/src/GraphicObjects/Label.cs b/Crow/src/GraphicObjects/Label.cs index 3736f968..f597f5d7 100644 --- a/Crow/src/GraphicObjects/Label.cs +++ b/Crow/src/GraphicObjects/Label.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Diagnostics; -using Cairo; +using Crow.Cairo; using System.Text.RegularExpressions; using System.Xml.Serialization; using System.ComponentModel; diff --git a/Crow/src/GraphicObjects/PrivateContainer.cs b/Crow/src/GraphicObjects/PrivateContainer.cs index 8b1650e5..1225cbb3 100644 --- a/Crow/src/GraphicObjects/PrivateContainer.cs +++ b/Crow/src/GraphicObjects/PrivateContainer.cs @@ -27,7 +27,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/ProgressBar.cs b/Crow/src/GraphicObjects/ProgressBar.cs index afaead9b..20fadadc 100644 --- a/Crow/src/GraphicObjects/ProgressBar.cs +++ b/Crow/src/GraphicObjects/ProgressBar.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Cairo; +using Crow.Cairo; using System.Diagnostics; using System.Xml.Serialization; using System.ComponentModel; diff --git a/Crow/src/GraphicObjects/SaturationValueSelector.cs b/Crow/src/GraphicObjects/SaturationValueSelector.cs index 5a25d6a2..535a90df 100644 --- a/Crow/src/GraphicObjects/SaturationValueSelector.cs +++ b/Crow/src/GraphicObjects/SaturationValueSelector.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; using System.Xml.Serialization; namespace Crow diff --git a/Crow/src/GraphicObjects/Scroller.cs b/Crow/src/GraphicObjects/Scroller.cs index e9d14711..a234a3e4 100644 --- a/Crow/src/GraphicObjects/Scroller.cs +++ b/Crow/src/GraphicObjects/Scroller.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/ScrollingObject.cs b/Crow/src/GraphicObjects/ScrollingObject.cs index 0f694236..12804899 100644 --- a/Crow/src/GraphicObjects/ScrollingObject.cs +++ b/Crow/src/GraphicObjects/ScrollingObject.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Collections; -using Cairo; +using Crow.Cairo; namespace Crow diff --git a/Crow/src/GraphicObjects/Shape.cs b/Crow/src/GraphicObjects/Shape.cs index ea0409b1..99678556 100644 --- a/Crow/src/GraphicObjects/Shape.cs +++ b/Crow/src/GraphicObjects/Shape.cs @@ -28,7 +28,7 @@ using System.Xml.Serialization; using System.ComponentModel; using System.IO; using System.Text; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/Slider.cs b/Crow/src/GraphicObjects/Slider.cs index 2db34f92..bd46b051 100644 --- a/Crow/src/GraphicObjects/Slider.cs +++ b/Crow/src/GraphicObjects/Slider.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; diff --git a/Crow/src/GraphicObjects/TabItem.cs b/Crow/src/GraphicObjects/TabItem.cs index 4d9847c7..113a4399 100644 --- a/Crow/src/GraphicObjects/TabItem.cs +++ b/Crow/src/GraphicObjects/TabItem.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Diagnostics; -using Cairo; +using Crow.Cairo; using System.Linq; namespace Crow diff --git a/Crow/src/GraphicObjects/TabView.cs b/Crow/src/GraphicObjects/TabView.cs index 655732f1..550d60aa 100644 --- a/Crow/src/GraphicObjects/TabView.cs +++ b/Crow/src/GraphicObjects/TabView.cs @@ -27,7 +27,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; -using Cairo; +using Crow.Cairo; using System.Diagnostics; using System.Linq; diff --git a/Crow/src/GraphicObjects/TemplatedControl.cs b/Crow/src/GraphicObjects/TemplatedControl.cs index 2e36eac6..d93cf4c8 100644 --- a/Crow/src/GraphicObjects/TemplatedControl.cs +++ b/Crow/src/GraphicObjects/TemplatedControl.cs @@ -29,7 +29,7 @@ using System.ComponentModel; using System.IO; using System.Xml; using System.Reflection; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/TemplatedGroup.cs b/Crow/src/GraphicObjects/TemplatedGroup.cs index 8b9e15b8..cb57a721 100644 --- a/Crow/src/GraphicObjects/TemplatedGroup.cs +++ b/Crow/src/GraphicObjects/TemplatedGroup.cs @@ -25,20 +25,13 @@ // THE SOFTWARE. using System; -using System.Xml.Serialization; -using System.Xml; -using System.Reflection; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; -using System.Collections; -using System.Threading; using System.Linq; using Crow.IML; -using System.Diagnostics; -using System.IO; -namespace Crow -{ +namespace Crow { public abstract class TemplatedGroup : TemplatedControl { #if DESIGN_MODE @@ -72,7 +65,7 @@ namespace Crow public event EventHandler Loaded; #endregion - IList data; + IEnumerable data; int _selectedIndex = -1; Color selBackground, selForeground; @@ -172,7 +165,7 @@ namespace Crow } } [XmlIgnore]public virtual object SelectedItem{ - get { return data == null ? null : _selectedIndex < 0 ? data.GetDefaultValue() : data[_selectedIndex]; } + get { return data == null ? null : _selectedIndex < 0 ? data.GetDefaultValue() : ((IList)data)?[_selectedIndex]; } set { if (data == null) { SelectedIndex = -1; @@ -182,13 +175,13 @@ namespace Crow if (value == SelectedItem) return; - SelectedIndex = data.IndexOf (value); + SelectedIndex = (int)((IList)data)?.IndexOf (value); } } [XmlIgnore]public bool HasItems { get { return Items.Count > 0; } } - public IList Data { + public IEnumerable Data { get { return data; } set { if (value == data) @@ -362,7 +355,7 @@ namespace Crow if (loadingThread != null) loadingThread.Cancel (); } - void loadPage(IList _data, Group page, string _dataTest) + void loadPage(IEnumerable _data, Group page, string _dataTest) { #if DEBUG_LOAD Stopwatch loadingTime = Stopwatch.StartNew (); @@ -374,26 +367,27 @@ namespace Crow // typeof(Wrapper).IsAssignableFrom (items.GetType ())) { //page = items; itemPerPage = int.MaxValue; -// } else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) { -// GenericStack gs = new GenericStack (items.CurrentInterface); -// gs.Orientation = (items as GenericStack).Orientation; -// gs.Width = items.Width; -// gs.Height = items.Height; -// gs.VerticalAlignment = items.VerticalAlignment; -// gs.HorizontalAlignment = items.HorizontalAlignment; -// page = gs; -// page.Name = "page" + pageNum; -// isPaged = true; -// } else { -// page = Activator.CreateInstance (items.GetType ()) as Group; -// page.CurrentInterface = items.CurrentInterface; -// page.Initialize (); -// page.Name = "page" + pageNum; -// isPaged = true; -// } - - for (int i = 0; i < _data.Count; i++) { - loadItem (_data[i], page, _dataTest); + // } else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) { + // GenericStack gs = new GenericStack (items.CurrentInterface); + // gs.Orientation = (items as GenericStack).Orientation; + // gs.Width = items.Width; + // gs.Height = items.Height; + // gs.VerticalAlignment = items.VerticalAlignment; + // gs.HorizontalAlignment = items.HorizontalAlignment; + // page = gs; + // page.Name = "page" + pageNum; + // isPaged = true; + // } else { + // page = Activator.CreateInstance (items.GetType ()) as Group; + // page.CurrentInterface = items.CurrentInterface; + // page.Initialize (); + // page.Name = "page" + pageNum; + // isPaged = true; + // } + + + foreach (object d in _data) { + loadItem (d, page, _dataTest); if (loadingThread.cancelRequested) break; } @@ -461,22 +455,27 @@ namespace Crow if (iTemp.Expand != null && g is Expandable) { Expandable e = g as Expandable; e.Expand += iTemp.Expand; - e.GetIsExpandable = iTemp.HasSubItems; + if ((o as ICollection) == null) + e.GetIsExpandable = new BooleanTestOnInstance((instance) => true); + else + e.GetIsExpandable = iTemp.HasSubItems; } g.DataSource = o; } -// protected void _list_LayoutChanged (object sender, LayoutingEventArgs e) -// { -// #if DEBUG_LAYOUTING -// Debug.WriteLine("list_LayoutChanged"); -// #endif -// if (_gsList.Orientation == Orientation.Horizontal) { -// if (e.LayoutType == LayoutingType.Width) -// _gsList.Width = approxSize; -// } else if (e.LayoutType == LayoutingType.Height) -// _gsList.Height = approxSize; -// } + + + // protected void _list_LayoutChanged (object sender, LayoutingEventArgs e) + // { + // #if DEBUG_LAYOUTING + // Debug.WriteLine("list_LayoutChanged"); + // #endif + // if (_gsList.Orientation == Orientation.Horizontal) { + // if (e.LayoutType == LayoutingType.Width) + // _gsList.Width = approxSize; + // } else if (e.LayoutType == LayoutingType.Height) + // _gsList.Height = approxSize; + // } int approxSize { get { @@ -487,16 +486,16 @@ namespace Crow return -1; return page1.Orientation == Orientation.Horizontal ? - data.Count < itemPerPage ? + (data as ICollection)?.Count < itemPerPage ? -1: - (int)Math.Ceiling ((double)page1.Slot.Width / (double)itemPerPage * (double)(data.Count+1)): - data.Count < itemPerPage ? + (int)Math.Ceiling ((double)page1.Slot.Width / (double)itemPerPage * (double)((data as ICollection)?.Count+1)): + (data as ICollection)?.Count < itemPerPage ? -1: - (int)Math.Ceiling ((double)page1.Slot.Height / (double)itemPerPage * (double)(data.Count+1)); + (int)Math.Ceiling ((double)page1.Slot.Height / (double)itemPerPage * (double)((data as ICollection)?.Count+1)); } } internal virtual void itemClick(object sender, MouseButtonEventArgs e){ - SelectedIndex = data.IndexOf((sender as Widget).DataSource); + SelectedIndex = (int)((IList)data)?.IndexOf((sender as Widget).DataSource); } bool emitHelperIsAlreadyExpanded (Widget go){ diff --git a/Crow/src/GraphicObjects/TestCairoPatch.cs b/Crow/src/GraphicObjects/TestCairoPatch.cs index cd15adc5..dcfb584c 100644 --- a/Crow/src/GraphicObjects/TestCairoPatch.cs +++ b/Crow/src/GraphicObjects/TestCairoPatch.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/TextBox.cs b/Crow/src/GraphicObjects/TextBox.cs index 500a0a1a..71fd6205 100644 --- a/Crow/src/GraphicObjects/TextBox.cs +++ b/Crow/src/GraphicObjects/TextBox.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; using System.Diagnostics; using System.Xml.Serialization; diff --git a/Crow/src/GraphicObjects/TextRun.cs b/Crow/src/GraphicObjects/TextRun.cs index 6550411e..f784f90e 100644 --- a/Crow/src/GraphicObjects/TextRun.cs +++ b/Crow/src/GraphicObjects/TextRun.cs @@ -29,7 +29,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; -using Cairo; +using Crow.Cairo; using System.Text.RegularExpressions; using System.Xml.Serialization; using System.ComponentModel; diff --git a/Crow/src/GraphicObjects/Trend.cs b/Crow/src/GraphicObjects/Trend.cs index 8fcd8830..b62fd2f2 100644 --- a/Crow/src/GraphicObjects/Trend.cs +++ b/Crow/src/GraphicObjects/Trend.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.ComponentModel; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/GraphicObjects/Widget.cs b/Crow/src/GraphicObjects/Widget.cs index d2314138..d85ddfaa 100644 --- a/Crow/src/GraphicObjects/Widget.cs +++ b/Crow/src/GraphicObjects/Widget.cs @@ -31,7 +31,7 @@ using System.Xml.Serialization; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -using Cairo; +using Crow.Cairo; using System.Diagnostics; using Crow.IML; using System.Threading; @@ -1007,7 +1007,7 @@ namespace Crow #if DEBUG_LOG DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOLockLayouting, this); #endif - lock (IFace.LayoutMutex) { + lock (IFace.UpdateMutex) { OnDataSourceChanged (this, dse); NotifyValueChanged ("DataSource", DataSource); } diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index 495ca23b..c4553066 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -32,7 +32,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Threading; -using Cairo; +using Crow.Cairo; using Crow.IML; @@ -62,37 +62,39 @@ namespace Crow /// The resulting surface (a byte array in the OpenTK renderer) is made available and protected with the /// RenderMutex of the interface. /// - public class Interface : ILayoutable, IDisposable ,IValueChange + public class Interface : ILayoutable, IDisposable, IValueChange { #region IValueChange implementation public event EventHandler ValueChanged; - public virtual void NotifyValueChanged(string MemberName, object _value) + public virtual void NotifyValueChanged (string MemberName, object _value) { //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value); - ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); + ValueChanged.Raise (this, new ValueChangeEventArgs (MemberName, _value)); } #endregion - internal IBackend backend; + protected IBackend backend; + protected bool running; + #region CTOR - static Interface(){ + static Interface () { /*if (Type.GetType ("Mono.Runtime") == null) { throw new Exception (@"C.R.O.W. run only on Mono, download latest version at: http://www.mono-project.com/download/stable/"); }*/ CROW_CONFIG_ROOT = - System.IO.Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + System.IO.Path.Combine ( + Environment.GetFolderPath (Environment.SpecialFolder.UserProfile), ".config"); CROW_CONFIG_ROOT = System.IO.Path.Combine (CROW_CONFIG_ROOT, "crow"); if (!Directory.Exists (CROW_CONFIG_ROOT)) Directory.CreateDirectory (CROW_CONFIG_ROOT); //ensure all assemblies are loaded, because IML could contains classes not instanciated in source - foreach (string af in Directory.GetFiles (AppDomain.CurrentDomain.BaseDirectory, "*.dll")){ + foreach (string af in Directory.GetFiles (AppDomain.CurrentDomain.BaseDirectory, "*.dll")) { try { - Assembly.LoadFrom (af); + Assembly.LoadFrom (af); } catch (Exception ex) { Console.WriteLine ("{0} not loaded as assembly.", af); } @@ -105,54 +107,70 @@ namespace Crow FontRenderingOptions.SubpixelOrder = SubpixelOrder.Default; } - public Interface(int width=800, int height=600){ - + public Interface(int width=800, int height=600, IBackend _backend = null){ + CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + CurrentInterface = this; clientRectangle = new Rectangle (0, 0, width, height); + backend = _backend; - Init (); - - InitBackend (); + Thread t = new Thread (InterfaceThread) { + IsBackground = true + }; + t.Start (); +#if MEASURE_TIME + PerfMeasures.Add (updateMeasure); + PerfMeasures.Add (drawingMeasure); + PerfMeasures.Add (layoutingMeasure); + PerfMeasures.Add (clippingMeasure); +#endif } #endregion - protected bool running; - protected virtual void InitBackend () { - if (Environment.OSVersion.Platform == PlatformID.Unix) - backend = new Crow.XCB.XCBBackend(); - //backend = new Crow.XLib.XLibBackend (); - else - backend = new Crow.Win32.Win32Backend(); - + public virtual void InterfaceThread () + { + if (backend == null) { + if (Environment.OSVersion.Platform == PlatformID.Unix) + backend = new XCB.XCBBackend (); + else + backend = new Win32.Win32Backend (); + } + backend.Init (this); + while (!running) + Thread.Sleep (2); + + while (running) { + Update (); + Thread.Sleep (5); + } + } + protected virtual void Startup () + { + try { + Load ("#main.crow").DataSource = this; + } catch { } + } + public virtual void Run () { + loadStyling (); + initTooltip (); initContextMenus (); running = true; - Thread t = new Thread (interfaceThread); - t.IsBackground = true; - t.Start (); - } - public void Run () { Startup (); + while (running) { ProcessEvents (); Thread.Sleep(1); } } - protected virtual void Startup () - { - //load default main.crow if present - try { - Load ("#main.crow").DataSource = this; - } catch { } - } + public void ProcessKeyPress (char c) { _focusedWidget?.onKeyPress (_focusedWidget, new KeyPressEventArgs(c)); } - public void ProcessKeyUp (Key key) { _focusedWidget?.onKeyUp (_focusedWidget, new KeyEventArgs(key, false)); @@ -173,26 +191,16 @@ namespace Crow // keyboardRepeatThread.IsBackground = true; // keyboardRepeatThread.Start (); } - public bool Shift { get { return backend.Shift; } } - public bool Ctrl { get { return backend.Ctrl; } } - public bool Alt { get { return backend.Alt; } } - void interfaceThread() - { - while (running) { - Update (); - Thread.Sleep (5); - } - } #region IDisposable Support private bool disposedValue = false; // To detect redundant calls @@ -254,24 +262,10 @@ namespace Crow FocusedWidget = w; break; } - w = w.LogicalParent as Widget; + w = w.FocusParent; } } - public void Init () { - CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture; - - CurrentInterface = this; - //loadCursors (); - loadStyling (); - - #if MEASURE_TIME - PerfMeasures.Add (updateMeasure); - PerfMeasures.Add (drawingMeasure); - PerfMeasures.Add (layoutingMeasure); - PerfMeasures.Add (clippingMeasure); - #endif - } #region Static and constants /// @@ -454,10 +448,10 @@ namespace Crow if (s == null) s = Assembly.GetAssembly (declaringType).GetManifestResourceStream (resId); if (s == null) - throw new Exception ($"Template not found '{path}'"); + throw new Exception ($"Template ressource not found '{path}'"); } else { if (!File.Exists (path)) - throw new FileNotFoundException ("Template not found: ", path); + throw new FileNotFoundException ($"Template not found: {path}", path); s = new FileStream (path, FileMode.Open, FileAccess.Read); } return s; @@ -481,7 +475,7 @@ namespace Crow throw new Exception ("Resource not found: " + path); } else { if (!File.Exists (path)) - throw new FileNotFoundException ("File not found: ", path); + throw new FileNotFoundException ($"File not found: {path}", path); stream = new FileStream (path, FileMode.Open, FileAccess.Read); } return stream; @@ -504,7 +498,7 @@ namespace Crow throw new Exception ("Resource not found: " + path); } else { if (!File.Exists (path)) - throw new FileNotFoundException ("File not found: ", path); + throw new FileNotFoundException ($"File not found: {path}", path); stream = new FileStream (path, FileMode.Open, FileAccess.Read); } return stream; @@ -700,7 +694,7 @@ namespace Crow /// - Drawing /// Result: the Interface bitmap is drawn in memory (byte[] bmp) and a dirtyRect and bitmap are available /// - public void Update(){ + public void Update(Context ctx = null){ CrowThread[] tmpThreads; lock (CrowThreads) { tmpThreads = new CrowThread[CrowThreads.Count]; @@ -734,11 +728,16 @@ namespace Crow clippingRegistration (); - processDrawing (); + if (ctx == null) { + using (ctx = new Context (surf)) { + processDrawing (ctx); + } + }else + processDrawing (ctx); - #if MEASURE_TIME +#if MEASURE_TIME updateMeasure.StopCycle(); - #endif +#endif Monitor.Exit (UpdateMutex); } @@ -800,7 +799,7 @@ namespace Crow } /// Clipping Rectangles drive the drawing process. For compositing, each object under a clip rectangle should be /// repainted. If it contains also clip rectangles, its cache will be update, or if not cached a full redraw will take place - void processDrawing(){ + void processDrawing(Context ctx){ #if MEASURE_TIME drawingMeasure.StartCycle(); #endif @@ -811,7 +810,6 @@ namespace Crow if (DragImage != null) clipping.UnionRectangle(new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight)); //using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) { - using (ctx = new Context (surf)){ if (!clipping.IsEmpty) { IsDirty = true; @@ -872,7 +870,7 @@ namespace Crow backend?.Flush (); } - } + /*#if DEBUG_LOG DebugLog.AddEvent (DbgEvtType.IFaceEndDrawing); #endif*/ @@ -1002,11 +1000,7 @@ namespace Crow /*surf.Dispose (); surf = new Cairo.XlibSurface (xHandle, xwinHnd, xDefaultVisual, clientRectangle.Width, clientRectangle.Height);*/ - if (surf is XlibSurface) - (surf as XlibSurface).SetSize (clientRectangle.Width, clientRectangle.Height); - else if (surf is XcbSurface) - (surf as XcbSurface).SetSize (clientRectangle.Width, clientRectangle.Height); - + surf.SetSize (clientRectangle.Width, clientRectangle.Height); foreach (Widget g in GraphicTree) g.RegisterForLayouting (LayoutingType.All); diff --git a/Crow/src/Mono.Cairo/Antialias.cs b/Crow/src/Mono.Cairo/Antialias.cs index 30c71c0f..64da6443 100644 --- a/Crow/src/Mono.Cairo/Antialias.cs +++ b/Crow/src/Mono.Cairo/Antialias.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum Antialias diff --git a/Crow/src/Mono.Cairo/Cairo.cs b/Crow/src/Mono.Cairo/Cairo.cs index c0a5f2ab..c32c00d8 100644 --- a/Crow/src/Mono.Cairo/Cairo.cs +++ b/Crow/src/Mono.Cairo/Cairo.cs @@ -1,4 +1,4 @@ -// +// // Cairo.cs - a simplistic binding of the Cairo API to C#. // // Authors: Duncan Mak (duncan@ximian.com) @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo +namespace Crow.Cairo { public static class CairoAPI { static public int Version { diff --git a/Crow/src/Mono.Cairo/CairoDebug.cs b/Crow/src/Mono.Cairo/CairoDebug.cs index d694bbb5..faff9338 100644 --- a/Crow/src/Mono.Cairo/CairoDebug.cs +++ b/Crow/src/Mono.Cairo/CairoDebug.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { static class CairoDebug { diff --git a/Crow/src/Mono.Cairo/Content.cs b/Crow/src/Mono.Cairo/Content.cs index a45370ff..f14305a4 100644 --- a/Crow/src/Mono.Cairo/Content.cs +++ b/Crow/src/Mono.Cairo/Content.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { //[Flags] diff --git a/Crow/src/Mono.Cairo/Context.cs b/Crow/src/Mono.Cairo/Context.cs index d428b42c..3259294f 100644 --- a/Crow/src/Mono.Cairo/Context.cs +++ b/Crow/src/Mono.Cairo/Context.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Context.cs // // Author: @@ -39,7 +39,7 @@ using System.Runtime.InteropServices; using System.Text; using Color = Crow.Color; -namespace Cairo { +namespace Crow.Cairo { [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")] public class Graphics : Context { diff --git a/Crow/src/Mono.Cairo/DRMDevice.cs b/Crow/src/Mono.Cairo/DRMDevice.cs index a03195fb..05e142cb 100644 --- a/Crow/src/Mono.Cairo/DRMDevice.cs +++ b/Crow/src/Mono.Cairo/DRMDevice.cs @@ -29,7 +29,7 @@ // using System; -namespace Cairo +namespace Crow.Cairo { public class DRMDevice : Device { diff --git a/Crow/src/Mono.Cairo/DRMSurface.cs b/Crow/src/Mono.Cairo/DRMSurface.cs index 248541c7..f624967f 100644 --- a/Crow/src/Mono.Cairo/DRMSurface.cs +++ b/Crow/src/Mono.Cairo/DRMSurface.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class DRMSurface : Surface { diff --git a/Crow/src/Mono.Cairo/Device.cs b/Crow/src/Mono.Cairo/Device.cs index a5452f9d..dc9910cb 100644 --- a/Crow/src/Mono.Cairo/Device.cs +++ b/Crow/src/Mono.Cairo/Device.cs @@ -29,7 +29,7 @@ // using System; -namespace Cairo +namespace Crow.Cairo { public class Device : IDisposable { diff --git a/Crow/src/Mono.Cairo/DirectFBSurface.cs b/Crow/src/Mono.Cairo/DirectFBSurface.cs index afa57b7d..64431574 100644 --- a/Crow/src/Mono.Cairo/DirectFBSurface.cs +++ b/Crow/src/Mono.Cairo/DirectFBSurface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class DirectFBSurface : Surface { internal DirectFBSurface (IntPtr handle, bool owns) : base (handle, owns) diff --git a/Crow/src/Mono.Cairo/Distance.cs b/Crow/src/Mono.Cairo/Distance.cs index 7cba3729..d716ab1f 100644 --- a/Crow/src/Mono.Cairo/Distance.cs +++ b/Crow/src/Mono.Cairo/Distance.cs @@ -34,7 +34,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace Cairo { +namespace Crow.Cairo { public struct Distance { diff --git a/Crow/src/Mono.Cairo/EGLDevice.cs b/Crow/src/Mono.Cairo/EGLDevice.cs index 45c988a3..44590c70 100644 --- a/Crow/src/Mono.Cairo/EGLDevice.cs +++ b/Crow/src/Mono.Cairo/EGLDevice.cs @@ -29,7 +29,7 @@ // using System; -namespace Cairo +namespace Crow.Cairo { public class EGLDevice : Device { diff --git a/Crow/src/Mono.Cairo/Extend.cs b/Crow/src/Mono.Cairo/Extend.cs index 1135c2ff..4af536dc 100644 --- a/Crow/src/Mono.Cairo/Extend.cs +++ b/Crow/src/Mono.Cairo/Extend.cs @@ -32,7 +32,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum Extend diff --git a/Crow/src/Mono.Cairo/FillRule.cs b/Crow/src/Mono.Cairo/FillRule.cs index 24cbfba2..80f61ed5 100644 --- a/Crow/src/Mono.Cairo/FillRule.cs +++ b/Crow/src/Mono.Cairo/FillRule.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum FillRule diff --git a/Crow/src/Mono.Cairo/Filter.cs b/Crow/src/Mono.Cairo/Filter.cs index 2355fbb3..a73ea58d 100644 --- a/Crow/src/Mono.Cairo/Filter.cs +++ b/Crow/src/Mono.Cairo/Filter.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum Filter diff --git a/Crow/src/Mono.Cairo/FontExtents.cs b/Crow/src/Mono.Cairo/FontExtents.cs index 76c7e658..ea26d9bb 100644 --- a/Crow/src/Mono.Cairo/FontExtents.cs +++ b/Crow/src/Mono.Cairo/FontExtents.cs @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo +namespace Crow.Cairo { [StructLayout (LayoutKind.Sequential)] public struct FontExtents diff --git a/Crow/src/Mono.Cairo/FontFace.cs b/Crow/src/Mono.Cairo/FontFace.cs index 19d8163c..64c428e2 100644 --- a/Crow/src/Mono.Cairo/FontFace.cs +++ b/Crow/src/Mono.Cairo/FontFace.cs @@ -32,7 +32,7 @@ // using System; -namespace Cairo +namespace Crow.Cairo { public class FontFace : IDisposable { diff --git a/Crow/src/Mono.Cairo/FontOptions.cs b/Crow/src/Mono.Cairo/FontOptions.cs index 5269d54d..f90a3a4d 100644 --- a/Crow/src/Mono.Cairo/FontOptions.cs +++ b/Crow/src/Mono.Cairo/FontOptions.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public class FontOptions : IDisposable { diff --git a/Crow/src/Mono.Cairo/FontSlant.cs b/Crow/src/Mono.Cairo/FontSlant.cs index b7a5684c..b3d8a1a2 100644 --- a/Crow/src/Mono.Cairo/FontSlant.cs +++ b/Crow/src/Mono.Cairo/FontSlant.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum FontSlant diff --git a/Crow/src/Mono.Cairo/FontType.cs b/Crow/src/Mono.Cairo/FontType.cs index e9fd263a..5db44d4e 100644 --- a/Crow/src/Mono.Cairo/FontType.cs +++ b/Crow/src/Mono.Cairo/FontType.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public enum FontType diff --git a/Crow/src/Mono.Cairo/FontWeight.cs b/Crow/src/Mono.Cairo/FontWeight.cs index 5b781095..0b8fc6a8 100644 --- a/Crow/src/Mono.Cairo/FontWeight.cs +++ b/Crow/src/Mono.Cairo/FontWeight.cs @@ -30,7 +30,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum FontWeight diff --git a/Crow/src/Mono.Cairo/Format.cs b/Crow/src/Mono.Cairo/Format.cs index 96e9a0f5..54c8be1e 100644 --- a/Crow/src/Mono.Cairo/Format.cs +++ b/Crow/src/Mono.Cairo/Format.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum Format diff --git a/Crow/src/Mono.Cairo/GLSurface.cs b/Crow/src/Mono.Cairo/GLSurface.cs index 9486c9cd..60384b02 100644 --- a/Crow/src/Mono.Cairo/GLSurface.cs +++ b/Crow/src/Mono.Cairo/GLSurface.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.GLSurface.cs // // Authors: @@ -30,7 +30,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class GLSurface : Surface { diff --git a/Crow/src/Mono.Cairo/GLXDevice.cs b/Crow/src/Mono.Cairo/GLXDevice.cs index 189872a2..00cbce1f 100644 --- a/Crow/src/Mono.Cairo/GLXDevice.cs +++ b/Crow/src/Mono.Cairo/GLXDevice.cs @@ -29,7 +29,7 @@ // using System; -namespace Cairo +namespace Crow.Cairo { public class GLXDevice : Device { diff --git a/Crow/src/Mono.Cairo/GlitzSurface.cs b/Crow/src/Mono.Cairo/GlitzSurface.cs index 6da1ac6a..4aa24983 100644 --- a/Crow/src/Mono.Cairo/GlitzSurface.cs +++ b/Crow/src/Mono.Cairo/GlitzSurface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class GlitzSurface : Surface { internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns) diff --git a/Crow/src/Mono.Cairo/Glyph.cs b/Crow/src/Mono.Cairo/Glyph.cs index ec9c2ff3..ad511562 100644 --- a/Crow/src/Mono.Cairo/Glyph.cs +++ b/Crow/src/Mono.Cairo/Glyph.cs @@ -30,7 +30,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo +namespace Crow.Cairo { [StructLayout(LayoutKind.Sequential)] public struct Glyph diff --git a/Crow/src/Mono.Cairo/Gradient.cs b/Crow/src/Mono.Cairo/Gradient.cs index c7bc53c6..427cc053 100644 --- a/Crow/src/Mono.Cairo/Gradient.cs +++ b/Crow/src/Mono.Cairo/Gradient.cs @@ -29,7 +29,7 @@ using System; using Color = Crow.Color; -namespace Cairo { +namespace Crow.Cairo { public class Gradient : Pattern { diff --git a/Crow/src/Mono.Cairo/HintMetrics.cs b/Crow/src/Mono.Cairo/HintMetrics.cs index 3bf01d23..d830f3eb 100644 --- a/Crow/src/Mono.Cairo/HintMetrics.cs +++ b/Crow/src/Mono.Cairo/HintMetrics.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum HintMetrics diff --git a/Crow/src/Mono.Cairo/HintStyle.cs b/Crow/src/Mono.Cairo/HintStyle.cs index b8cca974..343daf3e 100644 --- a/Crow/src/Mono.Cairo/HintStyle.cs +++ b/Crow/src/Mono.Cairo/HintStyle.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum HintStyle diff --git a/Crow/src/Mono.Cairo/ImageSurface.cs b/Crow/src/Mono.Cairo/ImageSurface.cs index 98143fe8..1dd83296 100644 --- a/Crow/src/Mono.Cairo/ImageSurface.cs +++ b/Crow/src/Mono.Cairo/ImageSurface.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.ImageSurface.cs // // Authors: @@ -35,7 +35,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo { +namespace Crow.Cairo { public class ImageSurface : Surface { diff --git a/Crow/src/Mono.Cairo/LineCap.cs b/Crow/src/Mono.Cairo/LineCap.cs index 46938c25..1560cda4 100644 --- a/Crow/src/Mono.Cairo/LineCap.cs +++ b/Crow/src/Mono.Cairo/LineCap.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum LineCap diff --git a/Crow/src/Mono.Cairo/LineJoin.cs b/Crow/src/Mono.Cairo/LineJoin.cs index b5c241b0..1d5389b5 100644 --- a/Crow/src/Mono.Cairo/LineJoin.cs +++ b/Crow/src/Mono.Cairo/LineJoin.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum LineJoin diff --git a/Crow/src/Mono.Cairo/LinearGradient.cs b/Crow/src/Mono.Cairo/LinearGradient.cs index 85fdea84..100d1e6d 100644 --- a/Crow/src/Mono.Cairo/LinearGradient.cs +++ b/Crow/src/Mono.Cairo/LinearGradient.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class LinearGradient : Gradient { diff --git a/Crow/src/Mono.Cairo/Matrix.cs b/Crow/src/Mono.Cairo/Matrix.cs index 12f0cb92..7d5a6acd 100644 --- a/Crow/src/Mono.Cairo/Matrix.cs +++ b/Crow/src/Mono.Cairo/Matrix.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Matrix.cs // // Author: Duncan Mak @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo { +namespace Crow.Cairo { [StructLayout(LayoutKind.Sequential)] public class Matrix //: ICloneable diff --git a/Crow/src/Mono.Cairo/MeshPattern.cs b/Crow/src/Mono.Cairo/MeshPattern.cs index b14c709b..96bc3c85 100644 --- a/Crow/src/Mono.Cairo/MeshPattern.cs +++ b/Crow/src/Mono.Cairo/MeshPattern.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class MeshPattern : Pattern { diff --git a/Crow/src/Mono.Cairo/NativeMethods.cs b/Crow/src/Mono.Cairo/NativeMethods.cs index 8ed90290..1b423209 100644 --- a/Crow/src/Mono.Cairo/NativeMethods.cs +++ b/Crow/src/Mono.Cairo/NativeMethods.cs @@ -1,4 +1,4 @@ -// +// // Cairo.cs - a simplistic binding of the Cairo API to C#. // // Authors: Duncan Mak (duncan@ximian.com) @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo +namespace Crow.Cairo { // sort the functions like in the following page so it is easier to find what is missing // http://cairographics.org/manual/index-all.html diff --git a/Crow/src/Mono.Cairo/Operator.cs b/Crow/src/Mono.Cairo/Operator.cs index f233a25f..1c11cccc 100644 --- a/Crow/src/Mono.Cairo/Operator.cs +++ b/Crow/src/Mono.Cairo/Operator.cs @@ -31,7 +31,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum Operator diff --git a/Crow/src/Mono.Cairo/PSSurface.cs b/Crow/src/Mono.Cairo/PSSurface.cs index 9d6b73be..cf90794e 100644 --- a/Crow/src/Mono.Cairo/PSSurface.cs +++ b/Crow/src/Mono.Cairo/PSSurface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class PSSurface : Surface { diff --git a/Crow/src/Mono.Cairo/Path.cs b/Crow/src/Mono.Cairo/Path.cs index 184c606c..a55f03b0 100644 --- a/Crow/src/Mono.Cairo/Path.cs +++ b/Crow/src/Mono.Cairo/Path.cs @@ -30,9 +30,9 @@ using System; using System.Runtime.InteropServices; -using Cairo; +using Crow.Cairo; -namespace Cairo { +namespace Crow.Cairo { public class Path : IDisposable { diff --git a/Crow/src/Mono.Cairo/Pattern.cs b/Crow/src/Mono.Cairo/Pattern.cs index bc0a962a..3e933a19 100644 --- a/Crow/src/Mono.Cairo/Pattern.cs +++ b/Crow/src/Mono.Cairo/Pattern.cs @@ -30,7 +30,7 @@ using System; using System.Collections; -namespace Cairo { +namespace Crow.Cairo { public class Pattern : IDisposable { diff --git a/Crow/src/Mono.Cairo/PatternType.cs b/Crow/src/Mono.Cairo/PatternType.cs index f9b9523a..deac3ab7 100644 --- a/Crow/src/Mono.Cairo/PatternType.cs +++ b/Crow/src/Mono.Cairo/PatternType.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public enum PatternType diff --git a/Crow/src/Mono.Cairo/PdfSurface.cs b/Crow/src/Mono.Cairo/PdfSurface.cs index c980f249..09a2d126 100644 --- a/Crow/src/Mono.Cairo/PdfSurface.cs +++ b/Crow/src/Mono.Cairo/PdfSurface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class PdfSurface : Surface { diff --git a/Crow/src/Mono.Cairo/Point.cs b/Crow/src/Mono.Cairo/Point.cs index e72ca6c5..cf07f311 100644 --- a/Crow/src/Mono.Cairo/Point.cs +++ b/Crow/src/Mono.Cairo/Point.cs @@ -34,7 +34,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace Cairo { +namespace Crow.Cairo { public struct Point { public Point (int x, int y) diff --git a/Crow/src/Mono.Cairo/PointD.cs b/Crow/src/Mono.Cairo/PointD.cs index c2e3587d..8bc019c9 100644 --- a/Crow/src/Mono.Cairo/PointD.cs +++ b/Crow/src/Mono.Cairo/PointD.cs @@ -34,7 +34,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -namespace Cairo { +namespace Crow.Cairo { public struct PointD { diff --git a/Crow/src/Mono.Cairo/RadialGradient.cs b/Crow/src/Mono.Cairo/RadialGradient.cs index 6422e00d..6abe2671 100644 --- a/Crow/src/Mono.Cairo/RadialGradient.cs +++ b/Crow/src/Mono.Cairo/RadialGradient.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class RadialGradient : Gradient { diff --git a/Crow/src/Mono.Cairo/Region.cs b/Crow/src/Mono.Cairo/Region.cs index 4a82842a..5e8d8d60 100644 --- a/Crow/src/Mono.Cairo/Region.cs +++ b/Crow/src/Mono.Cairo/Region.cs @@ -23,7 +23,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo +namespace Crow.Cairo { [StructLayout(LayoutKind.Sequential)] public struct RectangleList { diff --git a/Crow/src/Mono.Cairo/ScaledFont.cs b/Crow/src/Mono.Cairo/ScaledFont.cs index 93719460..594d1be9 100644 --- a/Crow/src/Mono.Cairo/ScaledFont.cs +++ b/Crow/src/Mono.Cairo/ScaledFont.cs @@ -26,7 +26,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo { +namespace Crow.Cairo { public class ScaledFont : IDisposable { diff --git a/Crow/src/Mono.Cairo/SolidPattern.cs b/Crow/src/Mono.Cairo/SolidPattern.cs index 37864e5b..6cd89f85 100644 --- a/Crow/src/Mono.Cairo/SolidPattern.cs +++ b/Crow/src/Mono.Cairo/SolidPattern.cs @@ -29,7 +29,7 @@ using System; using Color = Crow.Color; -namespace Cairo { +namespace Crow.Cairo { public class SolidPattern : Pattern { diff --git a/Crow/src/Mono.Cairo/Status.cs b/Crow/src/Mono.Cairo/Status.cs index 54b2fec3..2df15580 100644 --- a/Crow/src/Mono.Cairo/Status.cs +++ b/Crow/src/Mono.Cairo/Status.cs @@ -32,7 +32,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum Status diff --git a/Crow/src/Mono.Cairo/SubpixelOrder.cs b/Crow/src/Mono.Cairo/SubpixelOrder.cs index 3c3a3362..95f3cbee 100644 --- a/Crow/src/Mono.Cairo/SubpixelOrder.cs +++ b/Crow/src/Mono.Cairo/SubpixelOrder.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo +namespace Crow.Cairo { public enum SubpixelOrder diff --git a/Crow/src/Mono.Cairo/Surface.cs b/Crow/src/Mono.Cairo/Surface.cs index 14f4a2b1..70821435 100644 --- a/Crow/src/Mono.Cairo/Surface.cs +++ b/Crow/src/Mono.Cairo/Surface.cs @@ -1,4 +1,4 @@ -// +// // Mono.Cairo.Surface.cs // // Authors: @@ -36,7 +36,7 @@ using System; using System.Collections; -namespace Cairo { +namespace Crow.Cairo { public class Surface : IDisposable { diff --git a/Crow/src/Mono.Cairo/SurfacePattern.cs b/Crow/src/Mono.Cairo/SurfacePattern.cs index 4422b11d..53a90d38 100644 --- a/Crow/src/Mono.Cairo/SurfacePattern.cs +++ b/Crow/src/Mono.Cairo/SurfacePattern.cs @@ -29,7 +29,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class SurfacePattern : Pattern { diff --git a/Crow/src/Mono.Cairo/SurfaceType.cs b/Crow/src/Mono.Cairo/SurfaceType.cs index b0b659c6..bd992db0 100644 --- a/Crow/src/Mono.Cairo/SurfaceType.cs +++ b/Crow/src/Mono.Cairo/SurfaceType.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public enum SurfaceType diff --git a/Crow/src/Mono.Cairo/SvgSurface.cs b/Crow/src/Mono.Cairo/SvgSurface.cs index 41829501..c7d72988 100644 --- a/Crow/src/Mono.Cairo/SvgSurface.cs +++ b/Crow/src/Mono.Cairo/SvgSurface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class SvgSurface : Surface { diff --git a/Crow/src/Mono.Cairo/SvgVersion.cs b/Crow/src/Mono.Cairo/SvgVersion.cs index 7f0f4620..916fb861 100644 --- a/Crow/src/Mono.Cairo/SvgVersion.cs +++ b/Crow/src/Mono.Cairo/SvgVersion.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public enum SvgVersion diff --git a/Crow/src/Mono.Cairo/TextExtents.cs b/Crow/src/Mono.Cairo/TextExtents.cs index f9cd560f..965ca046 100644 --- a/Crow/src/Mono.Cairo/TextExtents.cs +++ b/Crow/src/Mono.Cairo/TextExtents.cs @@ -31,7 +31,7 @@ using System; using System.Runtime.InteropServices; -namespace Cairo +namespace Crow.Cairo { [StructLayout (LayoutKind.Sequential)] public struct TextExtents diff --git a/Crow/src/Mono.Cairo/WGLDevice.cs b/Crow/src/Mono.Cairo/WGLDevice.cs index 03f7e3a4..308cfadd 100644 --- a/Crow/src/Mono.Cairo/WGLDevice.cs +++ b/Crow/src/Mono.Cairo/WGLDevice.cs @@ -29,7 +29,7 @@ // using System; -namespace Cairo +namespace Crow.Cairo { public class WGLDevice : Device { diff --git a/Crow/src/Mono.Cairo/Win32Surface.cs b/Crow/src/Mono.Cairo/Win32Surface.cs index dd244286..4776a19b 100644 --- a/Crow/src/Mono.Cairo/Win32Surface.cs +++ b/Crow/src/Mono.Cairo/Win32Surface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class Win32Surface : Surface { diff --git a/Crow/src/Mono.Cairo/XcbSurface.cs b/Crow/src/Mono.Cairo/XcbSurface.cs index 340b0fae..32a67848 100644 --- a/Crow/src/Mono.Cairo/XcbSurface.cs +++ b/Crow/src/Mono.Cairo/XcbSurface.cs @@ -28,7 +28,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class XcbSurface : Surface { internal XcbSurface (IntPtr handle, bool owns) : base (handle, owns) diff --git a/Crow/src/Mono.Cairo/XlibSurface.cs b/Crow/src/Mono.Cairo/XlibSurface.cs index c0003a49..30b56f04 100644 --- a/Crow/src/Mono.Cairo/XlibSurface.cs +++ b/Crow/src/Mono.Cairo/XlibSurface.cs @@ -34,7 +34,7 @@ using System; -namespace Cairo { +namespace Crow.Cairo { public class XlibSurface : Surface { @@ -58,7 +58,7 @@ namespace Cairo { NativeMethods.cairo_xlib_surface_set_drawable (Handle, drawable, width, height); } - public void SetSize (int width, int height) + public override void SetSize (int width, int height) { NativeMethods.cairo_xlib_surface_set_size (Handle, width, height); } diff --git a/Crow/src/Picture.cs b/Crow/src/Picture.cs index f2f45261..133bc4ef 100644 --- a/Crow/src/Picture.cs +++ b/Crow/src/Picture.cs @@ -26,7 +26,7 @@ using System; using System.IO; -using Cairo; +using Crow.Cairo; using System.Collections.Generic; namespace Crow diff --git a/Crow/src/SolidColor.cs b/Crow/src/SolidColor.cs index d6423d31..f14c7cf7 100644 --- a/Crow/src/SolidColor.cs +++ b/Crow/src/SolidColor.cs @@ -31,7 +31,7 @@ using System.Text; using System.Xml.Serialization; using System.Reflection; using System.Diagnostics; -using Cairo; +using Crow.Cairo; diff --git a/Crow/src/SvgPicture.cs b/Crow/src/SvgPicture.cs index dee6c8e0..33f68955 100644 --- a/Crow/src/SvgPicture.cs +++ b/Crow/src/SvgPicture.cs @@ -26,7 +26,7 @@ using System; using System.IO; -using Cairo; +using Crow.Cairo; namespace Crow { diff --git a/Crow/src/backends/win32/WinBackend.cs b/Crow/src/backends/win32/WinBackend.cs old mode 100755 new mode 100644 diff --git a/Crow/src/debug/DbgEventTypeColors.cs b/Crow/src/debug/DbgEventTypeColors.cs index e0881182..1936704e 100644 --- a/Crow/src/debug/DbgEventTypeColors.cs +++ b/Crow/src/debug/DbgEventTypeColors.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; using System.Linq; namespace Crow diff --git a/Crow/src/debug/DbgLogViewer.cs b/Crow/src/debug/DbgLogViewer.cs index c10cfdf6..4ff6082e 100644 --- a/Crow/src/debug/DbgLogViewer.cs +++ b/Crow/src/debug/DbgLogViewer.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Cairo; +using Crow.Cairo; #if DEBUG_LOG namespace Crow diff --git a/Crow/src/debug/DebugLogger.cs b/Crow/src/debug/DebugLogger.cs index 38cbc2af..f1eaf9c8 100644 --- a/Crow/src/debug/DebugLogger.cs +++ b/Crow/src/debug/DebugLogger.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; using System.Collections.Generic; using System.Diagnostics; using System.IO; diff --git a/Crow/src/rsvg/Handle.cs b/Crow/src/rsvg/Handle.cs index e13f79ad..26e7869c 100644 --- a/Crow/src/rsvg/Handle.cs +++ b/Crow/src/rsvg/Handle.cs @@ -1,5 +1,5 @@ -//Copyright GPL2 -using Cairo; +//Copyright GPL2 +using Crow.Cairo; namespace Rsvg { @@ -108,7 +108,7 @@ namespace Rsvg { [DllImport("rsvg-2")] static extern void rsvg_handle_render_cairo_sub(IntPtr raw, IntPtr cr, string id); - public void RenderCairoSub(Cairo.Context cr, string id) { + public void RenderCairoSub(Crow.Cairo.Context cr, string id) { rsvg_handle_render_cairo_sub(Raw, cr == null ? IntPtr.Zero : cr.Handle, id); } diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index a03948bb..590ca9c8 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -1,7 +1,7 @@ - net471;netstandard2.0 + net472 $(SolutionDir)build\$(Configuration)\ Exe https://github.com/jpbruyere/Crow @@ -15,7 +15,7 @@ full - TRACE;NETSTANDARD2_0;DEBUG;NETCOREAPP2_0 + TRACE;DEBUG @@ -43,8 +43,19 @@ Crow.%(Filename).template - + + + + + + + + + + + + diff --git a/CrowIDE/IDE.style b/CrowIDE/IDE.style index 5b5054ab..95a821fe 100644 --- a/CrowIDE/IDE.style +++ b/CrowIDE/IDE.style @@ -1,5 +1,6 @@ -Label { - Foreground="Black"; +//test +Label { + Foreground="White"; } icon { Width="14"; @@ -60,5 +61,5 @@ Splitter { Background="RoyalBlue"; } DockWindow { - Background="0.98,0.98,0.99,0.9"; + Background="0.18,0.18,0.18,0.9"; } diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index a135e466..0aa743b2 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -112,17 +112,17 @@ namespace Crow.Coding { using (app = new CrowIDE ()) { MainIFace = app; - //app.Keyboard.KeyDown += App_KeyboardKeyDown; - app.initIde (); - - app.reloadWinConfigs (); - app.Run (); app.saveWinConfigs (); } } + protected override void Startup () + { + initIde (); + reloadWinConfigs (); + } static void App_KeyboardKeyDown (object sender, KeyEventArgs e) { @@ -142,7 +142,7 @@ namespace Crow.Coding } Instantiator instFileDlg; - Solution currentSolution; + Workspace currentSolution; Project currentProject; DockStack mainDock; @@ -159,9 +159,9 @@ namespace Crow.Coding mainDock = go.FindByName ("mainDock") as DockStack; if (ReopenLastSolution && !string.IsNullOrEmpty (LastOpenSolution)) { - CurrentSolution = Solution.LoadSolution (LastOpenSolution); + CurrentSolution = new Workspace (LastOpenSolution); //lock(MainIFace.UpdateMutex) - CurrentSolution.ReopenItemsSavedInUserConfig (); + // CurrentSolution.ReopenItemsSavedInUserConfig (); } instFileDlg = Instantiator.CreateFromImlFragment @@ -197,7 +197,7 @@ namespace Crow.Coding Crow.Configuration.Global.Set ("CurrentDirectory", value); } } - public Solution CurrentSolution { + public Workspace CurrentSolution { get { return currentSolution; } set { if (currentSolution == value) @@ -257,7 +257,7 @@ namespace Crow.Coding try { string ext = Path.GetExtension (filePath); if (string.Equals (ext, ".sln", StringComparison.InvariantCultureIgnoreCase)) { - CurrentSolution = Solution.LoadSolution (filePath); + CurrentSolution = new Workspace (filePath); LastOpenSolution = filePath; // }else if (string.Equals (ext, ".csproj", StringComparison.InvariantCultureIgnoreCase)) { // currentProject = new Project (filePath); diff --git a/CrowIDE/src/DesignInterface.cs b/CrowIDE/src/DesignInterface.cs index ae9af80c..241e80ee 100644 --- a/CrowIDE/src/DesignInterface.cs +++ b/CrowIDE/src/DesignInterface.cs @@ -30,7 +30,7 @@ using System.Threading; using System.Collections.Generic; using System.Diagnostics; using System.IO; -using Cairo; +using Crow.Cairo; namespace Crow.Coding { @@ -56,10 +56,21 @@ namespace Crow.Coding public DesignInterface () : base() { + surf = new ImageSurface (Format.Argb32, 100, 100); + + loadStyling (); } + public override void InterfaceThread () + { - public ProjectFile ProjFile; + //running = true; + //while (running) { + // Update (); + // Thread.Sleep (5); + //} + } + public ProjectFile ProjFile; public override Widget CreateInstance (string path) @@ -80,10 +91,7 @@ namespace Crow.Coding throw new Exception ($"In Design File not found: {path}"); } - protected override void InitBackend () - { - surf = new ImageSurface (Format.Argb32, 100, 100); - } + public override void ProcessResize (Rectangle bounds) { if (bounds == clientRectangle) diff --git a/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs b/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs index b60617c1..3dec9c9c 100644 --- a/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs +++ b/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs @@ -28,7 +28,7 @@ using System; using System.Xml.Serialization; using System.ComponentModel; using System.Collections; -using Cairo; +using Crow.Cairo; using System.Text; using System.Collections.Generic; using System.Text.RegularExpressions; diff --git a/CrowIDE/src/Editors/ImlVisualEditor.cs b/CrowIDE/src/Editors/ImlVisualEditor.cs index 616d9a6b..29154102 100644 --- a/CrowIDE/src/Editors/ImlVisualEditor.cs +++ b/CrowIDE/src/Editors/ImlVisualEditor.cs @@ -29,7 +29,7 @@ using Crow.IML; using System.Text; using System.Xml; using System.Diagnostics; -using Cairo; +using Crow.Cairo; namespace Crow.Coding { diff --git a/CrowIDE/src/Editors/SourceEditor.cs b/CrowIDE/src/Editors/SourceEditor.cs index e574d660..e800e002 100644 --- a/CrowIDE/src/Editors/SourceEditor.cs +++ b/CrowIDE/src/Editors/SourceEditor.cs @@ -26,7 +26,7 @@ using System; using System.ComponentModel; -using Cairo; +using Crow.Cairo; using System.Collections.Generic; using System.Diagnostics; diff --git a/CrowIDE/src/Editors/SvgEditor.cs b/CrowIDE/src/Editors/SvgEditor.cs index 97b19603..fbfafb7d 100644 --- a/CrowIDE/src/Editors/SvgEditor.cs +++ b/CrowIDE/src/Editors/SvgEditor.cs @@ -25,7 +25,7 @@ // THE SOFTWARE. using System; using System.ComponentModel; -using Cairo; +using Crow.Cairo; namespace Crow.Coding { diff --git a/CrowIDE/src/GraphicObjectDesignContainer.cs b/CrowIDE/src/GraphicObjectDesignContainer.cs index e5d620a6..e996ce3e 100644 --- a/CrowIDE/src/GraphicObjectDesignContainer.cs +++ b/CrowIDE/src/GraphicObjectDesignContainer.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using Cairo; +using Crow.Cairo; namespace Crow.Coding { diff --git a/CrowIDE/src/MemberView/MembersView.cs b/CrowIDE/src/MemberView/MembersView.cs index bd6ad144..27d1e025 100644 --- a/CrowIDE/src/MemberView/MembersView.cs +++ b/CrowIDE/src/MemberView/MembersView.cs @@ -25,7 +25,7 @@ using System.ComponentModel; using System.Reflection; using System.Collections.Generic; using System.Linq; -using Cairo; +using Crow.Cairo; namespace Crow.Coding { diff --git a/CrowIDE/src/MemberView/PropertyContainer.cs b/CrowIDE/src/MemberView/PropertyContainer.cs index 4d043ab4..f8e71d3d 100644 --- a/CrowIDE/src/MemberView/PropertyContainer.cs +++ b/CrowIDE/src/MemberView/PropertyContainer.cs @@ -200,6 +200,7 @@ namespace Crow.Coding return; FileLocation fl = g.design_style_locations [Name]; ProjectFile pf; + /* if (!mview.ProjectNode.Project.TryGetProjectFileFromPath ("#" + fl.FilePath, out pf)) return; @@ -209,7 +210,7 @@ namespace Crow.Coding pf.CurrentLine = fl.Line; pf.CurrentColumn = fl.Column; - pf.IsSelected = true; + pf.IsSelected = true;*/ } diff --git a/CrowIDE/src/Project.cs b/CrowIDE/src/Project.cs index c916095b..b12d67c8 100644 --- a/CrowIDE/src/Project.cs +++ b/CrowIDE/src/Project.cs @@ -32,6 +32,7 @@ using Microsoft.CSharp; using System.CodeDom.Compiler; using Crow; using System.Text.RegularExpressions; +using Microsoft.Build.Construction; namespace Crow.Coding { public class Project : IValueChange { @@ -43,21 +44,21 @@ namespace Crow.Coding { #endregion bool isLoaded = false; - bool isExpanded; - XmlDocument xmlDoc; - XmlNode nodeProject; - XmlNode nodeProps; - XmlNodeList nodesItems; - SolutionProject solutionProject; - Crow.Command cmdSave, cmdOpen, cmdCompile, cmdSetAsStartProj, cmdNewFile; + bool isExpanded; + ProjectInSolution solutionProject; + Microsoft.Build.Evaluation.Project project; + + Crow.Command cmdSave, cmdOpen, cmdCompile, cmdSetAsStartProj, cmdNewFile; #region CTOR - public Project (Solution sol, SolutionProject sp) { + public Project (Workspace sol, ProjectInSolution sp) { solutionProject = sp; - solution = sol; - cmdSave = new Crow.Command (new Action (() => Save ())) { Caption = "Save", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = true }; + ProjectRootElement projectRootElt = ProjectRootElement.Open (solutionProject.AbsolutePath); + project = new Microsoft.Build.Evaluation.Project (projectRootElt, null, "15.0"); + + cmdSave = new Crow.Command (new Action (() => Save ())) { Caption = "Save", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = true }; cmdOpen = new Crow.Command (new Action (() => Load ())) { Caption = "Open", Icon = new SvgPicture ("#CrowIDE.icons.open.svg"), CanExecute = false }; cmdCompile = new Crow.Command (new Action (() => Compile ())) { Caption = "Compile", @@ -78,13 +79,12 @@ namespace Crow.Coding { } #endregion - public Solution solution; + public Workspace solution; public List Commands; public CompilerResults CompilationResults; public List dependantProjects = new List (); public Project ParentProject = null; - List rootItems; - List flattenNodes; + List rootItems; public string Name { get { return solutionProject.ProjectName; } @@ -111,147 +111,60 @@ namespace Crow.Coding { get { return solution.StartupProject == this; } } public string Path { - get { return System.IO.Path.Combine (solution.SolutionFolder, solutionProject.RelativePath.Replace ('\\', '/')); } + get { return System.IO.Path.Combine (project.DirectoryPath.Replace ('\\', '/')); } } public string RootDir { get { return System.IO.Path.GetDirectoryName (Path); } } - - public List RootItems { get { return rootItems; } } - - void buildTreeNodes () { - ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace); - List items = new List (); - foreach (XmlNode i in nodesItems) { - foreach (XmlNode f in i.ChildNodes) { - items.Add (new ProjectItem (this, f)); - } - } - - flattenNodes = new List (); - - ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References"); - root.AddChild (refs); - - foreach (ProjectItem pn in items) { - switch (pn.Type) { - case ItemType.Reference: - refs.AddChild (pn); - flattenNodes.Add (pn); - break; - case ItemType.ProjectReference: - ProjectReference pr = new ProjectReference (pn); - refs.AddChild (pr); - flattenNodes.Add (pr); - break; - case ItemType.Compile: - case ItemType.None: - case ItemType.EmbeddedResource: - ProjectNode curNode = root; - string[] folds = pn.Path.Split ('/'); - for (int i = 0; i < folds.Length - 1; i++) { - ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds[i] && n.Type == ItemType.VirtualGroup); - if (nextNode == null) { - nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds[i]); - curNode.AddChild (nextNode); - } - curNode = nextNode; - } - ProjectNode f = null; - switch (pn.Extension) { - /*case ".cs": - f = new CSProjectFile (pn); - break;*/ - case ".crow": - case ".template": - case ".goml": - case ".itemp": - case ".imtl": - f = new ImlProjectItem (pn); - break; - case ".style": - f = new StyleProjectItem (pn); - break; - default: - f = new ProjectFile (pn); - break; - } - curNode.AddChild (f); - flattenNodes.Add (f); - break; - } - } - root.SortChilds (); - - rootItems = root.ChildNodes; - } - + #region Project properties public string ToolsVersion { - get { return nodeProject?.Attributes["ToolsVersion"]?.Value; } + get { return project.ToolsVersion; } } public string DefaultTargets { - get { return nodeProject?.Attributes["DefaultTargets"]?.Value; } + get { return project.Xml.DefaultTargets; } } public string ProjectGuid { get { return solutionProject.ProjectGuid; } } - public string AssemblyName { - get { return nodeProps["AssemblyName"]?.InnerText; } - } - public string OutputType { - get { return nodeProps["OutputType"]?.InnerText; } - } - public string RootNamespace { - get { return nodeProps["RootNamespace"]?.InnerText; } - } + public string AssemblyName => project.AllEvaluatedProperties.Where(p=>p.Name =="AssemblyName").FirstOrDefault().EvaluatedValue; + public string OutputType => project.AllEvaluatedProperties.Where (p => p.Name == "OutputType").FirstOrDefault ().EvaluatedValue; + public string RootNamespace => project.AllEvaluatedProperties.Where (p => p.Name == "RootNamespace").FirstOrDefault ().EvaluatedValue; public bool AllowUnsafeBlocks { get { - return nodeProps["AllowUnsafeBlocks"] == null ? false : - bool.Parse (nodeProps["AllowUnsafeBlocks"]?.InnerText); + return false; + /*return nodeProps["AllowUnsafeBlocks"] == null ? false : + bool.Parse (nodeProps["AllowUnsafeBlocks"]?.InnerText);*/ } } public bool NoStdLib { get { - return nodeProps["NoStdLib"] == null ? false : - bool.Parse (nodeProps["NoStdLib"]?.InnerText); + return false; + /*return nodeProps["NoStdLib"] == null ? false : + bool.Parse (nodeProps["NoStdLib"]?.InnerText);*/ } } public bool TreatWarningsAsErrors { get { - return nodeProps["TreatWarningsAsErrors"] == null ? false : - bool.Parse (nodeProps["TreatWarningsAsErrors"]?.InnerText); + return false; + /*return nodeProps["TreatWarningsAsErrors"] == null ? false : + bool.Parse (nodeProps["TreatWarningsAsErrors"]?.InnerText);*/ } } public bool SignAssembly { - get { return bool.Parse (nodeProps["SignAssembly"]?.InnerText); } - } - public string TargetFrameworkVersion { - get { return nodeProps["TargetFrameworkVersion"]?.InnerText; } - } - public string Description { - get { return nodeProps["Description"]?.InnerText; } - } - public string OutputPath { - get { return nodeProps["OutputPath"]?.InnerText; } - } - public string IntermediateOutputPath { - get { return nodeProps["IntermediateOutputPath"]?.InnerText; } - } - public string StartupObject { - get { return nodeProps["StartupObject"]?.InnerText; } - } - public bool DebugSymbols { - get { return nodeProps["DebugSymbols"] == null ? false : bool.Parse (nodeProps["DebugSymbols"]?.InnerText); } - } - public int WarningLevel { - get { return nodeProps["WarningLevel"] == null ? 0 : int.Parse (nodeProps["WarningLevel"]?.InnerText); } - } - + get { return false; }// projectRootElt.Properties.Where (p => p.Name == "SignAssembly").FirstOrDefault ().Value; } + } + public string TargetFrameworkVersion => project.AllEvaluatedProperties.Where (p => p.Name == "TargetFrameworkVersion").FirstOrDefault ().EvaluatedValue; + public string Description => project.AllEvaluatedProperties.Where (p => p.Name == "Description").FirstOrDefault ().EvaluatedValue; + public string OutputPath => project.AllEvaluatedProperties.Where (p => p.Name == "OutputPath").FirstOrDefault ().EvaluatedValue; + public string IntermediateOutputPath => project.AllEvaluatedProperties.Where (p => p.Name == "IntermediateOutputPath").FirstOrDefault ().EvaluatedValue; + public string StartupObject => project.AllEvaluatedProperties.Where (p => p.Name == "StartupObject").FirstOrDefault ().EvaluatedValue; + public bool DebugSymbols => false;// nodeProps["DebugSymbols"] == null ? false : bool.Parse (nodeProps["DebugSymbols"]?.InnerText); } + public int WarningLevel => 0; #endregion @@ -261,26 +174,67 @@ namespace Crow.Coding { public void Load () { - xmlDoc = new XmlDocument (); - using (Stream ins = new FileStream (this.Path, FileMode.Open)) { - xmlDoc.Load (new XmlTextReader (ins) { Namespaces = false }); - } - - nodeProject = xmlDoc.SelectSingleNode ("Project"); - XmlNodeList nodesProps = xmlDoc.SelectNodes ("/Project/PropertyGroup"); - - foreach (XmlNode n in nodesProps) { - if (n.Attributes["Condition"] == null) - nodeProps = n; - } - nodesItems = xmlDoc.SelectNodes ("/Project/ItemGroup"); - - if (ProjectGuid != solutionProject.ProjectGuid) - throw new Exception ("Project GUID not matching with solution"); - - buildTreeNodes (); - - IsLoaded = true; + ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace); + ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References"); + root.AddChild (refs); + + foreach (Microsoft.Build.Evaluation.ProjectItem pn in project.AllEvaluatedItems) { + switch (pn.ItemType) { + case "Reference": + refs.AddChild (new ProjectItem(this, pn)); + break; + case "ProjectReference": + ProjectReference pr = new ProjectReference (this, pn); + refs.AddChild (pr); + break; + case "Compile": + case "None": + case "EmbeddedResource": + + ProjectNode curNode = root; + try { + string file = pn.EvaluatedInclude.Replace ('\\', '/'); + string [] folds = file.Split ('/'); + for (int i = 0; i < folds.Length - 1; i++) { + ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup); + if (nextNode == null) { + nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds [i]); + curNode.AddChild (nextNode); + } + curNode = nextNode; + } + ProjectItem pi = new ProjectItem (this, pn); + + switch (System.IO.Path.GetExtension (file)) { + /*case ".cs": + f = new CSProjectFile (pn); + break;*/ + case ".crow": + case ".template": + case ".goml": + case ".itemp": + case ".imtl": + pi = new ImlProjectItem (pi); + break; + case ".style": + pi = new StyleProjectItem (pi); + break; + default: + pi = new ProjectFile (pi); + break; + } + curNode.AddChild (pi); + + } catch (Exception ex) { + + } + + break; + } + } + root.SortChilds (); + rootItems = root.ChildNodes; + IsLoaded = true; } public void Save () { @@ -311,164 +265,164 @@ namespace Crow.Coding { return tmp; } public string Compile () { - if (ParentProject != null) - ParentProject.Compile (); - - CSharpCodeProvider cp = new CSharpCodeProvider (); - CompilerParameters parameters = new CompilerParameters (); - - foreach (ProjectReference pr in flattenNodes.OfType ()) { - Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID); - if (p == null) - throw new Exception ("referenced project not found"); - parameters.ReferencedAssemblies.Add (p.Compile ()); - } - - string outputDir = getDirectoryWithTokens (this.OutputPath); - string objDir = getDirectoryWithTokens (this.IntermediateOutputPath); - - Directory.CreateDirectory (outputDir); - Directory.CreateDirectory (objDir); - - parameters.OutputAssembly = System.IO.Path.Combine (outputDir, this.AssemblyName); - - // True - exe file generation, false - dll file generation - if (this.OutputType == "Library") { - parameters.GenerateExecutable = false; - parameters.CompilerOptions += " /target:library"; - parameters.OutputAssembly += ".dll"; - } else { - parameters.GenerateExecutable = true; - parameters.CompilerOptions += " /target:exe"; - parameters.OutputAssembly += ".exe"; - parameters.MainClass = this.StartupObject; - } - - parameters.GenerateInMemory = false; - parameters.IncludeDebugInformation = this.DebugSymbols; - parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors; - parameters.WarningLevel = this.WarningLevel; - parameters.CompilerOptions += " /noconfig"; - if (this.AllowUnsafeBlocks) - parameters.CompilerOptions += " /unsafe"; - parameters.CompilerOptions += " /delaysign+"; - parameters.CompilerOptions += " /debug:full /debug+"; - parameters.CompilerOptions += " /optimize-"; - parameters.CompilerOptions += " /define:\"DEBUG;TRACE\""; - parameters.CompilerOptions += " /nostdlib"; - - - - foreach (ProjectItem pi in flattenNodes.Where (p => p.Type == ItemType.Reference)) { - - if (string.IsNullOrEmpty (pi.HintPath)) { - parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/" + pi.Path + ".dll"; - continue; - } - parameters.ReferencedAssemblies.Add (pi.Path); - string fullHintPath = System.IO.Path.GetFullPath (System.IO.Path.Combine (RootDir, pi.HintPath.Replace ('\\', '/'))); - if (File.Exists (fullHintPath)) { - string outPath = System.IO.Path.Combine (outputDir, System.IO.Path.GetFileName (fullHintPath)); - if (!File.Exists (outPath)) - File.Copy (fullHintPath, outPath); - } - } - parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/System.Core.dll"; - parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/mscorlib.dll"; - //parameters.ReferencedAssemblies.Add ("System.Core"); - //parameters.ReferencedAssemblies.Add ("mscorlib.dll"); - - - IEnumerable pfs = flattenNodes.OfType (); - - foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.EmbeddedResource)) { - - string absPath = pi.AbsolutePath; - string logicName = pi.LogicalName; - if (string.IsNullOrEmpty (logicName)) - parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, this.Name + "." + pi.Path.Replace ('/', '.')); - else - parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName); - } - foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.None)) { - if (pi.CopyToOutputDirectory == CopyToOutputState.Never) - continue; - string source = pi.AbsolutePath; - string target = System.IO.Path.Combine (outputDir, pi.Path); - Directory.CreateDirectory (System.IO.Path.GetDirectoryName (target)); - - if (File.Exists (target)) { - if (pi.CopyToOutputDirectory == CopyToOutputState.PreserveNewest) { - if (DateTime.Compare ( - System.IO.File.GetLastWriteTime (source), - System.IO.File.GetLastWriteTime (target)) < 0) - continue; - } - File.Delete (target); - } - System.Diagnostics.Debug.WriteLine ("copy " + source + " to " + target); - File.Copy (source, target); - } - string[] files = pfs.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray (); - - System.Diagnostics.Debug.WriteLine ("---- start compilation of :" + parameters.OutputAssembly); - System.Diagnostics.Debug.WriteLine (parameters.CompilerOptions); - - CompilationResults = cp.CompileAssemblyFromFile (parameters, files); - - solution.UpdateErrorList (); - - return parameters.OutputAssembly; - } - - public bool TryGetProjectFileFromAbsolutePath (string absolutePath, out ProjectFile pi) { - pi = flattenNodes.OfType ().FirstOrDefault - (pp => pp.AbsolutePath == absolutePath); - return pi != null; - } - public bool TryGetProjectFileFromPath (string path, out ProjectFile pi) { - if (path.StartsWith ("#", StringComparison.Ordinal)) - pi = flattenNodes.OfType ().FirstOrDefault - (pp => pp.Type == ItemType.EmbeddedResource && pp.ResourceID == path.Substring (1)); - else - pi = flattenNodes.OfType ().FirstOrDefault (pp => pp.Path == path); - - if (pi != null) - return true; - - foreach (ProjectReference pr in flattenNodes.OfType ()) { - Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID); - if (p == null) - throw new Exception ("referenced project not found"); - if (p.TryGetProjectFileFromPath (path, out pi)) - return true; - } - //TODO: search referenced assemblies - return false; + // if (ParentProject != null) + // ParentProject.Compile (); + + // CSharpCodeProvider cp = new CSharpCodeProvider (); + // CompilerParameters parameters = new CompilerParameters (); + + // foreach (ProjectReference pr in flattenNodes.OfType ()) { + // Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID); + // if (p == null) + // throw new Exception ("referenced project not found"); + // parameters.ReferencedAssemblies.Add (p.Compile ()); + // } + + // string outputDir = getDirectoryWithTokens (this.OutputPath); + // string objDir = getDirectoryWithTokens (this.IntermediateOutputPath); + + // Directory.CreateDirectory (outputDir); + // Directory.CreateDirectory (objDir); + + // parameters.OutputAssembly = System.IO.Path.Combine (outputDir, this.AssemblyName); + + // // True - exe file generation, false - dll file generation + // if (this.OutputType == "Library") { + // parameters.GenerateExecutable = false; + // parameters.CompilerOptions += " /target:library"; + // parameters.OutputAssembly += ".dll"; + // } else { + // parameters.GenerateExecutable = true; + // parameters.CompilerOptions += " /target:exe"; + // parameters.OutputAssembly += ".exe"; + // parameters.MainClass = this.StartupObject; + // } + + // parameters.GenerateInMemory = false; + // parameters.IncludeDebugInformation = this.DebugSymbols; + // parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors; + // parameters.WarningLevel = this.WarningLevel; + // parameters.CompilerOptions += " /noconfig"; + // if (this.AllowUnsafeBlocks) + // parameters.CompilerOptions += " /unsafe"; + // parameters.CompilerOptions += " /delaysign+"; + // parameters.CompilerOptions += " /debug:full /debug+"; + // parameters.CompilerOptions += " /optimize-"; + // parameters.CompilerOptions += " /define:\"DEBUG;TRACE\""; + // parameters.CompilerOptions += " /nostdlib"; + + + + // foreach (ProjectItem pi in flattenNodes.Where (p => p.Type == ItemType.Reference)) { + + // if (string.IsNullOrEmpty (pi.HintPath)) { + // parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/" + pi.Path + ".dll"; + // continue; + // } + // parameters.ReferencedAssemblies.Add (pi.Path); + // string fullHintPath = System.IO.Path.GetFullPath (System.IO.Path.Combine (RootDir, pi.HintPath.Replace ('\\', '/'))); + // if (File.Exists (fullHintPath)) { + // string outPath = System.IO.Path.Combine (outputDir, System.IO.Path.GetFileName (fullHintPath)); + // if (!File.Exists (outPath)) + // File.Copy (fullHintPath, outPath); + // } + // } + // parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/System.Core.dll"; + // parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/mscorlib.dll"; + // //parameters.ReferencedAssemblies.Add ("System.Core"); + // //parameters.ReferencedAssemblies.Add ("mscorlib.dll"); + + + // IEnumerable pfs = flattenNodes.OfType (); + + // foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.EmbeddedResource)) { + + // string absPath = pi.AbsolutePath; + // string logicName = pi.LogicalName; + // if (string.IsNullOrEmpty (logicName)) + // parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, this.Name + "." + pi.Path.Replace ('/', '.')); + // else + // parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName); + // } + // foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.None)) { + // if (pi.CopyToOutputDirectory == CopyToOutputState.Never) + // continue; + // string source = pi.AbsolutePath; + // string target = System.IO.Path.Combine (outputDir, pi.Path); + // Directory.CreateDirectory (System.IO.Path.GetDirectoryName (target)); + + // if (File.Exists (target)) { + // if (pi.CopyToOutputDirectory == CopyToOutputState.PreserveNewest) { + // if (DateTime.Compare ( + // System.IO.File.GetLastWriteTime (source), + // System.IO.File.GetLastWriteTime (target)) < 0) + // continue; + // } + // File.Delete (target); + // } + // System.Diagnostics.Debug.WriteLine ("copy " + source + " to " + target); + // File.Copy (source, target); + // } + // string[] files = pfs.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray (); + + // System.Diagnostics.Debug.WriteLine ("---- start compilation of :" + parameters.OutputAssembly); + // System.Diagnostics.Debug.WriteLine (parameters.CompilerOptions); + + // CompilationResults = cp.CompileAssemblyFromFile (parameters, files); + + // solution.UpdateErrorList (); + + // return parameters.OutputAssembly; + //} + + //public bool TryGetProjectFileFromAbsolutePath (string absolutePath, out ProjectFile pi) { + // pi = flattenNodes.OfType ().FirstOrDefault + // (pp => pp.AbsolutePath == absolutePath); + // return pi != null; + //} + //public bool TryGetProjectFileFromPath (string path, out ProjectFile pi) { + //if (path.StartsWith ("#", StringComparison.Ordinal)) + // pi = flattenNodes.OfType ().FirstOrDefault + // (pp => pp.Type == ItemType.EmbeddedResource && pp.ResourceID == path.Substring (1)); + //else + // pi = flattenNodes.OfType ().FirstOrDefault (pp => pp.Path == path); + + //if (pi != null) + // return true; + + //foreach (ProjectReference pr in flattenNodes.OfType ()) { + // Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID); + // if (p == null) + // throw new Exception ("referenced project not found"); + // if (p.TryGetProjectFileFromPath (path, out pi)) + // return true; + //} + ////TODO: search referenced assemblies + return ""; } public void GetDefaultTemplates () { - IEnumerable tmpFiles = - flattenNodes.OfType ().Where (pp => pp.Extension == ".template"); - - foreach (ProjectFile pi in tmpFiles.Where ( - pp => pp.Type == ItemType.None && pp.CopyToOutputDirectory != CopyToOutputState.Never)) { - - string clsName = System.IO.Path.GetFileNameWithoutExtension (pi.Path); - if (solution.DefaultTemplates.ContainsKey (clsName)) - continue; - solution.DefaultTemplates[clsName] = pi.AbsolutePath; - } - foreach (ProjectFile pi in tmpFiles.Where (pp => pp.Type == ItemType.EmbeddedResource)) { - string resId = pi.ResourceID; - string clsName = resId.Substring (0, resId.Length - 9); - if (solution.DefaultTemplates.ContainsKey (clsName)) - continue; - solution.DefaultTemplates[clsName] = pi.Path; - } - - foreach (Project p in ReferencedProjects) - p.GetDefaultTemplates (); + //IEnumerable tmpFiles = + // flattenNodes.OfType ().Where (pp => pp.Extension == ".template"); + + //foreach (ProjectFile pi in tmpFiles.Where ( + // pp => pp.Type == ItemType.None && pp.CopyToOutputDirectory != CopyToOutputState.Never)) { + + // string clsName = System.IO.Path.GetFileNameWithoutExtension (pi.Path); + // if (solution.DefaultTemplates.ContainsKey (clsName)) + // continue; + // solution.DefaultTemplates[clsName] = pi.AbsolutePath; + //} + //foreach (ProjectFile pi in tmpFiles.Where (pp => pp.Type == ItemType.EmbeddedResource)) { + // string resId = pi.ResourceID; + // string clsName = resId.Substring (0, resId.Length - 9); + // if (solution.DefaultTemplates.ContainsKey (clsName)) + // continue; + // solution.DefaultTemplates[clsName] = pi.Path; + //} + + //foreach (Project p in ReferencedProjects) + //p.GetDefaultTemplates (); } // void searchTemplatesIn(Assembly assembly){ // if (assembly == null) @@ -486,17 +440,17 @@ namespace Crow.Coding { public List ReferencedProjects { get { List tmp = new List (); - foreach (ProjectReference pr in flattenNodes.OfType ()) { + /*foreach (ProjectReference pr in flattenNodes.OfType ()) { Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID); if (p != null) tmp.Add (p); - } + }*/ return tmp; } } public void GetStyling () { - try { + /*try { foreach (ProjectFile pi in flattenNodes.OfType ().Where (pp => pp.Type == ItemType.EmbeddedResource && pp.Extension == ".style")) { using (Stream s = new MemoryStream (System.Text.Encoding.UTF8.GetBytes (pi.Source))) { new StyleReader (solution.Styling, s, pi.ResourceID); @@ -510,7 +464,7 @@ namespace Crow.Coding { if (p != null) //throw new Exception ("referenced project not found"); p.GetStyling (); - } + }*/ //TODO:get styling from referenced assemblies } diff --git a/CrowIDE/src/ProjectTree/ProjectFile.cs b/CrowIDE/src/ProjectTree/ProjectFile.cs index 294a28f5..24a31b97 100644 --- a/CrowIDE/src/ProjectTree/ProjectFile.cs +++ b/CrowIDE/src/ProjectTree/ProjectFile.cs @@ -77,16 +77,16 @@ namespace Crow.Coding { } public string ResourceID { - get { - return Type != ItemType.EmbeddedResource ? null : + get { + return "todo";/* Type != ItemType.EmbeddedResource ? null : node.SelectSingleNode ("LogicalName") == null ? Project.Name + "." + Path.Replace ('/', '.') : - LogicalName; + LogicalName;*/ } } public string LogicalName { get { - return node.SelectSingleNode ("LogicalName")?.InnerText; + return "todo";// node.SelectSingleNode ("LogicalName")?.InnerText; } } public bool IsOpened { @@ -214,9 +214,10 @@ namespace Crow.Coding { public CopyToOutputState CopyToOutputDirectory { get { - XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory"); + return CopyToOutputState.Never; + /*XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory"); return xn == null ? CopyToOutputState.Never : - (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true); + (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true);*/ } } diff --git a/CrowIDE/src/ProjectTree/ProjectItem.cs b/CrowIDE/src/ProjectTree/ProjectItem.cs index afa3e3ed..5c274a13 100644 --- a/CrowIDE/src/ProjectTree/ProjectItem.cs +++ b/CrowIDE/src/ProjectTree/ProjectItem.cs @@ -30,18 +30,19 @@ using System.Xml; using System.IO; using Crow; using System.Threading; +using Microsoft.Build.Construction; namespace Crow.Coding { public class ProjectItem : ProjectNode { #region CTOR public ProjectItem() {} - public ProjectItem (Project project, XmlNode _node) : base (project){ + public ProjectItem (Project project, Microsoft.Build.Evaluation.ProjectItem _node) : base (project){ node = _node; } #endregion - public XmlNode node; + public Microsoft.Build.Evaluation.ProjectItem node; public override Picture Icon { get { @@ -64,17 +65,17 @@ namespace Crow.Coding } public string Path { get { - return node.Attributes["Include"]?.Value.Replace('\\','/'); + return node.EvaluatedInclude?.Replace('\\','/'); } } public string AbsolutePath { get { - return System.IO.Path.Combine (Project.RootDir, Path); + return System.IO.Path.Combine (Project.Path, Path); } } public override ItemType Type { get { - return (ItemType)Enum.Parse (typeof(ItemType), node.Name, true); + return (ItemType)Enum.Parse (typeof(ItemType), node.ItemType, true); } } public override string DisplayName { @@ -85,7 +86,7 @@ namespace Crow.Coding } } public string HintPath { - get { return node.SelectSingleNode ("HintPath")?.InnerText; } + get { return "HintPath?"; } } public override bool IsSelected { diff --git a/CrowIDE/src/ProjectTree/ProjectReference.cs b/CrowIDE/src/ProjectTree/ProjectReference.cs index 84870746..a1993b05 100644 --- a/CrowIDE/src/ProjectTree/ProjectReference.cs +++ b/CrowIDE/src/ProjectTree/ProjectReference.cs @@ -30,20 +30,21 @@ using System.Xml; using System.IO; using Crow; using System.Threading; +using Microsoft.Build.Construction; namespace Crow.Coding { public class ProjectReference : ProjectItem { - public ProjectReference (ProjectItem pi) : base (pi.Project, pi.node){ + public ProjectReference (Project proj, Microsoft.Build.Evaluation.ProjectItem pi) : base (proj, pi){ } public string ProjectGUID { get { - return node.SelectSingleNode ("Project")?.InnerText; + return "todo"; //node.SelectSingleNode ("Project")?.InnerText; } } public override string DisplayName { get { - return node.SelectSingleNode ("Name").InnerText; + return "project Ref"; // node.SelectSingleNode ("Name").InnerText; } } } diff --git a/CrowIDE/src/Solution.cs b/CrowIDE/src/Workspace.cs similarity index 54% rename from CrowIDE/src/Solution.cs rename to CrowIDE/src/Workspace.cs index e69cc5e8..a28d0fc4 100644 --- a/CrowIDE/src/Solution.cs +++ b/CrowIDE/src/Workspace.cs @@ -8,26 +8,16 @@ // 2018 Jean-Philippe Bruyère //MIT-licenced -using Microsoft.Win32; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.IO; using System.Linq; using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml.Serialization; -using Crow; - -namespace Crow.Coding{ - public class SolutionProject { - public string ProjectHostGuid; - public string ProjectName; - public string RelativePath; - public string ProjectGuid; - } +using Microsoft.Build.Construction; + +namespace Crow.Coding +{ public class StyleItemContainer { public object Value; public string Name; @@ -76,7 +66,7 @@ namespace Crow.Coding{ /// /// .sln loaded into class. /// - public class Solution: IValueChange + public class Workspace: IValueChange { #region IValueChange implementation public event EventHandler ValueChanged; @@ -86,6 +76,8 @@ namespace Crow.Coding{ } #endregion + SolutionFile solutionFile; + ProjectItem selectedItem = null; object selectedItemElement = null; ObservableList openedItems = new ObservableList(); @@ -130,8 +122,8 @@ namespace Crow.Coding{ } public bool GetProjectFileFromPath (string path, out ProjectFile pi){ pi = null; - return StartupProject == null ? false : - StartupProject.TryGetProjectFileFromPath (path, out pi); + return false;/* StartupProject == null ? false : + StartupProject.TryGetProjectFileFromPath (path, out pi);*/ } public ObservableList OpenedItems { @@ -164,7 +156,7 @@ namespace Crow.Coding{ if (SelectedItem != null) SelectedItem.IsSelected = true; - UserConfig.Set ("SelectedProjItems", SelectedItem?.AbsolutePath); + //UserConfig.Set ("SelectedProjItems", SelectedItem?.AbsolutePath); NotifyValueChanged ("SelectedItem", selectedItem); } @@ -235,12 +227,12 @@ namespace Crow.Coding{ foreach (string f in tmp.Split(';')) { foreach (Project p in Projects) { ProjectFile pi; - if (p.TryGetProjectFileFromAbsolutePath (f, out pi)) { + /*if (p.TryGetProjectFileFromAbsolutePath (f, out pi)) { pi.Open (); if (pi.AbsolutePath == sel) selItem = pi; break; - } + }*/ } } if (selItem == null) @@ -268,7 +260,7 @@ namespace Crow.Coding{ while (openedItems.Count > 0) { openedItems.RemoveElement (openedItems [0]); } - while (toolboxItems.Count > 0) { + while (toolboxItems?.Count > 0) { toolboxItems.RemoveElement (toolboxItems [0]); } NotifyValueChanged ("Projects", null); @@ -341,7 +333,7 @@ namespace Crow.Coding{ public Configuration UserConfig; public Project StartupProject { - get { return Projects?.FirstOrDefault (p => p.ProjectGuid == UserConfig.Get ("StartupProject")); } + get { return null; }// Projects?.FirstOrDefault (p => p.ProjectGuid == UserConfig.Get ("StartupProject")); } set { if (value == StartupProject) return; @@ -358,183 +350,35 @@ namespace Crow.Coding{ } #region CTOR - /// - /// Creates new solution. - /// - public Solution() { + /// + /// Creates new solution. + /// + public Workspace (string path) + { + this.path = path; + solutionFile = SolutionFile.Parse (path); + UserConfig = new Configuration (path + ".user"); + + foreach (ProjectInSolution pis in solutionFile.ProjectsInOrder) { + switch (pis.ProjectType) { + case SolutionProjectType.Unknown: + break; + case SolutionProjectType.KnownToBeMSBuildFormat: + Projects.Add (new Project (this, pis)); + break; + case SolutionProjectType.SolutionFolder: + break; + case SolutionProjectType.WebProject: + break; + case SolutionProjectType.WebDeploymentProject: + break; + case SolutionProjectType.EtpSubProject: + break; + case SolutionProjectType.SharedProject: + break; + } + } } - #endregion - - - #region Loading from SLN file - /// - /// Loads visual studio .sln solution - /// - /// The file specified in path was not found. - static public Solution LoadSolution(string path) - { - Solution s = new Solution(); - s.path = path; - - String slnTxt = File.ReadAllText(path); - // - // Extra line feed is used by Visual studio, cmake does not generate extra line feed. - // - s.slnVer = Double.Parse(Regex.Match(slnTxt, "[\r\n]?Microsoft Visual Studio Solution File, Format Version ([0-9.]+)", RegexOptions.Multiline).Groups[1].Value, CultureInfo.InvariantCulture); - - int vsNumber = Int32.Parse(Regex.Match(slnTxt, "^\\# Visual Studio (Express )?([0-9]+)", RegexOptions.Multiline).Groups[2].Value); - if (vsNumber > 2000) - s.fileFormatVersion = vsNumber; - else - s.fileFormatVersion = vsNumber - 14 + 2015; // Visual Studio 14 => vs2015, formula might not be applicable for future vs versions. - - foreach (String line in new String[] { "VisualStudioVersion", "MinimumVisualStudioVersion" }) - { - var m = Regex.Match(slnTxt, "^" + line + " = ([0-9.]+)", RegexOptions.Multiline); - String v = null; - if (m.Success) - v = m.Groups[1].Value; - - s.GetType().GetField(line).SetValue(s, v); - } - - Regex reProjects = new Regex( - "Project\\(\"(?{[A-F0-9-]+})\"\\) = \"(?.*?)\", \"(?.*?)\", \"(?{[A-F0-9-]+})\"[\r\n]*(?.*?)EndProject[\r\n]+", - RegexOptions.Singleline); - - - reProjects.Replace(slnTxt, new MatchEvaluator(m => - { - SolutionProject p = new SolutionProject (); - - foreach (String g in reProjects.GetGroupNames()) - { - if (g == "0") //"0" - RegEx special kind of group - continue; - - // - // ProjectHostGuid, ProjectName, RelativePath, ProjectGuid fields/properties are set here. - // - String v = m.Groups[g].ToString(); - if (g != "dependencies") - { - FieldInfo fi = p.GetType().GetField(g); - if (fi != null) - { - fi.SetValue(p, v); - } - else - { - p.GetType().GetProperty(g).SetValue(p, v); - } - continue; - } - - if (v == "") // No dependencies set - continue; - - String depsv = new Regex("ProjectSection\\(ProjectDependencies\\)[^\r\n]*?[\r\n]+" + "(.*?)" + "EndProjectSection", RegexOptions.Singleline).Match(v).Groups[1].Value; - - // - // key is always equal to it's value. - // http://stackoverflow.com/questions/5629981/question-about-visual-studio-sln-file-format - // - var ProjectDependencies = new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Matches(depsv).Cast().Select(x => x.Groups[1].Value).ToList(); - } //foreach - s.Projects.Add(new Project (s, p)); - return ""; - } - ) - ); - - new Regex("GlobalSection\\(SolutionConfigurationPlatforms\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m2 => - { - s.configurations = new Regex("\\s*(.*)\\s+=").Matches(m2.Groups[1].ToString()).Cast().Select(x => x.Groups[1].Value).ToList(); - return ""; - } - )); - - Console.WriteLine ("******** CONFIG ***************"); - - new Regex("GlobalSection\\(ProjectConfigurationPlatforms\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m2 => - { - foreach (Match m3 in new Regex("\\s*({[A-F0-9-]+})\\.(.*?)\\.(.*?)\\s+=\\s+(.*?)[\r\n]+").Matches(m2.Groups[1].ToString())) - { - String guid = m3.Groups[1].Value; - String solutionConfig = m3.Groups[2].Value; - String action = m3.Groups[3].Value; - String projectConfig = m3.Groups[4].Value; - - Project p = s.Projects.Where(x => x.ProjectGuid == guid).FirstOrDefault(); - if (p == null) - continue; - - Console.WriteLine ("{0},{1},{2},{3}",guid,solutionConfig,action,projectConfig); - - int iConfigIndex = s.configurations.IndexOf(solutionConfig); - if (iConfigIndex == -1) - continue; - -// while (p.slnConfigurations.Count < s.configurations.Count) -// { -// p.slnConfigurations.Add(null); -// p.slnBuildProject.Add(false); -// } -// -// if (action == "ActiveCfg") -// { -// p.slnConfigurations[iConfigIndex] = projectConfig; -// } -// else -// { -// if (action.StartsWith("Build")) -// { -// p.slnBuildProject[iConfigIndex] = true; -// } -// else -// { -// if (action.StartsWith("Deploy")) -// { -// if (p.slnDeployProject == null) p.slnDeployProject = new List(); -// -// while (p.slnDeployProject.Count < s.configurations.Count) -// p.slnDeployProject.Add(null); -// -// p.slnDeployProject[iConfigIndex] = true; -// } -// } -// } //if-esle - } - return ""; - } - )); - - // - // Initializes parent-child relationship. - // - new Regex("GlobalSection\\(NestedProjects\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m4 => - { - String v = m4.Groups[1].Value; - new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Replace(v, new MatchEvaluator(m5 => - { - String[] args = m5.Groups.Cast().Skip(1).Select(x => x.Value).ToArray(); - Project child = s.Projects.Where(x => args[0] == x.ProjectGuid).FirstOrDefault(); - Project parent = s.Projects.Where(x => args[1] == x.ProjectGuid).FirstOrDefault(); - parent.dependantProjects.Add(child); - child.ParentProject = parent; - return ""; - })); - return ""; - } - )); - - s.UserConfig = new Configuration (s.path + ".user"); - s.ReloadStyling (); - s.ReloadDefaultTemplates (); - s.updateToolboxItems (); - return s; - } //LoadSolution - #endregion - } + } } diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs index a9d48fc9..14a1a2ad 100644 --- a/Samples/HelloWorld/main.cs +++ b/Samples/HelloWorld/main.cs @@ -1,13 +1,42 @@ -using Crow; +using System; +using Crow; namespace HelloWorld { class Program : Interface { + Command CMDQuit; static void Main (string[] args) { using (Program vke = new Program ()) { - vke.Load ("#HelloWorld.helloworld.crow"); vke.Run (); } } + protected override void Startup () + { + CMDQuit = new Command (new Action (() => running = false)) { Caption = "Quit", Icon = new SvgPicture ("#Crow.Icons.exit-symbol.svg") }; + + Widget w = Load ("#HelloWorld.helloworld.crow"); + w.KeyPress += W_KeyPress; + w.DataSource = this; + } + + Color [] colors = { Color.Blue, Color.DarkGoldenRod, Color.Red, Color.Azure, Color.Brown, Color.Black, Color.White, Color.Pink }; + int ptr = 0; + + void W_KeyPress (object sender, KeyPressEventArgs e) + { + switch (e.KeyChar) { + case 'w': + LoadIMLFragment ($""); + break; + case 'x': + LoadIMLFragment ($""); + break; + } + + ptr++; + if (ptr == colors.Length) + ptr = 0; + } + } } diff --git a/Samples/ShowCase/main.cs b/Samples/ShowCase/main.cs index c6ffc408..a2b263fe 100644 --- a/Samples/ShowCase/main.cs +++ b/Samples/ShowCase/main.cs @@ -45,18 +45,22 @@ namespace tests using (Showcase app = new Showcase ()) { //app.Keyboard.KeyDown += App_KeyboardKeyDown; - Widget g = app.Load ("#ShowCase.showcase.crow"); - g.DataSource = app; - app.crowContainer = g.FindByName ("CrowContainer") as Container; - //I set an empty object as datasource at this level to force update when new - //widgets are added to the interface - app.crowContainer.DataSource = new object (); - app.hideError (); app.Run (); } } + protected override void Startup () + { + Widget g = Load ("#ShowCase.showcase.crow"); + g.DataSource = this; + crowContainer = g.FindByName ("CrowContainer") as Container; + //I set an empty object as datasource at this level to force update when new + //widgets are added to the interface + crowContainer.DataSource = new object (); + hideError (); + } + static void App_KeyboardKeyDown (object sender, KeyEventArgs e) { #if DEBUG_LOG diff --git a/Samples/common/ui/Interfaces/Container/1.crow b/Samples/common/ui/Interfaces/Container/1.crow index 19af5237..df935b1d 100755 --- a/Samples/common/ui/Interfaces/Container/1.crow +++ b/Samples/common/ui/Interfaces/Container/1.crow @@ -1,5 +1,5 @@  - - + \ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Container/3.crow b/Samples/common/ui/Interfaces/Container/3.crow index 94655ca3..5ca515a8 100755 --- a/Samples/common/ui/Interfaces/Container/3.crow +++ b/Samples/common/ui/Interfaces/Container/3.crow @@ -1,4 +1,4 @@  - -