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
{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
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
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;
}
{
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)
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>netcoreapp2.0</TargetFramework>
-
- <OutputType>Exe</OutputType>
- <RootNamespace>Crow.Coding</RootNamespace>
- <AssemblyName>CrowIDE</AssemblyName>
- <StartupObject>Crow.Coding.CrowIDE</StartupObject>
-
- <OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath>
- <IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath>
-
- <EnableDefaultItems>false</EnableDefaultItems>
- <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>full</DebugType>
- <DefineConstants>TRACE;NETSTANDARD2_0;DEBUG;NETCOREAPP2_0</DefineConstants>
- </PropertyGroup>
-
- <ItemGroup>
- <EmbeddedResource Remove="icons\blank-file2.svg" />
- </ItemGroup>
- <ItemGroup>
-
- <PackageReference Include="System.CodeDom" Version="4.5.0" />
-<!--<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />-->
-
- <Compile Include="src\**\*.cs" Exclude="src\ProjectTree\CSProjectFile.cs" />
-
- <ProjectReference Include="..\Crow\Crow.NetStd.csproj" />
-
- <EmbeddedResource Include="icons\*.*">
- <LogicalName>icons.%(Filename)%(Extension)</LogicalName>
- </EmbeddedResource>
-
- <EmbeddedResource Include="ui\**\*.crow" />
- <EmbeddedResource Include="ui\**\*.itemp" />
-
- <EmbeddedResource Include="ui\**\*.template">
- <LogicalName>Crow.Coding.%(Filename).template</LogicalName>
- </EmbeddedResource>
-
- <EmbeddedResource Include="DefaultTemplateOverrides\*.*">
- <LogicalName>Crow.%(Filename).template</LogicalName>
- </EmbeddedResource>
-
- <EmbeddedResource Include="IDE.style" />
- </ItemGroup>
-
- <ItemGroup>
- <Folder Include="src\msbuild\" />
- </ItemGroup>
-</Project>
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
+ <Import Project="$(SolutionDir)netfx.props" />
<PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B6D911CD-1D09-42FC-B300-9187190F2AE1}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>CrowIDE</RootNamespace>
- <AssemblyName>CrowIDE</AssemblyName>
- <OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath>
- <IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath>
+ <TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
+ <OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
+ <OutputType>Exe</OutputType>
+ <RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>
+ <License>MIT</License>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <EnableDefaultItems>false</EnableDefaultItems>
<ReleaseVersion>0.8.0</ReleaseVersion>
+
<StartupObject>Crow.Coding.CrowIDE</StartupObject>
- <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
- <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath>
- <OutputPath>$(SolutionDir)build\$(Configuration)</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>none</DebugType>
- <Optimize>true</Optimize>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>0</WarningLevel>
- <ConsolePause>false</ConsolePause>
- <IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath>
- <OutputPath>$(SolutionDir)build\$(Configuration)</OutputPath>
+ <DefineConstants>TRACE;NETSTANDARD2_0;DEBUG;NETCOREAPP2_0</DefineConstants>
</PropertyGroup>
<ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Drawing" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ItemGroup>
- <ProjectReference Include="..\Crow\Crow.csproj">
- <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
- <Name>Crow</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="src\**\*.cs" Exclude="src\ProjectTree\CSProjectFile.cs" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="ui\" />
- <Folder Include="src\" />
- <Folder Include="images\" />
- <Folder Include="ui\ItemTemplates\" />
- <Folder Include="src\MemberView\" />
- <Folder Include="ui\DockWindows\" />
- <Folder Include="ui\editors\" />
- <Folder Include="src\Editors\" />
- <Folder Include="src\Editors\Parsers\" />
- <Folder Include="src\Editors\CodeBuffer\" />
- <Folder Include="src\ProjectTree\" />
- <Folder Include="src\Editors\Parsers2\" />
- <Folder Include="src\ProjectTree\msbuild\" />
+ <EmbeddedResource Remove="icons\blank-file2.svg" />
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="IDE.style" />
- <EmbeddedResource Include="icons\**\*.svg" />
- <EmbeddedResource Include="images\save.svg" />
- <EmbeddedResource Include="ui\MembersView.template">
- <LogicalName>Crow.Coding.MembersView.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\LQIsExplorer.crow" />
- <EmbeddedResource Include="ui\MemberView.crow" />
- <EmbeddedResource Include="ui\ProjectProperties.crow" />
- <EmbeddedResource Include="ui\TreeExpandable.template">
- <LogicalName>Crow.Coding.TreeExpandable.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\ProjectTree.template">
- <LogicalName>Crow.Coding.ProjectTree.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\CrowIDE.crow" />
- <EmbeddedResource Include="DefaultTemplateOverrides\TabItem.template">
- <LogicalName>Crow.TabItem.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="DefaultTemplateOverrides\MenuItem.template">
- <LogicalName>Crow.MenuItem.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="DefaultTemplateOverrides\ContextMenu.template">
- <LogicalName>Crow.ContextMenu.template</LogicalName>
+ <PackageReference Include="System.CodeDom" Version="4.5.0" />
+<!--<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />-->
+
+ <Compile Include="src\**\*.cs" Exclude="src\ProjectTree\CSProjectFile.cs" />
+
+ <EmbeddedResource Include="icons\*.*">
+<!-- <LogicalName>Crowicons.%(Filename)%(Extension)</LogicalName>-->
</EmbeddedResource>
- <EmbeddedResource Include="ui\Options.crow" />
- <EmbeddedResource Include="ui\IcoBut.template" />
- <EmbeddedResource Include="ui\MembersItem.template">
- <LogicalName>Crow.Coding.MembersItem.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\ItemTemplates\Enum.template">
- <LogicalName>Crow.Coding.Enum.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\ItemTemplates\Fill.template">
- <LogicalName>Crow.Coding.Fill.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\DockWindows\winEditor.crow" />
- <EmbeddedResource Include="ui\DockWindows\winErrors.crow" />
- <EmbeddedResource Include="ui\DockWindows\winSolution.crow" />
- <EmbeddedResource Include="ui\DockWindows\winProperties.crow" />
- <EmbeddedResource Include="ui\DockWindows\winToolbox.crow" />
- <EmbeddedResource Include="ui\DockWindows\toolboxBut.template" />
- <EmbeddedResource Include="ui\editors\EditPane.template">
- <LogicalName>Crow.Coding.EditPane.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\editors\EditPaneItems.template">
- <LogicalName>Crow.Coding.EditPaneItems.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\editors\IMLEdit.itemp" />
- <EmbeddedResource Include="ui\editors\SourceEditor.crow" />
- <EmbeddedResource Include="ui\editors\SrcEdit.itemp" />
- <EmbeddedResource Include="ui\editors\SvgEdit.itemp" />
- <EmbeddedResource Include="ui\DockWindows\winGTExplorer.crow" />
- <EmbeddedResource Include="ui\DockWindows\GTreeExpITemp.crow" />
- <EmbeddedResource Include="ui\NewFile.crow" />
- <EmbeddedResource Include="ui\DockWindows\winSchema.crow" />
- <EmbeddedResource Include="ui\DockWindows\WinSchemaItem.template" />
- <EmbeddedResource Include="ui\editors\TextEditor.crow">
- <LogicalName>Crow.Coding.ui.TextEditor.crow</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\DockWindows\winStyleView.crow" />
- <EmbeddedResource Include="ui\CategoryExp.template">
- <LogicalName>Crow.Coding.CategoryExp.template</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="ui\DockWindows\winDesign.crow" />
- <EmbeddedResource Include="ui\editors\EditTabItem.template">
- <LogicalName>Crow.Coding.EditTabItem.template</LogicalName>
+
+ <EmbeddedResource Include="ui\**\*.crow" />
+ <EmbeddedResource Include="ui\**\*.itemp" />
+
+ <EmbeddedResource Include="ui\**\*.template">
+ <LogicalName>Crow.Coding.%(Filename).template</LogicalName>
+ </EmbeddedResource>
+
+ <EmbeddedResource Include="DefaultTemplateOverrides\*.*">
+ <LogicalName>Crow.%(Filename).template</LogicalName>
</EmbeddedResource>
+
+ <EmbeddedResource Include="IDE.style" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Folder Include="src\msbuild\" />
</ItemGroup>
<ItemGroup>
- <None Include="ui\test.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
+ <ProjectReference Include="..\Crow\Crow.csproj" />
</ItemGroup>
</Project>
+++ /dev/null
-
-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
namespace Crow.Coding
{
/// <summary>
- /// Code buffer, lines are arranged in a List<string>, 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...',
/// </summary>
public class CodeBuffer
{
// Author:
// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
//
-// 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
// 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
{
// Author:
// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// 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