brlapi_param.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /*
  2. * libbrlapi - A library providing access to braille terminals for applications.
  3. *
  4. * Copyright (C) 2002-2020 by
  5. * Samuel Thibault <Samuel.Thibault@ens-lyon.org>
  6. * Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
  7. *
  8. * libbrlapi comes with ABSOLUTELY NO WARRANTY.
  9. *
  10. * This is free software, placed under the terms of the
  11. * GNU Lesser General Public License, as published by the Free Software
  12. * Foundation; either version 2.1 of the License, or (at your option) any
  13. * later version. Please see the file LICENSE-LGPL for details.
  14. *
  15. * Web Page: http://brltty.app/
  16. *
  17. * This software is maintained by Dave Mielke <dave@mielke.cc>.
  18. */
  19. /** \file
  20. */
  21. #ifndef BRLAPI_INCLUDED_PARAM
  22. #define BRLAPI_INCLUDED_PARAM
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /* __cplusplus */
  26. #include "brlapi_keycodes.h"
  27. /** \ingroup brlapi_parameterManagement
  28. *
  29. * @{ */
  30. typedef enum {
  31. //Connection Parameters
  32. BRLAPI_PARAM_SERVER_VERSION = 0, /**< Version of the server: uint32_t */
  33. BRLAPI_PARAM_CLIENT_PRIORITY = 1, /**< Priority of the client: uint32_t (from 0 through 100, default is 50) */
  34. //Device Parameters
  35. BRLAPI_PARAM_DRIVER_NAME = 2, /**< Full name of the driver: string */
  36. BRLAPI_PARAM_DRIVER_CODE = 3, /**< Code (short name) of the driver: string */
  37. BRLAPI_PARAM_DRIVER_VERSION = 4, /**< Version of the driver: string */
  38. BRLAPI_PARAM_DEVICE_MODEL = 5, /**< Model of the device: string */
  39. BRLAPI_PARAM_DEVICE_CELL_SIZE = 31, /**< Number of dots in a cell: uint8_t */
  40. BRLAPI_PARAM_DISPLAY_SIZE = 6, /**< Dimensions of the braille display: { uint32_t columns; uint32_t rows; } */
  41. BRLAPI_PARAM_DEVICE_IDENTIFIER = 7, /**< Identifier of the device: string */
  42. BRLAPI_PARAM_DEVICE_SPEED = 8, /**< Speed of the device: uint32_t */
  43. BRLAPI_PARAM_DEVICE_ONLINE = 9, /**< Device is online: boolean */
  44. /* TODO: status area */
  45. //Input Parameters
  46. BRLAPI_PARAM_RETAIN_DOTS = 10, /**< Pass dot combinations (rather than characters): boolean */
  47. //Braille Rendering Parameters
  48. BRLAPI_PARAM_COMPUTER_BRAILLE_CELL_SIZE = 11, /**< Number of dots used to render a computer braille character: uint8_t (8 or 6) */
  49. BRLAPI_PARAM_LITERARY_BRAILLE = 12, /**< Whether braille is literary (rather than computer): boolean */
  50. BRLAPI_PARAM_CURSOR_DOTS = 13, /**< Representation of the cursor: uint8_t (ISO 11548-1) */
  51. BRLAPI_PARAM_CURSOR_BLINK_PERIOD = 14, /**< Blinking period of the cursor: uint32_t (milliseconds) */
  52. BRLAPI_PARAM_CURSOR_BLINK_PERCENTAGE = 15, /**< Portion of the blinking period that the cursor is visible: uint8_t (from 0 through 100) */
  53. BRLAPI_PARAM_RENDERED_CELLS = 16, /**< Cells rendered by the client: uint8_t[] (ISO 11548-1), one cell per element */
  54. //Navigation Parameters
  55. BRLAPI_PARAM_SKIP_IDENTICAL_LINES = 17, /**< Whether to skip identical screen lines: boolean */
  56. BRLAPI_PARAM_AUDIBLE_ALERTS = 18, /**< Whether to use audible alerts: boolean */
  57. //Clipboard Parameters
  58. BRLAPI_PARAM_CLIPBOARD_CONTENT = 19, /**< Content of the clipboard: UTF-8 string */
  59. //TTY Mode Parameters
  60. BRLAPI_PARAM_BOUND_COMMAND_CODES = 20, /**< Commands bound for the device:
  61. * uint64_t[], one command code per element */
  62. BRLAPI_PARAM_COMMAND_SHORT_NAME = 21, /**< Short name for a command
  63. * (specified via the subparam argument):
  64. * string (usually a few characters) */
  65. BRLAPI_PARAM_COMMAND_LONG_NAME = 22, /**< Long name for a command
  66. * (specified via the subparam argument):
  67. * string (usually a few words) */
  68. //Raw Mode Parameters
  69. BRLAPI_PARAM_DEVICE_KEY_CODES = 23, /**< Keys defined for the device:
  70. * uint64_t[], one key code per element */
  71. BRLAPI_PARAM_KEY_SHORT_NAME = 24, /**< Short name for a key
  72. * (specified via the subparam argument):
  73. * string (usually a few characters) */
  74. BRLAPI_PARAM_KEY_LONG_NAME = 25, /**< Long name for a key
  75. * (specified via the subparam argument):
  76. * string (usually a few words) */
  77. //Braille Translation Parameters
  78. BRLAPI_PARAM_COMPUTER_BRAILLE_ROWS_MASK = 26, /**< Set of Unicode rows that are defined for computer braille
  79. * (from U+0000 through U+10FFFF):
  80. * uint8_t[544], one bit per row, eight rows per element */
  81. BRLAPI_PARAM_COMPUTER_BRAILLE_ROW_CELLS = 27, /**< Computer braille cells for a Unicode row
  82. * (specified via the subparam argument):
  83. * uint8_t[256] (ISO 11548-1), one cell per element */
  84. BRLAPI_PARAM_COMPUTER_BRAILLE_TABLE = 28, /**< Name of the computer braille table: string */
  85. BRLAPI_PARAM_LITERARY_BRAILLE_TABLE = 29, /**< Name of the literary braille table: string */
  86. BRLAPI_PARAM_MESSAGE_LOCALE = 30, /**< Locale to use for messages: string */
  87. /* TODO: dot-to-unicode as well */
  88. /* TODO: help strings */
  89. BRLAPI_PARAM_COUNT = 32 /** Number of parameters */
  90. } brlapi_param_t;
  91. /* brlapi_param_subparam_t */
  92. /** Type to be used for specifying a sub-parameter */
  93. typedef uint64_t brlapi_param_subparam_t;
  94. /* brlapi_param_bool_t */
  95. /** Type to be used for boolean parameters */
  96. typedef uint8_t brlapi_param_bool_t;
  97. /* brlapi_param_serverVersion_t */
  98. /** Type to be used for BRLAPI_PARAM_SERVER_VERSION */
  99. typedef uint32_t brlapi_param_serverVersion_t;
  100. /* brlapi_param_clientPriority_t */
  101. /** Type to be used for BRLAPI_PARAM_CLIENT_PRIORITY */
  102. typedef uint32_t brlapi_param_clientPriority_t;
  103. /* BRLAPI_PARAM_CLIENT_PRIORITY_DEFAULT */
  104. /** Default value for BRLAPI_PARAM_CLIENT_PRIORITY */
  105. #define BRLAPI_PARAM_CLIENT_PRIORITY_DEFAULT 50
  106. /* brlapi_param_driverName_t */
  107. /** Type to be used for BRLAPI_PARAM_DRIVER_NAME */
  108. typedef char *brlapi_param_driverName_t;
  109. /* brlapi_param_driverCode_t */
  110. /** Type to be used for BRLAPI_PARAM_DRIVER_CODE */
  111. typedef char *brlapi_param_driverCode_t;
  112. /* brlapi_param_driverVersion_t */
  113. /** Type to be used for BRLAPI_PARAM_DRIVER_VERSION */
  114. typedef char *brlapi_param_driverVersion_t;
  115. /* brlapi_param_deviceModel_t */
  116. /** Type to be used for BRLAPI_PARAM_DEVICE_MODEL */
  117. typedef char *brlapi_param_deviceModel_t;
  118. /* brlapi_param_deviceCellSize_t */
  119. /** Type to be used for BRLAPI_PARAM_DEVICE_CELL_SIZE */
  120. typedef uint8_t brlapi_param_deviceCellSize_t;
  121. /* brlapi_param_displaySize_t */
  122. /** Type to be used for BRLAPI_PARAM_DISPLAY_SIZE */
  123. typedef struct {
  124. uint32_t columns;
  125. uint32_t rows;
  126. } brlapi_param_displaySize_t;
  127. /* brlapi_param_deviceIdentifier_t */
  128. /** Type to be used for BRLAPI_PARAM_DEVICE_IDENTIFIER */
  129. typedef char *brlapi_param_deviceIdentifier_t;
  130. /* brlapi_param_deviceSpeed_t */
  131. /** Type to be used for BRLAPI_PARAM_DEVICE_SPEED */
  132. typedef uint32_t brlapi_param_deviceSpeed_t;
  133. /* brlapi_param_deviceOnline_t */
  134. /** Type to be used for BRLAPI_PARAM_DEVICE_ONLINE */
  135. typedef brlapi_param_bool_t brlapi_param_deviceOnline_t;
  136. /* brlapi_param_retainDots_t */
  137. /** Type to be used for BRLAPI_PARAM_RETAIN_DOTS */
  138. typedef brlapi_param_bool_t brlapi_param_retainDots_t;
  139. /* brlapi_param_computerBrailleCellSize_t */
  140. /** Type to be used for BRLAPI_PARAM_COMPUTER_BRAILLE_CELL_SIZE */
  141. typedef uint8_t brlapi_param_computerBrailleCellSize_t;
  142. /* brlapi_param_literaryBraille_t */
  143. /** Type to be used for BRLAPI_PARAM_LITERARY_BRAILLE */
  144. typedef brlapi_param_bool_t brlapi_param_literaryBraille_t;
  145. /* brlapi_param_cursorDots_t */
  146. /** Type to be used for BRLAPI_PARAM_CURSOR_DOTS */
  147. typedef uint8_t brlapi_param_cursorDots_t;
  148. /* brlapi_param_cursorBlinkPeriod_t */
  149. /** Type to be used for BRLAPI_PARAM_CURSOR_BLINK_PERIOD */
  150. typedef uint32_t brlapi_param_cursorBlinkPeriod_t;
  151. /* brlapi_param_cursorBlinkPercentage_t */
  152. /** Type to be used for BRLAPI_PARAM_CURSOR_BLINK_PERCENTAGE */
  153. typedef uint8_t brlapi_param_cursorBlinkPercentage_t;
  154. /* brlapi_param_renderedCells_t */
  155. /** Type to be used for BRLAPI_PARAM_RENDERED_CELLS */
  156. typedef uint8_t *brlapi_param_renderedCells_t;
  157. /* brlapi_param_skipIdenticalLines_t */
  158. /** Type to be used for BRLAPI_PARAM_SKIP_IDENTICAL_LINES */
  159. typedef brlapi_param_bool_t brlapi_param_skipIdenticalLines_t;
  160. /* brlapi_param_audibleAlerts_t */
  161. /** Type to be used for BRLAPI_PARAM_AUDIBLE_ALERTS */
  162. typedef brlapi_param_bool_t brlapi_param_audibleAlerts_t;
  163. /* brlapi_param_clipboardContent_t */
  164. /** Type to be used for BRLAPI_PARAM_CLIPBOARD_CONTENT */
  165. typedef char *brlapi_param_clipboardContent_t;
  166. /* brlapi_param_commandCode_t */
  167. /** Type to be used for BRLAPI_PARAM_BOUND_COMMAND_CODES */
  168. typedef brlapi_keyCode_t brlapi_param_commandCode_t;
  169. /* brlapi_param_commandShortName_t */
  170. /** Type to be used for BRLAPI_PARAM_COMMAND_SHORT_NAME */
  171. typedef char *brlapi_param_commandShortName_t;
  172. /* brlapi_param_commandLongName_t */
  173. /** Type to be used for BRLAPI_PARAM_COMMAND_LONG_NAME */
  174. typedef char *brlapi_param_commandLongName_t;
  175. /* brlapi_param_keyCode_t */
  176. /** Type to be used for BRLAPI_PARAM_DEVICE_KEY_CODES */
  177. typedef brlapi_keyCode_t brlapi_param_keyCode_t;
  178. /* brlapi_param_keyShortName_t */
  179. /** Type to be used for BRLAPI_PARAM_KEY_SHORT_NAME */
  180. typedef char *brlapi_param_keyShortName_t;
  181. /* brlapi_param_keyLongName_t */
  182. /** Type to be used for BRLAPI_PARAM_KEY_LONG_NAME */
  183. typedef char *brlapi_param_keyLongName_t;
  184. /* brlapi_param_computerBrailleRowsMask_t */
  185. /** Type to be used for BRLAPI_PARAM_COMPUTER_BRAILLE_ROWS_MASK */
  186. typedef uint8_t brlapi_param_computerBrailleRowsMask_t[544];
  187. /* brlapi_param_computerBrailleRowCells_t */
  188. /** Type to be used for BRLAPI_PARAM_COMPUTER_BRAILLE_ROW_CELLS */
  189. typedef struct {
  190. uint8_t cells[0X100];
  191. uint8_t defined[0X100 / 8];
  192. } brlapi_param_computerBrailleRowCells_t;
  193. /* brlapi_param_computerBrailleTable_t */
  194. /** Type to be used for BRLAPI_PARAM_COMPUTER_BRAILLE_TABLE */
  195. typedef char *brlapi_param_computerBrailleTable_t;
  196. /* brlapi_param_literaryBrailleTable_t */
  197. /** Type to be used for BRLAPI_PARAM_LITERARY_BRAILLE_TABLE */
  198. typedef char *brlapi_param_literaryBrailleTable_t;
  199. /* brlapi_param_messageLocale_t */
  200. /** Type to be used for BRLAPI_PARAM_MESSAGE_LOCALE */
  201. typedef char *brlapi_param_messageLocale_t;
  202. /** Enumeration of parameter value types */
  203. typedef enum {
  204. BRLAPI_PARAM_TYPE_STRING, /**< Parameter is a string of UTF-8 characters */
  205. BRLAPI_PARAM_TYPE_BOOLEAN, /**< Parameter is one or more booleans represented by a uint8_t */
  206. BRLAPI_PARAM_TYPE_UINT8, /**< Parameter is one or more 8-bit unsigned integers */
  207. BRLAPI_PARAM_TYPE_UINT16, /**< Parameter is one or more 16-bit unsigned integers */
  208. BRLAPI_PARAM_TYPE_UINT32, /**< Parameter is one or more 32-bit unsigned integers */
  209. BRLAPI_PARAM_TYPE_UINT64, /**< Parameter is one or more 64-bit unsigned integers */
  210. BRLAPI_PARAM_TYPE_KEYCODE = BRLAPI_PARAM_TYPE_UINT64, /**< Parameter is one or more key codes */
  211. } brlapi_param_type_t;
  212. /** Structure that describes the properties of a parameter */
  213. typedef struct {
  214. brlapi_param_type_t type; /**< Type of the parameter's value */
  215. uint16_t count; /**< Number of elements in the parameter's value */
  216. uint8_t isArray; /**< Whether the parameter contains several values, or always only one */
  217. uint8_t hasSubparam; /**< Parameter uses the subparam argument */
  218. } brlapi_param_properties_t;
  219. /** Enumeration of parameter types */
  220. /* brlapi_getParameterProperties */
  221. /** Return a description of the properties of a parameter
  222. *
  223. * \param parameter is the parameter whose properties describion shall be returned.
  224. *
  225. * \return a pointer to the description of the properties of the parameter.
  226. */
  227. extern const brlapi_param_properties_t *brlapi_getParameterProperties(brlapi_param_t parameter);
  228. /** @} */
  229. #ifdef __cplusplus
  230. }
  231. #endif /* __cplusplus */
  232. #endif /* BRLAPI_INCLUDED_PARAM */