From: Jean-Philippe Bruyère Date: Fri, 2 Jul 2021 05:47:08 +0000 (+0200) Subject: wip X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=fea8c75a4f4fac94655a5bda557ac82c0ddbbc5d;p=jp%2Fcrowedit.git wip --- diff --git a/Crow.dll.config b/Crow.dll.config deleted file mode 100644 index 6341771..0000000 --- a/Crow.dll.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/CrowEdit.csproj b/CrowEdit.csproj index 7234e31..4a34305 100644 --- a/CrowEdit.csproj +++ b/CrowEdit.csproj @@ -9,6 +9,8 @@ + + diff --git a/CrowEdit.style b/CrowEdit.style new file mode 100644 index 0000000..ba40e65 --- /dev/null +++ b/CrowEdit.style @@ -0,0 +1,37 @@ +SmallUIFont = "sans, 10"; +DocTabViewBackground = "DarkGrey"; +SelectedTabBackground = "Onyx"; +MenuIconSize = "14"; + +DockWindow { + Template = "#CrowEdit.ui.DockWindow.template"; +} +DockingTabView { + Template = "#CrowEdit.ui.DockingTabView.template"; +} +MenuItem { + Template = "#ui.MenuItem.template"; +} + +MenuIcon { + Margin = "2"; + Width = "${MenuIconSize}"; + Height = "${MenuIconSize}"; +} + +suggestionsListBox { + Template = "#ui.Suggestions.template"; + Width = "Fit"; + Height = "Fit"; + MaximumSize = "300, 120"; + Background = "Jet"; + UseLoadingThread = "false"; +} + +Editor { + Background="White"; + Foreground="Black"; + Text=""; + Multiline="true"; +} + diff --git a/CrowEditBase/src/CrowEditBase.cs b/CrowEditBase/src/CrowEditBase.cs new file mode 100644 index 0000000..b15fce9 --- /dev/null +++ b/CrowEditBase/src/CrowEditBase.cs @@ -0,0 +1,141 @@ +// Copyright (c) 2021-2021 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + +using System; +using System.IO; +using System.Linq; +using Crow; +using System.Runtime.CompilerServices; +using System.Collections.Generic; + +namespace CrowEditBase +{ + public abstract class CrowEditBase : Interface { + public static CrowEditBase App; + public CrowEditBase (int width, int height) : base (width, height) { + App = this; + } + + protected const string _defaultFileName = "unnamed.txt"; + + TextDocument currentDocument; + Editor currentEditor; + public CommandGroup FileCommands, EditCommands; + public ObservableList OpenedDocuments = new ObservableList (); + public TextDocument CurrentDocument { + get => currentDocument; + set { + if (currentDocument == value) + return; + + currentDocument?.UnselectDocument (); + + currentDocument = value; + NotifyValueChanged (currentDocument); + + if (currentDocument == null) + return; + + currentDocument.SelectDocument (); + FileCommands[2] = currentDocument.CMDSave; + FileCommands[3] = currentDocument.CMDSaveAs; + EditCommands[0] = currentDocument.CMDUndo; + EditCommands[1] = currentDocument.CMDRedo; + + } + } + public Editor CurrentEditor { + get => currentEditor; + set { + if (currentEditor == value) + return; + currentEditor = value; + NotifyValueChanged (currentEditor); + + if (currentEditor == null) + return; + EditCommands[2] = currentEditor.CMDCut; + EditCommands[3] = currentEditor.CMDCopy; + EditCommands[4] = currentEditor.CMDPaste; + } + } + public string CurrentDir { + get => Configuration.Global.Get("CurrentDir"); + set { + if (CurrentDir == value) + return; + Configuration.Global.Set ("CurrentDir", value); + NotifyValueChanged (CurrentDir); + } + } + public string PluginsDirecory { + get => Configuration.Global.Get("PluginsDirecory"); + set { + if (PluginsDirecory == value) + return; + Configuration.Global.Set ("PluginsDirecory", value); + NotifyValueChanged (PluginsDirecory); + } + } + public string CurrentFilePath { + get => Configuration.Global.Get ("CurrentFilePath"); + set { + if (CurrentFilePath == value) + return; + Configuration.Global.Set ("CurrentFilePath", value); + NotifyValueChanged (CurrentFilePath); + } + } + public string CurFileName { + get => string.IsNullOrEmpty (CurrentFilePath) ? _defaultFileName : Path.GetFileName (CurrentFilePath); + } + public string CurFileDir { + get => string.IsNullOrEmpty (CurrentFilePath) ? CurrentDir : Path.GetDirectoryName (CurrentFilePath); + } + + + public bool IsOpened (string filePath) => + string.IsNullOrEmpty (filePath) ? false : OpenedDocuments.Any (d => d.FullPath == filePath); + + public Document OpenOrSelectFile (string filePath) { + if (string.IsNullOrEmpty (filePath)) + return null; + TextDocument doc = OpenedDocuments.FirstOrDefault (d => d.FullPath == filePath); + return doc ?? openOrCreateFile (filePath); + } + public void CloseFile (string filePath) => + closeDocument (OpenedDocuments.FirstOrDefault (d => d.FullPath == filePath)); + + public void createNewFile(){ + openOrCreateFile (Path.Combine (CurFileDir, _defaultFileName)); + } + + protected abstract Document openOrCreateFile (string filePath); + void closeDocument (TextDocument doc) { + if (doc == null) + return; + int idx = OpenedDocuments.IndexOf (doc); + OpenedDocuments.Remove (doc); + if (doc == CurrentDocument) { + if (OpenedDocuments.Count > 0) + CurrentDocument = OpenedDocuments[Math.Min (idx, OpenedDocuments.Count - 1)]; + else + CurrentDocument = null; + } + } + protected void onQueryCloseDocument (object sender, EventArgs e) { + TextDocument doc = sender as TextDocument; + if (doc.IsDirty) { + MessageBox mb = MessageBox.ShowModal (this, + MessageBox.Type.YesNoCancel, $"{doc.FileName} has unsaved changes.\nSave it now?"); + mb.Yes += (object _sender, EventArgs _e) => { doc.Save (); closeDocument (doc); }; + mb.No += (object _sender, EventArgs _e) => closeDocument (doc); + } else + closeDocument (doc); + } + + + + } +} \ No newline at end of file diff --git a/CrowEditBase/src/Document.cs b/CrowEditBase/src/Document.cs index 6829139..5d1a4c6 100644 --- a/CrowEditBase/src/Document.cs +++ b/CrowEditBase/src/Document.cs @@ -92,7 +92,28 @@ namespace CrowEditBase public void OnQueryClose (object sender, EventArgs e){ CloseEvent.Raise (this, null); } - protected abstract void initCommands (); + public void SaveAs () { + iFace.LoadIMLFragment ( + "" + ).DataSource = this; + } + public void Save () { + if (File.Exists (FullPath)) + writeToDisk (); + else + SaveAs (); + } + + public Command CMDUndo, CMDRedo, CMDSave, CMDSaveAs; + + protected virtual void initCommands () { + CMDUndo = new Command ("Undo", undo, "#CrowEdit.ui.icons.reply.svg", false); + CMDRedo = new Command ("Redo", redo, "#CrowEdit.ui.icons.share-arrow.svg", false); + CMDSave = new Command ("save", Save, "#CrowEdit.ui.icons.inbox.svg", false); + CMDSaveAs = new Command ("Save As...", SaveAs, "#CrowEdit.ui.icons.inbox.svg"); + } + protected abstract void undo(); + protected abstract void redo(); protected abstract void writeToDisk (); protected abstract void readFromDisk (); protected abstract void initNewFile (); diff --git a/CrowEditBase/src/Editor.cs b/CrowEditBase/src/Editor.cs index 4f32829..9464c73 100644 --- a/CrowEditBase/src/Editor.cs +++ b/CrowEditBase/src/Editor.cs @@ -98,11 +98,13 @@ namespace Crow if (disableTextChangedEvent) return; base.OnTextChanged(sender, e); - } + } protected override void onFocused(object sender, EventArgs e) - { + { + if (CurrentLoc == null) + CurrentLoc = new CharLocation (0, 0); base.onFocused(sender, e); - IFace.NotifyValueChanged ("CurrentEditor", this); + (IFace as CrowEditBase.CrowEditBase).CurrentEditor = this; } protected void backgroundThreadFunc () { while (true) { diff --git a/CrowEditBase/src/TextDocument.cs b/CrowEditBase/src/TextDocument.cs index e51d246..9318f61 100644 --- a/CrowEditBase/src/TextDocument.cs +++ b/CrowEditBase/src/TextDocument.cs @@ -27,6 +27,8 @@ namespace CrowEditBase return; source = value; NotifyValueChanged (source); + NotifyValueChanged ("IsDirty", IsDirty); + CMDSave.CanExecute = IsDirty; } } @@ -109,26 +111,8 @@ namespace CrowEditBase protected Stack undoStack = new Stack (); protected Stack redoStack = new Stack (); - public Command CMDUndo, CMDRedo, CMDSave, CMDSaveAs; - - protected override void initCommands () { - CMDUndo = new Command ("Undo", undo, "#CrowEdit.ui.icons.reply.svg", false); - CMDRedo = new Command ("Redo", redo, "#CrowEdit.ui.icons.share-arrow.svg", false); - CMDSave = new Command ("save", Save, "#CrowEdit.ui.icons.inbox.svg"); - CMDSaveAs = new Command ("Save As...", SaveAs, "#CrowEdit.ui.icons.inbox.svg"); - } - public void SaveAs () { - iFace.LoadIMLFragment ( - "" - ).DataSource = this; - } - public void Save () { - if (File.Exists (FullPath)) - writeToDisk (); - else - SaveAs (); - } + protected void saveFileDialog_OkClicked (object sender, EventArgs e) { FileDialog fd = sender as FileDialog; @@ -149,7 +133,7 @@ namespace CrowEditBase } - protected void undo () { + protected override void undo () { editorRWLock.EnterWriteLock (); try { if (undoStack.TryPop (out TextChange tc)) { @@ -165,7 +149,7 @@ namespace CrowEditBase editorRWLock.ExitWriteLock (); } } - protected void redo () { + protected override void redo () { editorRWLock.EnterWriteLock (); try { if (redoStack.TryPop (out TextChange tc)) { diff --git a/CrowWindow.cs b/CrowWindow.cs deleted file mode 100644 index f1d644e..0000000 --- a/CrowWindow.cs +++ /dev/null @@ -1,412 +0,0 @@ -// -// CrowWindow.cs -// -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -using System; -using System.Threading; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using System.Collections.Generic; - -namespace Crow -{ - public class CrowWindow : GameWindow, IValueChange - { - #region IValueChange implementation - public event EventHandler ValueChanged; - public virtual void NotifyValueChanged(string MemberName, object _value) - { - if (ValueChanged != null) - ValueChanged.Invoke(this, new ValueChangeEventArgs(MemberName, _value)); - } - #endregion - - #region FPS - int frameCpt = 0; - int _fps = 0; - - public int fps { - get { return _fps; } - set { - if (_fps == value) - return; - - _fps = value; - #if MEASURE_TIME - if (_fps > fpsMax) { - fpsMax = _fps; - ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax)); - } else if (_fps < fpsMin) { - fpsMin = _fps; - ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin)); - } - #endif - if (frameCpt % 3 == 0) { - ValueChanged.Raise (this, new ValueChangeEventArgs ("fps", _fps)); - #if MEASURE_TIME - foreach (PerformanceMeasure m in ifaceControl[0].PerfMeasures) - m.NotifyChanges (); - #endif - } - } - } - - #if MEASURE_TIME - public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10); - - public int fpsMin = int.MaxValue; - public int fpsMax = 0; - - void resetFps () - { - fpsMin = int.MaxValue; - fpsMax = 0; - _fps = 0; - } - #endif - - #endregion - - #region ctor - public CrowWindow(int _width = 800, int _height = 600, string _title="Crow", - int colors = 32, int depth = 24, int stencil = 0, int samples = 1, - int major=3, int minor=3) - : this(_width, _height, new OpenTK.Graphics.GraphicsMode(colors, depth, stencil, samples), - _title,GameWindowFlags.Default,DisplayDevice.Default, - major,minor,OpenTK.Graphics.GraphicsContextFlags.Default) - { - } - public CrowWindow (int width, int height, OpenTK.Graphics.GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, OpenTK.Graphics.GraphicsContextFlags flags) - : base(width,height,mode,title,options,device,major,minor,flags) - { - } - - #endregion - - protected Shader shader; - public List ifaceControl = new List(); - int focusedIdx = -1, activeIdx = -2; - - // TODO:We should be able to set the current interface programmaticaly - /// - /// Gets the currently focused interface, focus could have been given by creation of new iface controler and - /// not only by the mouse - /// - public Interface CurrentInterface { - get { - if (ifaceControl.Count == 0) {//create default orthogonal interface - addInterfaceControler (new InterfaceControler ( - new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); - focusedIdx = 0; - } - return ifaceControl [focusedIdx].CrowInterface; - } - } - - void addInterfaceControler(InterfaceControler ifaceControler) - { - ifaceControler.CrowInterface.Quit += Quit; - ifaceControler.CrowInterface.MouseCursorChanged += CrowInterface_MouseCursorChanged; - - ifaceControl.Add (ifaceControler); - focusedIdx = ifaceControl.Count - 1; - } - void openGLDraw(){ - //save GL states - bool blend, depthTest, cullFace; - GL.GetBoolean (GetPName.Blend, out blend); - GL.GetBoolean (GetPName.DepthTest, out depthTest); - GL.GetBoolean (GetPName.CullFace, out cullFace); - GL.Enable (EnableCap.Blend); - GL.Disable (EnableCap.DepthTest); - GL.Disable (EnableCap.CullFace); - - #if MEASURE_TIME - glDrawMeasure.StartCycle(); - #endif - - shader.Enable (); - for (int i = 0; i < ifaceControl.Count; i++) { - shader.SetMVP (ifaceControl [i].InterfaceMVP); - ifaceControl [i].OpenGLDraw (); - } - - #if MEASURE_TIME - glDrawMeasure.StopCycle(); - #endif - - //restore GL states - if (!blend) - GL.Disable (EnableCap.Blend); - if (depthTest) - GL.Enable (EnableCap.DepthTest); - if (cullFace) - GL.Enable (EnableCap.CullFace); - } - - public void Quit (object sender, EventArgs e) - { - foreach (InterfaceControler ic in ifaceControl) { - ic.Dispose (); - } - this.Exit (); - } - void CrowInterface_MouseCursorChanged (object sender, MouseCursorChangedEventArgs e) - { - this.Cursor = new MouseCursor( - (int)e.NewCursor.Xhot, - (int)e.NewCursor.Yhot, - (int)e.NewCursor.Width, - (int)e.NewCursor.Height, - e.NewCursor.data); - } - - #region Events - //those events are raised only if mouse isn't in a graphic object - public event EventHandler CrowMouseWheel; - public event EventHandler CrowMouseUp; - public event EventHandler CrowMouseDown; - public event EventHandler CrowMouseClick; - public event EventHandler CrowMouseMove; - public event EventHandler CrowKeyDown; - public event EventHandler CrowKeyUp; - - #endregion - - public ProjectiveIFaceControler Add3DInterface(int width, int height, Matrix4 ifaceModelMat){ - ProjectiveIFaceControler tmp = new ProjectiveIFaceControler (new Rectangle (0, 0, width, height), ifaceModelMat); - addInterfaceControler (tmp); - return tmp; - } - public GraphicObject AddWidget (GraphicObject g, int interfaceIdx = 0){ - if (ifaceControl.Count == 0)//create default orthogonal interface - addInterfaceControler (new InterfaceControler ( - new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); - ifaceControl [interfaceIdx].CrowInterface.AddWidget (g); - return g; - } - - public void DeleteWidget (GraphicObject g, int interfaceIdx = 0){ - ifaceControl [interfaceIdx].CrowInterface.DeleteWidget (g); - } - /// - /// check if a default interface exists, create one if not - /// - void checkDefaultIFace (){ - if (ifaceControl.Count == 0)//create default orthogonal interface - addInterfaceControler (new InterfaceControler ( - new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); - } - /// - /// Load the content of the IML file pointed by path and add it to the current interface - /// graphic tree. - /// - /// the path of the IML file to load - /// interface index to bind to, a default one is created if none exists - public GraphicObject Load (string path, int interfaceIdx = 0){ - checkDefaultIFace(); - return ifaceControl [interfaceIdx].CrowInterface.AddWidget (path); - } - /// - /// Load the content of the IML string passed as first argument and add it to the current interface - /// graphic tree. - /// - /// a valid IML string - /// interface index to bind to, a default one is created if none exists - public void LoadIMLFragment (string imlFragment, int interfaceIdx = 0){ - checkDefaultIFace(); - ifaceControl [interfaceIdx].CrowInterface.LoadIMLFragment (imlFragment); - } - - public GraphicObject FindByName (string nameToFind){ - for (int i = 0; i < ifaceControl.Count; i++) { - GraphicObject tmp = ifaceControl [i].CrowInterface.FindByName (nameToFind); - if (tmp != null) - return tmp; - } - return null; - } - public void ClearInterface (int interfaceIdx = 0){ - ifaceControl [interfaceIdx].CrowInterface.ClearInterface (); - } - /// Override this method for your OpenGL rendering calls - public virtual void OnRender(FrameEventArgs e) - { - } - /// Override this method to customize clear method between frames - public virtual void GLClear() - { - GL.Clear (ClearBufferMask.ColorBufferBit|ClearBufferMask.DepthBufferBit); - } - - #region Game win overrides - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - this.KeyPress += new EventHandler(OpenTKGameWindow_KeyPress); - KeyDown += new EventHandler(Keyboard_KeyDown); - KeyUp += new EventHandler(Keyboard_KeyUp); - - MouseWheel += new EventHandler(GL_Mouse_WheelChanged); - MouseDown += new EventHandler(GL_Mouse_ButtonDown); - MouseUp += new EventHandler(GL_Mouse_ButtonUp); - MouseMove += new EventHandler(GL_Mouse_Move); - - #if DEBUG - Console.WriteLine("\n\n*************************************"); - Console.WriteLine("GL version: " + GL.GetString (StringName.Version)); - Console.WriteLine("GL vendor: " + GL.GetString (StringName.Vendor)); - Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion)); - Console.WriteLine("*************************************\n"); - #endif - - shader = new Shader (); - shader.Enable (); - - GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f); - } - protected override void OnUpdateFrame(FrameEventArgs e) - { - base.OnUpdateFrame(e); - fps = (int)RenderFrequency; - - #if MEASURE_TIME - if (frameCpt > 500) { - resetFps (); - frameCpt = 0; -// #if DEBUG -// GC.Collect(); -// GC.WaitForPendingFinalizers(); -// NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString()); -// #endif - } - #endif - - frameCpt++; - } - protected override void OnRenderFrame(FrameEventArgs e) - { - GLClear (); - - base.OnRenderFrame(e); - - OnRender (e); - openGLDraw (); - - - SwapBuffers (); - } - protected override void OnResize(EventArgs e) - { - base.OnResize (e); - for (int i = 0; i < ifaceControl.Count; i++) { - ifaceControl[i].ProcessResize( - new Rectangle( - 0, - 0, - this.ClientRectangle.Width, - this.ClientRectangle.Height)); - } - } - #endregion - - #region Mouse and Keyboard Handling - void update_mouseButtonStates(ref MouseState e, OpenTK.Input.MouseState otk_e){ - for (int i = 0; i < MouseState.MaxButtons; i++) { - if (otk_e.IsButtonDown ((OpenTK.Input.MouseButton)i)) - e.EnableBit (i); - } - } - protected virtual void GL_Mouse_Move(object sender, OpenTK.Input.MouseMoveEventArgs otk_e) - { - if (activeIdx == -2) { - focusedIdx = -1; - for (int i = 0; i < ifaceControl.Count; i++) { - if (ifaceControl [i].ProcessMouseMove (otk_e.X, otk_e.Y)) { - focusedIdx = i; - return; - } - } - } else if (focusedIdx >= 0) { - ifaceControl [focusedIdx].ProcessMouseMove (otk_e.X, otk_e.Y); - return; - } - if (focusedIdx < 0) - CrowMouseMove.Raise (sender, otk_e); - } - protected virtual void GL_Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs otk_e) - { - activeIdx = -2; - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessMouseButtonUp ((int)otk_e.Button)) - return; - } - CrowMouseUp.Raise (sender, otk_e); - } - protected virtual void GL_Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs otk_e) - { - activeIdx = focusedIdx; - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessMouseButtonDown ((int)otk_e.Button)) - return; - } - CrowMouseDown.Raise (sender, otk_e); - } - protected virtual void GL_Mouse_WheelChanged(object sender, OpenTK.Input.MouseWheelEventArgs otk_e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessMouseWheelChanged (otk_e.DeltaPrecise)) - return; - } - CrowMouseWheel.Raise (sender, otk_e); - } - - protected virtual void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessKeyDown((int)otk_e.Key)) - return; - } - CrowKeyDown.Raise (this, otk_e); - } - protected virtual void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessKeyUp((int)otk_e.Key)) - return; - } - CrowKeyUp.Raise (this, otk_e); - } - protected virtual void OpenTKGameWindow_KeyPress (object sender, OpenTK.KeyPressEventArgs e) - { - if (focusedIdx >= 0) { - if (ifaceControl [focusedIdx].ProcessKeyPress (e.KeyChar)) - return; - } - //TODO:create keyboardkeypress evt - } - #endregion - } -} diff --git a/InterfaceControler.cs b/InterfaceControler.cs deleted file mode 100644 index 5098e11..0000000 --- a/InterfaceControler.cs +++ /dev/null @@ -1,267 +0,0 @@ -// -// InterfaceControler.cs -// -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using OpenTK; -using OpenTK.Graphics.OpenGL; -using System.Threading; -using System.Collections.Generic; - -namespace Crow -{ - public class ProjectiveIFaceControler : InterfaceControler { - Matrix4 modelview; - int[] viewport = new int[4]; - Vector3 vEyePosition; - - public Matrix4 ifaceModelMat; - Point localMousePos; - - public ProjectiveIFaceControler(Rectangle ifaceBounds, Matrix4 _ifaceModelMat) - : base(ifaceBounds){ - ifaceModelMat = _ifaceModelMat; - } - - public override Matrix4 InterfaceMVP { - get { return ifaceModelMat * modelview * projection; } - } - - public override void initGL(){ - quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1); - //ifaceModelMat = Matrix4.CreateRotationX(MathHelper.PiOver2) * Matrix4.CreateTranslation(Vector3.UnitY); - CrowInterface.ProcessResize(iRect); - createContext (); - //CrowInterface.ProcessResize (iRect); - } - public override void ProcessResize (Rectangle newSize) - { - } - public override void OpenGLDraw () - { - GL.Enable (EnableCap.DepthTest); - base.OpenGLDraw (); - GL.Disable (EnableCap.DepthTest); - } - public void UpdateView (Matrix4 _projection, Matrix4 _modelview, int[] _viewport, Vector3 _vEyePosition) - { - projection = _projection; - modelview = _modelview; - viewport = _viewport; - vEyePosition = _vEyePosition; - } - public override bool ProcessMouseMove (int x, int y) - { - Matrix4 mv = ifaceModelMat * modelview; - Vector3 vMouse = UnProject(ref projection, ref mv, viewport, new Vector2 (x, y)).Xyz; - Vector3 vE = vEyePosition.Transform (ifaceModelMat.Inverted()); - Vector3 vMouseRay = Vector3.Normalize(vMouse - vE); - float a = vE.Z / vMouseRay.Z; - vMouse = vE - vMouseRay * a; - //vMouse = vMouse.Transform (interfaceModelView.Inverted()); - localMousePos = new Point ((int)Math.Truncate ((vMouse.X + 0.5f) * iRect.Width), - iRect.Height - (int)Math.Truncate ((vMouse.Y + 0.5f) * iRect.Height)); - mouseIsInInterface = localMousePos.X.IsInBetween (0, iRect.Width) & localMousePos.Y.IsInBetween (0, iRect.Height); - - return mouseIsInInterface ? CrowInterface.ProcessMouseMove (localMousePos.X, localMousePos.Y) : false; - } - Vector4 UnProject(ref Matrix4 projection, ref Matrix4 view, int[] viewport, Vector2 mouse) - { - Vector4 vec; - - vec.X = 2.0f * mouse.X / (float)viewport[2] - 1; - vec.Y = -(2.0f * mouse.Y / (float)viewport[3] - 1); - vec.Z = 0f; - vec.W = 1.0f; - - Matrix4 viewInv = Matrix4.Invert(view); - Matrix4 projInv = Matrix4.Invert(projection); - - Vector4.Transform(ref vec, ref projInv, out vec); - Vector4.Transform(ref vec, ref viewInv, out vec); - - if (vec.W > float.Epsilon || vec.W < float.Epsilon) - { - vec.X /= vec.W; - vec.Y /= vec.W; - vec.Z /= vec.W; - } - - return vec; - } - } - public class InterfaceControler : IDisposable { - public Interface CrowInterface; - public int texID; - public vaoMesh quad; - public Rectangle iRect = new Rectangle(0,0,2048,2048); - public bool mouseIsInInterface = false; - - protected Matrix4 projection; - public virtual Matrix4 InterfaceMVP { - get { return projection; } - } - - #if MEASURE_TIME - public List PerfMeasures; - public PerformanceMeasure glDrawMeasure = new PerformanceMeasure("OpenGL Draw", 10); - #endif - - #region CTOR - public InterfaceControler(Rectangle ifaceBounds){ - iRect = ifaceBounds; - - CrowInterface = new Interface (); - - #if MEASURE_TIME - PerfMeasures = new List ( - new PerformanceMeasure[] { - this.CrowInterface.updateMeasure, - this.CrowInterface.layoutingMeasure, - this.CrowInterface.clippingMeasure, - this.CrowInterface.drawingMeasure, - this.glDrawMeasure - } - ); - #endif - - Thread t = new Thread (interfaceThread); - t.IsBackground = true; - t.Start (); - - initGL (); - } - #endregion - - void interfaceThread() - { - while (CrowInterface.ClientRectangle.Size.Width == 0) - Thread.Sleep (5); - - while (true) { - CrowInterface.Update (); - Thread.Sleep (2); - } - } - - #region Mouse And Keyboard handling - public virtual void ProcessResize(Rectangle newSize){ - iRect = newSize; - CrowInterface.ProcessResize(newSize); - createContext (); - GL.Viewport (0, 0, newSize.Width, newSize.Height);//TODO:find a better place for this - } - public virtual bool ProcessMouseMove(int x, int y){ - return CrowInterface.ProcessMouseMove (x, y); - } - public virtual bool ProcessMouseButtonUp(int button) - { - return CrowInterface.ProcessMouseButtonUp (button); - } - public virtual bool ProcessMouseButtonDown(int button) - { - return CrowInterface.ProcessMouseButtonDown (button); - } - public virtual bool ProcessMouseWheelChanged(float delta) - { - return CrowInterface.ProcessMouseWheelChanged (delta); - } - public virtual bool ProcessKeyDown(int Key){ - return CrowInterface.ProcessKeyDown(Key); - } - public virtual bool ProcessKeyUp(int Key){ - return CrowInterface.ProcessKeyUp(Key); - } - public virtual bool ProcessKeyPress(char Key){ - return CrowInterface.ProcessKeyPress(Key); - } - #endregion - - #region graphic context - public virtual void initGL(){ - projection = OpenTK.Matrix4.CreateOrthographicOffCenter (-0.5f, 0.5f, -0.5f, 0.5f, 1, -1); - quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1); - createContext (); - } - /// Create the texture for the interface redering - public virtual void createContext() - { - if (GL.IsTexture(texID)) - GL.DeleteTexture (texID); - GL.GenTextures(1, out texID); - GL.ActiveTexture (TextureUnit.Texture0); - GL.BindTexture(TextureTarget.Texture2D, texID); - - GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, - iRect.Width, iRect.Height, 0, - OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, CrowInterface.bmp); - - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); - - GL.BindTexture(TextureTarget.Texture2D, 0); - } - /// Rendering of the interface - public virtual void OpenGLDraw() - { - #if MEASURE_TIME - glDrawMeasure.StartCycle(); - #endif - - GL.ActiveTexture (TextureUnit.Texture0); - GL.BindTexture (TextureTarget.Texture2D, texID); - if (Monitor.TryEnter(CrowInterface.RenderMutex)) { - if (CrowInterface.IsDirty) { - GL.TexSubImage2D (TextureTarget.Texture2D, 0, - CrowInterface.DirtyRect.Left, CrowInterface.DirtyRect.Top, - CrowInterface.DirtyRect.Width, CrowInterface.DirtyRect.Height, - OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, CrowInterface.dirtyBmp); - CrowInterface.IsDirty = false; - } - Monitor.Exit (CrowInterface.RenderMutex); - } - quad.Render (BeginMode.TriangleStrip); - GL.BindTexture(TextureTarget.Texture2D, 0); - - #if MEASURE_TIME - glDrawMeasure.StopCycle(); - #endif - } - #endregion - - #region IDisposable implementation - - public void Dispose () - { - if (GL.IsTexture(texID)) - GL.DeleteTexture (texID); - if (quad != null) - quad.Dispose (); - } - - #endregion - } -} - diff --git a/LICENSE.md b/LICENSE.md index 63bb0bf..aa5d54a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) [2017] [Jean-Philippe Bruyère] +Copyright (c) [2017-2021] [Jean-Philippe Bruyère] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/default.config b/default.config new file mode 100644 index 0000000..4413948 --- /dev/null +++ b/default.config @@ -0,0 +1,2 @@ +MainWinWidth=1024 +MainWinHeight=768 diff --git a/plugins/CEXmlPlugin/CEXmlPlugin.csproj b/plugins/CEXmlPlugin/CEXmlPlugin.csproj index 1eb661b..9a35389 100644 --- a/plugins/CEXmlPlugin/CEXmlPlugin.csproj +++ b/plugins/CEXmlPlugin/CEXmlPlugin.csproj @@ -6,9 +6,7 @@ - - - + diff --git a/plugins/CEXmlPlugin/Properties/AssemblyInfo.cs b/plugins/CEXmlPlugin/Properties/AssemblyInfo.cs deleted file mode 100644 index d864652..0000000 --- a/plugins/CEXmlPlugin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) 2013-2020 Jean-Philippe Bruyère -// -// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -[assembly: Crow.Crow ] - diff --git a/plugins/CEXmlPlugin/icons/blank-file.svg b/plugins/CEXmlPlugin/icons/blank-file.svg deleted file mode 100644 index 8136979..0000000 --- a/plugins/CEXmlPlugin/icons/blank-file.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/compile.svg b/plugins/CEXmlPlugin/icons/compile.svg deleted file mode 100644 index c1a14e7..0000000 --- a/plugins/CEXmlPlugin/icons/compile.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/copy-file.svg b/plugins/CEXmlPlugin/icons/copy-file.svg deleted file mode 100644 index 63c2dd3..0000000 --- a/plugins/CEXmlPlugin/icons/copy-file.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/curly-brackets.svg b/plugins/CEXmlPlugin/icons/curly-brackets.svg deleted file mode 100644 index 89ef798..0000000 --- a/plugins/CEXmlPlugin/icons/curly-brackets.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/edit.svg b/plugins/CEXmlPlugin/icons/edit.svg deleted file mode 100644 index 366862c..0000000 --- a/plugins/CEXmlPlugin/icons/edit.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/eraser.svg b/plugins/CEXmlPlugin/icons/eraser.svg deleted file mode 100644 index 5dd73ba..0000000 --- a/plugins/CEXmlPlugin/icons/eraser.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/file.svg b/plugins/CEXmlPlugin/icons/file.svg deleted file mode 100644 index 9d06b00..0000000 --- a/plugins/CEXmlPlugin/icons/file.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/folder.svg b/plugins/CEXmlPlugin/icons/folder.svg deleted file mode 100644 index f59e2da..0000000 --- a/plugins/CEXmlPlugin/icons/folder.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/light-bulb.svg b/plugins/CEXmlPlugin/icons/light-bulb.svg deleted file mode 100644 index 89ff236..0000000 --- a/plugins/CEXmlPlugin/icons/light-bulb.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/move-arrows.svg b/plugins/CEXmlPlugin/icons/move-arrows.svg deleted file mode 100644 index ecbb2f9..0000000 --- a/plugins/CEXmlPlugin/icons/move-arrows.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/open.svg b/plugins/CEXmlPlugin/icons/open.svg deleted file mode 100644 index bd8d7d9..0000000 --- a/plugins/CEXmlPlugin/icons/open.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/paint-brush.svg b/plugins/CEXmlPlugin/icons/paint-brush.svg deleted file mode 100644 index 2bdd5be..0000000 --- a/plugins/CEXmlPlugin/icons/paint-brush.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/palette.svg b/plugins/CEXmlPlugin/icons/palette.svg deleted file mode 100644 index 8e425f7..0000000 --- a/plugins/CEXmlPlugin/icons/palette.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/paste-on-document.svg b/plugins/CEXmlPlugin/icons/paste-on-document.svg deleted file mode 100644 index b0a705e..0000000 --- a/plugins/CEXmlPlugin/icons/paste-on-document.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/pin.svg b/plugins/CEXmlPlugin/icons/pin.svg deleted file mode 100644 index b36340b..0000000 --- a/plugins/CEXmlPlugin/icons/pin.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/question.svg b/plugins/CEXmlPlugin/icons/question.svg deleted file mode 100644 index fb8e3d3..0000000 --- a/plugins/CEXmlPlugin/icons/question.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/redo.svg b/plugins/CEXmlPlugin/icons/redo.svg deleted file mode 100644 index 59fcc90..0000000 --- a/plugins/CEXmlPlugin/icons/redo.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/save.svg b/plugins/CEXmlPlugin/icons/save.svg deleted file mode 100644 index 6aa6714..0000000 --- a/plugins/CEXmlPlugin/icons/save.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/scissors.svg b/plugins/CEXmlPlugin/icons/scissors.svg deleted file mode 100644 index 4b5a225..0000000 --- a/plugins/CEXmlPlugin/icons/scissors.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/search.svg b/plugins/CEXmlPlugin/icons/search.svg deleted file mode 100644 index f3eb368..0000000 --- a/plugins/CEXmlPlugin/icons/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/text-file.svg b/plugins/CEXmlPlugin/icons/text-file.svg deleted file mode 100644 index 826bc32..0000000 --- a/plugins/CEXmlPlugin/icons/text-file.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Border.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Border.svg deleted file mode 100644 index 09eb7ac..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Border.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Button.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Button.svg deleted file mode 100644 index 01f5c6c..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Button.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.CheckBox.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.CheckBox.svg deleted file mode 100644 index 2f0b083..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.CheckBox.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.ColorPicker.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.ColorPicker.svg deleted file mode 100644 index 517a26a..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.ColorPicker.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.ComboBox.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.ComboBox.svg deleted file mode 100644 index 1cb88fa..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.ComboBox.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Container.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Container.svg deleted file mode 100644 index d7d1dc8..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Container.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.DirectoryView.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.DirectoryView.svg deleted file mode 100644 index 9029469..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.DirectoryView.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Docker.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Docker.svg deleted file mode 100644 index e38a283..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Docker.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Expandable.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Expandable.svg deleted file mode 100644 index 1c56d56..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Expandable.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.FileDialog.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.FileDialog.svg deleted file mode 100644 index 25142ea..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.FileDialog.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Grid.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Grid.svg deleted file mode 100644 index 6151f97..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Grid.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Group.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Group.svg deleted file mode 100644 index eae67f6..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Group.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.GroupBox.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.GroupBox.svg deleted file mode 100644 index e469779..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.GroupBox.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.HorizontalStack.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.HorizontalStack.svg deleted file mode 100644 index f8e7025..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.HorizontalStack.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.IMLContainer.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.IMLContainer.svg deleted file mode 100644 index b5687ba..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.IMLContainer.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Image.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Image.svg deleted file mode 100644 index 11356c0..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Image.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Label.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Label.svg deleted file mode 100644 index 65bb85b..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Label.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.ListBox.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.ListBox.svg deleted file mode 100644 index 40d1673..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.ListBox.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Menu.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Menu.svg deleted file mode 100644 index b6b2111..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Menu.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.MenuItem.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.MenuItem.svg deleted file mode 100644 index c8bd847..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.MenuItem.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.MessageBox.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.MessageBox.svg deleted file mode 100644 index 16ebd72..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.MessageBox.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.ProgressBar.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.ProgressBar.svg deleted file mode 100644 index 884f185..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.ProgressBar.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.RadioButton.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.RadioButton.svg deleted file mode 100644 index 6c33e84..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.RadioButton.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.ScrollBar.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.ScrollBar.svg deleted file mode 100644 index 91a1f84..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.ScrollBar.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Scroller.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Scroller.svg deleted file mode 100644 index bbc9719..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Scroller.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Shape.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Shape.svg deleted file mode 100644 index de5dd37..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Shape.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Slider.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Slider.svg deleted file mode 100644 index fe41c2b..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Slider.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Spinner.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Spinner.svg deleted file mode 100644 index 5fa848a..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Spinner.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Splitter.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Splitter.svg deleted file mode 100644 index 9fcd9dd..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Splitter.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.TabItem.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.TabItem.svg deleted file mode 100644 index a9aaed3..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.TabItem.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.TabView.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.TabView.svg deleted file mode 100644 index 942358b..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.TabView.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.TemplatedContainer.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.TemplatedContainer.svg deleted file mode 100644 index 34a0aa2..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.TemplatedContainer.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.TemplatedGroup.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.TemplatedGroup.svg deleted file mode 100644 index 14ea6f3..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.TemplatedGroup.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.TextBox.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.TextBox.svg deleted file mode 100644 index c1fc2bb..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.TextBox.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.TreeView.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.TreeView.svg deleted file mode 100644 index b863291..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.TreeView.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.VerticalStack.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.VerticalStack.svg deleted file mode 100644 index c3c3ec9..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.VerticalStack.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Window.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Window.svg deleted file mode 100644 index 74b0a24..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Window.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/Crow.Wrapper.svg b/plugins/CEXmlPlugin/icons/toolbox/Crow.Wrapper.svg deleted file mode 100644 index 9e69e41..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/Crow.Wrapper.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/bar-chart.svg b/plugins/CEXmlPlugin/icons/toolbox/bar-chart.svg deleted file mode 100644 index ff86c96..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/bar-chart.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/bar-menu.svg b/plugins/CEXmlPlugin/icons/toolbox/bar-menu.svg deleted file mode 100644 index 87ec061..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/bar-menu.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/bullets.svg b/plugins/CEXmlPlugin/icons/toolbox/bullets.svg deleted file mode 100644 index 81fb1f0..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/bullets.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/calendar.svg b/plugins/CEXmlPlugin/icons/toolbox/calendar.svg deleted file mode 100644 index 9ceaa1e..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/calendar.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/check-square-1.svg b/plugins/CEXmlPlugin/icons/toolbox/check-square-1.svg deleted file mode 100644 index e198007..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/check-square-1.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/database.svg b/plugins/CEXmlPlugin/icons/toolbox/database.svg deleted file mode 100644 index 65a8f06..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/database.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/ellipsis.svg b/plugins/CEXmlPlugin/icons/toolbox/ellipsis.svg deleted file mode 100644 index cff94cc..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/ellipsis.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/file-code.svg b/plugins/CEXmlPlugin/icons/toolbox/file-code.svg deleted file mode 100644 index a2fd2d1..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/file-code.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/grab.svg b/plugins/CEXmlPlugin/icons/toolbox/grab.svg deleted file mode 100644 index 25bc571..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/grab.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/hash.svg b/plugins/CEXmlPlugin/icons/toolbox/hash.svg deleted file mode 100644 index 82196fb..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/hash.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/line-list.svg b/plugins/CEXmlPlugin/icons/toolbox/line-list.svg deleted file mode 100644 index ec15f7b..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/line-list.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/list.svg b/plugins/CEXmlPlugin/icons/toolbox/list.svg deleted file mode 100644 index 9aad88f..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/list.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/modal-list.svg b/plugins/CEXmlPlugin/icons/toolbox/modal-list.svg deleted file mode 100644 index f1d8f70..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/modal-list.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/options.svg b/plugins/CEXmlPlugin/icons/toolbox/options.svg deleted file mode 100644 index a56f6be..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/options.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/package.svg b/plugins/CEXmlPlugin/icons/toolbox/package.svg deleted file mode 100644 index 07f8b37..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/package.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/padding.svg b/plugins/CEXmlPlugin/icons/toolbox/padding.svg deleted file mode 100644 index d93b246..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/padding.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/picture-file.svg b/plugins/CEXmlPlugin/icons/toolbox/picture-file.svg deleted file mode 100644 index c45a6ad..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/picture-file.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/pointer.svg b/plugins/CEXmlPlugin/icons/toolbox/pointer.svg deleted file mode 100644 index 605c0e2..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/pointer.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/puzzle-piece.svg b/plugins/CEXmlPlugin/icons/toolbox/puzzle-piece.svg deleted file mode 100644 index b09c47e..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/puzzle-piece.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/refresh-file.svg b/plugins/CEXmlPlugin/icons/toolbox/refresh-file.svg deleted file mode 100644 index 248e420..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/refresh-file.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/sliders.svg b/plugins/CEXmlPlugin/icons/toolbox/sliders.svg deleted file mode 100644 index 81f72d1..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/sliders.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/split-browser-1.svg b/plugins/CEXmlPlugin/icons/toolbox/split-browser-1.svg deleted file mode 100644 index 4dfd93a..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/split-browser-1.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/table.svg b/plugins/CEXmlPlugin/icons/toolbox/table.svg deleted file mode 100644 index 0b42122..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/table.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/tasks.svg b/plugins/CEXmlPlugin/icons/toolbox/tasks.svg deleted file mode 100644 index 8793c88..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/tasks.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/toolbox/warning.svg b/plugins/CEXmlPlugin/icons/toolbox/warning.svg deleted file mode 100644 index f5a2573..0000000 --- a/plugins/CEXmlPlugin/icons/toolbox/warning.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/tools.svg b/plugins/CEXmlPlugin/icons/tools.svg deleted file mode 100644 index 5ad8a8d..0000000 --- a/plugins/CEXmlPlugin/icons/tools.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/trash.svg b/plugins/CEXmlPlugin/icons/trash.svg deleted file mode 100644 index e73a5e3..0000000 --- a/plugins/CEXmlPlugin/icons/trash.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/undo.svg b/plugins/CEXmlPlugin/icons/undo.svg deleted file mode 100644 index f78f134..0000000 --- a/plugins/CEXmlPlugin/icons/undo.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/icons/zoom-in.svg b/plugins/CEXmlPlugin/icons/zoom-in.svg deleted file mode 100644 index 540a93b..0000000 --- a/plugins/CEXmlPlugin/icons/zoom-in.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/icons/zoom-out.svg b/plugins/CEXmlPlugin/icons/zoom-out.svg deleted file mode 100644 index 6bd256f..0000000 --- a/plugins/CEXmlPlugin/icons/zoom-out.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/images/save.svg b/plugins/CEXmlPlugin/images/save.svg deleted file mode 100644 index 7bdc551..0000000 --- a/plugins/CEXmlPlugin/images/save.svg +++ /dev/null @@ -1,3421 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/CEXmlPlugin/ui/CategoryExp.template b/plugins/CEXmlPlugin/ui/CategoryExp.template deleted file mode 100755 index f546492..0000000 --- a/plugins/CEXmlPlugin/ui/CategoryExp.template +++ /dev/null @@ -1,21 +0,0 @@ - - - - - \ No newline at end of file diff --git a/plugins/CEXmlPlugin/ui/ContextMenu.template b/plugins/CEXmlPlugin/ui/ContextMenu.template deleted file mode 100644 index 38e6b7b..0000000 --- a/plugins/CEXmlPlugin/ui/ContextMenu.template +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/IDE.style b/plugins/CEXmlPlugin/ui/IDE.style deleted file mode 100644 index 5a3c67b..0000000 --- a/plugins/CEXmlPlugin/ui/IDE.style +++ /dev/null @@ -1,25 +0,0 @@ -icon { - Width="14"; - Height="14"; -} -MemberViewLabel { - Margin="1"; - Height="Fit"; - Width="50%"; - Background="White"; -} -MemberViewHStack { - Focusable="true"; - Height="Fit"; - Spacing="1"; - MouseEnter="{Background=SteelBlue}"; - MouseLeave="{Background=Transparent}"; -} - -IcoBut { - Template = "#Crow.Coding.ui.IcoBut.template"; - MinimumSize = "10,10"; - Width = "8"; - Height = "14"; - Background = "White"; -} diff --git a/plugins/CEXmlPlugin/ui/IcoBut.template b/plugins/CEXmlPlugin/ui/IcoBut.template deleted file mode 100644 index a9fc28a..0000000 --- a/plugins/CEXmlPlugin/ui/IcoBut.template +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/plugins/CEXmlPlugin/ui/ItemTemplates/Enum.template b/plugins/CEXmlPlugin/ui/ItemTemplates/Enum.template deleted file mode 100755 index efd9e43..0000000 --- a/plugins/CEXmlPlugin/ui/ItemTemplates/Enum.template +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/plugins/CEXmlPlugin/ui/ItemTemplates/Fill.template b/plugins/CEXmlPlugin/ui/ItemTemplates/Fill.template deleted file mode 100755 index 56d4a4d..0000000 --- a/plugins/CEXmlPlugin/ui/ItemTemplates/Fill.template +++ /dev/null @@ -1,19 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/CEXmlPlugin/ui/icons/basic_floppydisk.svg b/plugins/CEXmlPlugin/ui/icons/basic_floppydisk.svg deleted file mode 100644 index 55d901d..0000000 --- a/plugins/CEXmlPlugin/ui/icons/basic_floppydisk.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/blank-file.svg b/plugins/CEXmlPlugin/ui/icons/blank-file.svg deleted file mode 100644 index 8136979..0000000 --- a/plugins/CEXmlPlugin/ui/icons/blank-file.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/center-align.svg b/plugins/CEXmlPlugin/ui/icons/center-align.svg deleted file mode 100644 index 92e3fac..0000000 --- a/plugins/CEXmlPlugin/ui/icons/center-align.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/cogwheel.svg b/plugins/CEXmlPlugin/ui/icons/cogwheel.svg deleted file mode 100644 index c104c47..0000000 --- a/plugins/CEXmlPlugin/ui/icons/cogwheel.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/copy-file.svg b/plugins/CEXmlPlugin/ui/icons/copy-file.svg deleted file mode 100644 index 63c2dd3..0000000 --- a/plugins/CEXmlPlugin/ui/icons/copy-file.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/edit.svg b/plugins/CEXmlPlugin/ui/icons/edit.svg deleted file mode 100644 index 73569d8..0000000 --- a/plugins/CEXmlPlugin/ui/icons/edit.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/file-code.svg b/plugins/CEXmlPlugin/ui/icons/file-code.svg deleted file mode 100644 index 2dc00db..0000000 --- a/plugins/CEXmlPlugin/ui/icons/file-code.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/folder.svg b/plugins/CEXmlPlugin/ui/icons/folder.svg deleted file mode 100644 index ee1f82b..0000000 --- a/plugins/CEXmlPlugin/ui/icons/folder.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/font-file.svg b/plugins/CEXmlPlugin/ui/icons/font-file.svg deleted file mode 100644 index 20beac1..0000000 --- a/plugins/CEXmlPlugin/ui/icons/font-file.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/light-bulb.svg b/plugins/CEXmlPlugin/ui/icons/light-bulb.svg deleted file mode 100644 index 4193a75..0000000 --- a/plugins/CEXmlPlugin/ui/icons/light-bulb.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/paragraph.svg b/plugins/CEXmlPlugin/ui/icons/paragraph.svg deleted file mode 100644 index 826aa63..0000000 --- a/plugins/CEXmlPlugin/ui/icons/paragraph.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/paste-on-document.svg b/plugins/CEXmlPlugin/ui/icons/paste-on-document.svg deleted file mode 100644 index b0a705e..0000000 --- a/plugins/CEXmlPlugin/ui/icons/paste-on-document.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/previous.svg b/plugins/CEXmlPlugin/ui/icons/previous.svg deleted file mode 100644 index 566c8a3..0000000 --- a/plugins/CEXmlPlugin/ui/icons/previous.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/question.svg b/plugins/CEXmlPlugin/ui/icons/question.svg deleted file mode 100644 index fb8e3d3..0000000 --- a/plugins/CEXmlPlugin/ui/icons/question.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/reply.svg b/plugins/CEXmlPlugin/ui/icons/reply.svg deleted file mode 100644 index d008cb3..0000000 --- a/plugins/CEXmlPlugin/ui/icons/reply.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/scissors.svg b/plugins/CEXmlPlugin/ui/icons/scissors.svg deleted file mode 100644 index 4b5a225..0000000 --- a/plugins/CEXmlPlugin/ui/icons/scissors.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/search.svg b/plugins/CEXmlPlugin/ui/icons/search.svg deleted file mode 100644 index 4a931b3..0000000 --- a/plugins/CEXmlPlugin/ui/icons/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/share-arrow.svg b/plugins/CEXmlPlugin/ui/icons/share-arrow.svg deleted file mode 100644 index e0eb246..0000000 --- a/plugins/CEXmlPlugin/ui/icons/share-arrow.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/sign-out.svg b/plugins/CEXmlPlugin/ui/icons/sign-out.svg deleted file mode 100644 index c5951fc..0000000 --- a/plugins/CEXmlPlugin/ui/icons/sign-out.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/text-file.svg b/plugins/CEXmlPlugin/ui/icons/text-file.svg deleted file mode 100644 index eafca90..0000000 --- a/plugins/CEXmlPlugin/ui/icons/text-file.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/text-label.svg b/plugins/CEXmlPlugin/ui/icons/text-label.svg deleted file mode 100644 index 8fa9196..0000000 --- a/plugins/CEXmlPlugin/ui/icons/text-label.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/tools.svg b/plugins/CEXmlPlugin/ui/icons/tools.svg deleted file mode 100644 index 5326f19..0000000 --- a/plugins/CEXmlPlugin/ui/icons/tools.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/zoom-in.svg b/plugins/CEXmlPlugin/ui/icons/zoom-in.svg deleted file mode 100644 index 60c41d1..0000000 --- a/plugins/CEXmlPlugin/ui/icons/zoom-in.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/CEXmlPlugin/ui/icons/zoom-out.svg b/plugins/CEXmlPlugin/ui/icons/zoom-out.svg deleted file mode 100644 index bd4eec3..0000000 --- a/plugins/CEXmlPlugin/ui/icons/zoom-out.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/CrowEdit.cs b/src/CrowEdit.cs index 1f7d3da..6f8ad69 100644 --- a/src/CrowEdit.cs +++ b/src/CrowEdit.cs @@ -14,7 +14,7 @@ using System.Linq; namespace CrowEdit { - public class CrowEdit : Interface + public class CrowEdit : CrowEditBase.CrowEditBase { #if NETCOREAPP static IntPtr resolveUnmanaged(Assembly assembly, String libraryName) @@ -30,23 +30,120 @@ namespace CrowEdit Console.WriteLine($"[UNRESOLVE] {assembly} {libraryName}"); return IntPtr.Zero; } - static void Main () - { - using (CrowEdit win = new CrowEdit ()) - win.Run (); - } static CrowEdit() { System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()).ResolvingUnmanagedDll += resolveUnmanaged; Interface.CrowAssemblyNames = new string[] {"CrowEditBase"}; } - public CrowEdit () : base(800, 600) { +#endif + static void Main () + { + using (CrowEdit app = new CrowEdit ()) + app.Run (); + } + public CrowEdit () : base (Configuration.Global.Get("MainWinWidth"), Configuration.Global.Get("MainWinHeight")) { + initPlugins (); } + public override void ProcessResize(Rectangle bounds) + { + base.ProcessResize(bounds); + Configuration.Global.Set ("MainWinWidth", clientRectangle.Width); + Configuration.Global.Set ("MainWinHeight", clientRectangle.Height); + } + + protected override void OnInitialized () { + base.OnInitialized (); + + //SetWindowIcon ("#CrowEdit.images.crow.png"); + + if (CurrentDir == null) + CurrentDir = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments); + + initCommands (); + + Widget w = Load ("#CrowEdit.ui.main.crow"); + w.DataSource = this; + + mainDock = w.FindByName ("mainDock") as DockStack; + + reloadWinConfigs (); + + reopenLastDocumentList (); + } + public override void Terminate() + { + saveOpenedDocumentList (); + saveWinConfigs (); + } + DockStack mainDock; + public void saveWinConfigs() { + Configuration.Global.Set ("WinConfigs", mainDock.ExportConfig ()); + Configuration.Global.Save (); + } + public Command CMDSave, CMDSaveAs, CMDQuit, CMDHelp, CMDAbout, CMDOptions; + + public CommandGroup AllCommands => new CommandGroup ( + FileCommands, + EditCommands, + ViewCommands + ); + public CommandGroup ViewCommands = new CommandGroup ("View", + new Command("Explorer", (sender) => loadWindowWithThisDataSource (sender, "#CrowEdit.ui.windows.winFileExplorer.crow")), + new Command("Editor", (sender) => loadWindowWithThisDataSource (sender, "#CrowEdit.ui.windows.winEditor.crow")) + ); + void initCommands (){ + FileCommands = new CommandGroup ("File", + new Command("New", createNewFile, "#CrowEdit.ui.icons.blank-file.svg"), + new Command("Open...", openFileDialog, "#CrowEdit.ui.icons.outbox.svg"), + new Command ("save", default(Action), "#CrowEdit.ui.icons.inbox.svg", false), + new Command ("Save As...", default(Action), "#CrowEdit.ui.icons.inbox.svg", false), + new Command("Options", openOptionsDialog, "#CrowEdit.ui.icons.tools.svg"), + new Command("Quit", base.Quit, "#CrowEdit.ui.icons.sign-out.svg") + ); + EditCommands = new CommandGroup ("Edit", + new Command ("Undo", default(Action), "#CrowEdit.ui.icons.reply.svg", false), + new Command ("Redo", default(Action), "#CrowEdit.ui.icons.share-arrow.svg", false), + new Command ("Cut", default(Action), "#CrowEditBase.ui.icons.scissors.svg", false), + new Command ("Copy", default(Action), "#CrowEditBase.ui.icons.copy-file.svg", false), + new Command ("Paste", default(Action), "#CrowEditBase.ui.icons.paste-on-document.svg", false) + + ); + + CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#CrowEdit.ui.icons.question.svg")}; + } + + static void loadWindowWithThisDataSource(object sender, string path) { + Widget w = sender as Widget; + CrowEdit e = w.IFace as CrowEdit; + e.loadWindow (path, e); + } + public void reloadWinConfigs() { + string conf = Configuration.Global.Get("WinConfigs"); + if (string.IsNullOrEmpty (conf)) + return; + mainDock.ImportConfig (conf, this); + } + public Window loadWindow (string path, object dataSource = null){ + try { + Widget g = FindByName (path); + if (g != null) + return g as Window; + g = Load (path); + g.Name = path; + g.DataSource = dataSource; + return g as Window; + } catch (Exception ex) { + Console.WriteLine (ex.ToString ()); + } + return null; + } + public void closeWindow (string path){ + Widget g = FindByName (path); + if (g != null) + DeleteWidget (g); + } -#endif - public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit, CMDShowLeftPane, - CMDHelp, CMDAbout, CMDOptions; PluginsLoadContext pluginsCtx; void initPlugins () { @@ -59,74 +156,29 @@ namespace CrowEdit pluginsCtx = new PluginsLoadContext (PluginsDirecory); } - public ObservableList OpenedDocuments = new ObservableList (); - - const string _defaultFileName = "unnamed.txt"; - - - void undo () { - } - void redo () { - } + protected override Document openOrCreateFile (string filePath) { + TextDocument doc = null; + CurrentFilePath = filePath; + string ext = Path.GetExtension (CurrentFilePath); - TextDocument currentDocument; - public TextDocument CurrentDocument { - get => currentDocument; - set { - if (currentDocument == value) - return; + using (System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope ctx = pluginsCtx.EnterContextualReflection ()) { - currentDocument?.UnselectDocument (); + Type docType = Type.GetType (Document.GetDocumentClass (ext)); - currentDocument = value; - NotifyValueChanged (currentDocument); + doc = docType == null ? new TextDocument (this, CurrentFilePath) + : (TextDocument)Activator.CreateInstance (docType, new object[] {this, CurrentFilePath}); - currentDocument?.SelectDocument (); - } - } - public string PluginsDirecory { - get => Configuration.Global.Get("PluginsDirecory"); - set { - if (PluginsDirecory == value) - return; - Configuration.Global.Set ("PluginsDirecory", value); - NotifyValueChanged (PluginsDirecory); } + + doc.CloseEvent += onQueryCloseDocument; + OpenedDocuments.Add (doc); + CurrentDocument = doc; + return doc; } - public string CurrentDir { - get => Configuration.Global.Get("CurrentDir"); - set { - if (CurrentDir == value) - return; - Configuration.Global.Set ("CurrentDir", value); - NotifyValueChanged (CurrentDir); - } - } - public string CurrentFilePath { - get => Configuration.Global.Get ("CurrentFilePath"); - set { - if (CurrentFilePath == value) - return; - Configuration.Global.Set ("CurrentFilePath", value); - NotifyValueChanged (CurrentFilePath); - } - } - public string CurFileName { - get => string.IsNullOrEmpty (CurrentFilePath) ? _defaultFileName : Path.GetFileName (CurrentFilePath); - } - public string CurFileDir { - get => string.IsNullOrEmpty (CurrentFilePath) ? CurrentDir : Path.GetDirectoryName (CurrentFilePath); - } - public bool ShowLeftPane { - get => Configuration.Global.Get ("ShowLeftPane"); - set { - if (ShowLeftPane == value) - return; - Configuration.Global.Set ("ShowLeftPane", value); - NotifyValueChanged (ShowLeftPane); - } - } + /*public TreeNode[] GetCurrentDirNodes => + (string.IsNullOrEmpty(CurrentDir) || !Directory.Exists (CurrentDir)) ? + null : new DirectoryNode (new DirectoryInfo(CurrentDir)).GetFileSystemTreeNodeOrdered();*/ public bool ReopenLastFile { get => Configuration.Global.Get ("ReopenLastFile"); set { @@ -137,21 +189,6 @@ namespace CrowEdit } } - void initCommands (){ - CMDNew = new Command("New", createNewFile, "#CrowEdit.ui.icons.blank-file.svg"); - CMDOpen = new Command("Open...", openFileDialog, "#CrowEdit.ui.icons.outbox.svg"); - - - CMDQuit = new Command("Quit", base.Quit, "#CrowEdit.ui.icons.sign-out.svg"); - - CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#CrowEdit.ui.icons.question.svg")}; - - CMDOptions = new Command("Editor Options", openOptionsDialog, new SvgPicture("#CrowEdit.ui.icons.tools.svg")); - CMDShowLeftPane = new Command ("Show Left Pane", () => ShowLeftPane = !ShowLeftPane); - } - void createNewFile(){ - openOrCreateFile (Path.Combine (CurFileDir, _defaultFileName)); - } void openOptionsDialog() => Load ("#CrowEdit.ui.EditorOptions.crow").DataSource = this; void openFileDialog() => LoadIMLFragment ( @@ -162,43 +199,8 @@ namespace CrowEdit void openFileDialog_OkClicked (object sender, EventArgs e) { - FileDialog fd = sender as FileDialog; - if (string.IsNullOrEmpty (fd.SelectedFile)) - return; - TextDocument doc = OpenedDocuments.FirstOrDefault (d => d.FullPath == fd.SelectedFileFullPath); - if (doc != null) - CurrentDocument = doc; - else - openOrCreateFile (fd.SelectedFileFullPath); - } - - void openOrCreateFile (string filePath) { - TextDocument doc = null; - CurrentFilePath = filePath; - string ext = Path.GetExtension (CurrentFilePath); - - using (System.Runtime.Loader.AssemblyLoadContext.ContextualReflectionScope ctx = pluginsCtx.EnterContextualReflection ()) { - - Type docType = Type.GetType (Document.GetDocumentClass (ext)); - - doc = docType == null ? new TextDocument (this, CurrentFilePath) - : (TextDocument)Activator.CreateInstance (docType, new object[] {this, CurrentFilePath}); - - } - - doc.CloseEvent += onQueryCloseDocument; - OpenedDocuments.Add (doc); - CurrentDocument = doc; - } - void closeDocument (TextDocument doc) { - int idx = OpenedDocuments.IndexOf (doc); - OpenedDocuments.Remove (doc); - if (doc == CurrentDocument) { - if (OpenedDocuments.Count > 0) - CurrentDocument = OpenedDocuments[Math.Min (idx, OpenedDocuments.Count - 1)]; - else - CurrentDocument = null; - } + if (OpenOrSelectFile ((sender as FileDialog).SelectedFile) is TextDocument textDocument) + CurrentDocument = textDocument; } void goUpDirClick (object sender, MouseButtonEventArgs e) { @@ -219,32 +221,31 @@ namespace CrowEdit TextDocument doc = OpenedDocuments.FirstOrDefault (d => d.FullPath == fi.FullName); if (doc != null) CurrentDocument = doc; + /*else + openOrCreateFile (fi.FullName);*/ + } + void saveOpenedDocumentList () { + if (OpenedDocuments.Count == 0) + Configuration.Global.Set ("OpenedItems", ""); else - openOrCreateFile (fi.FullName); + Configuration.Global.Set ("OpenedItems", OpenedDocuments.Select(o => o.FullPath).Aggregate((a,b)=>$"{a};{b}")); + Configuration.Global.Set ("CurrentDocument", CurrentDocument?.FullPath); } - - - void onQueryCloseDocument (object sender, EventArgs e) { - TextDocument doc = sender as TextDocument; - if (doc.IsDirty) { - MessageBox mb = MessageBox.ShowModal (this, - MessageBox.Type.YesNoCancel, $"{doc.FileName} has unsaved changes.\nSave it now?"); - mb.Yes += (object _sender, EventArgs _e) => { doc.Save (); closeDocument (doc); }; - mb.No += (object _sender, EventArgs _e) => closeDocument (doc); - } else - closeDocument (doc); + void reopenLastDocumentList () { + string tmp = Configuration.Global.Get ("OpenedItems"); + if (string.IsNullOrEmpty (tmp)) + return; + foreach (string f in tmp.Split(';')) + openOrCreateFile (f); + string lastCurDoc = Configuration.Global.Get ("CurrentDocument"); + if (string.IsNullOrEmpty (lastCurDoc)) + return; + TextDocument doc = OpenedDocuments.FirstOrDefault (d => d.FullPath == lastCurDoc); + if (doc != null) + CurrentDocument = doc; } - protected override void OnInitialized () { - base.OnInitialized (); - - if (CurrentDir == null) - CurrentDir = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments); - - initCommands (); - Load ("#CrowEdit.ui.main.crow").DataSource = this; - - } + } } diff --git a/src/DirectoryNode.cs b/src/DirectoryNode.cs new file mode 100644 index 0000000..87aa78a --- /dev/null +++ b/src/DirectoryNode.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2021 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using Crow; + +namespace CrowEditBase +{ + public class DirectoryNode : TreeNode + { + DirectoryInfo info; + public DirectoryInfo Info => info; + public DirectoryNode (DirectoryInfo info, TreeNode parent = null) : base (parent) { + this.info = info; + } + public override string Name => info.Name; + + public override CommandGroup Commands => + new CommandGroup( + new Command ("Set as root", ()=> {CrowEditBase.App.CurrentDir = info.FullName;}) + ); + public TreeNode [] GetFileSystemTreeNodeOrdered () + => info.GetFileSystemInfos ().OrderBy (f => f.Attributes).ThenBy (f => f.Name) + .Select (d=> d is DirectoryInfo dinfo ? (TreeNode)new DirectoryNode(dinfo, this) : (TreeNode)new FileNode (d as FileInfo, this)).ToArray (); + + } + + +} diff --git a/src/Extensions.cs b/src/Extensions.cs index 6cd0e85..a9b7657 100644 --- a/src/Extensions.cs +++ b/src/Extensions.cs @@ -1,7 +1,11 @@ using System; +using System.IO; +using System.Linq; using System.Collections.Generic; using System.Text; +using Crow; using Crow.Text; +using CrowEditBase; namespace CrowEdit { @@ -10,5 +14,27 @@ namespace CrowEdit public static TextChange Inverse (this TextChange tch, string src) => new TextChange (tch.Start, string.IsNullOrEmpty (tch.ChangedText) ? 0 : tch.ChangedText.Length, tch.Length == 0 ? "" : src.AsSpan (tch.Start, tch.Length).ToString()); + public static CommandGroup GetCommands (this System.IO.DirectoryInfo di) => + new CommandGroup( + new Command ("Set as root", ()=> {CrowEdit.App.CurrentDir = di.FullName;}) + ); + public static CommandGroup GetCommands (this System.IO.FileInfo fi) => + new CommandGroup( + new Command ("Open", ()=> {CrowEdit.App.OpenOrSelectFile (fi.FullName);}), + new Command ("Close", ()=> {CrowEdit.App.CloseFile (fi.FullName);},null, CrowEdit.App.IsOpened (fi.FullName)), + new Command ("Delete", (sender0) => { + MessageBox.ShowModal (CrowEdit.App, MessageBox.Type.YesNo, $"Delete {fi.Name}?").Yes += (sender, e) => { + System.IO.File.Delete(fi.FullName); + Widget listContainer = ((sender0 as Widget).LogicalParent as Widget).DataSource as Widget; + (listContainer.Parent as Group).RemoveChild(listContainer); + }; + }) + ); + public static void OpenWithCrowEdit (this System.IO.FileInfo fi, object sender = null, EventArgs e = null) => CrowEdit.App.OpenOrSelectFile (fi.FullName); + + public static TreeNode [] GetFileSystemTreeNodeOrdered (this DirectoryInfo di) + => di.GetFileSystemInfos ().OrderBy (f => f.Attributes).ThenBy (f => f.Name).Cast ().ToArray (); + + } } diff --git a/src/FileNode.cs b/src/FileNode.cs new file mode 100644 index 0000000..ffc619a --- /dev/null +++ b/src/FileNode.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2021 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using Crow; + +namespace CrowEditBase +{ + public class FileNode : TreeNode + { + FileInfo info; + Document doc; + public override CommandGroup Commands => + new CommandGroup( + new Command ("Open", Open), + new Command ("Delete", (sender0) => { + MessageBox.ShowModal (CrowEditBase.App, MessageBox.Type.YesNo, $"Delete {info.Name}?").Yes += (sender, e) => { + System.IO.File.Delete(info.FullName); + Widget listContainer = ((sender0 as Widget).LogicalParent as Widget).DataSource as Widget; + (listContainer.Parent as Group).RemoveChild(listContainer); + }; + }) + ); + public FileNode (FileInfo info, TreeNode parent = null) : base (parent) { + this.info = info; + } + public override string Name => info.Name; + + public bool IsOpen => doc != null; + + public void Open () { + doc = CrowEditBase.App.OpenOrSelectFile (info.FullName); + if (doc is TextDocument td) + CrowEditBase.App.CurrentDocument = td; + NotifyValueChanged ("IsOpen", IsOpen); + } + public void OnOpenClick (object sender, EventArgs e) => Open(); + } + + +} diff --git a/src/TreeNode.cs b/src/TreeNode.cs new file mode 100644 index 0000000..834efe0 --- /dev/null +++ b/src/TreeNode.cs @@ -0,0 +1,115 @@ +// Copyright (c) 2020 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using Crow; + +namespace CrowEditBase +{ + public abstract class TreeNode : IValueChange, ISelectable + { + #region IValueChange implementation + public event EventHandler ValueChanged; + + public virtual void NotifyValueChanged (string MemberName, object _value) + { + ValueChanged.Raise (this, new ValueChangeEventArgs (MemberName, _value)); + } + #endregion + + #region ISelectable implementation + public event EventHandler Selected; + public event EventHandler Unselected; + public virtual bool IsSelected { + get { return isSelected; } + set { + if (value == isSelected) + return; + + Console.WriteLine ($"TreeNode({this}).IsSelected: {isSelected} -> {value}"); + + isSelected = value; + + NotifyValueChanged ("IsSelected", isSelected); + } + } + #endregion + + ObservableList childs = new ObservableList (); + + public TreeNode () {} + public TreeNode (TreeNode parent) { + Parent?.AddChild (this); + } + + protected bool isSelected, isExpanded; + + public TreeNode Parent { get; protected set; } + + public abstract string Name { get; } + public ObservableList Childs { + get => childs; + set { + if (childs == value) + return; + childs = value; + NotifyValueChanged ("Childs", childs); + } + } + public abstract CommandGroup Commands { get; } + + public void AddChild (TreeNode pn) + { + childs.Add (pn); + pn.Parent = this; + } + public void RemoveChild (TreeNode pn) + { + pn.Parent = null; + childs.Remove (pn); + } + + public virtual bool IsExpanded { + get { return isExpanded; } + set { + if (value == isExpanded) + return; + isExpanded = value; + NotifyValueChanged ("IsExpanded", isExpanded); + NotifyValueChanged ("IconSub", IconSub); + } + } + public virtual Picture Icon => new SvgPicture ("#Icons.Question.svg"); + public virtual string IconSub => null; + + public override string ToString () => Name; + + public IEnumerable Flatten { + get { + yield return this; + foreach (var node in childs.SelectMany (child => child.Flatten)) + yield return node; + } + } + + public virtual void SortChilds () + { + foreach (TreeNode pn in Childs) + pn.SortChilds (); + Childs = new ObservableList (Childs.OrderBy (c => c, new NodeComparer())); + } + + public class NodeComparer : IComparer + { + public int Compare (TreeNode x, TreeNode y) + { + return string.Compare (x.Name, y.Name); + } + } + } + + +} diff --git a/ui/CrowEdit.style b/ui/CrowEdit.style deleted file mode 100644 index 7df64a6..0000000 --- a/ui/CrowEdit.style +++ /dev/null @@ -1,30 +0,0 @@ -DocTabViewBackground = "DarkGrey"; -SelectedTabBackground = "Onyx"; -MenuIconSize = "14"; - -MenuItem { - Template = "#CrowEdit.ui.MenuItem.template"; -} - -MenuIcon { - Margin = "2"; - Width = "${MenuIconSize}"; - Height = "${MenuIconSize}"; -} - -suggestionsListBox { - Template = "#CrowEdit.ui.Suggestions.template"; - Width = "Fit"; - Height = "Fit"; - MaximumSize = "300, 120"; - Background = "Jet"; - UseLoadingThread = "false"; -} - -Editor { - Background="White"; - Foreground="Black"; - Text=""; - Multiline="true"; -} - diff --git a/ui/DockWindow.template b/ui/DockWindow.template new file mode 100644 index 0000000..d2c70e1 --- /dev/null +++ b/ui/DockWindow.template @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/ui/DockingTabView.template b/ui/DockingTabView.template new file mode 100644 index 0000000..7565f65 --- /dev/null +++ b/ui/DockingTabView.template @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/ui/MenuItem.template b/ui/MenuItem.template index 7c4e208..df853bc 100644 --- a/ui/MenuItem.template +++ b/ui/MenuItem.template @@ -1,21 +1,13 @@  - + - - - - + + + + + + \ No newline at end of file diff --git a/ui/main.crow b/ui/main.crow index da8385e..702542f 100755 --- a/ui/main.crow +++ b/ui/main.crow @@ -1,90 +1,23 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/ui/sourceEditor.itmp b/ui/sourceEditor.itmp index 6c7dc13..91ac4c8 100644 --- a/ui/sourceEditor.itmp +++ b/ui/sourceEditor.itmp @@ -1,10 +1,9 @@ - + + Document="{}" TextChanged="onTextChanged" /> diff --git a/ui/windows/winEditor.crow b/ui/windows/winEditor.crow new file mode 100644 index 0000000..9d3224c --- /dev/null +++ b/ui/windows/winEditor.crow @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/windows/winFileExplorer.crow b/ui/windows/winFileExplorer.crow new file mode 100644 index 0000000..4aa98ae --- /dev/null +++ b/ui/windows/winFileExplorer.crow @@ -0,0 +1,65 @@ + + + + + + + + + + + + + +