Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/extensions/api/braille_display_private/brlapi_connection.h

Issue 2401393003: Add multiline braille support. (Closed)
Patch Set: Fixed tests and addressed comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTION_ H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTION_ H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTION_ H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTION_ H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector>
11 12
12 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "library_loaders/libbrlapi.h" 15 #include "library_loaders/libbrlapi.h"
15 16
16 namespace extensions { 17 namespace extensions {
17 namespace api { 18 namespace api {
18 namespace braille_display_private { 19 namespace braille_display_private {
19 20
20 // A connection to the brlapi server. See brlapi.h for more information 21 // A connection to the brlapi server. See brlapi.h for more information
(...skipping 22 matching lines...) Expand all
43 // This works similar to errno in C. There's one thread-local error 44 // This works similar to errno in C. There's one thread-local error
44 // value, meaning that this method should be called after any 45 // value, meaning that this method should be called after any
45 // other method of this class that can return an error without calling 46 // other method of this class that can return an error without calling
46 // another method in between. This class is not thread safe. 47 // another method in between. This class is not thread safe.
47 virtual brlapi_error_t* BrlapiError() = 0; 48 virtual brlapi_error_t* BrlapiError() = 0;
48 49
49 // Gets a description of the last brlapi error for this thread, useful 50 // Gets a description of the last brlapi error for this thread, useful
50 // for logging. 51 // for logging.
51 virtual std::string BrlapiStrError() = 0; 52 virtual std::string BrlapiStrError() = 0;
52 53
53 // Gets the total size of the display, which may be 0 if no display is 54 // Gets the row and column size of the display. Row x columns might be 0
54 // present, returning true on success. Note that this is cached in the 55 // if no display is present, returning true on success. Note that this is
55 // brlapi client so it is cheap. 56 // cached in the brlapi client so it is cheap.
56 virtual bool GetDisplaySize(size_t* size) = 0; 57 virtual bool GetDisplaySize(unsigned int* columns, unsigned int* rows) = 0;
57 58
58 // Sends the specified cells to the display. The array size must 59 // Sends the specified cells to the display. The array size must
59 // be equal to what GetDisplaySize() last returned for this connection. 60 // be equal to what GetDisplaySize() last returned for this connection,
60 virtual bool WriteDots(const unsigned char* cells) = 0; 61 // that is, cells must have a size of rows x columns.
62 virtual bool WriteDots(const std::vector<unsigned char> cells) = 0;
Devlin 2016/10/25 22:36:54 const &?
ultimatedbz 2016/10/27 03:16:58 Done.
61 63
62 // Reads the next keyboard command, returning true on success. 64 // Reads the next keyboard command, returning true on success.
63 // Returns < 0 on error, 0 if no more keys are pending and > 0 65 // Returns < 0 on error, 0 if no more keys are pending and > 0
64 // on success, in which case keyCode will be set to the key command 66 // on success, in which case keyCode will be set to the key command
65 // value. 67 // value.
66 virtual int ReadKey(brlapi_keyCode_t* keyCode) = 0; 68 virtual int ReadKey(brlapi_keyCode_t* keyCode) = 0;
67 69
68 protected: 70 protected:
69 BrlapiConnection(); 71 BrlapiConnection();
70 DISALLOW_COPY_AND_ASSIGN(BrlapiConnection); 72 DISALLOW_COPY_AND_ASSIGN(BrlapiConnection);
71 }; 73 };
72 74
73 } // namespace braille_display_private 75 } // namespace braille_display_private
74 } // namespace api 76 } // namespace api
75 } // namespace extensions 77 } // namespace extensions
76 78
77 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTI ON_H_ 79 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTI ON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698