MiniDisplay.h
author sl
Sat, 12 Jul 2014 13:15:31 +0200
changeset 7 8bac7aac665c
parent 5 33e930b11152
child 8 5a9dbbc40c6b
permissions -rw-r--r--
Display can now be opened, closed and reopened thanks to the following fixes.
Fixing issue with non-virtual destructor.
Fixing issue with deletion of void pointer.
     1 //
     2 //
     3 //
     4 
     5 #ifndef MINI_DISPLAY_H
     6 #define MINI_DISPLAY_H
     7 
     8 /* Cmake will define MyLibrary_EXPORTS on Windows when it
     9 configures to build a shared library. If you are going to use
    10 another build system on windows or create the visual studio
    11 projects by hand you need to define MyLibrary_EXPORTS when
    12 building a DLL on windows.
    13 */
    14 // We are using the Visual Studio Compiler and building Shared libraries
    15 
    16 #if defined (_WIN32)
    17   #if defined(MiniDisplay_EXPORTS)
    18     #define  MDAPI __declspec(dllexport)
    19   #else
    20     #define  MDAPI __declspec(dllimport)
    21   #endif /* MyLibrary_EXPORTS */
    22 #else /* defined (_WIN32) */
    23  #define MDAPI
    24 #endif
    25 
    26 typedef void* MiniDisplayDevice;
    27 
    28 typedef enum
    29     {
    30     EMiniDisplayRequestNone,
    31     EMiniDisplayRequestDeviceId,
    32     EMiniDisplayRequestFirmwareRevision,
    33     EMiniDisplayRequestPowerSupplyStatus
    34     }
    35 TMiniDisplayRequest;
    36 
    37 //Open & Close functions
    38 extern "C" MDAPI MiniDisplayDevice MiniDisplayOpen();
    39 extern "C" MDAPI void MiniDisplayClose(MiniDisplayDevice aDevice);
    40 
    41 /**
    42 Clear our MiniDisplay.
    43 @param [IN] The device to apply this command to.
    44 */
    45 extern "C" MDAPI void MiniDisplayClear(MiniDisplayDevice aDevice);
    46 
    47 /**
    48 Fill our MiniDisplay.
    49 @param [IN] The device to apply this command to.
    50 */
    51 extern "C" MDAPI void MiniDisplayFill(MiniDisplayDevice aDevice);
    52 
    53 /**
    54 Swap our MiniDisplay buffers committing our back buffer content to the screen.
    55 @param [IN] The device to apply this command to.
    56 */
    57 extern "C" MDAPI void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice);
    58 
    59 /**
    60 Provide maximum brightness level for the given device.
    61 @param [IN] The device to apply this command to.
    62 @return Maximum brightness level.
    63 */
    64 extern "C" MDAPI int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice);
    65 
    66 /**
    67 Provide minimum brightness level for the given device.
    68 @param [IN] The device to apply this command to.
    69 @return Minimum brightness level.
    70 */
    71 extern "C" MDAPI int MiniDisplayMinBrightness(MiniDisplayDevice aDevice);
    72 
    73 /**
    74 Set device brightness level.
    75 @param [IN] The device to apply this command to.
    76 @param [IN] Brightness level
    77 */
    78 extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness);
    79 
    80 /**
    81 Provide pixels width of our display.
    82 @param [IN] The device to apply this command to.
    83 @return Width in pixels.
    84 */
    85 extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice);
    86 
    87 /**
    88 Provide pixels height of our display.
    89 @param [IN] The device to apply this command to.
    90 @return Height in pixels.
    91 */
    92 extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice);
    93 
    94 /**
    95 Set our given pixel.
    96 @param [IN] The device to apply this command to.
    97 @param [IN] Pixel X coordinate.
    98 @param [IN] Pixel Y coordinate.
    99 @param [IN] Pixel value.
   100 */
   101 extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, int aValue);
   102 
   103 //TODO: Have an API to specify pixel depth
   104 
   105 /**
   106 Provide vendor name.
   107 @param [IN] The device to apply this command to.
   108 @return Vendor name.
   109 */
   110 extern "C" MDAPI wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice);
   111 
   112 /**
   113 Provide product name.
   114 @param [IN] The device to apply this command to.
   115 @return Product name.
   116 */
   117 extern "C" MDAPI wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice);
   118 
   119 /**
   120 Provide Serial number.
   121 @param [IN] The device to apply this command to.
   122 @return Serial number name.
   123 */
   124 extern "C" MDAPI wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice);
   125 
   126 /**
   127 Request device ID.
   128 @param [IN] The device to apply this command to.
   129 */
   130 extern "C" MDAPI void MiniDisplayRequestDeviceId(MiniDisplayDevice aDevice);
   131 
   132 /**
   133 Request power status.
   134 @param [IN] The device to apply this command to.
   135 */
   136 extern "C" MDAPI void MiniDisplayRequestPowerSupplyStatus(MiniDisplayDevice aDevice);
   137 
   138 /**
   139 Request firmware version.
   140 @param [IN] The device to apply this command to.
   141 */
   142 extern "C" MDAPI void MiniDisplayRequestFirmwareRevision(MiniDisplayDevice aDevice);
   143 
   144 /**
   145 Tell whether or not a request is pending.
   146 @param [IN] The device to apply this command to.
   147 @return true if we have a request pending, false otherwise.
   148 */
   149 extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice);
   150 
   151 
   152 /**
   153 Provide the current request if any.
   154 @param [IN] The device to apply this command to.
   155 @return The current request if any.
   156 */
   157 extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice);
   158 
   159 
   160 /**
   161 Cancel any pending request.
   162 @param [IN] The device to apply this command to.
   163 */
   164 extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
   165 
   166 /**
   167 Attempt request completion.
   168 @param [IN] The device to apply this command to.
   169 */
   170 extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice);
   171 
   172 /**
   173 Provide device ID.
   174 @param [IN] The device to apply this command to.
   175 @return Device ID name.
   176 */
   177 extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
   178 
   179 /**
   180 Provide firmware revision.
   181 @param [IN] The device to apply this command to.
   182 @return Firmware revision name.
   183 */
   184 extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
   185 
   186 /**
   187 Get power supply status.
   188 @param [IN] The device to apply this command to.
   189 */
   190 extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice);
   191 
   192 
   193 
   194 #endif
   195