File: braille_display_private.idl

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (93 lines) | stat: -rw-r--r-- 3,616 bytes parent folder | download | duplicates (7)
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
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Braille display access private API.
namespace brailleDisplayPrivate {
  // Braille display keyboard command.
  enum KeyCommand {
    line_up,
    line_down,
    pan_left,
    pan_right,
    top,
    bottom,
    routing,
    secondary_routing,
    dots,
    chord,
    standard_key
  };

  // A keyboard event.  This is not a standard keyboard event because
  // braille display keyboards look significantly different from standard
  // keyboards.
  dictionary KeyEvent {
    KeyCommand command;
    // 0-based display position for commands that involve a routing key.
    long? displayPosition;
    // Braille dot keys that were pressed, stored in the low-order bits.
    // Dot 1 is stored in bit 0, dot2 in bit 1, etc.
    long? brailleDots;
    // DOM keyboard event code.  This is present when command is standard_key
    // and the braille display event represents a non-alphanumeric key such
    // as an arrow key or function key.
    // The value is as defined by the |code| property in
    // http://www.w3.org/TR/uievents/#keyboard-event-interface
    DOMString? standardKeyCode;
    // DOM keyboard event character value.  This is present if the
    // braille key event corresponds to a character.
    DOMString? standardKeyChar;
    // Whether the space key was pressed.
    boolean? spaceKey;
    // Whether the alt key was pressed.
    boolean? altKey;
    // Whether the shift key was pressed.
    boolean? shiftKey;
    // Whether the ctrl key was pressed.
    boolean? ctrlKey;
  };

  // The current braille display state.
  dictionary DisplayState {
    // Whether a braille display is currently available.
    boolean available;
    // Number of rows of braille cells on the currently connected display.
    long? textRowCount;
    // Number of columns of braille cells on the currently connected display.
    long? textColumnCount;
    // The number of dots in a braille cell on the currently connected display.
    long? cellSize;
  };

  callback DisplayStateCallback = void(DisplayState result);

  interface Functions {
    // Gets the current display state.
    static void getDisplayState(
        DisplayStateCallback callback);

    // Write the given dot patterns to the display.  The buffer contains one
    // byte for each braille cell on the display, starting from the leftmost
    // cell. Each byte contains a bit pattern indicating which dots should be
    // raised in the corresponding cell with the low-order bit representing
    // dot 1 and so on until bit 7 which corresponds to dot 8.  If the number
    // of bytes in the buffer is not equal to the display size, the buffer
    // will either be clipped or padded with blank cells on the right. The
    // buffer is a 2D array compressed into 1D. The |columns| and |rows|
    // parameters give the original 2D dimensions of the buffer. To access
    // an element cells[r][c], simply access cells[r * columns + c].
    static void writeDots(ArrayBuffer cells, long columns, long rows);

    // Updates the single user-preferred braille device with the given bluetooth
    // device address and starts or restarts the Brltty daemon.
    static void updateBluetoothBrailleDisplayAddress(DOMString address);
  };

  interface Events {
    // Fired when a braille display is connected or disconnected.
    static void onDisplayStateChanged(DisplayState state);
    // Fired when an input event is received from the display.
    static void onKeyEvent(KeyEvent event);
  };
};