Skip to content

Commit 8d62131

Browse files
authored
Merge pull request #22 from Abdesol/CrossPlatform
Cross platform to Master branch
2 parents cb0338c + 88bf1ef commit 8d62131

586 files changed

Lines changed: 44659 additions & 44739 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/.idea.CutCode/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.CutCode/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.CutCode/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.CutCode/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AvaloniaEdit/AvaloniaEdit.csproj

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<WarningsNotAsErrors>612,618</WarningsNotAsErrors>
6+
<Version>0.10.0-preview6</Version>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<EmbeddedResource Include="**\*.xshd;**\*.resx;" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
11+
<AvaloniaResource Include="**\*.xaml;Assets\*;" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
12+
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<None Remove="Search\Assets\CaseSensitive.png" />
17+
<None Remove="Search\Assets\CompleteWord.png" />
18+
<None Remove="Search\Assets\FindNext.png" />
19+
<None Remove="Search\Assets\FindPrevious.png" />
20+
<None Remove="Search\Assets\RegularExpression.png" />
21+
<None Remove="Search\Assets\ReplaceAll.png" />
22+
<None Remove="Search\Assets\ReplaceNext.png" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<EmbeddedResource Include="Search\Assets\CaseSensitive.png" />
27+
<EmbeddedResource Include="Search\Assets\CompleteWord.png" />
28+
<EmbeddedResource Include="Search\Assets\FindNext.png" />
29+
<EmbeddedResource Include="Search\Assets\FindPrevious.png" />
30+
<EmbeddedResource Include="Search\Assets\RegularExpression.png" />
31+
<EmbeddedResource Include="Search\Assets\ReplaceAll.png" />
32+
<EmbeddedResource Include="Search\Assets\ReplaceNext.png" />
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<PackageReference Include="Avalonia" Version="0.10.11" />
37+
<PackageReference Include="System.Collections.Immutable" Version="1.6.0" />
38+
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.1" />
39+
</ItemGroup>
40+
41+
<ItemGroup>
42+
<Compile Update="SR.Designer.cs">
43+
<DesignTime>True</DesignTime>
44+
<AutoGen>True</AutoGen>
45+
<DependentUpon>SR.resx</DependentUpon>
46+
</Compile>
47+
</ItemGroup>
48+
49+
<ItemGroup>
50+
<EmbeddedResource Update="SR.resx">
51+
<Generator>PublicResXFileCodeGenerator</Generator>
52+
<LastGenOutput>SR.Designer.cs</LastGenOutput>
53+
</EmbeddedResource>
54+
</ItemGroup>
55+
56+
<Target Name="ChangeAliasesOfSystemDrawing" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
57+
<ItemGroup>
58+
<ReferencePath Condition="'%(FileName)' == 'Splat'">
59+
<Aliases>SystemDrawing</Aliases>
60+
</ReferencePath>
61+
</ItemGroup>
62+
</Target>
63+
</Project>

AvaloniaEdit/AvaloniaEdit.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Styles xmlns="https://github.com/avaloniaui">
2+
3+
<StyleInclude Source="avares://AvaloniaEdit/TextEditor.xaml" />
4+
<StyleInclude Source="avares://AvaloniaEdit/Editing/TextArea.xaml" />
5+
<StyleInclude Source="avares://AvaloniaEdit/CodeCompletion/CompletionList.xaml" />
6+
<StyleInclude Source="avares://AvaloniaEdit/CodeCompletion/InsightWindow.xaml" />
7+
<StyleInclude Source="avares://AvaloniaEdit/Search/DropDownButton.xaml" />
8+
<StyleInclude Source="avares://AvaloniaEdit/Search/SearchPanel.xaml" />
9+
10+
</Styles>
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
// software and associated documentation files (the "Software"), to deal in the Software
5+
// without restriction, including without limitation the rights to use, copy, modify, merge,
6+
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7+
// to whom the Software is furnished to do so, subject to the following conditions:
8+
//
9+
// The above copyright notice and this permission notice shall be included in all copies or
10+
// substantial portions of the Software.
11+
//
12+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14+
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15+
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
// DEALINGS IN THE SOFTWARE.
18+
19+
using System.Diagnostics.CodeAnalysis;
20+
using Avalonia;
21+
using Avalonia.Input;
22+
using Avalonia.Platform;
23+
24+
namespace AvaloniaEdit
25+
{
26+
/// <summary>
27+
/// Custom commands for AvalonEdit.
28+
/// </summary>
29+
public static class AvaloniaEditCommands
30+
{
31+
/// <summary>
32+
/// Toggles Overstrike mode
33+
/// The default shortcut is Ins.
34+
/// </summary>
35+
public static RoutedCommand ToggleOverstrike { get; } = new RoutedCommand(nameof(ToggleOverstrike), new KeyGesture(Key.Insert));
36+
37+
/// <summary>
38+
/// Deletes the current line.
39+
/// The default shortcut is Ctrl+D.
40+
/// </summary>
41+
public static RoutedCommand DeleteLine { get; } = new RoutedCommand(nameof(DeleteLine), new KeyGesture(Key.D, KeyModifiers.Control));
42+
43+
/// <summary>
44+
/// Removes leading whitespace from the selected lines (or the whole document if the selection is empty).
45+
/// </summary>
46+
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace")]
47+
public static RoutedCommand RemoveLeadingWhitespace { get; } = new RoutedCommand(nameof(RemoveLeadingWhitespace));
48+
49+
/// <summary>
50+
/// Removes trailing whitespace from the selected lines (or the whole document if the selection is empty).
51+
/// </summary>
52+
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace")]
53+
public static RoutedCommand RemoveTrailingWhitespace { get; } = new RoutedCommand(nameof(RemoveTrailingWhitespace));
54+
55+
/// <summary>
56+
/// Converts the selected text to upper case.
57+
/// </summary>
58+
public static RoutedCommand ConvertToUppercase { get; } = new RoutedCommand(nameof(ConvertToUppercase));
59+
60+
/// <summary>
61+
/// Converts the selected text to lower case.
62+
/// </summary>
63+
public static RoutedCommand ConvertToLowercase { get; } = new RoutedCommand(nameof(ConvertToLowercase));
64+
65+
/// <summary>
66+
/// Converts the selected text to title case.
67+
/// </summary>
68+
public static RoutedCommand ConvertToTitleCase { get; } = new RoutedCommand(nameof(ConvertToTitleCase));
69+
70+
/// <summary>
71+
/// Inverts the case of the selected text.
72+
/// </summary>
73+
public static RoutedCommand InvertCase { get; } = new RoutedCommand(nameof(InvertCase));
74+
75+
/// <summary>
76+
/// Converts tabs to spaces in the selected text.
77+
/// </summary>
78+
public static RoutedCommand ConvertTabsToSpaces { get; } = new RoutedCommand(nameof(ConvertTabsToSpaces));
79+
80+
/// <summary>
81+
/// Converts spaces to tabs in the selected text.
82+
/// </summary>
83+
public static RoutedCommand ConvertSpacesToTabs { get; } = new RoutedCommand(nameof(ConvertSpacesToTabs));
84+
85+
/// <summary>
86+
/// Converts leading tabs to spaces in the selected lines (or the whole document if the selection is empty).
87+
/// </summary>
88+
public static RoutedCommand ConvertLeadingTabsToSpaces { get; } = new RoutedCommand(nameof(ConvertLeadingTabsToSpaces));
89+
90+
/// <summary>
91+
/// Converts leading spaces to tabs in the selected lines (or the whole document if the selection is empty).
92+
/// </summary>
93+
public static RoutedCommand ConvertLeadingSpacesToTabs { get; } = new RoutedCommand(nameof(ConvertLeadingSpacesToTabs));
94+
95+
/// <summary>InputModifiers
96+
/// Runs the IIndentationStrategy on the selected lines (or the whole document if the selection is empty).
97+
/// </summary>
98+
public static RoutedCommand IndentSelection { get; } = new RoutedCommand(nameof(IndentSelection), new KeyGesture(Key.I, KeyModifiers.Control));
99+
}
100+
101+
102+
public static class ApplicationCommands
103+
{
104+
private static readonly KeyModifiers PlatformCommandKey = GetPlatformCommandKey();
105+
106+
public static RoutedCommand Delete { get; } = new RoutedCommand(nameof(Delete), new KeyGesture(Key.Delete));
107+
public static RoutedCommand Copy { get; } = new RoutedCommand(nameof(Copy), new KeyGesture(Key.C, PlatformCommandKey));
108+
public static RoutedCommand Cut { get; } = new RoutedCommand(nameof(Cut), new KeyGesture(Key.X, PlatformCommandKey));
109+
public static RoutedCommand Paste { get; } = new RoutedCommand(nameof(Paste), new KeyGesture(Key.V, PlatformCommandKey));
110+
public static RoutedCommand SelectAll { get; } = new RoutedCommand(nameof(SelectAll), new KeyGesture(Key.A, PlatformCommandKey));
111+
public static RoutedCommand Undo { get; } = new RoutedCommand(nameof(Undo), new KeyGesture(Key.Z, PlatformCommandKey));
112+
public static RoutedCommand Redo { get; } = new RoutedCommand(nameof(Redo), new KeyGesture(Key.Y, PlatformCommandKey));
113+
public static RoutedCommand Find { get; } = new RoutedCommand(nameof(Find), new KeyGesture(Key.F, PlatformCommandKey));
114+
public static RoutedCommand Replace { get; } = new RoutedCommand(nameof(Replace), GetReplaceKeyGesture());
115+
116+
private static OperatingSystemType GetOperatingSystemType()
117+
{
118+
return AvaloniaLocator.Current.GetService<IRuntimePlatform>().GetRuntimeInfo().OperatingSystem;
119+
}
120+
121+
private static KeyModifiers GetPlatformCommandKey()
122+
{
123+
var os = GetOperatingSystemType();
124+
125+
if (os == OperatingSystemType.OSX)
126+
{
127+
return KeyModifiers.Meta;
128+
}
129+
130+
return KeyModifiers.Control;
131+
}
132+
133+
private static KeyGesture GetReplaceKeyGesture()
134+
{
135+
var os = GetOperatingSystemType();
136+
137+
if (os == OperatingSystemType.OSX)
138+
{
139+
return new KeyGesture(Key.F, KeyModifiers.Meta | KeyModifiers.Alt);
140+
}
141+
142+
return new KeyGesture(Key.H, PlatformCommandKey);
143+
}
144+
}
145+
146+
public static class EditingCommands
147+
{
148+
public static RoutedCommand Delete { get; } = new RoutedCommand(nameof(Delete));
149+
public static RoutedCommand DeleteNextWord { get; } = new RoutedCommand(nameof(DeleteNextWord));
150+
public static RoutedCommand Backspace { get; } = new RoutedCommand(nameof(Backspace));
151+
public static RoutedCommand DeletePreviousWord { get; } = new RoutedCommand(nameof(DeletePreviousWord));
152+
public static RoutedCommand EnterParagraphBreak { get; } = new RoutedCommand(nameof(EnterParagraphBreak));
153+
public static RoutedCommand EnterLineBreak { get; } = new RoutedCommand(nameof(EnterLineBreak));
154+
public static RoutedCommand TabForward { get; } = new RoutedCommand(nameof(TabForward));
155+
public static RoutedCommand TabBackward { get; } = new RoutedCommand(nameof(TabBackward));
156+
public static RoutedCommand MoveLeftByCharacter { get; } = new RoutedCommand(nameof(MoveLeftByCharacter));
157+
public static RoutedCommand SelectLeftByCharacter { get; } = new RoutedCommand(nameof(SelectLeftByCharacter));
158+
public static RoutedCommand MoveRightByCharacter { get; } = new RoutedCommand(nameof(MoveRightByCharacter));
159+
public static RoutedCommand SelectRightByCharacter { get; } = new RoutedCommand(nameof(SelectRightByCharacter));
160+
public static RoutedCommand MoveLeftByWord { get; } = new RoutedCommand(nameof(MoveLeftByWord));
161+
public static RoutedCommand SelectLeftByWord { get; } = new RoutedCommand(nameof(SelectLeftByWord));
162+
public static RoutedCommand MoveRightByWord { get; } = new RoutedCommand(nameof(MoveRightByWord));
163+
public static RoutedCommand SelectRightByWord { get; } = new RoutedCommand(nameof(SelectRightByWord));
164+
public static RoutedCommand MoveUpByLine { get; } = new RoutedCommand(nameof(MoveUpByLine));
165+
public static RoutedCommand SelectUpByLine { get; } = new RoutedCommand(nameof(SelectUpByLine));
166+
public static RoutedCommand MoveDownByLine { get; } = new RoutedCommand(nameof(MoveDownByLine));
167+
public static RoutedCommand SelectDownByLine { get; } = new RoutedCommand(nameof(SelectDownByLine));
168+
public static RoutedCommand MoveDownByPage { get; } = new RoutedCommand(nameof(MoveDownByPage));
169+
public static RoutedCommand SelectDownByPage { get; } = new RoutedCommand(nameof(SelectDownByPage));
170+
public static RoutedCommand MoveUpByPage { get; } = new RoutedCommand(nameof(MoveUpByPage));
171+
public static RoutedCommand SelectUpByPage { get; } = new RoutedCommand(nameof(SelectUpByPage));
172+
public static RoutedCommand MoveToLineStart { get; } = new RoutedCommand(nameof(MoveToLineStart));
173+
public static RoutedCommand SelectToLineStart { get; } = new RoutedCommand(nameof(SelectToLineStart));
174+
public static RoutedCommand MoveToLineEnd { get; } = new RoutedCommand(nameof(MoveToLineEnd));
175+
public static RoutedCommand SelectToLineEnd { get; } = new RoutedCommand(nameof(SelectToLineEnd));
176+
public static RoutedCommand MoveToDocumentStart { get; } = new RoutedCommand(nameof(MoveToDocumentStart));
177+
public static RoutedCommand SelectToDocumentStart { get; } = new RoutedCommand(nameof(SelectToDocumentStart));
178+
public static RoutedCommand MoveToDocumentEnd { get; } = new RoutedCommand(nameof(MoveToDocumentEnd));
179+
public static RoutedCommand SelectToDocumentEnd { get; } = new RoutedCommand(nameof(SelectToDocumentEnd));
180+
}
181+
}

0 commit comments

Comments
 (0)