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