# HG changeset patch # User StephaneLenclud # Date 1430939033 -7200 # Node ID 3b94d0640115d710e7f49df74aefbcbdf7a443ba # Parent 638eb0763e2037befec34fea356ff1370728cbd1 Adding C# interop project and NuGet package. diff -r 638eb0763e20 -r 3b94d0640115 Interop/MiniDisplay.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Interop/MiniDisplay.cs Wed May 06 21:03:53 2015 +0200 @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace MiniDisplay +{ + public class Interop + { + + //[Serializable] + public enum TMiniDisplayType + { + EMiniDisplayAutoDetect, /*Not yet implemented*/ + //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")] + EMiniDisplayFutabaGP1212A01, + //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")] + EMiniDisplayFutabaGP1212A02 + }; + + /// + /// + /// + public enum TMiniDisplayRequest + { + EMiniDisplayRequestNone, + EMiniDisplayRequestDeviceId, + EMiniDisplayRequestFirmwareRevision, + EMiniDisplayRequestPowerSupplyStatus + }; + + + /// + /// Define the various type of icons we support. + /// For binary compatibility new entries must be added at the end. + /// + public enum TMiniDisplayIconType + { + EMiniDisplayIconNetworkSignal = 0, + EMiniDisplayIconInternet, + EMiniDisplayIconEmail, + EMiniDisplayIconMute, + EMiniDisplayIconVolume, + EMiniDisplayIconVolumeLabel, + EMiniDisplayIconPlay, + EMiniDisplayIconPause, + EMiniDisplayIconRecording + }; + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplayOpen(TMiniDisplayType aType); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayClose(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayTypeCount(); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplayTypeName(TMiniDisplayType aType); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayClear(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayFill(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySwapBuffers(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetBrightness(IntPtr aDevice, int aBrightness); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayMinBrightness(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayMaxBrightness(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayWidthInPixels(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayHeightInPixels(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplaySetPixel(IntPtr aDevice, int aX, int aY, uint aValue); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplayVendor(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplayProduct(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplaySerialNumber(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplayDeviceId(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr MiniDisplayFirmwareRevision(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool MiniDisplayPowerSupplyStatus(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayRequest(IntPtr aDevice, TMiniDisplayRequest aRequest); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern TMiniDisplayRequest MiniDisplayCurrentRequest(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayCancelRequest(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayPowerOn(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayPowerOff(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool MiniDisplaySupportPowerOnOff(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayShowClock(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplayHideClock(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool MiniDisplaySupportClock(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconCount(IntPtr aDevice, TMiniDisplayIconType aIcon); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconStatusCount(IntPtr aDevice, TMiniDisplayIconType aIcon); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconStatus(IntPtr aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus); + + + } +} diff -r 638eb0763e20 -r 3b94d0640115 Interop/MiniDisplayInterop.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Interop/MiniDisplayInterop.csproj Wed May 06 21:03:53 2015 +0200 @@ -0,0 +1,49 @@ + + + + + Debug + AnyCPU + {C2328BBD-3B13-4E02-B967-A7283FEB22C9} + Library + Properties + MiniDisplayInterop + MiniDisplayInterop + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + \ No newline at end of file diff -r 638eb0763e20 -r 3b94d0640115 Interop/MiniDisplayInterop.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Interop/MiniDisplayInterop.sln Wed May 06 21:03:53 2015 +0200 @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniDisplayInterop", "MiniDisplayInterop.csproj", "{C2328BBD-3B13-4E02-B967-A7283FEB22C9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C2328BBD-3B13-4E02-B967-A7283FEB22C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2328BBD-3B13-4E02-B967-A7283FEB22C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2328BBD-3B13-4E02-B967-A7283FEB22C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2328BBD-3B13-4E02-B967-A7283FEB22C9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 638eb0763e20 -r 3b94d0640115 Interop/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Interop/Properties/AssemblyInfo.cs Wed May 06 21:03:53 2015 +0200 @@ -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("MiniDisplayInterop")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MiniDisplayInterop")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[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("5d6efa59-b758-4f09-884d-ef351cb279bc")] + +// 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")] diff -r 638eb0763e20 -r 3b94d0640115 LibMiniDisplay.nuspec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LibMiniDisplay.nuspec Wed May 06 21:03:53 2015 +0200 @@ -0,0 +1,22 @@ + + + + LibMiniDisplay + 1.1.3 + Mini Display Library + Stéphane Lenclud + https://www.gnu.org/copyleft/gpl.html + http://hg.slions.net/MiniDisplay + false + Provide a C interface to drive some Futaba VFD displays. + Currently only supports HID USB conections. + Stéphane Lenclud + VFD LCD display module Futaba + + + + + + + + \ No newline at end of file diff -r 638eb0763e20 -r 3b94d0640115 LibMiniDisplay.targets --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LibMiniDisplay.targets Wed May 06 21:03:53 2015 +0200 @@ -0,0 +1,33 @@ + + + + + $(MSBuildThisFileDirectory)..\native\$(Platform)\MiniDisplay.dll + + + + + + + + + + + + CopyLibMiniDisplayNativeReference; + + + + + \ No newline at end of file