Porting to new MiniDisplay interop naming from NuGet LibMiniDisplay package.
authorStephaneLenclud
Wed, 06 May 2015 21:56:21 +0200
changeset 1352edc5da1796e
parent 134 3f6d708e6499
child 136 8badd89fb78c
Porting to new MiniDisplay interop naming from NuGet LibMiniDisplay package.
Server/Display.cs
Server/MainForm.cs
Server/SharpDisplayManager.csproj
Server/packages.config
     1.1 --- a/Server/Display.cs	Wed May 06 21:05:51 2015 +0200
     1.2 +++ b/Server/Display.cs	Wed May 06 21:56:21 2015 +0200
     1.3 @@ -26,6 +26,8 @@
     1.4  using System.Runtime.InteropServices;
     1.5  //using System.Runtime.Serialization;
     1.6  
     1.7 +using MiniDisplayInterop;
     1.8 +
     1.9  namespace SharpDisplayManager
    1.10  {
    1.11  
    1.12 @@ -47,12 +49,12 @@
    1.13  		//static functions
    1.14  		public static int TypeCount()
    1.15  		{
    1.16 -			return MiniDisplayTypeCount();
    1.17 +			return MiniDisplay.TypeCount();
    1.18  		}
    1.19  
    1.20 -		public static string TypeName(TMiniDisplayType aType)
    1.21 +		public static string TypeName(MiniDisplay.Type aType)
    1.22  		{
    1.23 -			IntPtr ptr = MiniDisplayTypeName(aType);
    1.24 +			IntPtr ptr = MiniDisplay.TypeName(aType);
    1.25  			string str = Marshal.PtrToStringUni(ptr);
    1.26  			return str;
    1.27  		}
    1.28 @@ -64,7 +66,7 @@
    1.29          }
    1.30  
    1.31          //
    1.32 -        public bool Open(TMiniDisplayType aType)
    1.33 +        public bool Open(MiniDisplay.Type aType)
    1.34          {
    1.35  			if (IsOpen())
    1.36  			{
    1.37 @@ -72,7 +74,7 @@
    1.38  				return false;
    1.39  			}
    1.40  
    1.41 -            iDevice = MiniDisplayOpen(aType);
    1.42 +            iDevice = MiniDisplay.Open(aType);
    1.43  
    1.44              bool success = iDevice != IntPtr.Zero;
    1.45  			if (success)
    1.46 @@ -93,7 +95,7 @@
    1.47  			}
    1.48  
    1.49  			//
    1.50 -            MiniDisplayClose(iDevice);
    1.51 +            MiniDisplay.Close(iDevice);
    1.52              iDevice = IntPtr.Zero;
    1.53  			//Broadcast closed event
    1.54  			OnClosed(this);
    1.55 @@ -106,147 +108,147 @@
    1.56  
    1.57          public void Clear()
    1.58          {
    1.59 -            MiniDisplayClear(iDevice);
    1.60 +            MiniDisplay.Clear(iDevice);
    1.61          }
    1.62  
    1.63          public void Fill()
    1.64          {
    1.65 -            MiniDisplayFill(iDevice);
    1.66 +            MiniDisplay.Fill(iDevice);
    1.67          }
    1.68  
    1.69          public void SwapBuffers()
    1.70          {
    1.71 -            MiniDisplaySwapBuffers(iDevice);
    1.72 +            MiniDisplay.SwapBuffers(iDevice);
    1.73          }
    1.74  
    1.75          public int MaxBrightness()
    1.76          {
    1.77 -            return MiniDisplayMaxBrightness(iDevice);
    1.78 +            return MiniDisplay.MaxBrightness(iDevice);
    1.79          }
    1.80  
    1.81          public int MinBrightness()
    1.82          {
    1.83 -            return MiniDisplayMinBrightness(iDevice);
    1.84 +            return MiniDisplay.MinBrightness(iDevice);
    1.85          }
    1.86  
    1.87          public void SetBrightness(int aBrightness)
    1.88          {
    1.89              if (!IsOpen()) return;
    1.90  
    1.91 -            MiniDisplaySetBrightness(iDevice, aBrightness);
    1.92 +            MiniDisplay.SetBrightness(iDevice, aBrightness);
    1.93          }
    1.94  
    1.95          public int WidthInPixels()
    1.96          {
    1.97 -            return MiniDisplayWidthInPixels(iDevice);
    1.98 +            return MiniDisplay.WidthInPixels(iDevice);
    1.99          }
   1.100  
   1.101          public int HeightInPixels()
   1.102          {
   1.103 -            return MiniDisplayHeightInPixels(iDevice);
   1.104 +            return MiniDisplay.HeightInPixels(iDevice);
   1.105          }
   1.106  
   1.107          public void SetPixel(int aX, int aY, uint aValue)
   1.108          {
   1.109 -            MiniDisplaySetPixel(iDevice,aX,aY,aValue);
   1.110 +            MiniDisplay.SetPixel(iDevice,aX,aY,aValue);
   1.111          }
   1.112  
   1.113          public void RequestPowerSupplyStatus()
   1.114          {
   1.115 -            MiniDisplayRequest(iDevice, TMiniDisplayRequest.EMiniDisplayRequestPowerSupplyStatus);
   1.116 +            MiniDisplay.SendRequest(iDevice, MiniDisplay.Request.PowerSupplyStatus);
   1.117          }
   1.118  
   1.119          public void RequestDeviceId()
   1.120          {
   1.121 -            MiniDisplayRequest(iDevice, TMiniDisplayRequest.EMiniDisplayRequestDeviceId);
   1.122 +            MiniDisplay.SendRequest(iDevice, MiniDisplay.Request.DeviceId);
   1.123          }
   1.124  
   1.125          public void RequestFirmwareRevision()
   1.126          {
   1.127 -            MiniDisplayRequest(iDevice, TMiniDisplayRequest.EMiniDisplayRequestFirmwareRevision);
   1.128 +            MiniDisplay.SendRequest(iDevice, MiniDisplay.Request.FirmwareRevision);
   1.129          }
   1.130  
   1.131          public void PowerOn()
   1.132          {
   1.133 -            MiniDisplayPowerOn(iDevice);
   1.134 +            MiniDisplay.PowerOn(iDevice);
   1.135          }
   1.136  
   1.137          public void PowerOff()
   1.138          {
   1.139 -            MiniDisplayPowerOff(iDevice);
   1.140 +            MiniDisplay.PowerOff(iDevice);
   1.141          }
   1.142  
   1.143          public bool SupportPowerOnOff()
   1.144          {
   1.145 -            return MiniDisplaySupportPowerOnOff(iDevice);
   1.146 +            return MiniDisplay.SupportPowerOnOff(iDevice);
   1.147          }
   1.148  
   1.149          public void ShowClock()
   1.150          {
   1.151 -            MiniDisplayShowClock(iDevice);
   1.152 +            MiniDisplay.ShowClock(iDevice);
   1.153          }
   1.154  
   1.155          public void HideClock()
   1.156          {
   1.157 -            MiniDisplayHideClock(iDevice);
   1.158 +            MiniDisplay.HideClock(iDevice);
   1.159          }
   1.160  
   1.161          public bool SupportClock()
   1.162          {
   1.163 -            return MiniDisplaySupportClock(iDevice);
   1.164 +            return MiniDisplay.SupportClock(iDevice);
   1.165          }
   1.166  
   1.167          public bool PowerSupplyStatus()
   1.168          {
   1.169 -            bool res = MiniDisplayPowerSupplyStatus(iDevice);
   1.170 +            bool res = MiniDisplay.PowerSupplyStatus(iDevice);
   1.171              return res;
   1.172          }
   1.173  
   1.174 -        public TMiniDisplayRequest AttemptRequestCompletion()
   1.175 +        public MiniDisplay.Request AttemptRequestCompletion()
   1.176          {
   1.177 -            return MiniDisplayAttemptRequestCompletion(iDevice);
   1.178 +            return MiniDisplay.AttemptRequestCompletion(iDevice);
   1.179          }
   1.180  
   1.181 -        public TMiniDisplayRequest CurrentRequest()
   1.182 +        public MiniDisplay.Request CurrentRequest()
   1.183          {
   1.184 -            return MiniDisplayCurrentRequest(iDevice);
   1.185 +            return MiniDisplay.CurrentRequest(iDevice);
   1.186          }
   1.187  
   1.188          public bool IsRequestPending()
   1.189          {
   1.190 -            return CurrentRequest() != TMiniDisplayRequest.EMiniDisplayRequestNone;
   1.191 +            return CurrentRequest() != MiniDisplay.Request.None;
   1.192          }
   1.193  
   1.194  		//
   1.195 -		public int IconCount(TMiniDisplayIconType aIcon)
   1.196 +		public int IconCount(MiniDisplay.IconType aIcon)
   1.197  		{
   1.198 -			return MiniDisplayIconCount(iDevice,aIcon);
   1.199 +			return MiniDisplay.IconCount(iDevice,aIcon);
   1.200  		}
   1.201  
   1.202 -		public int IconStatusCount(TMiniDisplayIconType aIcon)
   1.203 +		public int IconStatusCount(MiniDisplay.IconType aIcon)
   1.204  		{
   1.205 -			return MiniDisplayIconStatusCount(iDevice, aIcon);
   1.206 +			return MiniDisplay.IconStatusCount(iDevice, aIcon);
   1.207  		}
   1.208  
   1.209 -		public void SetIconStatus(TMiniDisplayIconType aIcon, int aIndex, int aStatus)
   1.210 +		public void SetIconStatus(MiniDisplay.IconType aIcon, int aIndex, int aStatus)
   1.211  		{
   1.212 -			MiniDisplaySetIconStatus(iDevice, aIcon, aIndex, aStatus);
   1.213 +			MiniDisplay.SetIconStatus(iDevice, aIcon, aIndex, aStatus);
   1.214  		}
   1.215  
   1.216 -		public void SetIconOn(TMiniDisplayIconType aIcon, int aIndex)
   1.217 +		public void SetIconOn(MiniDisplay.IconType aIcon, int aIndex)
   1.218  		{
   1.219 -			MiniDisplaySetIconStatus(iDevice, aIcon, aIndex, IconStatusCount(aIcon) - 1);
   1.220 +			MiniDisplay.SetIconStatus(iDevice, aIcon, aIndex, IconStatusCount(aIcon) - 1);
   1.221  		}
   1.222  
   1.223 -		public void SetIconOff(TMiniDisplayIconType aIcon, int aIndex)
   1.224 +		public void SetIconOff(MiniDisplay.IconType aIcon, int aIndex)
   1.225  		{
   1.226 -			MiniDisplaySetIconStatus(iDevice, aIcon, aIndex, 0);
   1.227 +			MiniDisplay.SetIconStatus(iDevice, aIcon, aIndex, 0);
   1.228  		}
   1.229  
   1.230  
   1.231  		public void SetAllIconsStatus(int aStatus)
   1.232  		{
   1.233 -			foreach (TMiniDisplayIconType icon in Enum.GetValues(typeof(TMiniDisplayIconType)))
   1.234 +			foreach (MiniDisplay.IconType icon in Enum.GetValues(typeof(MiniDisplay.IconType)))
   1.235  			{
   1.236  				int count=IconCount(icon);
   1.237  				for (int i = 0; i < count; i++)
   1.238 @@ -261,7 +263,7 @@
   1.239  		/// </summary>
   1.240  		/// <param name="aIcon"></param>
   1.241  		/// <param name="aStatus"></param>
   1.242 -		public void SetIconStatus(TMiniDisplayIconType aIcon, int aStatus)
   1.243 +		public void SetIconStatus(MiniDisplay.IconType aIcon, int aStatus)
   1.244  		{
   1.245  			int iconCount = IconCount(aIcon);
   1.246  			for (int i = 0; i < iconCount; i++)
   1.247 @@ -275,7 +277,7 @@
   1.248  		/// </summary>
   1.249  		/// <param name="aIcon"></param>
   1.250  		/// <param name="aOn"></param>		
   1.251 -		public void SetIconOnOff(TMiniDisplayIconType aIcon, bool aOn)
   1.252 +		public void SetIconOnOff(MiniDisplay.IconType aIcon, bool aOn)
   1.253  		{
   1.254  			if (aOn)
   1.255  			{
   1.256 @@ -291,7 +293,7 @@
   1.257  		/// Set all elements of an icon to there maximum status.
   1.258  		/// </summary>
   1.259  		/// <param name="aIcon"></param>
   1.260 -		public void SetIconOn(TMiniDisplayIconType aIcon)
   1.261 +		public void SetIconOn(MiniDisplay.IconType aIcon)
   1.262  		{
   1.263  			int iconCount = IconCount(aIcon);
   1.264  			for (int i = 0; i < iconCount; i++)
   1.265 @@ -304,7 +306,7 @@
   1.266  		/// Turn off all elements of an icon.
   1.267  		/// </summary>
   1.268  		/// <param name="aIcon"></param>
   1.269 -		public void SetIconOff(TMiniDisplayIconType aIcon)
   1.270 +		public void SetIconOff(MiniDisplay.IconType aIcon)
   1.271  		{
   1.272  			int iconCount = IconCount(aIcon);
   1.273  			for (int i = 0; i < iconCount; i++)
   1.274 @@ -317,176 +319,39 @@
   1.275  
   1.276          public string Vendor()
   1.277          {
   1.278 -            IntPtr ptr = MiniDisplayVendor(iDevice);
   1.279 +            IntPtr ptr = MiniDisplay.Vendor(iDevice);
   1.280              string str = Marshal.PtrToStringUni(ptr);
   1.281              return str;
   1.282          }
   1.283  
   1.284          public string Product()
   1.285          {
   1.286 -            IntPtr ptr = MiniDisplayProduct(iDevice);
   1.287 +            IntPtr ptr = MiniDisplay.Product(iDevice);
   1.288              string str = Marshal.PtrToStringUni(ptr);
   1.289              return str;
   1.290          }
   1.291  
   1.292          public string SerialNumber()
   1.293          {
   1.294 -            IntPtr ptr = MiniDisplaySerialNumber(iDevice);
   1.295 +            IntPtr ptr = MiniDisplay.SerialNumber(iDevice);
   1.296              string str = Marshal.PtrToStringUni(ptr);
   1.297              return str;
   1.298          }
   1.299  
   1.300          public string DeviceId()
   1.301          {
   1.302 -            IntPtr ptr = MiniDisplayDeviceId(iDevice);
   1.303 +            IntPtr ptr = MiniDisplay.DeviceId(iDevice);
   1.304              string str = Marshal.PtrToStringAnsi(ptr);
   1.305              return str;
   1.306          }
   1.307  
   1.308          public string FirmwareRevision()
   1.309          {
   1.310 -            IntPtr ptr = MiniDisplayFirmwareRevision(iDevice);
   1.311 +            IntPtr ptr = MiniDisplay.FirmwareRevision(iDevice);
   1.312              string str = Marshal.PtrToStringAnsi(ptr);
   1.313              return str;
   1.314          }
   1.315  
   1.316 -        //[Serializable]
   1.317 -        public enum TMiniDisplayType
   1.318 -        {
   1.319 -            EMiniDisplayAutoDetect, /*Not yet implemented*/
   1.320 -            //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")]
   1.321 -            EMiniDisplayFutabaGP1212A01,
   1.322 -            //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")]
   1.323 -            EMiniDisplayFutabaGP1212A02
   1.324 -        };
   1.325 -
   1.326 -		/// <summary>
   1.327 -		/// 
   1.328 -		/// </summary>
   1.329 -        public enum TMiniDisplayRequest
   1.330 -        {
   1.331 -            EMiniDisplayRequestNone,
   1.332 -            EMiniDisplayRequestDeviceId,
   1.333 -            EMiniDisplayRequestFirmwareRevision,
   1.334 -            EMiniDisplayRequestPowerSupplyStatus
   1.335 -        };
   1.336 -
   1.337 -			
   1.338 -		/// <summary>
   1.339 -		/// Define the various type of icons we support.
   1.340 -		/// For binary compatibility new entries must be added at the end.
   1.341 -		/// </summary>
   1.342 -		public enum TMiniDisplayIconType
   1.343 -		{
   1.344 -			EMiniDisplayIconNetworkSignal=0,
   1.345 -			EMiniDisplayIconInternet,
   1.346 -			EMiniDisplayIconEmail,
   1.347 -			EMiniDisplayIconMute,
   1.348 -			EMiniDisplayIconVolume,
   1.349 -			EMiniDisplayIconVolumeLabel,
   1.350 -			EMiniDisplayIconPlay,
   1.351 -			EMiniDisplayIconPause,
   1.352 -			EMiniDisplayIconRecording
   1.353 -		};
   1.354 -
   1.355 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.356 -        public static extern IntPtr MiniDisplayOpen(TMiniDisplayType aType);
   1.357 -
   1.358 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.359 -        public static extern void MiniDisplayClose(IntPtr aDevice);
   1.360 -
   1.361 -		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.362 -		public static extern int MiniDisplayTypeCount();
   1.363 -
   1.364 -		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.365 -		public static extern IntPtr MiniDisplayTypeName(TMiniDisplayType aType);
   1.366 -
   1.367 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.368 -        public static extern void MiniDisplayClear(IntPtr aDevice);
   1.369 -
   1.370 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.371 -        public static extern void MiniDisplayFill(IntPtr aDevice);
   1.372 -
   1.373 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.374 -        public static extern void MiniDisplaySwapBuffers(IntPtr aDevice);
   1.375 -
   1.376 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.377 -        public static extern void MiniDisplaySetBrightness(IntPtr aDevice, int aBrightness);
   1.378 -
   1.379 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.380 -        public static extern int MiniDisplayMinBrightness(IntPtr aDevice);
   1.381 -
   1.382 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.383 -        public static extern int MiniDisplayMaxBrightness(IntPtr aDevice);
   1.384 -
   1.385 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.386 -        public static extern int MiniDisplayWidthInPixels(IntPtr aDevice);
   1.387 -
   1.388 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.389 -        public static extern int MiniDisplayHeightInPixels(IntPtr aDevice);
   1.390 -
   1.391 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.392 -        public static extern int MiniDisplaySetPixel(IntPtr aDevice, int aX, int aY, uint aValue);
   1.393 -
   1.394 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.395 -        public static extern IntPtr MiniDisplayVendor(IntPtr aDevice);
   1.396 -
   1.397 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.398 -        public static extern IntPtr MiniDisplayProduct(IntPtr aDevice);
   1.399 -
   1.400 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.401 -        public static extern IntPtr MiniDisplaySerialNumber(IntPtr aDevice);
   1.402 -
   1.403 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.404 -        public static extern IntPtr MiniDisplayDeviceId(IntPtr aDevice);
   1.405 -
   1.406 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.407 -        public static extern IntPtr MiniDisplayFirmwareRevision(IntPtr aDevice);
   1.408 -
   1.409 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.410 -        [return: MarshalAs(UnmanagedType.I1)]
   1.411 -        public static extern bool MiniDisplayPowerSupplyStatus(IntPtr aDevice);
   1.412 -
   1.413 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.414 -        public static extern void MiniDisplayRequest(IntPtr aDevice, TMiniDisplayRequest aRequest);
   1.415 -
   1.416 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.417 -        public static extern TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(IntPtr aDevice);
   1.418 -
   1.419 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.420 -        public static extern TMiniDisplayRequest MiniDisplayCurrentRequest(IntPtr aDevice);
   1.421 -
   1.422 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.423 -        public static extern void MiniDisplayCancelRequest(IntPtr aDevice);
   1.424 -
   1.425 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.426 -        public static extern void MiniDisplayPowerOn(IntPtr aDevice);
   1.427 -
   1.428 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.429 -        public static extern void MiniDisplayPowerOff(IntPtr aDevice);
   1.430 -
   1.431 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.432 -        [return: MarshalAs(UnmanagedType.I1)]
   1.433 -        public static extern bool MiniDisplaySupportPowerOnOff(IntPtr aDevice);
   1.434 -
   1.435 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.436 -        public static extern void MiniDisplayShowClock(IntPtr aDevice);
   1.437 -
   1.438 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.439 -        public static extern void MiniDisplayHideClock(IntPtr aDevice);
   1.440 -
   1.441 -        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.442 -        [return: MarshalAs(UnmanagedType.I1)]
   1.443 -        public static extern bool MiniDisplaySupportClock(IntPtr aDevice);
   1.444 -
   1.445 -		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.446 -		public static extern int MiniDisplayIconCount(IntPtr aDevice, TMiniDisplayIconType aIcon);
   1.447 -
   1.448 -		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.449 -		public static extern int MiniDisplayIconStatusCount(IntPtr aDevice, TMiniDisplayIconType aIcon);
   1.450 -		
   1.451 -		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
   1.452 -		public static extern void MiniDisplaySetIconStatus(IntPtr aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus);
   1.453  
   1.454      }
   1.455  }
     2.1 --- a/Server/MainForm.cs	Wed May 06 21:05:51 2015 +0200
     2.2 +++ b/Server/MainForm.cs	Wed May 06 21:56:21 2015 +0200
     2.3 @@ -43,6 +43,7 @@
     2.4  //
     2.5  using SharpDisplayClient;
     2.6  using SharpDisplay;
     2.7 +using MiniDisplayInterop;
     2.8  
     2.9  
    2.10  namespace SharpDisplayManager
    2.11 @@ -257,8 +258,8 @@
    2.12  		{
    2.13  			if (iDisplay.IsOpen())
    2.14  			{
    2.15 -				iDisplay.SetIconOnOff(Display.TMiniDisplayIconType.EMiniDisplayIconInternet, iNetworkManager.NetworkListManager.IsConnectedToInternet);
    2.16 -				iDisplay.SetIconOnOff(Display.TMiniDisplayIconType.EMiniDisplayIconNetworkSignal, iNetworkManager.NetworkListManager.IsConnected);
    2.17 +                iDisplay.SetIconOnOff(MiniDisplay.IconType.Internet, iNetworkManager.NetworkListManager.IsConnectedToInternet);
    2.18 +                iDisplay.SetIconOnOff(MiniDisplay.IconType.NetworkSignal, iNetworkManager.NetworkListManager.IsConnected);
    2.19  			}
    2.20  		}
    2.21  
    2.22 @@ -275,8 +276,8 @@
    2.23  			iUpdateCountSinceLastNetworkAnimation = iUpdateCountSinceLastNetworkAnimation % 4;
    2.24  
    2.25  			if (iDisplay.IsOpen() && iNetworkManager.NetworkListManager.IsConnected && iUpdateCountSinceLastNetworkAnimation==0)
    2.26 -			{				
    2.27 -				int iconCount=iDisplay.IconCount(Display.TMiniDisplayIconType.EMiniDisplayIconNetworkSignal);
    2.28 +			{
    2.29 +                int iconCount = iDisplay.IconCount(MiniDisplay.IconType.NetworkSignal);
    2.30  				if (iconCount <= 0)
    2.31  				{
    2.32  					//Prevents div by zero and other undefined behavior
    2.33 @@ -288,11 +289,11 @@
    2.34  				{
    2.35  					if (i < iLastNetworkIconIndex && !(i == 0 && iLastNetworkIconIndex > 3) && !(i == 1 && iLastNetworkIconIndex > 4))
    2.36  					{
    2.37 -						iDisplay.SetIconOn(Display.TMiniDisplayIconType.EMiniDisplayIconNetworkSignal,i);
    2.38 +                        iDisplay.SetIconOn(MiniDisplay.IconType.NetworkSignal, i);
    2.39  					}
    2.40  					else
    2.41  					{
    2.42 -						iDisplay.SetIconOff(Display.TMiniDisplayIconType.EMiniDisplayIconNetworkSignal,i);
    2.43 +                        iDisplay.SetIconOff(MiniDisplay.IconType.NetworkSignal, i);
    2.44  					}
    2.45  				}				
    2.46  			}
    2.47 @@ -393,7 +394,7 @@
    2.48  			if (iDisplay.IsOpen())
    2.49  			{
    2.50  				//First take care our our volume level icons
    2.51 -				int volumeIconCount = iDisplay.IconCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolume);
    2.52 +                int volumeIconCount = iDisplay.IconCount(MiniDisplay.IconType.Volume);
    2.53  				if (volumeIconCount > 0)
    2.54  				{					
    2.55  					//Compute current volume level from system level and the number of segments in our display volume bar.
    2.56 @@ -411,23 +412,23 @@
    2.57  							if (i == segmentOnCount - 1 && roundedUp)
    2.58  							{
    2.59  								//Half brightness
    2.60 -								iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconVolume, i, (iDisplay.IconStatusCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolume) - 1)/2);
    2.61 +                                iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i, (iDisplay.IconStatusCount(MiniDisplay.IconType.Volume) - 1) / 2);
    2.62  							}
    2.63  							else
    2.64  							{
    2.65  								//Full brightness
    2.66 -								iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconVolume, i, iDisplay.IconStatusCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolume) - 1);
    2.67 +                                iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i, iDisplay.IconStatusCount(MiniDisplay.IconType.Volume) - 1);
    2.68  							}
    2.69  						}
    2.70  						else
    2.71  						{
    2.72 -							iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconVolume, i, 0);
    2.73 +                            iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i, 0);
    2.74  						}
    2.75  					}
    2.76  				}
    2.77  
    2.78  				//Take care our our mute icon
    2.79 -				iDisplay.SetIconOnOff(Display.TMiniDisplayIconType.EMiniDisplayIconMute, iMultiMediaDevice.AudioEndpointVolume.Mute);
    2.80 +                iDisplay.SetIconOnOff(MiniDisplay.IconType.Mute, iMultiMediaDevice.AudioEndpointVolume.Mute);
    2.81  			}
    2.82  
    2.83  		}
    2.84 @@ -479,7 +480,7 @@
    2.85  
    2.86  			for (int i = 0; i < count; i++)
    2.87  			{
    2.88 -				comboBoxDisplayType.Items.Add(Display.TypeName((Display.TMiniDisplayType)i));
    2.89 +				comboBoxDisplayType.Items.Add(Display.TypeName((MiniDisplay.Type)i));
    2.90  			}
    2.91  		}
    2.92  
    2.93 @@ -682,13 +683,13 @@
    2.94              {
    2.95                  switch (iDisplay.AttemptRequestCompletion())
    2.96                  {
    2.97 -                    case Display.TMiniDisplayRequest.EMiniDisplayRequestFirmwareRevision:
    2.98 +                    case MiniDisplay.Request.FirmwareRevision:
    2.99                          toolStripStatusLabelConnect.Text += " v" + iDisplay.FirmwareRevision();
   2.100                          //Issue next request then
   2.101                          iDisplay.RequestPowerSupplyStatus();
   2.102                          break;
   2.103  
   2.104 -                    case Display.TMiniDisplayRequest.EMiniDisplayRequestPowerSupplyStatus:
   2.105 +                    case MiniDisplay.Request.PowerSupplyStatus:
   2.106                          if (iDisplay.PowerSupplyStatus())
   2.107                          {
   2.108                              toolStripStatusLabelPower.Text = "ON";
   2.109 @@ -701,7 +702,7 @@
   2.110                          iDisplay.RequestDeviceId();
   2.111                          break;
   2.112  
   2.113 -                    case Display.TMiniDisplayRequest.EMiniDisplayRequestDeviceId:
   2.114 +                    case MiniDisplay.Request.DeviceId:
   2.115                          toolStripStatusLabelConnect.Text += " - " + iDisplay.DeviceId();
   2.116                          //No more request to issue
   2.117                          break;
   2.118 @@ -865,7 +866,7 @@
   2.119          {
   2.120              CloseDisplayConnection();
   2.121  
   2.122 -            if (!iDisplay.Open((Display.TMiniDisplayType)cds.DisplayType))
   2.123 +            if (!iDisplay.Open((MiniDisplay.Type)cds.DisplayType))
   2.124              {   
   2.125  				UpdateStatus();               
   2.126  				toolStripStatusLabelConnect.Text = "Connection error";
   2.127 @@ -1074,15 +1075,15 @@
   2.128  
   2.129  				
   2.130  				//Check if Volume Label is supported. To date only MDM166AA supports that crap :)
   2.131 -				checkBoxShowVolumeLabel.Enabled = iDisplay.IconCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolumeLabel)>0;
   2.132 +				checkBoxShowVolumeLabel.Enabled = iDisplay.IconCount(MiniDisplay.IconType.VolumeLabel)>0;
   2.133  
   2.134  				if (cds.ShowVolumeLabel)
   2.135  				{
   2.136 -					iDisplay.SetIconOn(Display.TMiniDisplayIconType.EMiniDisplayIconVolumeLabel);
   2.137 +                    iDisplay.SetIconOn(MiniDisplay.IconType.VolumeLabel);
   2.138  				}
   2.139  				else
   2.140  				{
   2.141 -					iDisplay.SetIconOff(Display.TMiniDisplayIconType.EMiniDisplayIconVolumeLabel);
   2.142 +                    iDisplay.SetIconOff(MiniDisplay.IconType.VolumeLabel);
   2.143  				}
   2.144              }
   2.145              else
     3.1 --- a/Server/SharpDisplayManager.csproj	Wed May 06 21:05:51 2015 +0200
     3.2 +++ b/Server/SharpDisplayManager.csproj	Wed May 06 21:56:21 2015 +0200
     3.3 @@ -37,7 +37,7 @@
     3.4      <CreateDesktopShortcut>true</CreateDesktopShortcut>
     3.5      <PublishWizardCompleted>true</PublishWizardCompleted>
     3.6      <BootstrapperEnabled>true</BootstrapperEnabled>
     3.7 -    <NuGetPackageImportStamp>36fd58bc</NuGetPackageImportStamp>
     3.8 +    <NuGetPackageImportStamp>c59d0cd0</NuGetPackageImportStamp>
     3.9    </PropertyGroup>
    3.10    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    3.11      <PlatformTarget>AnyCPU</PlatformTarget>
    3.12 @@ -107,9 +107,9 @@
    3.13    <ItemGroup>
    3.14      <Reference Include="Microsoft.VisualBasic" />
    3.15      <Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
    3.16 -    <Reference Include="MiniDisplayInterop, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
    3.17 -      <SpecificVersion>False</SpecificVersion>
    3.18 -      <HintPath>..\packages\LibMiniDisplay.1.1.3\lib\MiniDisplayInterop.dll</HintPath>
    3.19 +    <Reference Include="MiniDisplayInterop">
    3.20 +      <HintPath>..\packages\LibMiniDisplay.1.1.4\lib\MiniDisplayInterop.dll</HintPath>
    3.21 +      <Private>True</Private>
    3.22      </Reference>
    3.23      <Reference Include="NAudio, Version=1.7.3.0, Culture=neutral, processorArchitecture=MSIL">
    3.24        <SpecificVersion>False</SpecificVersion>
    3.25 @@ -262,12 +262,12 @@
    3.26      </COMReference>
    3.27    </ItemGroup>
    3.28    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    3.29 -  <Import Project="..\packages\LibMiniDisplay.1.1.3\build\LibMiniDisplay.targets" Condition="Exists('..\packages\LibMiniDisplay.1.1.3\build\LibMiniDisplay.targets')" />
    3.30 +  <Import Project="..\packages\LibMiniDisplay.1.1.4\build\LibMiniDisplay.targets" Condition="Exists('..\packages\LibMiniDisplay.1.1.4\build\LibMiniDisplay.targets')" />
    3.31    <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    3.32      <PropertyGroup>
    3.33        <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    3.34      </PropertyGroup>
    3.35 -    <Error Condition="!Exists('..\packages\LibMiniDisplay.1.1.3\build\LibMiniDisplay.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibMiniDisplay.1.1.3\build\LibMiniDisplay.targets'))" />
    3.36 +    <Error Condition="!Exists('..\packages\LibMiniDisplay.1.1.4\build\LibMiniDisplay.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibMiniDisplay.1.1.4\build\LibMiniDisplay.targets'))" />
    3.37    </Target>
    3.38    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
    3.39         Other similar extension points exist, see Microsoft.Common.targets.
     4.1 --- a/Server/packages.config	Wed May 06 21:05:51 2015 +0200
     4.2 +++ b/Server/packages.config	Wed May 06 21:56:21 2015 +0200
     4.3 @@ -1,6 +1,6 @@
     4.4  <?xml version="1.0" encoding="utf-8"?>
     4.5  <packages>
     4.6 -  <package id="LibMiniDisplay" version="1.1.3" targetFramework="net45" />
     4.7 +  <package id="LibMiniDisplay" version="1.1.4" targetFramework="net45" />
     4.8    <package id="NAudio" version="1.7.3" targetFramework="net45" />
     4.9    <package id="SharpLibHid" version="1.0.7" targetFramework="net45" />
    4.10  </packages>
    4.11 \ No newline at end of file