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