From 08bcb77eb1dfd49c90b17614e22ae4f79c8200ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E5=90=AF=E5=B7=A5=E4=BD=9C=E5=AE=A4?= Date: Sun, 28 Jun 2026 11:38:34 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20manifest.coin=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=87=B3=201.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Better-EN5/Services/Conversion/SmfTypes.cs | 305 +++++++++++++++++++++ Better-EN5/manifest.coin | 2 +- 2 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 Better-EN5/Services/Conversion/SmfTypes.cs diff --git a/Better-EN5/Services/Conversion/SmfTypes.cs b/Better-EN5/Services/Conversion/SmfTypes.cs new file mode 100644 index 0000000..314501a --- /dev/null +++ b/Better-EN5/Services/Conversion/SmfTypes.cs @@ -0,0 +1,305 @@ +using System; +using System.Collections.Generic; +using System.Xml.Linq; + +namespace BetterEN5.Services.Conversion +{ + public enum SmfShapeType + { + Rectangle, Ellipse, Triangle, Diamond, Parallelogram, + Trapezoid, Pentagon, Hexagon, Octagon, Star, + ArrowLeft, ArrowRight, ArrowUp, ArrowDown, + Line, LineArrow, LineDoubleArrow, + RoundedRectangle, Cloud, Heart, Cross, + RightTriangle, RegularPentagon, Chevron, Pie, + BlockArc, NoShape + } + + public enum SmfStrokeDashStyle + { + Solid, Dash, Dot, DashDot, DashDotDot, LongDash, LongDashDot + } + + public enum SmfVerticalAlignment + { + Top, Middle, Bottom + } + + public enum SmfHorizontalAlignment + { + Left, Center, Right, Justify + } + + public enum SmfTextDirection + { + Horizontal, Vertical, Rotated270, Rotated90 + } + + public enum SmfFillType + { + None, Solid, Gradient, Pattern, SlideBackground + } + + public enum SmfGradientType + { + Linear, Radial, Rectangular, Path + } + + public enum SmfTableBorderStyle + { + None, Solid, Dashed, Dotted + } + + public class SmfBounds + { + public double X { get; set; } + public double Y { get; set; } + public double Width { get; set; } + public double Height { get; set; } + } + + public class SmfColor + { + public string Value { get; set; } = "000000"; + public double Alpha { get; set; } = 100; + } + + public class SmfFill + { + public SmfFillType Type { get; set; } = SmfFillType.None; + public SmfColor? SolidColor { get; set; } + public SmfGradientFill? Gradient { get; set; } + public string? ImageRef { get; set; } + } + + public class SmfGradientFill + { + public SmfGradientType Type { get; set; } = SmfGradientType.Linear; + public double Angle { get; set; } + public List Stops { get; set; } = new(); + } + + public class SmfGradientStop + { + public double Position { get; set; } + public SmfColor Color { get; set; } = new(); + } + + public class SmfStroke + { + public SmfColor? Color { get; set; } + public double Width { get; set; } = 1; + public SmfStrokeDashStyle DashStyle { get; set; } = SmfStrokeDashStyle.Solid; + } + + public class SmfFormatting + { + public double? Size { get; set; } + public bool? Bold { get; set; } + public bool? Italic { get; set; } + public bool? Underline { get; set; } + public bool? Strikethrough { get; set; } + public SmfColor? Color { get; set; } + public string? Font { get; set; } + public string? LinkTarget { get; set; } + } + + public class SmfRun + { + public string Text { get; set; } = string.Empty; + public SmfFormatting? Formatting { get; set; } + } + + public class SmfParagraph + { + public List Runs { get; set; } = new(); + public SmfHorizontalAlignment? Alignment { get; set; } + public double? SpaceBefore { get; set; } + public double? SpaceAfter { get; set; } + public double? LineSpacing { get; set; } + } + + public class SmfRichText + { + public List Paragraphs { get; set; } = new(); + public double LeftMargin { get; set; } = 91440; + public double RightMargin { get; set; } = 91440; + public double TopMargin { get; set; } = 91440; + public double BottomMargin { get; set; } = 91440; + public SmfVerticalAlignment VerticalAlignment { get; set; } = SmfVerticalAlignment.Top; + public SmfTextDirection TextDirection { get; set; } = SmfTextDirection.Horizontal; + public bool WordWrap { get; set; } = true; + public bool AutoFit { get; set; } + } + + public abstract class SmfElement + { + public string Id { get; set; } = string.Empty; + public SmfBounds Bounds { get; set; } = new(); + public double Rotation { get; set; } + public bool Locked { get; set; } + public string? Name { get; set; } + public bool Hidden { get; set; } + } + + public class SmfTextElement : SmfElement + { + public SmfRichText RichText { get; set; } = new(); + public SmfFill? BackgroundFill { get; set; } + public SmfStroke? Outline { get; set; } + } + + public class SmfImageElement : SmfElement + { + public string Source { get; set; } = string.Empty; + public string ContentType { get; set; } = "image/png"; + public byte[]? Data { get; set; } + public SmfCropInfo? Crop { get; set; } + public string? Hyperlink { get; set; } + public double? Brightness { get; set; } + public double? Contrast { get; set; } + } + + public class SmfCropInfo + { + public double Left { get; set; } + public double Right { get; set; } + public double Top { get; set; } + public double Bottom { get; set; } + } + + public class SmfShapeElement : SmfElement + { + public SmfShapeType ShapeType { get; set; } = SmfShapeType.Rectangle; + public SmfFill Fill { get; set; } = new(); + public SmfStroke? Stroke { get; set; } + public SmfRichText? TextContent { get; set; } + public bool FlipHorizontal { get; set; } + public bool FlipVertical { get; set; } + } + + public class SmfTableElement : SmfElement + { + public List ColumnWidths { get; set; } = new(); + public List Rows { get; set; } = new(); + public SmfTableStyle TableStyle { get; set; } = new(); + } + + public class SmfTableRow + { + public double Height { get; set; } + public List Cells { get; set; } = new(); + } + + public class SmfTableCell + { + public SmfRichText? Content { get; set; } + public SmfFill? Background { get; set; } + public SmfTableBorder TopBorder { get; set; } = new(); + public SmfTableBorder BottomBorder { get; set; } = new(); + public SmfTableBorder LeftBorder { get; set; } = new(); + public SmfTableBorder RightBorder { get; set; } = new(); + public int RowSpan { get; set; } = 1; + public int ColSpan { get; set; } = 1; + public bool MergeHorizontal { get; set; } + public bool MergeVertical { get; set; } + public double LeftMargin { get; set; } = 45720; + public double RightMargin { get; set; } = 45720; + public double TopMargin { get; set; } = 0; + public double BottomMargin { get; set; } = 0; + public SmfVerticalAlignment VerticalAlign { get; set; } = SmfVerticalAlignment.Top; + } + + public class SmfTableBorder + { + public SmfTableBorderStyle Style { get; set; } = SmfTableBorderStyle.None; + public string Color { get; set; } = "000000"; + public double Width { get; set; } = 6350; + } + + public class SmfTableStyle + { + public bool BandRows { get; set; } + public bool BandColumns { get; set; } + public SmfColor? FirstRowColor { get; set; } + public SmfColor? LastRowColor { get; set; } + public SmfColor? FirstColumnColor { get; set; } + public SmfColor? LastColumnColor { get; set; } + } + + public class SmfInkPoint + { + public double X { get; set; } + public double Y { get; set; } + public double Pressure { get; set; } = 0.5; + } + + public class SmfInkStroke + { + public List Points { get; set; } = new(); + public SmfColor Color { get; set; } = new() { Value = "000000" }; + public double Width { get; set; } = 2; + public bool IsHighlighter { get; set; } + public double Transparency { get; set; } + public string? PenType { get; set; } + } + + public class SmfInkElement : SmfElement + { + public List Strokes { get; set; } = new(); + } + + public class SmfGroupElement : SmfElement + { + public List ChildIds { get; set; } = new(); + } + + public class SmfMediaElement : SmfElement + { + public string Source { get; set; } = string.Empty; + public string ContentType { get; set; } = "video/mp4"; + public byte[]? Data { get; set; } + public bool AutoPlay { get; set; } + public bool Loop { get; set; } + public double? StartTime { get; set; } + public double? EndTime { get; set; } + public string? PosterImageRef { get; set; } + } + + public class SmfBackground + { + public SmfFillType Type { get; set; } = SmfFillType.Solid; + public SmfColor? SolidColor { get; set; } + public SmfGradientFill? Gradient { get; set; } + public string? ImageRef { get; set; } + } + + public class SmfSlide + { + public string Id { get; set; } = string.Empty; + public SmfBackground Background { get; set; } = new(); + public List Elements { get; set; } = new(); + public string? Notes { get; set; } + public string? LayoutName { get; set; } + public double? TransitionDuration { get; set; } + public string? TransitionType { get; set; } + } + + public class SmfProperties + { + public string Title { get; set; } = string.Empty; + public string? Author { get; set; } + public DateTime? Created { get; set; } + public string? Application { get; set; } + public double SlideWidth { get; set; } = 12192000; + public double SlideHeight { get; set; } = 6858000; + } + + public class SmfDocument + { + public SmfProperties Properties { get; set; } = new(); + public List Slides { get; set; } = new(); + public Dictionary MediaFiles { get; set; } = new(); + public Dictionary MediaContentTypes { get; set; } = new(); + } +} diff --git a/Better-EN5/manifest.coin b/Better-EN5/manifest.coin index 5f14b4a..5a5f900 100644 --- a/Better-EN5/manifest.coin +++ b/Better-EN5/manifest.coin @@ -24,5 +24,5 @@ Preinstalled False > Version -1.1.2 +1.2.0 >