Server/Display.cs
author StephaneLenclud
Mon, 09 Feb 2015 18:25:14 +0100
changeset 117 9e48cc704a69
parent 115 5c61a13c4241
child 118 606c22398045
permissions -rw-r--r--
Adding basic support for networks.
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@109
   221
		public void SetAllIconsStatus(int aStatus)
StephaneLenclud@108
   222
		{
StephaneLenclud@109
   223
			foreach (TMiniDisplayIconType icon in Enum.GetValues(typeof(TMiniDisplayIconType)))
StephaneLenclud@109
   224
			{
StephaneLenclud@109
   225
				int count=IconCount(icon);
StephaneLenclud@109
   226
				for (int i = 0; i < count; i++)
StephaneLenclud@109
   227
				{
StephaneLenclud@109
   228
					SetIconStatus(icon,i,aStatus);
StephaneLenclud@109
   229
				}
StephaneLenclud@109
   230
			}
StephaneLenclud@109
   231
StephaneLenclud@108
   232
		}
StephaneLenclud@108
   233
StephaneLenclud@115
   234
		/// <summary>
StephaneLenclud@116
   235
		/// Set all elements of an icon to the given status.
StephaneLenclud@115
   236
		/// </summary>
StephaneLenclud@115
   237
		/// <param name="aIcon"></param>
StephaneLenclud@115
   238
		/// <param name="aStatus"></param>
StephaneLenclud@115
   239
		public void SetIconStatus(TMiniDisplayIconType aIcon, int aStatus)
StephaneLenclud@115
   240
		{
StephaneLenclud@115
   241
			int iconCount = IconCount(aIcon);
StephaneLenclud@115
   242
			for (int i = 0; i < iconCount; i++)
StephaneLenclud@115
   243
			{
StephaneLenclud@115
   244
				SetIconStatus(aIcon, i, aStatus);
StephaneLenclud@115
   245
			}
StephaneLenclud@115
   246
		}
StephaneLenclud@115
   247
StephaneLenclud@115
   248
		/// <summary>
StephaneLenclud@116
   249
		/// Set all elements of an icon to be either on or off.
StephaneLenclud@116
   250
		/// </summary>
StephaneLenclud@116
   251
		/// <param name="aIcon"></param>
StephaneLenclud@116
   252
		/// <param name="aOn"></param>		
StephaneLenclud@116
   253
		public void SetIconOnOff(TMiniDisplayIconType aIcon, bool aOn)
StephaneLenclud@116
   254
		{
StephaneLenclud@116
   255
			if (aOn)
StephaneLenclud@116
   256
			{
StephaneLenclud@116
   257
				SetIconOn(aIcon);
StephaneLenclud@116
   258
			}
StephaneLenclud@116
   259
			else
StephaneLenclud@116
   260
			{
StephaneLenclud@116
   261
				SetIconOff(aIcon);
StephaneLenclud@116
   262
			}
StephaneLenclud@116
   263
		}
StephaneLenclud@116
   264
StephaneLenclud@116
   265
		/// <summary>
StephaneLenclud@116
   266
		/// Set all elements of an icon to there maximum status.
StephaneLenclud@115
   267
		/// </summary>
StephaneLenclud@115
   268
		/// <param name="aIcon"></param>
StephaneLenclud@115
   269
		public void SetIconOn(TMiniDisplayIconType aIcon)
StephaneLenclud@115
   270
		{
StephaneLenclud@115
   271
			int iconCount = IconCount(aIcon);
StephaneLenclud@115
   272
			for (int i = 0; i < iconCount; i++)
StephaneLenclud@115
   273
			{
StephaneLenclud@115
   274
				SetIconStatus(aIcon, i, IconStatusCount(aIcon) - 1);
StephaneLenclud@115
   275
			}
StephaneLenclud@115
   276
		}
StephaneLenclud@115
   277
StephaneLenclud@115
   278
		/// <summary>
StephaneLenclud@116
   279
		/// Turn off all elements of an icon.
StephaneLenclud@115
   280
		/// </summary>
StephaneLenclud@115
   281
		/// <param name="aIcon"></param>
StephaneLenclud@115
   282
		public void SetIconOff(TMiniDisplayIconType aIcon)
StephaneLenclud@115
   283
		{
StephaneLenclud@115
   284
			int iconCount = IconCount(aIcon);
StephaneLenclud@115
   285
			for (int i = 0; i < iconCount; i++)
StephaneLenclud@115
   286
			{
StephaneLenclud@115
   287
				SetIconStatus(aIcon, i, 0);
StephaneLenclud@115
   288
			}
StephaneLenclud@115
   289
		}
StephaneLenclud@115
   290
StephaneLenclud@108
   291
sl@12
   292
sl@10
   293
        public string Vendor()
sl@10
   294
        {
sl@10
   295
            IntPtr ptr = MiniDisplayVendor(iDevice);
sl@10
   296
            string str = Marshal.PtrToStringUni(ptr);
sl@10
   297
            return str;
sl@10
   298
        }
sl@4
   299
sl@10
   300
        public string Product()
sl@10
   301
        {
sl@10
   302
            IntPtr ptr = MiniDisplayProduct(iDevice);
sl@10
   303
            string str = Marshal.PtrToStringUni(ptr);
sl@10
   304
            return str;
sl@10
   305
        }
sl@10
   306
sl@10
   307
        public string SerialNumber()
sl@10
   308
        {
sl@10
   309
            IntPtr ptr = MiniDisplaySerialNumber(iDevice);
sl@10
   310
            string str = Marshal.PtrToStringUni(ptr);
sl@10
   311
            return str;
sl@10
   312
        }
sl@4
   313
sl@12
   314
        public string DeviceId()
sl@12
   315
        {
sl@12
   316
            IntPtr ptr = MiniDisplayDeviceId(iDevice);
sl@12
   317
            string str = Marshal.PtrToStringAnsi(ptr);
sl@12
   318
            return str;
sl@12
   319
        }
sl@12
   320
sl@12
   321
        public string FirmwareRevision()
sl@12
   322
        {
sl@12
   323
            IntPtr ptr = MiniDisplayFirmwareRevision(iDevice);
sl@12
   324
            string str = Marshal.PtrToStringAnsi(ptr);
sl@12
   325
            return str;
sl@12
   326
        }
sl@12
   327
sl@46
   328
        //[Serializable]
sl@39
   329
        public enum TMiniDisplayType
sl@39
   330
        {
sl@39
   331
            EMiniDisplayAutoDetect, /*Not yet implemented*/
sl@46
   332
            //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")]
sl@39
   333
            EMiniDisplayFutabaGP1212A01,
sl@46
   334
            //[EnumMember(Value = "EMiniDisplayFutabaGP1212A01")]
sl@39
   335
            EMiniDisplayFutabaGP1212A02
sl@39
   336
        };
sl@39
   337
StephaneLenclud@109
   338
		/// <summary>
StephaneLenclud@109
   339
		/// 
StephaneLenclud@109
   340
		/// </summary>
sl@10
   341
        public enum TMiniDisplayRequest
sl@10
   342
        {
sl@10
   343
            EMiniDisplayRequestNone,
sl@10
   344
            EMiniDisplayRequestDeviceId,
sl@10
   345
            EMiniDisplayRequestFirmwareRevision,
sl@10
   346
            EMiniDisplayRequestPowerSupplyStatus
sl@39
   347
        };
sl@10
   348
StephaneLenclud@109
   349
			
StephaneLenclud@109
   350
		/// <summary>
StephaneLenclud@109
   351
		/// Define the various type of icons we support.
StephaneLenclud@109
   352
		/// For binary compatibility new entries must be added at the end.
StephaneLenclud@109
   353
		/// </summary>
StephaneLenclud@109
   354
		public enum TMiniDisplayIconType
StephaneLenclud@109
   355
		{
StephaneLenclud@109
   356
			EMiniDisplayIconNetwork=0,
StephaneLenclud@109
   357
			EMiniDisplayIconEmail,
StephaneLenclud@109
   358
			EMiniDisplayIconMute,
StephaneLenclud@109
   359
			EMiniDisplayIconVolume,
StephaneLenclud@109
   360
			EMiniDisplayIconVolumeLabel,
StephaneLenclud@109
   361
			EMiniDisplayIconPlay,
StephaneLenclud@109
   362
			EMiniDisplayIconPause,
StephaneLenclud@109
   363
			EMiniDisplayIconRecording
StephaneLenclud@109
   364
		};
StephaneLenclud@109
   365
sl@3
   366
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@39
   367
        public static extern IntPtr MiniDisplayOpen(TMiniDisplayType aType);
sl@3
   368
sl@3
   369
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   370
        public static extern void MiniDisplayClose(IntPtr aDevice);
sl@3
   371
StephaneLenclud@104
   372
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@104
   373
		public static extern int MiniDisplayTypeCount();
StephaneLenclud@104
   374
StephaneLenclud@104
   375
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@104
   376
		public static extern IntPtr MiniDisplayTypeName(TMiniDisplayType aType);
StephaneLenclud@104
   377
sl@3
   378
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   379
        public static extern void MiniDisplayClear(IntPtr aDevice);
sl@3
   380
sl@3
   381
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   382
        public static extern void MiniDisplayFill(IntPtr aDevice);
sl@3
   383
sl@3
   384
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   385
        public static extern void MiniDisplaySwapBuffers(IntPtr aDevice);
sl@3
   386
sl@3
   387
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   388
        public static extern void MiniDisplaySetBrightness(IntPtr aDevice, int aBrightness);
sl@3
   389
sl@3
   390
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   391
        public static extern int MiniDisplayMinBrightness(IntPtr aDevice);
sl@3
   392
sl@3
   393
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@3
   394
        public static extern int MiniDisplayMaxBrightness(IntPtr aDevice);
sl@3
   395
sl@4
   396
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@4
   397
        public static extern int MiniDisplayWidthInPixels(IntPtr aDevice);
sl@4
   398
sl@4
   399
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@4
   400
        public static extern int MiniDisplayHeightInPixels(IntPtr aDevice);
sl@4
   401
sl@4
   402
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@57
   403
        public static extern int MiniDisplaySetPixel(IntPtr aDevice, int aX, int aY, uint aValue);
sl@4
   404
sl@10
   405
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   406
        public static extern IntPtr MiniDisplayVendor(IntPtr aDevice);
sl@10
   407
sl@10
   408
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   409
        public static extern IntPtr MiniDisplayProduct(IntPtr aDevice);
sl@10
   410
sl@10
   411
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   412
        public static extern IntPtr MiniDisplaySerialNumber(IntPtr aDevice);
sl@10
   413
sl@10
   414
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   415
        public static extern IntPtr MiniDisplayDeviceId(IntPtr aDevice);
sl@10
   416
sl@10
   417
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   418
        public static extern IntPtr MiniDisplayFirmwareRevision(IntPtr aDevice);
sl@10
   419
sl@10
   420
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@12
   421
        [return: MarshalAs(UnmanagedType.I1)]
sl@10
   422
        public static extern bool MiniDisplayPowerSupplyStatus(IntPtr aDevice);
sl@10
   423
sl@10
   424
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@44
   425
        public static extern void MiniDisplayRequest(IntPtr aDevice, TMiniDisplayRequest aRequest);
sl@10
   426
sl@10
   427
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   428
        public static extern TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(IntPtr aDevice);
sl@10
   429
sl@10
   430
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   431
        public static extern TMiniDisplayRequest MiniDisplayCurrentRequest(IntPtr aDevice);
sl@10
   432
sl@10
   433
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@10
   434
        public static extern void MiniDisplayCancelRequest(IntPtr aDevice);
sl@10
   435
sl@52
   436
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@52
   437
        public static extern void MiniDisplayPowerOn(IntPtr aDevice);
sl@52
   438
sl@52
   439
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@52
   440
        public static extern void MiniDisplayPowerOff(IntPtr aDevice);
sl@52
   441
sl@52
   442
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@52
   443
        [return: MarshalAs(UnmanagedType.I1)]
sl@52
   444
        public static extern bool MiniDisplaySupportPowerOnOff(IntPtr aDevice);
sl@10
   445
sl@53
   446
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@53
   447
        public static extern void MiniDisplayShowClock(IntPtr aDevice);
sl@53
   448
sl@53
   449
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@53
   450
        public static extern void MiniDisplayHideClock(IntPtr aDevice);
sl@53
   451
sl@53
   452
        [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
sl@53
   453
        [return: MarshalAs(UnmanagedType.I1)]
sl@53
   454
        public static extern bool MiniDisplaySupportClock(IntPtr aDevice);
sl@53
   455
StephaneLenclud@108
   456
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@109
   457
		public static extern int MiniDisplayIconCount(IntPtr aDevice, TMiniDisplayIconType aIcon);
StephaneLenclud@108
   458
StephaneLenclud@108
   459
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@109
   460
		public static extern int MiniDisplayIconStatusCount(IntPtr aDevice, TMiniDisplayIconType aIcon);
StephaneLenclud@108
   461
		
StephaneLenclud@108
   462
		[DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
StephaneLenclud@109
   463
		public static extern void MiniDisplaySetIconStatus(IntPtr aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus);
sl@53
   464
sl@3
   465
    }
sl@3
   466
}