DragAndDrop core

This commit is contained in:
FrigaT
2026-01-18 16:33:35 +03:00
parent 9ea82af329
commit 79bdd8bc62
229 changed files with 21214 additions and 2494 deletions

19
Lattice.IDE/App.xaml Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Application
x:Class="Lattice.IDE.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lt="using:Lattice.Themes"
xmlns:local="using:Lattice.IDE">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="ms-appx:///Lattice.UI.Docking.WinUI/Themes/Generic.xaml" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
</Application>

37
Lattice.IDE/App.xaml.cs Normal file
View File

@@ -0,0 +1,37 @@
using Lattice.Themes;
using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Lattice.IDE
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
private Window? _window;
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
}
/// <summary>
/// Invoked when the application is launched.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
ThemeManager.Current.ApplyTheme(new FluentThemePack());
_window = new MainWindow();
_window.Activate();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="Lattice.IDE.Controls.EditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Lattice.IDE.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource Lattice.Brush.Background.Secondary}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- Полоса номеров строк -->
<ColumnDefinition Width="*"/>
<!-- Текст кода -->
</Grid.ColumnDefinitions>
<!-- Левая панель с номерами строк -->
<StackPanel Grid.Column="0" Background="{ThemeResource Lattice.Brush.Background.Primary}" Padding="10,5">
<TextBlock Text="1" Foreground="Gray" FontFamily="Cascadia Code, Consolas"/>
<TextBlock Text="2" Foreground="Gray" FontFamily="Cascadia Code, Consolas"/>
<TextBlock Text="3" Foreground="Gray" FontFamily="Cascadia Code, Consolas"/>
<TextBlock Text="4" Foreground="Gray" FontFamily="Cascadia Code, Consolas"/>
<TextBlock Text="5" Foreground="Gray" FontFamily="Cascadia Code, Consolas"/>
<TextBlock Text="6" Foreground="Gray" FontFamily="Cascadia Code, Consolas"/>
</StackPanel>
<!-- Основная область редактирования -->
<TextBox Grid.Column="1"
AcceptsReturn="True"
IsSpellCheckEnabled="False"
TextWrapping="NoWrap"
FontFamily="Cascadia Code, Consolas"
FontSize="14"
BorderThickness="0"
Padding="10"
Background="Transparent"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
xml:space="preserve">
<TextBox.Text>using System;
using Lattice.Core;
namespace Lattice.IDE.Demo;
public class Program
{
public void Main()
{
Console.WriteLine("Hello, Lattice 2026!");
}
}
</TextBox.Text>
</TextBox>
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Lattice.IDE.Controls
{
public sealed partial class EditorView : UserControl
{
public EditorView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="Lattice.IDE.Controls.SolutionExplorerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Lattice.IDE.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource LayerFillColorDefaultBrush}" Padding="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="SOLUTION 'LATTICE' (2026)"
FontSize="11"
FontWeight="Bold"
Opacity="0.6"/>
<TreeView Grid.Row="1" Margin="0,10,0,0">
<TreeView.RootNodes>
<TreeViewNode Content="Lattice.Core.Docking" IsExpanded="True">
<TreeViewNode.Children>
<TreeViewNode Content="Models" />
<TreeViewNode Content="Engine" />
</TreeViewNode.Children>
</TreeViewNode>
<TreeViewNode Content="Lattice.UI.Docking.WinUI" IsExpanded="True">
<TreeViewNode.Children>
<TreeViewNode Content="Controls" />
<TreeViewNode Content="Themes" />
</TreeViewNode.Children>
</TreeViewNode>
</TreeView.RootNodes>
</TreeView>
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Lattice.IDE.Controls
{
public sealed partial class SolutionExplorerView : UserControl
{
public SolutionExplorerView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,81 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net8.0-windows10.0.19041.0;net9.0-windows10.0.19041.0;net10.0-windows10.0.19041.0</TargetFrameworks>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>Lattice.IDE</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<WinUISDKReferences>false</WinUISDKReferences>
<EnableMsixTooling>true</EnableMsixTooling>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="Controls\EditorView.xaml" />
<None Remove="Controls\SolutionExplorerView.xaml" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
<!--
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored.
-->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7463" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.251106002" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lattice.Core.Docking\Lattice.Core.Docking.csproj" />
<ProjectReference Include="..\Lattice.Themes.Core\Lattice.Themes.Core.csproj" />
<ProjectReference Include="..\Lattice.Themes.Fluent\Lattice.Themes.Fluent.csproj" />
<ProjectReference Include="..\Lattice.Themes.VS2026\Lattice.Themes.VS2026.csproj" />
<ProjectReference Include="..\Lattice.UI.Docking.WinUI\Lattice.UI.Docking.WinUI.csproj" />
</ItemGroup>
<ItemGroup>
<Page Update="Controls\EditorView.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Controls\SolutionExplorerView.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<!--
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
Explorer "Package and Publish" context menu entry to be enabled for this project even if
the Windows App SDK Nuget package has not yet been restored.
-->
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
<!-- Publish Properties -->
<PropertyGroup>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,28 @@
using Lattice.Core.Docking.Abstractions;
namespace Lattice.IDE;
/// <summary>
/// Реализация контента для демонстрации, принимающая любой UI-объект.
/// </summary>
public class DemoContent : IDockContent
{
public string Id { get; }
public string Title { get; set; }
/// <summary>
/// Сюда мы передаем наш UserControl (SolutionExplorerView и т.д.)
/// </summary>
public object View { get; set; }
public bool CanClose { get; set; } = true;
public DemoContent(string id, string title, object view)
{
Id = id;
Title = title;
View = view;
}
public bool OnClosing() => true;
}

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="Lattice.IDE.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Lattice.IDE"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lattice="using:Lattice.UI"
mc:Ignorable="d"
Title="Lattice.IDE">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Меню управления Demo -->
<StackPanel Orientation="Horizontal" Spacing="10" Padding="10" Background="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}">
<Button Content="Fluent UI Theme" Click="SetFluentTheme"/>
<Button Content="VS 2026 Theme" Click="SetVSTheme"/>
<TextBlock Text="Lattice IDE Demo 2026" VerticalAlignment="Center" Margin="20,0" FontWeight="Bold"/>
</StackPanel>
<!-- Lattice Docking Host -->
<lattice:LatticeDockHost x:Name="DockHost" Grid.Row="1" />
</Grid>
</Window>

View File

@@ -0,0 +1,64 @@
using Lattice.Core.Docking.Engine;
using Lattice.Core.Docking.Models;
using Lattice.IDE.Controls;
using Lattice.Themes;
using Microsoft.UI.Xaml;
// Ïðåäïîëîæèì, ÷òî VS2026Theme òîæå ðåàëèçîâàí àíàëîãè÷íî Fluent
// using Lattice.Themes.VisualStudio2026;
namespace Lattice.IDE;
public sealed partial class MainWindow : Window
{
private LayoutManager _manager;
public MainWindow()
{
this.InitializeComponent();
WindowTracker.Register(this);
SystemBackdrop = new Microsoft.UI.Xaml.Media.MicaBackdrop();
InitLattice();
}
private void InitLattice()
{
_manager = new LayoutManager();
// Ñîçäàåì êîíòåíò íà îñíîâå XAML UserControls
var solutionExplorer = new DemoContent(
"sln",
"Solution Explorer",
new SolutionExplorerView()
);
var editor = new DemoContent(
"code_01",
"Program.cs",
new EditorView()
);
// Ñîáèðàåì äåðåâî (êàê ðàíüøå)
var leftLeaf = new DockLeaf();
leftLeaf.AddContent(solutionExplorer);
var centerLeaf = new DockLeaf()
{
TabPlacement = TabPlacement.Top,
};
centerLeaf.AddContent(editor);
var rootGroup = new DockGroup(leftLeaf, centerLeaf, SplitDirection.Horizontal)
{
SplitRatio = 0.25
};
_manager.SetRoot(rootGroup);
DockHost.Manager = _manager;
}
private void SetFluentTheme(object sender, RoutedEventArgs e) =>
ThemeManager.Current.ApplyTheme(new FluentThemePack());
private void SetVSTheme(object sender, RoutedEventArgs e) =>
ThemeManager.Current.ApplyTheme(new VS2026ThemePack());
}

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity
Name="c6596033-98b6-4778-8280-bc9256b9be07"
Publisher="CN=frost"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="c6596033-98b6-4778-8280-bc9256b9be07" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>Lattice.IDE</DisplayName>
<PublisherDisplayName>frost</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="Lattice.IDE"
Description="Lattice.IDE"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

View File

@@ -0,0 +1,10 @@
{
"profiles": {
"Lattice.IDE (Package)": {
"commandName": "MsixPackage"
},
"Lattice.IDE (Unpackaged)": {
"commandName": "Project"
}
}
}

19
Lattice.IDE/app.manifest Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="Lattice.IDE.app"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- The ID below informs the system that this application is compatible with OS features first introduced in Windows 10.
It is necessary to support features in unpackaged applications, for example the custom titlebar implementation.
For more info see https://docs.microsoft.com/windows/apps/windows-app-sdk/use-windows-app-sdk-run-time#declare-os-compatibility-in-your-application-manifest -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
</assembly>