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