add plugins that are referenced in SLN but haven't been committed yet

This commit is contained in:
Michael Becker 2020-08-13 22:21:19 -04:00
parent ad6d7dbbf0
commit 53e9f00269
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7
9 changed files with 539 additions and 0 deletions

View File

@ -0,0 +1,62 @@
//
// PresentationSlideControl.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using MBS.Framework.Drawing;
using MBS.Framework.UserInterface;
using MBS.Framework.UserInterface.Drawing;
using MBS.Framework.UserInterface.Input.Mouse;
using UniversalEditor.Plugins.Designer.UserInterface.Editors.Designer.Controls;
namespace UniversalEditor.Plugins.Office.UserInterface.Controls
{
public class PresentationSlideControl : DesignerControl
{
private int SlideOffsetX = 32, SlideOffsetY = 0;
private int SlideWidth = 640, SlideHeight = 480;
private double _ZoomFactor = 1.0;
public double ZoomFactor { get { return _ZoomFactor; } set { _ZoomFactor = value; Refresh(); } }
private int ShadowOffset = 4;
public PresentationSlideControl()
{
// TODO: add support for multiple designer areas with their own sets of components
// DesignerAreas.Clear();
// DesignerAreas.Add(new DesignerArea());
}
protected override void OnBeforePaint(PaintEventArgs e)
{
base.OnBeforePaint(e);
double zp = ((double)SlideHeight / SlideWidth);
int maxw = (int)(Size.Width - SlideOffsetX - SlideOffsetX);
int x = SlideOffsetX, w = (int)(ZoomFactor * maxw), h = (int)(ZoomFactor * (zp * maxw));
int y = (int)((Size.Height - h) / 2) + SlideOffsetY;
e.Graphics.FillRectangle(new SolidBrush(Colors.Black), new Rectangle(x + ShadowOffset, y + ShadowOffset, w, h));
e.Graphics.FillRectangle(new SolidBrush(Colors.White), new Rectangle(x, y, w, h));
}
}
}

View File

@ -0,0 +1,84 @@
//
// PresentationEditor.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using MBS.Framework.UserInterface;
using MBS.Framework.UserInterface.Layouts;
using UniversalEditor.Plugins.Office.ObjectModels.Presentation;
using UniversalEditor.Plugins.Office.UserInterface.Controls;
using UniversalEditor.UserInterface;
namespace UniversalEditor.Plugins.Office.UserInterface.Editors
{
public class PresentationEditor : Editor
{
private static EditorReference _er = null;
public override EditorReference MakeReference()
{
if (_er == null)
{
_er = base.MakeReference();
_er.SupportedObjectModels.Add(typeof(PresentationObjectModel));
}
return _er;
}
public override void UpdateSelections()
{
}
protected override EditorSelection CreateSelectionInternal(object content)
{
return null;
}
protected override void OnDocumentExplorerSelectionChanged(EditorDocumentExplorerSelectionChangedEventArgs e)
{
base.OnDocumentExplorerSelectionChanged(e);
}
protected override void OnObjectModelChanged(EventArgs e)
{
base.OnObjectModelChanged(e);
DocumentExplorer.Nodes.Clear();
PresentationObjectModel pres = (ObjectModel as PresentationObjectModel);
if (pres == null) return;
if (pres.Slides.Count == 0)
pres.Slides.Add(new Slide());
EditorDocumentExplorerNode nodeSlides = DocumentExplorer.Nodes.Add("Slides");
for (int i = 0; i < pres.Slides.Count; i++)
{
EditorDocumentExplorerNode nodeSlide = new EditorDocumentExplorerNode(String.Format("Slide {0}", (i + 1).ToString()));
nodeSlides.Nodes.Add(nodeSlide);
}
}
public PresentationEditor()
{
Layout = new BoxLayout(Orientation.Vertical);
Controls.Add(new PresentationSlideControl(), new BoxLayout.Constraints(true, true));
}
}
}

View File

@ -0,0 +1,46 @@
//
// AssemblyInfo.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("UniversalEditor.Plugins.Office.UserInterface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mike Becker's Software")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Mike Becker's Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{317CDFBC-9B41-4157-B2C0-D37E2BCEB42B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>UniversalEditor.Plugins.Office.UserInterface</RootNamespace>
<AssemblyName>UniversalEditor.Plugins.Office.UserInterface</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<ReleaseVersion>4.0.2019.12</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Output\Debug\Plugins</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>..\..\Output\Release\Plugins</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Editors\PresentationEditor.cs" />
<Compile Include="Controls\PresentationSlideControl.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Editors\" />
<Folder Include="Controls\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Libraries\UniversalEditor.UserInterface\UniversalEditor.UserInterface.csproj">
<Project>{8622EBC4-8E20-476E-B284-33D472081F5C}</Project>
<Name>UniversalEditor.UserInterface</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\UniversalEditor.Core\UniversalEditor.Core.csproj">
<Project>{2D4737E6-6D95-408A-90DB-8DFF38147E85}</Project>
<Name>UniversalEditor.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\UniversalEditor.Essential\UniversalEditor.Essential.csproj">
<Project>{30467E5C-05BC-4856-AADC-13906EF4CADD}</Project>
<Name>UniversalEditor.Essential</Name>
</ProjectReference>
<ProjectReference Include="..\..\Plugins\UniversalEditor.Plugins.Office\UniversalEditor.Plugins.Office.csproj">
<Project>{5D62192C-EB3E-4E73-A440-C53579B6EB47}</Project>
<Name>UniversalEditor.Plugins.Office</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\MBS.Framework\MBS.Framework\MBS.Framework.csproj">
<Project>{00266B21-35C9-4A7F-A6BA-D54D7FDCC25C}</Project>
<Name>MBS.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\MBS.Framework.UserInterface\Libraries\MBS.Framework.UserInterface\MBS.Framework.UserInterface.csproj">
<Project>{29E1C1BB-3EA5-4062-B62F-85EEC703FE07}</Project>
<Name>MBS.Framework.UserInterface</Name>
</ProjectReference>
<ProjectReference Include="..\..\Plugins\UniversalEditor.Plugins.Designer\UniversalEditor.Plugins.Designer.csproj">
<Project>{899E3DD6-EA65-4168-AAE3-867A4F9650A6}</Project>
<Name>UniversalEditor.Plugins.Designer</Name>
</ProjectReference>
<ProjectReference Include="..\UniversalEditor.Plugins.Designer.UserInterface\UniversalEditor.Plugins.Designer.UserInterface.csproj">
<Project>{08168BEA-E652-4493-8D89-5AB72B225841}</Project>
<Name>UniversalEditor.Plugins.Designer.UserInterface</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,93 @@
//
// FlashBaseDataFormat.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using MBS.Framework.Drawing;
using UniversalEditor.IO;
namespace UniversalEditor.Plugins.Adobe.Flash.Base
{
public class FlashBaseDataFormat : DataFormat
{
private static DataFormatReference _dfr = null;
protected override DataFormatReference MakeReferenceInternal()
{
if (_dfr == null)
{
_dfr = base.MakeReferenceInternal();
_dfr.Capabilities.Add(typeof(FlashBaseObjectModel), DataFormatCapabilities.All);
}
return _dfr;
}
public bool Compressed { get; set; } = false;
public byte FormatVersion { get; set; } = 5;
protected override void LoadInternal(ref ObjectModel objectModel)
{
FlashBaseObjectModel swf = (objectModel as FlashBaseObjectModel);
if (swf == null)
throw new ObjectModelNotSupportedException();
Reader reader = Accessor.Reader;
string signature = reader.ReadFixedLengthString(3);
if (signature == "CWS")
{
Compressed = true;
}
else if (signature == "FWS")
{
Compressed = false;
}
else
{
throw new InvalidDataFormatException("file does not begin with 'CWS' (compressed) or 'FWS' (uncompressed)");
}
FormatVersion = reader.ReadByte();
uint totalFileLength = reader.ReadUInt32();
Rectangle frameSize = ReadRECT(reader);
ushort frameRate = reader.ReadUInt16(); // 8.8
ushort frameCount = reader.ReadUInt16();
}
private Rectangle ReadRECT(Reader reader)
{
// Bit values are stored by using the minimum number of bits possible for the range needed.
// Most bit value fields use a fixed number of bits.Some use a variable number of bits, but in all
// such cases, the number of bits to be used is explicitly stated in another field in the same
// structure.In these variable - length cases, applications that generate SWF files must determine
// the minimum number of bits necessary to represent the actual values that will be specified.
// For signed-bit values, if the number to be encoded is positive, an extra bit is necessary to
// preserve the leading 0; otherwise sign extension changes the bit value into a negative number.
int nbits_ = reader.ReadBitsAsInt32(5);
int xmin = 0, ymin = 0, xmax = 0, ymax = 0;
return new Rectangle(xmin, ymin, xmax - xmin, ymax - ymin);
}
protected override void SaveInternal(ObjectModel objectModel)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,38 @@
//
// FlashBaseObjectModel.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
namespace UniversalEditor.Plugins.Adobe.Flash.Base
{
public class FlashBaseObjectModel : ObjectModel
{
public override void Clear()
{
throw new NotImplementedException();
}
public override void CopyTo(ObjectModel where)
{
throw new NotImplementedException();
}
public FlashBaseTag.FlashBaseTagCollection Tags { get; } = new FlashBaseTag.FlashBaseTagCollection();
}
}

View File

@ -0,0 +1,35 @@
//
// FlashBaseTag.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace UniversalEditor.Plugins.Adobe.Flash.Base
{
public class FlashBaseTag
{
public class FlashBaseTagCollection
: System.Collections.ObjectModel.Collection<FlashBaseTag>
{
}
public byte TagType { get; set; } = 0;
public byte[] Data { get; set; } = new byte[0];
}
}

View File

@ -0,0 +1,46 @@
//
// AssemblyInfo.cs
//
// Author:
// Michael Becker <alcexhim@gmail.com>
//
// Copyright (c) 2020 Mike Becker's Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("UniversalEditor.Plugins.Adobe")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mike Becker's Software")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Mike Becker's Software")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FD46EA8D-7711-4BAF-A486-719D754504F8}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>UniversalEditor.Plugins.Adobe</RootNamespace>
<AssemblyName>UniversalEditor.Plugins.Adobe</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<ReleaseVersion>4.0.2019.12</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Output\Debug\Plugins</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>..\..\Output\Release\Plugins</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Flash\Base\FlashBaseObjectModel.cs" />
<Compile Include="Flash\Base\FlashBaseDataFormat.cs" />
<Compile Include="Flash\Base\FlashBaseTag.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Flash\" />
<Folder Include="Flash\Base\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Libraries\UniversalEditor.Core\UniversalEditor.Core.csproj">
<Project>{2D4737E6-6D95-408A-90DB-8DFF38147E85}</Project>
<Name>UniversalEditor.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\UniversalEditor.Essential\UniversalEditor.Essential.csproj">
<Project>{30467E5C-05BC-4856-AADC-13906EF4CADD}</Project>
<Name>UniversalEditor.Essential</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\MBS.Framework\MBS.Framework\MBS.Framework.csproj">
<Project>{00266B21-35C9-4A7F-A6BA-D54D7FDCC25C}</Project>
<Name>MBS.Framework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>