Server/Display.cs
author StephaneLenclud
Wed, 18 Mar 2015 21:47:06 +0100
changeset 129 9d5867ce966a
parent 122 300f3d3114a8
child 135 2edc5da1796e
permissions -rw-r--r--
Looks like we have a solution for our bring to foreground problem.
StephaneLenclud@123
     1
//
StephaneLenclud@123
     2
// Copyright (C) 2014-2015 Stéphane Lenclud.
StephaneLenclud@123
     3
//
StephaneLenclud@123
     4
// This file is part of SharpDisplayManager.
StephaneLenclud@123
     5
//
StephaneLenclud@123
     6
// SharpDisplayManager is free software: you can redistribute it and/or modify
StephaneLenclud@123
     7
// it under the terms of the GNU General Public License as published by
StephaneLenclud@123
     8
// the Free Software Foundation, either version 3 of the License, or
StephaneLenclud@123
     9
// (at your option) any later version.
StephaneLenclud@123
    10
//
StephaneLenclud@123
    11
// SharpDisplayManager is distributed in the hope that it will be useful,
StephaneLenclud@123
    12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
StephaneLenclud@123
    13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
StephaneLenclud@123
    14
// GNU General Public License for more details.
StephaneLenclud@123
    15
//
StephaneLenclud@123
    16
// You should have received a copy of the GNU General Public License
StephaneLenclud@123
    17
// along with SharpDisplayManager.  If not, see <http://www.gnu.org/licenses/>.
StephaneLenclud@123
    18
//
StephaneLenclud@123
    19
StephaneLenclud@123
    20
using System;
sl@3
    21
using System.Collections.Generic;
sl@3
    22
using System.Linq;
sl@3
    23
using System.Text;
sl@3
    24
using System.Threading.Tasks;
sl@3
    25
//
sl@3
    26
using System.Runtime.InteropServices;
sl@46
    27
//using System.Runtime.Serialization;
sl@3
    28
sl@3
    29
namespace SharpDisplayManager
sl@3
    30
{
sl@46
    31
StephaneLenclud@104
    32
sl@44
    33
    /// <summary>
sl@44
    34
    /// Provide access to our display hardware through MiniDisplay API.
sl@44
    35
    /// </summary>
sl@46
    36
    public class Display
sl@3
    37
    {
StephaneLenclud@104
    38
		public delegate void OnOpenedHandler(Display aDisplay);
StephaneLenclud@104
    39
		public event OnOpenedHandler OnOpened;
StephaneLenclud@104
    40
StephaneLenclud@104
    41
		public delegate void OnClosedHandler(Display aDisplay);
StephaneLenclud@104
    42
		public event OnClosedHandler OnClosed;
StephaneLenclud@104
    43
StephaneLenclud@104
    44
		//Our display device handle
StephaneLenclud@104
    45
		IntPtr iDevice;
StephaneLenclud@104
    46
StephaneLenclud@104
    47
		//static functions
StephaneLenclud@104
    48
		public static int TypeCount()
StephaneLenclud@104
    49
		{
StephaneLenclud@104
    50
			return MiniDisplayTypeCount();
StephaneLenclud@104
    51
		}
StephaneLenclud@104
    52
StephaneLenclud@104
    53
		public static string TypeName(TMiniDisplayType aType)
StephaneLenclud@104
    54
		{
StephaneLenclud@104
    55
			IntPtr ptr = MiniDisplayTypeName(aType);
StephaneLenclud@104
    56
			string str = Marshal.PtrToStringUni(ptr);
StephaneLenclud@104
    57
			return str;
StephaneLenclud@104
    58
		}
sl@3
    59
sl@3
    60
        //Constructor
sl@3
    61
        public Display()
sl@3
    62
        {
sl@3
    63
            iDevice = IntPtr.Zero;
sl@3
    64
        }
sl@3
    65
sl@3
    66
        //
sl@39
    67
        public bool Open(TMiniDisplayType aType)
sl@3
    68
        {
StephaneLenclud@104
    69
			if (IsOpen())
StephaneLenclud@104
    70
			{
StephaneLenclud@104
    71
				//Already open return an error
StephaneLenclud@104
    72
				return false;
StephaneLenclud@104
    73
			}
StephaneLenclud@104
    74
StephaneLenclud@104
    75
            iDevice = MiniDisplayOpen(aType);
StephaneLenclud@104
    76
StephaneLenclud@104
    77
            bool success = iDevice != IntPtr.Zero;
StephaneLenclud@104
    78
			if (success)
StephaneLenclud@104
    79
			{
StephaneLenclud@104
    80
				//Broadcast opened event
StephaneLenclud@104
    81
				OnOpened(this);
StephaneLenclud@104
    82
			}
StephaneLenclud@104
    83
StephaneLenclud@104
    84
			return success;
sl@3
    85
        }
sl@3
    86
sl@3
    87
        public void Close()
sl@3
    88
        {
StephaneLenclud@104
    89
			if (!IsOpen())
StephaneLenclud@104
    90
			{
StephaneLenclud@104
    91
				//Pointless
StephaneLenclud@104
    92
				return;
StephaneLenclud@104
    93
			}
StephaneLenclud@104
    94
StephaneLenclud@105
    95
			//
sl@3
    96
            MiniDisplayClose(iDevice);
sl@3
    97
            iDevice = IntPtr.Zero;
StephaneLenclud@104
    98
			//Broadcast closed event
StephaneLenclud@104
    99
			OnClosed(this);
sl@3
   100
        }
sl@3
   101
sl@3
   102
        public bool IsOpen()
sl@3
   103
        {
sl@3
   104
            return iDevice != IntPtr.Zero;
sl@3
   105
        }
sl@3
   106
sl@3
   107
        public void Clear()
sl@3
   108
        {
sl@3
   109
            MiniDisplayClear(iDevice);
sl@3
   110
        }
sl@3
   111
sl@3
   112
        public void Fill()
sl@3
   113
        {
sl@3
   114
            MiniDisplayFill(iDevice);
sl@3
   115
        }
sl@3
   116
sl@3
   117
        public void SwapBuffers()
sl@3
   118
        {
sl@3
   119
            MiniDisplaySwapBuffers(iDevice);
sl@3
   120
        }
sl@3
   121
sl@3
   122
        public int MaxBrightness()
sl@3
   123
        {
sl@3
   124
            return MiniDisplayMaxBrightness(iDevice);
sl@3
   125
        }
sl@3
   126
sl@3
   127
        public int MinBrightness()
sl@3
   128
        {
sl@3
   129
            return MiniDisplayMinBrightness(iDevice);
sl@3
   130
        }
sl@3
   131
sl@3
   132
        public void SetBrightness(int aBrightness)
sl@3
   133
        {
sl@3
   134
            if (!IsOpen()) return;
sl@3
   135
sl@3
   136
            MiniDisplaySetBrightness(iDevice, aBrightness);
sl@3
   137
        }
sl@3
   138
sl@4
   139
        public int WidthInPixels()
sl@4
   140
        {
sl@4
   141
            return MiniDisplayWidthInPixels(iDevice);
sl@4
   142
        }
sl@4
   143
sl@4
   144
        public int HeightInPixels()
sl@4
   145
        {
sl@4
   146
            return MiniDisplayHeightInPixels(iDevice);
sl@4
   147
        }
sl@4
   148
sl@57
   149
        public void SetPixel(int aX, int aY, uint aValue)
sl@4
   150
        {
sl@4
   151
            MiniDisplaySetPixel(iDevice,aX,aY,aValue);
sl@4
   152
        }
sl@4
   153
sl@12
   154
        public void RequestPowerSupplyStatus()
sl@12
   155
        {
sl@44
   156
            MiniDisplayRequest(iDevice, TMiniDisplayRequest.EMiniDisplayRequestPowerSupplyStatus);
sl@12
   157
        }
sl@12
   158
sl@12
   159
        public void RequestDeviceId()
sl@12
   160
        {
sl@44
   161
            MiniDisplayRequest(iDevice, TMiniDisplayRequest.EMiniDisplayRequestDeviceId);
sl@12
   162
        }
sl@12
   163
sl@12
   164
        public void RequestFirmwareRevision()
sl@12
   165
        {
sl@44
   166
            MiniDisplayRequest(iDevice, TMiniDisplayRequest.EMiniDisplayRequestFirmwareRevision);
sl@12
   167
        }
sl@12
   168
sl@52
   169
        public void PowerOn()
sl@52
   170
        {
sl@52
   171
            MiniDisplayPowerOn(iDevice);
sl@52
   172
        }
sl@52
   173
sl@52
   174
        public void PowerOff()
sl@52
   175
        {
sl@52
   176
            MiniDisplayPowerOff(iDevice);
sl@52
   177
        }
sl@52
   178
sl@52
   179
        public bool SupportPowerOnOff()
sl@52
   180
        {
sl@52
   181
            return MiniDisplaySupportPowerOnOff(iDevice);
sl@52
   182
        }
sl@52
   183
sl@53
   184
        public void ShowClock()
sl@53
   185
        {
sl@53
   186
            MiniDisplayShowClock(iDevice);
sl@53
   187
        }
sl@53
   188
sl@53
   189
        public void HideClock()
sl@53
   190
        {
sl@53
   191
            MiniDisplayHideClock(iDevice);
sl@53
   192
        }
sl@53
   193
sl@53
   194
        public bool SupportClock()
sl@53
   195
        {
sl@53
   196
            return MiniDisplaySupportClock(iDevice);
sl@53
   197
        }
sl@53
   198
sl@12
   199
        public bool PowerSupplyStatus()
sl@12
   200
        {
sl@12
   201
            bool res = MiniDisplayPowerSupplyStatus(iDevice);
sl@12
   202
            return res;
sl@12
   203
        }
sl@12
   204
sl@12
   205
        public TMiniDisplayRequest AttemptRequestCompletion()
sl@12
   206
        {
sl@12
   207
            return MiniDisplayAttemptRequestCompletion(iDevice);
sl@12
   208
        }
sl@12
   209
sl@12
   210
        public TMiniDisplayRequest CurrentRequest()
sl@12
   211
        {
sl@12
   212
            return MiniDisplayCurrentRequest(iDevice);
sl@12
   213
        }
sl@12
   214
sl@12
   215
        public bool IsRequestPending()
sl@12
   216
        {
sl@12
   217
            return CurrentRequest() != TMiniDisplayRequest.EMiniDisplayRequestNone;
sl@12
   218
        }
sl@12
   219
StephaneLenclud@108
   220
		//
StephaneLenclud@109
   221
		public int IconCount(TMiniDisplayIconType aIcon)
StephaneLenclud@108
   222
		{
StephaneLenclud@109
   223
			return MiniDisplayIconCount(iDevice,aIcon);
StephaneLenclud@108
   224
		}
StephaneLenclud@108
   225
StephaneLenclud@109
   226
		public int IconStatusCount(TMiniDisplayIconType aIcon)
StephaneLenclud@108
   227
		{
StephaneLenclud@109
   228
			return MiniDisplayIconStatusCount(iDevice, aIcon);
StephaneLenclud@108
   229
		}
StephaneLenclud@108
   230
StephaneLenclud@109
   231
		public void SetIconStatus(TMiniDisplayIconType aIcon, int aIndex, int aStatus)
StephaneLenclud@108
   232
		{
StephaneLenclud@109
   233
			MiniDisplaySetIconStatus(iDevice, aIcon, aIndex, aStatus);
StephaneLenclud@108
   234
		}
StephaneLenclud@108
   235
StephaneLenclud@118
   236
		public void SetIconOn(TMiniDisplayIconType aIcon, int aIndex)
StephaneLenclud@118
   237
		{
StephaneLenclud@118
   238
			MiniDisplaySetIconStatus(iDevice, aIcon, aIndex, IconStatusCount(aIcon) - 1);
StephaneLenclud@118
   239
		}
StephaneLenclud@118
   240
StephaneLenclud@118
   241
		public void SetIconOff(TMiniDisplayIconType aIcon, int aIndex)
StephaneLenclud@118
   242
		{
StephaneLenclud@118
   243
			MiniDisplaySetIconStatus(iDevice, aIcon, aIndex, 0);
StephaneLenclud@118
   244
		}
StephaneLenclud@118
   245
StephaneLenclud@118
   246
StephaneLenclud@109
   247
		public void SetAllIconsStatus(int aStatus)
StephaneLenclud@108
   248
		{
StephaneLenclud@109
   249
			foreach (TMiniDisplayIconType icon in Enum.GetValues(typeof(TMiniDisplayIconType)))
StephaneLenclud@109
   250
			{
StephaneLenclud@109
   251
				int count=IconCount(icon);
StephaneLenclud@109
   252
				for (int i = 0; i < count; i++)
StephaneLenclud@109
   253
				{
StephaneLenclud@109
   254
					SetIconStatus(icon,i,aStatus);
StephaneLenclud@109
   255
				}
StephaneLenclud@109
   256
			}
StephaneLenclud@108
   257
		}
StephaneLenclud@108
   258
StephaneLenclud@115
   259
		/// <summary>
StephaneLenclud@116
   260
		/// Set all elements of an icon to the given status.
StephaneLenclud@115
   261
		/// </summary>
StephaneLenclud@115
   262
		/// <param name="aIcon"></param>
StephaneLenclud@115
   263
		/// <param name="aStatus"></param>
StephaneLenclud@115
   264
		public void SetIconStatus(TMiniDisplayIconType aIcon, int aStatus)
StephaneLenclud@115
   265
		{
StephaneLenclud@115
   266
			int iconCount = IconCount(aIcon);
StephaneLenclud@115
   267
			for (int i = 0; i < iconCount; i++)
StephaneLenclud@115
   268
			{
StephaneLenclud@115
   269
				SetIconStatus(aIcon, i, aStatus);
StephaneLenclud@115
   270
			}
StephaneLenclud@115
   271
		}
StephaneLenclud@115
   272
StephaneLenclud@115
   273
		/// <summary>
StephaneLenclud@116
   274
		/// Set all elements of an icon to be either on or off.
StephaneLenclud@116
   275
		/// </summary>
StephaneLenclud@116
   276
		/// <param name="aIcon"></param>
StephaneLenclud@116
   277
		/// <param name="aOn"></param>		
StephaneLenclud@116
   278
		public void SetIconOnOff(TMiniDisplayIconType aIcon, bool aOn)
StephaneLenclud@116
   279
		{
StephaneLenclud@116
   280
			if (aOn)
StephaneLenclud@116
   281
			{
StephaneLenclud@116
   282
				SetIconOn(aIcon);
StephaneLenclud@116
   283
			}
StephaneLenclud@116
   284
			else
StephaneLenclud@116
   285
			{
StephaneLenclud@116
   286
				SetIconOff(aIcon);
StephaneLenclud@116
   287
			}
StephaneLenclud@116
   288
		}
StephaneLenclud@116
   289
StephaneLenclud@116
   290
		/// <summary>
StephaneLenclud@116
   291
		/// Set all elements of an icon to there maximum status.
StephaneLenclud@115
   292
		/// </summary>
StephaneLenclud@115
   293
		/// <param name="aIcon"></param>
StephaneLenclud@115
   294
		public void SetIconOn(TMiniDisplayIconType aIcon)
StephaneLenclud@115
   295
		{
StephaneLenclud@115
   296
			int iconCount = IconCount(aIcon);
StephaneLenclud@115
   297
			for (int i = 0; i < iconCount; i++)
StephaneLenclud@115
   298
			{
StephaneLenclud@115
   299
				SetIconStatus(aIcon, i, IconStatusCount(aIcon) - 1);
StephaneLenclud@115
   300
			}
StephaneLenclud@115
   301
		}
StephaneLenclud@115
   302
StephaneLenclud@115
   303
		/// <summary>
StephaneLenclud@116
   304
		/// Turn off all elements of an icon.
StephaneLenclud@115
   305
		/// </summary>
StephaneLenclud@115
   306
		/// <param name="aIcon"></param>
StephaneLenclud@115
   307
		public void SetIconOff(TMiniDisplayIconType aIcon)
StephaneLenclud@115
   308
		{
StephaneLenclud@115
   309
			int iconCount = IconCount(aIcon);
StephaneLenclud@115
   310
			for (int i = 0; i < iconCount; i++)
StephaneLenclud@115
   311
			{
StephaneLenclud@115
   312
				SetIconStatus(aIcon, i, 0);
StephaneLenclud@115
   313
			}
StephaneLenclud@115
   314
		}
StephaneLenclud@115
   315
StephaneLenclud@108
   316
sl@12
   317
sl@10
   318
        public string Vendor()
sl@10
   319
        {
sl@10
   320
            IntPtr ptr = MiniDisplayVendor(iDevice);
sl@10
   321
            string str = Marshal.PtrToStringUni(ptr);
sl@10
   322
            return str;
sl@10
   323
        }
sl@4
   324
sl@10
   325
        public string Product()
sl@10
   326
        {
sl@10
   327
            IntPtr ptr = MiniDisplayProduct(iDevice);
sl@10
   328
            string str = Marshal.PtrToStringUni(ptr);
sl@10
   329
            return str;
sl@10
   330
        }
sl@10
   331
sl@10
   332
        public string SerialNumber()
sl@10
   333
        {
sl@10
   334
            IntPtr ptr = MiniDisplaySerialNumber(iDevice);
sl@10
   335
            string str = Marshal.PtrToStringUni(ptr);
sl@10
   336
            return str;
sl@10
   337
        }
sl@4
   338
sl@12
   339
        public string DeviceId()
sl@12
   340
        {
sl@12
   341
            IntPtr ptr = MiniDisplayDeviceId(iDevice);
sl@12
   342
            string str = Marshal.PtrToStringAnsi(ptr);
sl@12
   343
            return str;
sl@12
   344
        }
sl@12
   345
sl@12
   346
        public string FirmwareRevision()
sl@12
   347
        {
sl@12
   348
            IntPtr ptr = MiniDisplayFirmwareRevision(iDevice);
sl@12
   349
            string str = Marshal.PtrToStringAnsi(ptr);
sl@12
   350
            return str;
sl@12
   351
        }
sl@12
   352
sl@46
   353
        //[Serializable]
sl@39
   354
        public enum TMiniDisplayType
sl@39
   355
        {
sl@39
   356
            EMiniDisplayAutoDetect, /*Not yet implemented*/
sl@46
   357
            //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")]
sl@39
   358
            EMiniDisplayFutabaGP1212A01,
sl@46
   359
            //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")]
sl@39
   360
            EMiniDisplayFutabaGP1212A02
sl@39
   361
        };
sl@39
   362
StephaneLenclud@109
   363
		/// <summary>
StephaneLenclud@109
   364
		/// 
StephaneLenclud@109
   365
		/// </summary>
sl@10
   366
        public enum TMiniDisplayRequest
sl@10
   367
        {
sl@10
   368
            EMiniDisplayRequestNone,
sl@10
   369
            EMiniDisplayRequestDeviceId,
sl@10
   370
            EMiniDisplayRequestFirmwareRevision,
sl@10
   371
            EMiniDisplayRequestPowerSupplyStatus
sl@39
   372
        };
sl@10
   373
StephaneLenclud@109
   374
			
StephaneLenclud@109
   375
		/// <summary>
StephaneLenclud@109
   376
		/// Define the various type of icons we support.
StephaneLenclud@109
   377
		/// For binary compatibility new entries must be added at the end.
StephaneLenclud@109
   378
		/// </summary>
StephaneLenclud@109
   379
		public enum TMiniDisplayIconType
StephaneLenclud@109
   380
		{
StephaneLenclud@118
   381
			EMiniDisplayIconNetworkSignal=0,
StephaneLenclud@118
   382
			EMiniDisplayIconInternet,
StephaneLenclud@109
   383
			EMiniDisplayIconEmail,
StephaneLenclud@109
   384
			EMiniDisplayIconMute,
StephaneLenclud@109
   385
			EMiniDisplayIconVolume,
StephaneLenclud@109
   386
			EMiniDisplayIconVolumeLabel,
StephaneLenclud@109
   387
			EMiniDisplayIconPlay,
StephaneLenclud@109
   388
			EMiniDisplayIconPause,
StephaneLenclud@109
   389
			EMiniDisplayIconRecording
StephaneLenclud@109
   390
		};
StephaneLenclud@109
   391
sl@3
   392
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@39
   393
        public static extern IntPtr MiniDisplayOpen(TMiniDisplayType aType);
sl@3
   394
sl@3
   395
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   396
        public static extern void MiniDisplayClose(IntPtr aDevice);
sl@3
   397
StephaneLenclud@104
   398
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@104
   399
		public static extern int MiniDisplayTypeCount();
StephaneLenclud@104
   400
StephaneLenclud@104
   401
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@104
   402
		public static extern IntPtr MiniDisplayTypeName(TMiniDisplayType aType);
StephaneLenclud@104
   403
sl@3
   404
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   405
        public static extern void MiniDisplayClear(IntPtr aDevice);
sl@3
   406
sl@3
   407
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   408
        public static extern void MiniDisplayFill(IntPtr aDevice);
sl@3
   409
sl@3
   410
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   411
        public static extern void MiniDisplaySwapBuffers(IntPtr aDevice);
sl@3
   412
sl@3
   413
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   414
        public static extern void MiniDisplaySetBrightness(IntPtr aDevice, int aBrightness);
sl@3
   415
sl@3
   416
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   417
        public static extern int MiniDisplayMinBrightness(IntPtr aDevice);
sl@3
   418
sl@3
   419
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   420
        public static extern int MiniDisplayMaxBrightness(IntPtr aDevice);
sl@3
   421
sl@4
   422
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@4
   423
        public static extern int MiniDisplayWidthInPixels(IntPtr aDevice);
sl@4
   424
sl@4
   425
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@4
   426
        public static extern int MiniDisplayHeightInPixels(IntPtr aDevice);
sl@4
   427
sl@4
   428
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@57
   429
        public static extern int MiniDisplaySetPixel(IntPtr aDevice, int aX, int aY, uint aValue);
sl@4
   430
sl@10
   431
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   432
        public static extern IntPtr MiniDisplayVendor(IntPtr aDevice);
sl@10
   433
sl@10
   434
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   435
        public static extern IntPtr MiniDisplayProduct(IntPtr aDevice);
sl@10
   436
sl@10
   437
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   438
        public static extern IntPtr MiniDisplaySerialNumber(IntPtr aDevice);
sl@10
   439
sl@10
   440
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   441
        public static extern IntPtr MiniDisplayDeviceId(IntPtr aDevice);
sl@10
   442
sl@10
   443
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   444
        public static extern IntPtr MiniDisplayFirmwareRevision(IntPtr aDevice);
sl@10
   445
sl@10
   446
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@12
   447
        [return: MarshalAs(UnmanagedType.I1)]
sl@10
   448
        public static extern bool MiniDisplayPowerSupplyStatus(IntPtr aDevice);
sl@10
   449
sl@10
   450
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@44
   451
        public static extern void MiniDisplayRequest(IntPtr aDevice, TMiniDisplayRequest aRequest);
sl@10
   452
sl@10
   453
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   454
        public static extern TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(IntPtr aDevice);
sl@10
   455
sl@10
   456
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   457
        public static extern TMiniDisplayRequest MiniDisplayCurrentRequest(IntPtr aDevice);
sl@10
   458
sl@10
   459
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   460
        public static extern void MiniDisplayCancelRequest(IntPtr aDevice);
sl@10
   461
sl@52
   462
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@52
   463
        public static extern void MiniDisplayPowerOn(IntPtr aDevice);
sl@52
   464
sl@52
   465
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@52
   466
        public static extern void MiniDisplayPowerOff(IntPtr aDevice);
sl@52
   467
sl@52
   468
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@52
   469
        [return: MarshalAs(UnmanagedType.I1)]
sl@52
   470
        public static extern bool MiniDisplaySupportPowerOnOff(IntPtr aDevice);
sl@10
   471
sl@53
   472
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@53
   473
        public static extern void MiniDisplayShowClock(IntPtr aDevice);
sl@53
   474
sl@53
   475
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@53
   476
        public static extern void MiniDisplayHideClock(IntPtr aDevice);
sl@53
   477
sl@53
   478
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@53
   479
        [return: MarshalAs(UnmanagedType.I1)]
sl@53
   480
        public static extern bool MiniDisplaySupportClock(IntPtr aDevice);
sl@53
   481
StephaneLenclud@108
   482
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@109
   483
		public static extern int MiniDisplayIconCount(IntPtr aDevice, TMiniDisplayIconType aIcon);
StephaneLenclud@108
   484
StephaneLenclud@108
   485
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@109
   486
		public static extern int MiniDisplayIconStatusCount(IntPtr aDevice, TMiniDisplayIconType aIcon);
StephaneLenclud@108
   487
		
StephaneLenclud@108
   488
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@109
   489
		public static extern void MiniDisplaySetIconStatus(IntPtr aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus);
sl@53
   490
sl@3
   491
    }
sl@3
   492
}