Adding C# interop project and NuGet package.
2 // Copyright (C) 2014-2015 Stéphane Lenclud.
4 // This file is part of MiniDisplay.
6 // MiniDisplay is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // MiniDisplay is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with MiniDisplay. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef MINI_DISPLAY_H
21 #define MINI_DISPLAY_H
23 /* Cmake will define MyLibrary_EXPORTS on Windows when it
24 configures to build a shared library. If you are going to use
25 another build system on windows or create the visual studio
26 projects by hand you need to define MyLibrary_EXPORTS when
27 building a DLL on windows.
29 // We are using the Visual Studio Compiler and building Shared libraries
32 #if defined(MiniDisplay_EXPORTS)
33 #define MDAPI __declspec(dllexport)
35 #define MDAPI __declspec(dllimport)
36 #endif /* MyLibrary_EXPORTS */
37 #else /* defined (_WIN32) */
41 typedef void* MiniDisplayDevice;
45 EMiniDisplayAutoDetect=0,
46 EMiniDisplayFutabaGP1212A01,
47 EMiniDisplayFutabaGP1212A02,
48 EMiniDisplayFutabaMDM166AA,
49 EMiniDisplayAutoDetectFailed
55 EMiniDisplayRequestNone=0,
56 EMiniDisplayRequestDeviceId,
57 EMiniDisplayRequestFirmwareRevision,
58 EMiniDisplayRequestPowerSupplyStatus
63 Define the various type of icons we support.
64 For binary compatibility new entries must be added at the end.
68 EMiniDisplayIconNetworkSignal=0,
69 EMiniDisplayIconInternet,
70 EMiniDisplayIconEmail,
72 EMiniDisplayIconVolume,
73 EMiniDisplayIconVolumeLabel,
75 EMiniDisplayIconPause,
76 EMiniDisplayIconRecording
81 Attempt to establish a connection to with a display of the given type.
82 Supports display auto-detection too.
84 @param [IN] The display type we want to connect to.
85 @return Handle to the device we connected to on success, null otherwise.
87 extern "C" MDAPI MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType);
90 Close the connection with the given display device.
92 @param [IN] The device to apply this command to.
94 extern "C" MDAPI void MiniDisplayClose(MiniDisplayDevice aDevice);
97 Provides the number of display types supported.
98 That includes the pseudo 'Auto-Detect' display.
99 @return The number of display type supported.
101 extern "C" MDAPI int MiniDisplayTypeCount();
104 Provides the human readable name of the given display type.
106 @param [IN] The display type we want to get the name for.
107 @return The name of the given display type.
109 extern "C" MDAPI wchar_t* MiniDisplayTypeName(TMiniDisplayType aType);
112 Clear our MiniDisplay.
113 @param [IN] The device to apply this command to.
115 extern "C" MDAPI void MiniDisplayClear(MiniDisplayDevice aDevice);
118 Fill our MiniDisplay.
119 @param [IN] The device to apply this command to.
121 extern "C" MDAPI void MiniDisplayFill(MiniDisplayDevice aDevice);
124 Swap our MiniDisplay buffers committing our back buffer content to the screen.
125 @param [IN] The device to apply this command to.
127 extern "C" MDAPI void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice);
130 Provide maximum brightness level for the given device.
131 @param [IN] The device to apply this command to.
132 @return Maximum brightness level.
134 extern "C" MDAPI int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice);
137 Provide minimum brightness level for the given device.
138 @param [IN] The device to apply this command to.
139 @return Minimum brightness level.
141 extern "C" MDAPI int MiniDisplayMinBrightness(MiniDisplayDevice aDevice);
144 Set device brightness level.
145 @param [IN] The device to apply this command to.
146 @param [IN] Brightness level
148 extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness);
151 Provide pixels width of our display.
152 @param [IN] The device to apply this command to.
153 @return Width in pixels.
155 extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice);
158 Provide pixels height of our display.
159 @param [IN] The device to apply this command to.
160 @return Height in pixels.
162 extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice);
166 @param [IN] The device to apply this command to.
167 @param [IN] Pixel X coordinate.
168 @param [IN] Pixel Y coordinate.
169 @param [IN] Pixel value.
171 extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, unsigned int aPixel);
173 //TODO: Have an API to specify pixel depth
177 @param [IN] The device to apply this command to.
180 extern "C" MDAPI wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice);
183 Provide product name.
184 @param [IN] The device to apply this command to.
185 @return Product name.
187 extern "C" MDAPI wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice);
190 Provide Serial number.
191 @param [IN] The device to apply this command to.
192 @return Serial number name.
194 extern "C" MDAPI wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice);
198 @param [IN] The device to apply this command to.
200 extern "C" MDAPI void MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest);
203 Tell whether or not a request is pending.
204 @param [IN] The device to apply this command to.
205 @return true if we have a request pending, false otherwise.
207 extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice);
211 Provide the current request if any.
212 @param [IN] The device to apply this command to.
213 @return The current request if any.
215 extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice);
219 Cancel any pending request.
220 @param [IN] The device to apply this command to.
222 extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
225 Attempt request completion.
226 @param [IN] The device to apply this command to.
228 extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice);
232 @param [IN] The device to apply this command to.
233 @return Device ID name.
235 extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
238 Provide firmware revision.
239 @param [IN] The device to apply this command to.
240 @return Firmware revision name.
242 extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
245 Get power supply status.
246 @param [IN] The device to apply this command to.
248 extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice);
251 Turn device Power ON.
252 @param [IN] The device to apply this command to.
254 extern "C" MDAPI void MiniDisplayPowerOn(MiniDisplayDevice aDevice);
257 Turn device Power OFF.
258 @param [IN] The device to apply this command to.
260 extern "C" MDAPI void MiniDisplayPowerOff(MiniDisplayDevice aDevice);
263 Specifies whether or not this display supports power ON/OFF functions.
264 @param [IN] The device to apply this command to.
265 @return True if one can turn display power on and off, false otherwise.
267 extern "C" MDAPI bool MiniDisplaySupportPowerOnOff(MiniDisplayDevice aDevice);
271 @param [IN] The device to apply this command to.
273 extern "C" MDAPI void MiniDisplayShowClock(MiniDisplayDevice aDevice);
277 @param [IN] The device to apply this command to.
279 extern "C" MDAPI void MiniDisplayHideClock(MiniDisplayDevice aDevice);
282 Specifies whether or not this display supports clock functions.
283 @param [IN] The device to apply this command to.
284 @return True if this display supports built-in clock, false otherwise.
286 extern "C" MDAPI bool MiniDisplaySupportClock(MiniDisplayDevice aDevice);
289 Tells how many icons of the given are supported by the specified device.
290 Typically icons on a VFD hardware have several segments that can be light up separately.
291 @param [IN] The device to apply this command to.
292 @param [IN] The type of icon we are interested in.
293 @return The number of icons of this kind this display supports.
295 extern "C" MDAPI int MiniDisplayIconCount(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon);
298 Tells how many status the icon of the specified type supports for the given device.
299 Status are typically brightness level on VFD hardware.
300 Most icon will just support 2 status: 0 for Off and 1 for On.
301 @param [IN] The device to apply this command to.
302 @param [IN] The type of icon we are interested in.
303 @return The number of icons of this kind this display supports.
305 extern "C" MDAPI int MiniDisplayIconStatusCount(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon);
308 Set the status of the given icon for the specified device.
309 @param [IN] The device to apply this command to.
310 @param [IN] The type of icon we are interested in.
311 @param [IN] The index of the icon of the given type.
312 @param [IN] The status the icon is to assume.
314 extern "C" MDAPI void MiniDisplaySetIconStatus(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus);