| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 PPAPI_CPP_INSTANCE_H_ | 5 #ifndef PPAPI_CPP_INSTANCE_H_ |
| 6 #define PPAPI_CPP_INSTANCE_H_ | 6 #define PPAPI_CPP_INSTANCE_H_ |
| 7 | 7 |
| 8 /// @file | 8 /// @file |
| 9 /// This file defines the C++ wrapper for an instance. | 9 /// This file defines the C++ wrapper for an instance. |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 /// @param[in] clip The visible region of the instance. This is relative to | 132 /// @param[in] clip The visible region of the instance. This is relative to |
| 133 /// the top left of the instance's coordinate system (not the page). If the | 133 /// the top left of the instance's coordinate system (not the page). If the |
| 134 /// instance is invisible, <code>clip</code> will be (0, 0, 0, 0). | 134 /// instance is invisible, <code>clip</code> will be (0, 0, 0, 0). |
| 135 /// | 135 /// |
| 136 /// It's recommended to check for invisible instances and to stop | 136 /// It's recommended to check for invisible instances and to stop |
| 137 /// generating graphics updates in this case to save system resources. It's | 137 /// generating graphics updates in this case to save system resources. It's |
| 138 /// not usually worthwhile, however, to generate partial updates according to | 138 /// not usually worthwhile, however, to generate partial updates according to |
| 139 /// the clip when the instance is partially visible. Instead, update the | 139 /// the clip when the instance is partially visible. Instead, update the |
| 140 /// entire region. The time saved doing partial paints is usually not | 140 /// entire region. The time saved doing partial paints is usually not |
| 141 /// significant and it can create artifacts when scrolling (this notification | 141 /// significant and it can create artifacts when scrolling (this notification |
| 142 /// is sent asynchronously from scolling so there can be flashes of old | 142 /// is sent asynchronously from scrolling so there can be flashes of old |
| 143 /// content in the exposed regions). | 143 /// content in the exposed regions). |
| 144 virtual void DidChangeView(const Rect& position, const Rect& clip); | 144 virtual void DidChangeView(const Rect& position, const Rect& clip); |
| 145 | 145 |
| 146 /// DidChangeFocus() is called when an instance has gained or lost focus. | 146 /// DidChangeFocus() is called when an instance has gained or lost focus. |
| 147 /// Having focus means that keyboard events will be sent to the instance. | 147 /// Having focus means that keyboard events will be sent to the instance. |
| 148 /// An instance's default condition is that it will not have focus. | 148 /// An instance's default condition is that it will not have focus. |
| 149 /// | 149 /// |
| 150 /// The focus flag takes into account both browser tab and window focus as | 150 /// The focus flag takes into account both browser tab and window focus as |
| 151 /// well as focus of the plugin element on the page. In order to be deemed | 151 /// well as focus of the plugin element on the page. In order to be deemed |
| 152 /// to have focus, the browser window must be topmost, the tab must be | 152 /// to have focus, the browser window must be topmost, the tab must be |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 /// the instance. Calling this function will override any previous setting for | 326 /// the instance. Calling this function will override any previous setting for |
| 327 /// each specified class of input events (for example, if you previously | 327 /// each specified class of input events (for example, if you previously |
| 328 /// called RequestFilteringInputEvents(), this function will set those events | 328 /// called RequestFilteringInputEvents(), this function will set those events |
| 329 /// to non-filtering mode). | 329 /// to non-filtering mode). |
| 330 /// | 330 /// |
| 331 /// Input events may have high overhead, so you should only request input | 331 /// Input events may have high overhead, so you should only request input |
| 332 /// events that your plugin will actually handle. For example, the browser may | 332 /// events that your plugin will actually handle. For example, the browser may |
| 333 /// do optimizations for scroll or touch events that can be processed | 333 /// do optimizations for scroll or touch events that can be processed |
| 334 /// substantially faster if it knows there are no non-default receivers for | 334 /// substantially faster if it knows there are no non-default receivers for |
| 335 /// that message. Requesting that such messages be delivered, even if they are | 335 /// that message. Requesting that such messages be delivered, even if they are |
| 336 /// processed very quickly, may have a noticable effect on the performance of | 336 /// processed very quickly, may have a noticeable effect on the performance of |
| 337 /// the page. | 337 /// the page. |
| 338 /// | 338 /// |
| 339 /// When requesting input events through this function, the events will be | 339 /// When requesting input events through this function, the events will be |
| 340 /// delivered and <em>not</em> bubbled to the page. This means that even if | 340 /// delivered and <em>not</em> bubbled to the page. This means that even if |
| 341 /// you aren't interested in the message, no other parts of the page will get | 341 /// you aren't interested in the message, no other parts of the page will get |
| 342 /// the message. | 342 /// the message. |
| 343 /// | 343 /// |
| 344 /// <strong>Example:</strong> | 344 /// <strong>Example:</strong> |
| 345 /// | 345 /// |
| 346 /// <code> | 346 /// <code> |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 private: | 557 private: |
| 558 PP_Instance pp_instance_; | 558 PP_Instance pp_instance_; |
| 559 | 559 |
| 560 typedef std::map<std::string, void*> InterfaceNameToObjectMap; | 560 typedef std::map<std::string, void*> InterfaceNameToObjectMap; |
| 561 InterfaceNameToObjectMap interface_name_to_objects_; | 561 InterfaceNameToObjectMap interface_name_to_objects_; |
| 562 }; | 562 }; |
| 563 | 563 |
| 564 } // namespace pp | 564 } // namespace pp |
| 565 | 565 |
| 566 #endif // PPAPI_CPP_INSTANCE_H_ | 566 #endif // PPAPI_CPP_INSTANCE_H_ |
| OLD | NEW |