Package AccessEngine :: Package AEConstants :: Module Output
[hide private]
[frames] | no frames]

Source Code for Module AccessEngine.AEConstants.Output

  1  ''' 
  2  Output related constants. 
  3   
  4  @var CMD_NOOP: No-op command for all devices. 
  5  @type CMD_NOOP: integer 
  6  @var CMD_STOP: Instruct the output device to stop. 
  7  @type CMD_STOP: integer 
  8  @var CMD_TALK: Instruct the output device to send buffered data. 
  9  @type CMD_TALK: integer 
 10  @var CMD_STRING: Instruction indicating that a string is being sent to  
 11  an output device. 
 12  @type CMD_STRING: integer 
 13  @var CMD_FILENAME: Instruction indicating that a file name is being sent to  
 14  an output device. 
 15  @type CMD_FILENAME: integer 
 16  @var CMD_GET_CLOSEST_LANG: Instruction indicating that an output device should 
 17  output the closest language possible. 
 18  @type CMD_GET_CLOSEST_LANG: integer 
 19  @var CMD_CARET: Braille command used to retrieve current caret position. 
 20  @type CMD_CARET: integer 
 21  @var CMD_TRUNCATE: Braille command used to retrieve right and left text  
 22  trucation indicators. 
 23  @type CMD_TRUNCATE: integer 
 24  @var CMD_GET_ELLIPSIS_SIZE: Braille command to retrieve both left and right 
 25  ellipsis sizes as number of cells. 
 26  @type CMD_GET_ELLIPSIS_SIZE: integer 
 27  @var CMD_GET_MISSINGCELL_COUNT: Braille command to retrieve the number of  
 28  missing or broken cells. 
 29  @type CMD_GET_MISSINGCELL_COUNT: integer 
 30  @var CMD_INDEX: Instruction indicating that an output device is receiving an  
 31  index marker. 
 32  @type CMD_INDEX: integer 
 33  @var CMD_STRING_SYNC: Instruction indicating that an output device should  
 34  buffer the given string. 
 35  @type CMD_STRING_SYNC: integer 
 36  @var CMD_GOTO: Magnifier command instructing magnifier to goto a specified  
 37  screen position. 
 38  @type CMD_GOTO: integer 
 39  @var CMD_GET_ROI: Magnifier command used to retrieve the region of interest 
 40  from the magnifier device. 
 41  @type CMD_GET_ROI: integer 
 42  @var CARET_NONE: Braille command indicating no caret will be used. 
 43  @type CARET_NONE: integer 
 44  @var CARET_TWO_BOTTOM: Braille command indicating the bottom two pins will be 
 45  used to represent the caret. 
 46  @type CARET_TWO_BOTTOM: integer 
 47  @var CARET_BOTTOM_RIGHT: Braille command indicating the bottom right pin will be 
 48  used to represent the caret. 
 49  @type CARET_BOTTOM_RIGHT: integer 
 50  @var CARET_LAST: Constant representing last caret type.  Used for iterating  
 51  through caret types. 
 52  @type CARET_LAST: integer 
 53  @var ELLIPSIS_CONTINUATION: Braille command indicating that the continuation 
 54  symbol will be used for the ellipsis. 
 55  @type ELLIPSIS_CONTINUATION: integer 
 56  @var ELLIPSIS_ELLIPSIS: Braille command indicating that the ellipsis 
 57  symbol will be used for the ellipsis. 
 58  @type ELLIPSIS_ELLIPSIS: integer 
 59  @var ELLIPSIS_LAST: Constant representing last ellipsis type.  Used for iterating  
 60  through ellipsis types. 
 61  @type ELLIPSIS_LAST: integer 
 62  @var OUTPUT_COMMAND_NAMES: Dictionary containing all output commands. 
 63  @type OUTPUT_COMMAND_NAMES: dictionary 
 64   
 65  @author: Peter Parente 
 66  @author: Scott Haeger 
 67  @organization: IBM Corporation 
 68  @copyright: Copyright (c) 2005, 2007 IBM Corporation 
 69  @license: The BSD License 
 70   
 71  All rights reserved. This program and the accompanying materials are made  
 72  available under the terms of the BSD license which accompanies 
 73  this distribution, and is available at 
 74  U{http://www.opensource.org/licenses/bsd-license.php} 
 75  ''' 
 76  # no-op command for all devices 
 77  CMD_NOOP = 0 
 78   
 79  # common commands for serial output devices (e.g. audio, Braille) 
 80  CMD_STOP = 1 
 81  CMD_TALK = 2 
 82  CMD_STRING = 3 
 83  CMD_FILENAME = 5 
 84  CMD_GET_CLOSEST_LANG = 8 
 85   
 86  # commands for Braille devices 
 87  BRAILLE_CMD = 0x0010 
 88  CMD_CARET = (BRAILLE_CMD | 0x0001) 
 89  CMD_TRUNCATE = (BRAILLE_CMD | 0x0002) 
 90  CMD_GET_ELLIPSIS_SIZE = (BRAILLE_CMD | 0x0003) 
 91  CMD_GET_MISSINGCELL_COUNT = (BRAILLE_CMD | 0x0004) 
 92   
 93  # commands for audio devices 
 94  CMD_INDEX = 7 
 95  CMD_STRING_SYNC = 4 
 96   
 97  # commands for magnifiers 
 98  CMD_GOTO = 9 
 99  CMD_GET_ROI = 10 
100   
101  # braille constants 
102  # Caret display styles 
103  CARET_NONE = 0 
104  CARET_TWO_BOTTOM = 1 
105  CARET_BOTTOM_RIGHT = 2 
106  CARET_ALL = 3 
107  CARET_LAST = CARET_ALL 
108   
109  # ellipsis display styles 
110  ELLIPSIS_CONTINUATION = 0 
111  ELLIPSIS_ELLIPSIS = 1 
112  ELLIPSIS_LAST = ELLIPSIS_ELLIPSIS 
113   
114  # provide a reverse mapping from command constants to string command names 
115  OUTPUT_COMMAND_NAMES = dict([(value, name.lower()[4:].replace('_', ' ')) 
116                               for name, value in  
117                               locals().items() if name.startswith('CMD_')]) 
118   
119  # settings common to all devices 
120   
121  # settings common to audio device styles 
122