Merge pull request #3695 from jlewin/master
Remove Winforms dependencies from MatterControl assembly
This commit is contained in:
commit
4689552b28
20 changed files with 287 additions and 141 deletions
|
|
@ -1250,12 +1250,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
this.RebuildSceneOperations(this.Theme);
|
||||
|
||||
#if DEBUG && !__ANDROID__
|
||||
if (AggContext.StaticData is FileSystemStaticData staticData)
|
||||
{
|
||||
staticData.PurgeCache();
|
||||
}
|
||||
#endif
|
||||
AggContext.StaticData.PurgeCache();
|
||||
}
|
||||
|
||||
public bool RunAnyRequiredPrinterSetup(PrinterConfig printer, ThemeConfig theme)
|
||||
|
|
@ -2497,20 +2492,6 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public enum ReportSeverity2 { Warning, Error }
|
||||
|
||||
public interface INativePlatformFeatures
|
||||
{
|
||||
event EventHandler PictureTaken;
|
||||
void TakePhoto(string imageFileName);
|
||||
void OpenCameraPreview();
|
||||
void PlaySound(string fileName);
|
||||
void ConfigureWifi();
|
||||
bool CameraInUseByExternalProcess { get; set; }
|
||||
bool IsNetworkConnected();
|
||||
void FindAndInstantiatePlugins(SystemWindow systemWindow);
|
||||
void ProcessCommandline();
|
||||
void PlatformInit(Action<string> reporter);
|
||||
}
|
||||
|
||||
public static class Application
|
||||
{
|
||||
private static ProgressBar progressBar;
|
||||
|
|
|
|||
|
|
@ -158,7 +158,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
|
||||
if (languageCode == "L10N")
|
||||
{
|
||||
GenerateLocalizationValidationFile();
|
||||
#if DEBUG
|
||||
AppContext.Platform.GenerateLocalizationValidationFile();
|
||||
#endif
|
||||
}
|
||||
|
||||
ApplicationController.Instance.ResetTranslationMap();
|
||||
|
|
@ -424,50 +426,5 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
|
||||
return container;
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private void GenerateLocalizationValidationFile()
|
||||
{
|
||||
#if !__ANDROID__
|
||||
if (AggContext.StaticData is FileSystemStaticData fileSystemStaticData)
|
||||
{
|
||||
char currentChar = 'A';
|
||||
|
||||
// Note: Functionality only expected to work on Desktop/Debug builds and as such, is coupled to FileSystemStaticData
|
||||
string outputPath = fileSystemStaticData.MapPath(Path.Combine("Translations", "L10N", "Translation.txt"));
|
||||
string sourceFilePath = fileSystemStaticData.MapPath(Path.Combine("Translations", "Master.txt"));
|
||||
|
||||
// Ensure the output directory exists
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
using (var outstream = new StreamWriter(outputPath))
|
||||
{
|
||||
foreach (var line in File.ReadAllLines(sourceFilePath))
|
||||
{
|
||||
if (line.StartsWith("Translated:"))
|
||||
{
|
||||
var pos = line.IndexOf(':');
|
||||
var segments = new string[]
|
||||
{
|
||||
line.Substring(0, pos),
|
||||
line.Substring(pos + 1),
|
||||
};
|
||||
|
||||
outstream.WriteLine("{0}:{1}", segments[0], new string(segments[1].ToCharArray().Select(c => c == ' ' ? ' ' : currentChar).ToArray()));
|
||||
|
||||
if (currentChar++ == 'Z')
|
||||
{
|
||||
currentChar = 'A';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outstream.WriteLine(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
95
MatterControl.Winforms/MatterControl.Winforms.csproj
Normal file
95
MatterControl.Winforms/MatterControl.Winforms.csproj
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MatterControl.Winforms</RootNamespace>
|
||||
<AssemblyName>MatterControl.Winforms</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="InspectForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="InspectForm.Designer.cs">
|
||||
<DependentUpon>InspectForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WindowsPlatformsFeatures.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MatterControl.csproj">
|
||||
<Project>{0b8d6f56-bd7f-4426-b858-d9292b084656}</Project>
|
||||
<Name>MatterControl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\PluginSystem\MatterControlPluginSystem.csproj">
|
||||
<Project>{865172a0-a1a9-49c2-9386-f2fdb4e141b7}</Project>
|
||||
<Name>MatterControlPluginSystem</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Submodules\agg-sharp\agg\Agg.csproj">
|
||||
<Project>{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}</Project>
|
||||
<Name>Agg</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Submodules\agg-sharp\DataConverters3D\DataConverters3D.csproj">
|
||||
<Project>{04667764-dc7b-4b95-aef6-b4e6c87a54e9}</Project>
|
||||
<Name>DataConverters3D</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Submodules\agg-sharp\Gui\Gui.csproj">
|
||||
<Project>{74f6bb6c-9d02-4512-a59a-21940e35c532}</Project>
|
||||
<Name>Gui</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Submodules\agg-sharp\PlatformWin32\PlatformWin32.csproj">
|
||||
<Project>{670bddff-927b-425d-9dd1-22acb14356eb}</Project>
|
||||
<Name>PlatformWin32</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Submodules\agg-sharp\RenderOpenGl\RenderOpenGl.csproj">
|
||||
<Project>{545b6912-77ff-4b34-ba76-6c3d6a32be6a}</Project>
|
||||
<Name>RenderOpenGl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Submodules\agg-sharp\VectorMath\VectorMath.csproj">
|
||||
<Project>{d3e41b4e-bfbb-44ca-94c8-95c00f754fdd}</Project>
|
||||
<Name>VectorMath</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="InspectForm.resx">
|
||||
<DependentUpon>InspectForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
MatterControl.Winforms/Properties/AssemblyInfo.cs
Normal file
36
MatterControl.Winforms/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MatterControl.Winforms")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MatterControl.Winforms")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("d6dc2669-7b1f-40fe-89bf-45d4c94473e3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -28,18 +28,16 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.PluginSystem;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
using Agg.Image;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.MatterControl.PluginSystem;
|
||||
using MatterHackers.RenderOpenGl.OpenGl;
|
||||
|
||||
public class WindowsPlatformsFeatures : INativePlatformFeatures
|
||||
{
|
||||
public bool CameraInUseByExternalProcess { get; set; } = false;
|
||||
|
|
@ -93,23 +91,9 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public void FindAndInstantiatePlugins(SystemWindow systemWindow)
|
||||
{
|
||||
string oemName = ApplicationSettings.Instance.GetOEMName();
|
||||
foreach (MatterControlPlugin plugin in PluginFinder.CreateInstancesOf<MatterControlPlugin>())
|
||||
{
|
||||
string pluginInfo = plugin.GetPluginInfoJSon();
|
||||
Dictionary<string, string> nameValuePairs = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(pluginInfo);
|
||||
|
||||
if (nameValuePairs != null && nameValuePairs.ContainsKey("OEM"))
|
||||
{
|
||||
if (nameValuePairs["OEM"] == oemName)
|
||||
{
|
||||
plugin.Initialize(systemWindow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.Initialize(systemWindow);
|
||||
}
|
||||
plugin.Initialize(systemWindow);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +145,70 @@ namespace MatterHackers.MatterControl
|
|||
AggContext.StaticData = new FileSystemStaticData();
|
||||
}
|
||||
|
||||
if (Clipboard.Instance == null)
|
||||
{
|
||||
Clipboard.SetSystemClipboard(new WindowsFormsClipboard());
|
||||
}
|
||||
|
||||
WinformsSystemWindow.InspectorCreator = (inspectingWindow) =>
|
||||
{
|
||||
if (inspectingWindow == AppContext.RootSystemWindow)
|
||||
{
|
||||
// If this is MatterControlApplication, include Scene
|
||||
var partContext = ApplicationController.Instance.DragDropData;
|
||||
return new InspectForm(inspectingWindow, partContext.SceneContext?.Scene ?? null, partContext.View3DWidget);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, exclude Scene
|
||||
return new InspectForm(inspectingWindow);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ApplicationSettings.Instance.set("HardwareHasCamera", "false");
|
||||
}
|
||||
|
||||
public void GenerateLocalizationValidationFile()
|
||||
{
|
||||
if (AggContext.StaticData is FileSystemStaticData fileSystemStaticData)
|
||||
{
|
||||
char currentChar = 'A';
|
||||
|
||||
// Note: Functionality only expected to work on Desktop/Debug builds and as such, is coupled to FileSystemStaticData
|
||||
string outputPath = fileSystemStaticData.MapPath(Path.Combine("Translations", "L10N", "Translation.txt"));
|
||||
string sourceFilePath = fileSystemStaticData.MapPath(Path.Combine("Translations", "Master.txt"));
|
||||
|
||||
// Ensure the output directory exists
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
|
||||
using (var outstream = new StreamWriter(outputPath))
|
||||
{
|
||||
foreach (var line in File.ReadAllLines(sourceFilePath))
|
||||
{
|
||||
if (line.StartsWith("Translated:"))
|
||||
{
|
||||
var pos = line.IndexOf(':');
|
||||
var segments = new string[]
|
||||
{
|
||||
line.Substring(0, pos),
|
||||
line.Substring(pos + 1),
|
||||
};
|
||||
|
||||
outstream.WriteLine("{0}:{1}", segments[0], new string(segments[1].ToCharArray().Select(c => c == ' ' ? ' ' : currentChar).ToArray()));
|
||||
|
||||
if (currentChar++ == 'Z')
|
||||
{
|
||||
currentChar = 'A';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outstream.WriteLine(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -186,7 +186,6 @@
|
|||
<Compile Include="ActionBar\PrinterSelector.cs" />
|
||||
<Compile Include="ActionBar\TemperatureWidgetBed.cs" />
|
||||
<Compile Include="ApplicationView\OemProfileDictionary.cs" />
|
||||
<Compile Include="ApplicationView\WindowsPlatformsFeatures.cs" />
|
||||
<Compile Include="DataStorage\ApplicationDataStorage.cs" />
|
||||
<Compile Include="DesignTools\Attributes\IconsAttribute.cs" />
|
||||
<Compile Include="DesignTools\Attributes\WebPageLinkAttribute.cs" />
|
||||
|
|
@ -316,12 +315,6 @@
|
|||
<Compile Include="Utilities\MarkdigAgg\Inlines\AggLiteralInlineRenderer.cs" />
|
||||
<Compile Include="Utilities\MarkdigAgg\AggParagraphRenderer.cs" />
|
||||
<Compile Include="Utilities\IGCodePostProcessor.cs" />
|
||||
<Compile Include="Utilities\InspectForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Utilities\InspectForm.Designer.cs">
|
||||
<DependentUpon>InspectForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Library\ContentProviders\GCodeContentProvider.cs" />
|
||||
<Compile Include="Library\ContentProviders\IContentProvider.cs" />
|
||||
<Compile Include="ConfigurationPage\ApplicationSettings\ApplicationSettingsView.cs" />
|
||||
|
|
@ -559,13 +552,8 @@
|
|||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="OpenTK">
|
||||
<HintPath>Submodules\agg-sharp\PlatformWin32\OpenTK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
|
|
@ -598,9 +586,6 @@
|
|||
<Content Include="StaticData\SliceSettings\unload_filament.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Utilities\InspectForm.resx">
|
||||
<DependentUpon>InspectForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="App.config" />
|
||||
<None Include="appsettings.json" />
|
||||
<None Include="Library\LibraryProviders.cd" />
|
||||
|
|
@ -661,10 +646,6 @@
|
|||
<Project>{d3e41b4e-bfbb-44ca-94c8-95c00f754fdd}</Project>
|
||||
<Name>VectorMath</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Submodules\agg-sharp\Veldrid\MatterHackers.VeldridProvider.csproj">
|
||||
<Project>{5754893a-e806-4d67-96b4-d64d3f85d1e4}</Project>
|
||||
<Name>MatterHackers.VeldridProvider</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Submodules\MatterSlice\MatterSlice.csproj">
|
||||
<Project>{c46ca728-dd2f-4dd1-971a-aaa89d9dff95}</Project>
|
||||
<Name>MatterSlice</Name>
|
||||
|
|
@ -689,10 +670,6 @@
|
|||
<Project>{86f6aaf2-9b50-40b8-a427-1897d76471c5}</Project>
|
||||
<Name>PolygonMesh</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Submodules\agg-sharp\PlatformWin32\PlatformWin32.csproj">
|
||||
<Project>{670bddff-927b-425d-9dd1-22acb14356eb}</Project>
|
||||
<Name>PlatformWin32</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="PluginSystem\MatterControlPluginSystem.csproj">
|
||||
<Project>{865172a0-a1a9-49c2-9386-f2fdb4e141b7}</Project>
|
||||
<Name>MatterControlPluginSystem</Name>
|
||||
|
|
|
|||
|
|
@ -106,6 +106,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Typography.OpenFont", "Subm
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatterHackers.VeldridProvider", "Submodules\agg-sharp\Veldrid\MatterHackers.VeldridProvider.csproj", "{676EB09F-8913-49A4-AB85-5DA45506AB3D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatterControl.Winforms", "MatterControl.Winforms\MatterControl.Winforms.csproj", "{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
Submodules\agg-sharp\Typography.GlyphLayout\Typography.GlyphLayout.projitems*{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}*SharedItemsImports = 4
|
||||
|
|
@ -406,6 +408,14 @@ Global
|
|||
{676EB09F-8913-49A4-AB85-5DA45506AB3D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{676EB09F-8913-49A4-AB85-5DA45506AB3D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{676EB09F-8913-49A4-AB85-5DA45506AB3D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -425,6 +435,7 @@ Global
|
|||
{036BCCBA-52D8-457C-84AE-8821F209FE4A} = {2AB9B589-5C98-4C05-BBEA-F97DAE168EAB}
|
||||
{9B062971-A88E-4A3D-B3C9-12B78D15FA66} = {2AB9B589-5C98-4C05-BBEA-F97DAE168EAB}
|
||||
{DF6845CD-64C6-4263-8357-DA8066855739} = {2AB9B589-5C98-4C05-BBEA-F97DAE168EAB}
|
||||
{865172A0-A1A9-49C2-9386-F2FDB4E141B7} = {FED00F38-E911-45E1-A788-26980E84C3D6}
|
||||
{C46CA728-DD2F-4DD1-971A-AAA89D9DFF95} = {57647FCB-8F00-4C05-972C-3CF6ACD12A63}
|
||||
{3DF4CB3D-9A03-4256-9A81-70523AAD828B} = {FED00F38-E911-45E1-A788-26980E84C3D6}
|
||||
{990A9AD3-B6A4-407B-9DFC-9C722AF7C9B9} = {FED00F38-E911-45E1-A788-26980E84C3D6}
|
||||
|
|
@ -445,6 +456,7 @@ Global
|
|||
{DE958333-2467-409D-904D-92C9CCD0BA52} = {2AB9B589-5C98-4C05-BBEA-F97DAE168EAB}
|
||||
{723AE80D-A512-4CF0-9F5A-8CC7323A26BB} = {2AB9B589-5C98-4C05-BBEA-F97DAE168EAB}
|
||||
{676EB09F-8913-49A4-AB85-5DA45506AB3D} = {2AB9B589-5C98-4C05-BBEA-F97DAE168EAB}
|
||||
{D6DC2669-7B1F-40FE-89BF-45D4C94473E3} = {FED00F38-E911-45E1-A788-26980E84C3D6}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {42D74E06-00EA-43D2-A05B-9BEAD4A2C8A0}
|
||||
|
|
|
|||
49
PluginSystem/INativePlatformFeatures.cs
Normal file
49
PluginSystem/INativePlatformFeatures.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
Copyright (c) 2018, Lars Brubaker, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using MatterHackers.Agg.UI;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
{
|
||||
public interface INativePlatformFeatures
|
||||
{
|
||||
event EventHandler PictureTaken;
|
||||
void TakePhoto(string imageFileName);
|
||||
void OpenCameraPreview();
|
||||
void PlaySound(string fileName);
|
||||
void ConfigureWifi();
|
||||
bool CameraInUseByExternalProcess { get; set; }
|
||||
bool IsNetworkConnected();
|
||||
void FindAndInstantiatePlugins(SystemWindow systemWindow);
|
||||
void ProcessCommandline();
|
||||
void PlatformInit(Action<string> reporter);
|
||||
void GenerateLocalizationValidationFile();
|
||||
}
|
||||
}
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="INativePlatformFeatures.cs" />
|
||||
<Compile Include="MatterControlPluginBase.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.SettingsManagement;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
|
|
@ -94,7 +95,7 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
|
||||
// Init platformFeaturesProvider before ShowAsSystemWindow
|
||||
string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl";
|
||||
string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl.Winforms";
|
||||
AppContext.Platform = AggContext.CreateInstanceFrom<INativePlatformFeatures>(platformFeaturesProvider);
|
||||
AppContext.Platform.ProcessCommandline();
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
private AverageMillisecondTimer millisecondTimer = new AverageMillisecondTimer();
|
||||
|
||||
internal static bool ShowMemoryUsed = false;
|
||||
public static bool ShowMemoryUsed = false;
|
||||
|
||||
private int drawCount = 0;
|
||||
|
||||
|
|
@ -122,28 +122,6 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
|
||||
this.Maximized = ApplicationSettings.Instance.get(ApplicationSettingsKey.MainWindowMaximized) == "true";
|
||||
|
||||
#if IS_WINDOWS_FORMS
|
||||
if (Clipboard.Instance == null)
|
||||
{
|
||||
Clipboard.SetSystemClipboard(new WindowsFormsClipboard());
|
||||
}
|
||||
|
||||
WinformsSystemWindow.InspectorCreator = (inspectingWindow) =>
|
||||
{
|
||||
if (inspectingWindow == this)
|
||||
{
|
||||
// If this is MatterControlApplication, include Scene
|
||||
var partContext = ApplicationController.Instance.DragDropData;
|
||||
return new InspectForm(inspectingWindow, partContext.SceneContext?.Scene ?? null, partContext.View3DWidget);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, exclude Scene
|
||||
return new InspectForm(inspectingWindow);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
public static (int width, int height) GetStartupBounds(int overrideWidth = -1, int overrideHeight = -1)
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
catch { }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
@ -637,7 +637,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
var results = new List<(string layerName, string currentValue)>();
|
||||
|
||||
|
||||
foreach (PrinterSettingsLayer layer in layerCascade)
|
||||
{
|
||||
if (layer.TryGetValue(sliceSetting, out string value))
|
||||
|
|
@ -975,7 +974,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return (T)default(T);
|
||||
}
|
||||
|
||||
|
|
@ -1349,4 +1347,3 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit cf361853c36e3b99bd4a970e7a6c7e9fb70a1800
|
||||
Subproject commit 6eebd27a04e2adab433af0a3447fec2936ba5a3f
|
||||
|
|
@ -78,6 +78,14 @@
|
|||
<Project>{97d5ade3-c1b4-4b46-8a3e-718a4f7f079f}</Project>
|
||||
<Name>MatterControl.Printing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\MatterControl.Winforms\MatterControl.Winforms.csproj">
|
||||
<Project>{d6dc2669-7b1f-40fe-89bf-45d4c94473e3}</Project>
|
||||
<Name>MatterControl.Winforms</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\PluginSystem\MatterControlPluginSystem.csproj">
|
||||
<Project>{865172a0-a1a9-49c2-9386-f2fdb4e141b7}</Project>
|
||||
<Name>MatterControlPluginSystem</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Submodules\agg-sharp\agg\Agg.csproj">
|
||||
<Project>{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}</Project>
|
||||
<Name>Agg</Name>
|
||||
|
|
|
|||
|
|
@ -92,6 +92,14 @@
|
|||
<Project>{97d5ade3-c1b4-4b46-8a3e-718a4f7f079f}</Project>
|
||||
<Name>MatterControl.Printing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\MatterControl.Winforms\MatterControl.Winforms.csproj">
|
||||
<Project>{d6dc2669-7b1f-40fe-89bf-45d4c94473e3}</Project>
|
||||
<Name>MatterControl.Winforms</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\PluginSystem\MatterControlPluginSystem.csproj">
|
||||
<Project>{865172a0-a1a9-49c2-9386-f2fdb4e141b7}</Project>
|
||||
<Name>MatterControlPluginSystem</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Submodules\agg-sharp\agg\Agg.csproj">
|
||||
<Project>{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}</Project>
|
||||
<Name>Agg</Name>
|
||||
|
|
|
|||
|
|
@ -658,7 +658,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
AutomationRunner.UpDelaySeconds = config.MouseUpDelay;
|
||||
|
||||
// Automation runner must do as much as program.cs to spin up platform
|
||||
string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl";
|
||||
string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl.Winforms";
|
||||
AppContext.Platform = AggContext.CreateInstanceFrom<INativePlatformFeatures>(platformFeaturesProvider);
|
||||
AppContext.Platform.ProcessCommandline();
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ namespace MatterControl.Tests
|
|||
RayTracer.dll
|
||||
DataConverters3D.dll
|
||||
Localizations.dll
|
||||
agg_platform_win32.dll
|
||||
Community.CsharpSqlite.dll
|
||||
MatterHackers.MatterControl.Plugins.dll
|
||||
MatterHackers.Agg.ImageProcessing.dll
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue