Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Braille display access private API. | 5 // Braille display access private API. |
| 6 namespace brailleDisplayPrivate { | 6 namespace brailleDisplayPrivate { |
| 7 // Braille display keyboard command. | 7 // Braille display keyboard command. |
| 8 enum KeyCommand { | 8 enum KeyCommand { |
| 9 line_up, | 9 line_up, |
| 10 line_down, | 10 line_down, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 // Whether the shift key was pressed. | 44 // Whether the shift key was pressed. |
| 45 boolean? shiftKey; | 45 boolean? shiftKey; |
| 46 // Whether the ctrl key was pressed. | 46 // Whether the ctrl key was pressed. |
| 47 boolean? ctrlKey; | 47 boolean? ctrlKey; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // The current braille display state. | 50 // The current braille display state. |
| 51 dictionary DisplayState { | 51 dictionary DisplayState { |
| 52 // Whether a braille display is currently available. | 52 // Whether a braille display is currently available. |
| 53 boolean available; | 53 boolean available; |
| 54 // Number of braille cells on the currently connected display. | 54 // Number of rows of braille cells on the currently connected display. |
| 55 long? textCellCount; | 55 long? textRowCount; |
| 56 // Number of columns of braille cells on the currently connected display. | |
| 57 long? textColumnCount; | |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 callback DisplayStateCallback = void(DisplayState result); | 60 callback DisplayStateCallback = void(DisplayState result); |
| 59 | 61 |
| 60 interface Functions { | 62 interface Functions { |
| 61 // Gets the current display state. | 63 // Gets the current display state. |
| 62 static void getDisplayState(DisplayStateCallback callback); | 64 static void getDisplayState(DisplayStateCallback callback); |
| 63 // Write the given dot patterns to the display. The buffer contains one | 65 // Write the given dot patterns to the display. The buffer contains one |
| 64 // byte for each braille cell on the display, starting from the leftmost | 66 // byte for each braille cell on the display, starting from the leftmost |
| 65 // cell. Each byte contains a bit pattern indicating which dots should be | 67 // cell. Each byte contains a bit pattern indicating which dots should be |
| 66 // raised in the corresponding cell with the low-order bit representing | 68 // raised in the corresponding cell with the low-order bit representing |
| 67 // dot 1 and so on until bit 7 which corresponds to dot 8. If the number | 69 // dot 1 and so on until bit 7 which corresponds to dot 8. If the number |
| 68 // of bytes in the buffer is not equal to the display size, the buffer | 70 // of bytes in the buffer is not equal to the display size, the buffer |
| 69 // will either be clipped or padded with blank cells on the right. | 71 // will either be clipped or padded with blank cells on the right. |
| 70 static void writeDots(ArrayBuffer cells); | 72 static void writeDots(ArrayBuffer cells, long columns, long rows); |
|
Devlin
2016/10/18 23:01:29
document new params columns and rows?
ultimatedbz
2016/10/20 18:27:45
Done.
| |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 interface Events { | 75 interface Events { |
| 74 // Fired when a braille display is connected or disconnected. | 76 // Fired when a braille display is connected or disconnected. |
| 75 static void onDisplayStateChanged(DisplayState state); | 77 static void onDisplayStateChanged(DisplayState state); |
| 76 // Fired when an input event is received from the display. | 78 // Fired when an input event is received from the display. |
| 77 static void onKeyEvent(KeyEvent event); | 79 static void onKeyEvent(KeyEvent event); |
| 78 }; | 80 }; |
| 79 }; | 81 }; |
| OLD | NEW |