EverythingToJpeg(N→JPEG 단방향)에서 Everything2Everything(N×M 매트릭스)으로 앱을 피보팅. 7개 Provider, 200+ 변환 쌍 지원. 리네이밍 - 디렉토리/솔루션/csproj/namespace/AssemblyName/MSIX Identity 일괄 치환 - 임시파일 prefix e2j_ → e2e_, 로고 라벨 E2J → E2E 아키텍처 - ConversionPair(input, output) 신규 + ProviderCapability.SupportedConversions - IConverterProvider.ConvertAsync에 outputExtension 파라미터 추가 - ProviderRegistry를 Dictionary<(input, output), Provider> 매트릭스로 재작성 + OutputsForInput / OutputsForFile 쿼리 API - ConversionEngine: 출력 ext 라우팅, 동일 입출력 자동 skip, 서브폴더 suffix를 출력 ext에서 자동 도출 - ConvertOptions를 형식별 sub-record로 분리 (Jpeg/Png/Webp/Avif/Tiff/Pdf*/Html*/Ocr) Provider 매트릭스 - MagickProvider: PNG/JPEG/WebP/AVIF/BMP/TIFF/GIF/PDF 양방향 + RAW/PSD 디코딩 (단일이미지→1페이지 PDF, GIF/TIFF→다페이지 PDF) - HeicProvider: HEIC/HEIF → 이미지 7종 - PdfProvider: PDF → 이미지 6종 (PNG임베드 후 ImageMagick 인코딩) - HtmlProvider: HTML/HTM → 이미지 + PDF (CDP printToPDF) - DocxProvider/HwpxProvider: PDF + 이미지 7종 (LibreOffice 활용) - OcrProvider 신규: 이미지/PDF → TXT/DOCX (Windows.Media.Ocr + DocumentFormat.OpenXml, PDF는 페이지별 OCR 후 결합) UI - 사이드바 TARGET FORMAT을 동적 ComboBox로 (큐 파일 매트릭스의 교집합만 표시) - 출력 형식별 색상 배지 + Quality 패널 라벨 동적 - OUTPUT DESTINATION hint도 출력 ext 기반 동적 CLI - 신규 'to <ext> <files...>' verb (예: to png photo.heic doc.docx) - help 텍스트 양방향 컨셉으로 갱신 셸 통합 - ContextMenuRegistrar 카스케이드로 재설계 (ExtendedSubCommandsKey + Everything2Everything.SubMenu.<ext>) - 입력별 매트릭스에 따라 인기 출력 10종(JPEG/PNG/WebP/PDF/TXT/DOCX/AVIF/GIF/TIFF/BMP) 동적 노출, 마지막에 '변환…' 옵션 - 메뉴 라벨 'JPEG로 변환' → 'Everything2Everything으로 변환' 기타 - Core.csproj TFM net9.0-windows → net9.0-windows10.0.19041.0 (WinRT API용) - DocumentFormat.OpenXml 3.1.0 NuGet 추가 - README 양방향 매트릭스 기준 전면 개편 - MSIX appxmanifest Description / IExplorerCommand DLL 라벨 갱신 빌드: 0 errors, 0 warnings
118 lines
4.7 KiB
C#
118 lines
4.7 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
using Everything2Everything.Core;
|
|
using Everything2Everything.Core.Providers;
|
|
using Wpf.Ui.Controls;
|
|
|
|
namespace Everything2Everything.App.Views;
|
|
|
|
public partial class DiagnoseWindow : FluentWindow
|
|
{
|
|
private readonly ConversionEngine _engine;
|
|
|
|
public DiagnoseWindow(ConversionEngine engine)
|
|
{
|
|
_engine = engine;
|
|
InitializeComponent();
|
|
Loaded += async (_, _) => await PopulateAsync();
|
|
}
|
|
|
|
private async Task PopulateAsync()
|
|
{
|
|
ItemsPanel.Children.Clear();
|
|
|
|
ItemsPanel.Children.Add(BuildSection("환경", new[]
|
|
{
|
|
("OS", Environment.OSVersion.VersionString),
|
|
(".NET", Environment.Version.ToString()),
|
|
("실행 경로", Environment.ProcessPath ?? AppContext.BaseDirectory),
|
|
}));
|
|
|
|
foreach (var provider in _engine.Providers.All)
|
|
{
|
|
var availability = await provider.CheckAvailabilityAsync();
|
|
ItemsPanel.Children.Add(BuildProviderCard(provider, availability));
|
|
}
|
|
}
|
|
|
|
private static UIElement BuildSection(string title, IEnumerable<(string Key, string Value)> items)
|
|
{
|
|
var card = new CardControl { Padding = new Thickness(16, 12, 16, 12), Margin = new Thickness(0, 0, 0, 12) };
|
|
var stack = new StackPanel();
|
|
stack.Children.Add(new TextBlock
|
|
{
|
|
Text = title,
|
|
FontSize = 14,
|
|
FontWeight = FontWeights.SemiBold,
|
|
Margin = new Thickness(0, 0, 0, 8),
|
|
});
|
|
foreach (var (k, v) in items)
|
|
{
|
|
var row = new Grid { Margin = new Thickness(0, 2, 0, 2) };
|
|
row.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(120) });
|
|
row.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
|
|
var keyText = new TextBlock { Text = k, FontSize = 12, Foreground = (Brush)Application.Current.FindResource("TextFillColorSecondaryBrush") };
|
|
var valueText = new TextBlock { Text = v, FontSize = 12, TextTrimming = TextTrimming.CharacterEllipsis };
|
|
Grid.SetColumn(valueText, 1);
|
|
row.Children.Add(keyText);
|
|
row.Children.Add(valueText);
|
|
stack.Children.Add(row);
|
|
}
|
|
card.Content = stack;
|
|
return card;
|
|
}
|
|
|
|
private UIElement BuildProviderCard(IConverterProvider provider, ProviderAvailability availability)
|
|
{
|
|
var card = new CardControl { Padding = new Thickness(16, 12, 16, 12), Margin = new Thickness(0, 0, 0, 12) };
|
|
var stack = new StackPanel();
|
|
var header = new StackPanel { Orientation = Orientation.Horizontal };
|
|
header.Children.Add(new TextBlock
|
|
{
|
|
Text = provider.Capability.DisplayName,
|
|
FontSize = 14,
|
|
FontWeight = FontWeights.SemiBold,
|
|
});
|
|
var (badgeText, brushKey) = (provider.Capability.Status, availability.IsReady) switch
|
|
{
|
|
(ProviderStatus.ComingSoon, _) => ("개발 중", "BadgeMutedBrush"),
|
|
(ProviderStatus.Disabled, _) => ("비활성", "BadgeMutedBrush"),
|
|
(_, true) => ("준비됨", "BadgeReadyBrush"),
|
|
_ => ("점검 필요", "BadgeWarnBrush"),
|
|
};
|
|
header.Children.Add(new Border
|
|
{
|
|
Background = (Brush)Application.Current.FindResource(brushKey),
|
|
CornerRadius = new CornerRadius(10),
|
|
Padding = new Thickness(8, 2, 8, 2),
|
|
Margin = new Thickness(8, 0, 0, 0),
|
|
Child = new TextBlock { Text = badgeText, FontSize = 11, Foreground = Brushes.White },
|
|
});
|
|
stack.Children.Add(header);
|
|
|
|
stack.Children.Add(new TextBlock
|
|
{
|
|
Text = $"입력: {string.Join(", ", provider.Capability.InputExtensions)} → 출력: {string.Join(", ", provider.Capability.OutputExtensions)}",
|
|
FontSize = 11,
|
|
Foreground = (Brush)Application.Current.FindResource("TextFillColorTertiaryBrush"),
|
|
Margin = new Thickness(0, 4, 0, 0),
|
|
});
|
|
if (!availability.IsReady && !string.IsNullOrEmpty(availability.Reason))
|
|
{
|
|
stack.Children.Add(new TextBlock
|
|
{
|
|
Text = availability.Reason,
|
|
FontSize = 11,
|
|
Foreground = (Brush)Application.Current.FindResource("BadgeWarnBrush"),
|
|
TextWrapping = TextWrapping.Wrap,
|
|
Margin = new Thickness(0, 4, 0, 0),
|
|
});
|
|
}
|
|
card.Content = stack;
|
|
return card;
|
|
}
|
|
|
|
private async void OnRefreshClick(object sender, RoutedEventArgs e) => await PopulateAsync();
|
|
private void OnCloseClick(object sender, RoutedEventArgs e) => Close();
|
|
}
|