From: Jean-Philippe Bruyère Date: Sun, 4 Aug 2019 09:11:47 +0000 (+0200) Subject: update crowIDE X-Git-Tag: v0.8.7~15 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=32e880b9779e8edc17cf6be6ecee10552c5f3db7;p=jp%2Fcrow.git update crowIDE --- diff --git a/Crow.sln b/Crow.sln index a729dd56..37f1d7b1 100644 --- a/Crow.sln +++ b/Crow.sln @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "Samples\Hello EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowCase", "Samples\ShowCase\ShowCase.csproj", "{56329D48-D382-4850-93DE-59C453894E8A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{C40A3F21-0558-4265-9251-718C1564D10A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C40A3F21-0558-4265-9251-718C1564D10A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C40A3F21-0558-4265-9251-718C1564D10A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C40A3F21-0558-4265-9251-718C1564D10A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C40A3F21-0558-4265-9251-718C1564D10A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 @@ -69,6 +75,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} - {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} + {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} EndGlobalSection EndGlobal diff --git a/Crow/src/GraphicObjects/Label.cs b/Crow/src/GraphicObjects/Label.cs index b4b813c6..c7bd5124 100644 --- a/Crow/src/GraphicObjects/Label.cs +++ b/Crow/src/GraphicObjects/Label.cs @@ -447,37 +447,34 @@ namespace Crow if (lines == null) lines = getLines; if (!textMeasureIsUpToDate) { - using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) { - using (Context gr = new Context (img)) { - //Cairo.FontFace cf = gr.GetContextFontFace (); - - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Interface.Antialias; - - fe = gr.FontExtents; - te = new TextExtents (); - - cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2; - - try { - for (int i = 0; i < lines.Count; i++) { - string l = lines[i].Replace ("\t", new String (' ', Interface.TabSize)); - - TextExtents tmp = gr.TextExtents (l); - - if (tmp.XAdvance > te.XAdvance) - te = tmp; - } - cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance) + Margin * 2; - textMeasureIsUpToDate = true; - } catch { - return -1; - } - } - } + using (Context gr = new Context (IFace.surf)) { + //Cairo.FontFace cf = gr.GetContextFontFace (); + + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); + gr.FontOptions = Interface.FontRenderingOptions; + gr.Antialias = Interface.Antialias; + + fe = gr.FontExtents; + te = new TextExtents (); + + cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2; + try { + for (int i = 0; i < lines.Count; i++) { + string l = lines[i].Replace ("\t", new String (' ', Interface.TabSize)); + + TextExtents tmp = gr.TextExtents (l); + + if (tmp.XAdvance > te.XAdvance) + te = tmp; + } + cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance) + Margin * 2; + textMeasureIsUpToDate = true; + } catch { + return -1; + } + } } return lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width; } diff --git a/Crow/src/GraphicObjects/TextRun.cs b/Crow/src/GraphicObjects/TextRun.cs index 2be1d628..48687176 100644 --- a/Crow/src/GraphicObjects/TextRun.cs +++ b/Crow/src/GraphicObjects/TextRun.cs @@ -149,35 +149,33 @@ namespace Crow { if (lines == null) lines = getLines; + + using (Context gr = new Context (IFace.surf)) { + //Cairo.FontFace cf = gr.GetContextFontFace (); - using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) { - using (Context gr = new Context (img)) { - //Cairo.FontFace cf = gr.GetContextFontFace (); + gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); + gr.SetFontSize (Font.Size); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); + fe = gr.FontExtents; + te = new TextExtents (); - fe = gr.FontExtents; - te = new TextExtents (); + if (lt == LayoutingType.Height) { + int lc = lines.Count; + //ensure minimal height = text line height + if (lc == 0) + lc = 1; - if (lt == LayoutingType.Height) { - int lc = lines.Count; - //ensure minimal height = text line height - if (lc == 0) - lc = 1; - - return (int)(fe.Height * lc) + Margin * 2; - } + return (int)(fe.Height * lc) + Margin * 2; + } - foreach (string s in lines) { - string l = s.Replace("\t", new String (' ', Interface.TabSize)); - TextExtents tmp = gr.TextExtents (l); - if (tmp.XAdvance > te.XAdvance) - te = tmp; - } - return (int)Math.Ceiling (te.XAdvance) + Margin * 2; + foreach (string s in lines) { + string l = s.Replace("\t", new String (' ', Interface.TabSize)); + TextExtents tmp = gr.TextExtents (l); + if (tmp.XAdvance > te.XAdvance) + te = tmp; } + return (int)Math.Ceiling (te.XAdvance) + Margin * 2; } } protected override void onDraw (Context gr) diff --git a/CrowIDE/CrowIDE.NetStd.csproj b/CrowIDE/CrowIDE.NetStd.csproj deleted file mode 100644 index 0872a62d..00000000 --- a/CrowIDE/CrowIDE.NetStd.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - netcoreapp2.0 - - Exe - Crow.Coding - CrowIDE - Crow.Coding.CrowIDE - - $(SolutionDir)build/$(Configuration) - $(SolutionDir)build/obj/$(Configuration) - - false - false - - - full - TRACE;NETSTANDARD2_0;DEBUG;NETCOREAPP2_0 - - - - - - - - - - - - - - - - icons.%(Filename)%(Extension) - - - - - - - Crow.Coding.%(Filename).template - - - - Crow.%(Filename).template - - - - - - - - - diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index c0c44ed6..a03948bb 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -1,146 +1,55 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {B6D911CD-1D09-42FC-B300-9187190F2AE1} - Exe - CrowIDE - CrowIDE - $(SolutionDir)build/$(Configuration) - $(SolutionDir)build/obj/$(Configuration) + net471;netstandard2.0 + $(SolutionDir)build\$(Configuration)\ + Exe + https://github.com/jpbruyere/Crow + MIT + true + false 0.8.0 + Crow.Coding.CrowIDE - v4.6.1 + - true full - false - DEBUG; - prompt - 4 - false - $(SolutionDir)build\obj\$(Configuration) - $(SolutionDir)build\$(Configuration) - - - none - true - prompt - 0 - false - $(SolutionDir)build\obj\$(Configuration) - $(SolutionDir)build\$(Configuration) + TRACE;NETSTANDARD2_0;DEBUG;NETCOREAPP2_0 - - - - - - - - - {C2980F9B-4798-4C05-99E2-E174810F7C7B} - Crow - - - - - - - - - - - - - - - - - - - + - - - - - Crow.Coding.MembersView.template - - - - - - Crow.Coding.TreeExpandable.template - - - Crow.Coding.ProjectTree.template - - - - Crow.TabItem.template - - - Crow.MenuItem.template - - - Crow.ContextMenu.template + + + + + + + - - - - Crow.Coding.MembersItem.template - - - Crow.Coding.Enum.template - - - Crow.Coding.Fill.template - - - - - - - - - Crow.Coding.EditPane.template - - - Crow.Coding.EditPaneItems.template - - - - - - - - - - - - Crow.Coding.ui.TextEditor.crow - - - - Crow.Coding.CategoryExp.template - - - - Crow.Coding.EditTabItem.template + + + + + + Crow.Coding.%(Filename).template + + + + Crow.%(Filename).template + + + + + + - - PreserveNewest - + diff --git a/CrowIDE/CrowIDE.sln b/CrowIDE/CrowIDE.sln deleted file mode 100644 index 49e1e026..00000000 --- a/CrowIDE/CrowIDE.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs b/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs index 7d5efec9..348a5b62 100644 --- a/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs +++ b/CrowIDE/src/Editors/CodeBuffer/CodeBuffer.cs @@ -28,7 +28,7 @@ using System.Threading; namespace Crow.Coding { /// - /// Code buffer, lines are arranged in a List, new line chars are removed during string.split on '\n...', + /// Code buffer, lines are arranged in a List'string', new line chars are removed during string.split on '\n...', /// public class CodeBuffer { diff --git a/CrowIDE/src/Editors/SourceEditor.cs b/CrowIDE/src/Editors/SourceEditor.cs index decda6d8..86e0bdbf 100644 --- a/CrowIDE/src/Editors/SourceEditor.cs +++ b/CrowIDE/src/Editors/SourceEditor.cs @@ -4,7 +4,7 @@ // Author: // Jean-Philippe Bruyère // -// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// Copyright (c) 2013-2019 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 @@ -25,17 +25,10 @@ // THE SOFTWARE. using System; -using System.Xml.Serialization; using System.ComponentModel; -using System.Collections; using Cairo; -using System.Text; using System.Collections.Generic; -using System.Text.RegularExpressions; -using System.Linq; using System.Diagnostics; -using System.IO; -using System.Threading; namespace Crow.Coding { diff --git a/CrowIDE/src/Editors/SvgEditor.cs b/CrowIDE/src/Editors/SvgEditor.cs index 163b5ac1..97b19603 100644 --- a/CrowIDE/src/Editors/SvgEditor.cs +++ b/CrowIDE/src/Editors/SvgEditor.cs @@ -4,7 +4,7 @@ // Author: // Jean-Philippe Bruyère // -// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// Copyright (c) 2013-2019 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