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 #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 Loading... | |
| 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 total size of the display, which may be 0 if no display is |
|
dmazzoni
2016/10/11 17:15:39
Update this comment
ultimatedbz
2016/10/16 01:12:39
Done.
| |
| 54 // present, returning true on success. Note that this is cached in the | 55 // present, returning true on success. Note that this is cached in the |
| 55 // brlapi client so it is cheap. | 56 // brlapi client so it is cheap. |
| 56 virtual bool GetDisplaySize(size_t* size) = 0; | 57 virtual bool GetDisplaySize(unsigned int* rows, unsigned int* columns) = 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 |
|
dmazzoni
2016/10/11 17:15:39
Update the comment
ultimatedbz
2016/10/16 01:12:39
Done.
| |
| 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 // virtual bool WriteDots(const std::vector<unsigned char> cells) = 0; |
|
dmazzoni
2016/10/11 17:15:39
Delete the old commented-out line
ultimatedbz
2016/10/16 01:12:39
Done.
| |
| 62 virtual bool WriteDots( | |
| 63 const std::vector<std::vector<unsigned char>> cells) = 0; | |
| 61 | 64 |
| 62 // Reads the next keyboard command, returning true on success. | 65 // Reads the next keyboard command, returning true on success. |
| 63 // Returns < 0 on error, 0 if no more keys are pending and > 0 | 66 // 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 | 67 // on success, in which case keyCode will be set to the key command |
| 65 // value. | 68 // value. |
| 66 virtual int ReadKey(brlapi_keyCode_t* keyCode) = 0; | 69 virtual int ReadKey(brlapi_keyCode_t* keyCode) = 0; |
| 67 | 70 |
| 68 protected: | 71 protected: |
| 69 BrlapiConnection(); | 72 BrlapiConnection(); |
| 70 DISALLOW_COPY_AND_ASSIGN(BrlapiConnection); | 73 DISALLOW_COPY_AND_ASSIGN(BrlapiConnection); |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 } // namespace braille_display_private | 76 } // namespace braille_display_private |
| 74 } // namespace api | 77 } // namespace api |
| 75 } // namespace extensions | 78 } // namespace extensions |
| 76 | 79 |
| 77 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTI ON_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRLAPI_CONNECTI ON_H_ |
| OLD | NEW |