| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /// Defines the C++ wrapper for a plugin instance. | 9 /// Defines the C++ wrapper for a plugin instance. |
| 10 /// | 10 /// |
| 11 /// @addtogroup CPP | 11 /// @addtogroup CPP |
| 12 /// @{ | 12 /// @{ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "ppapi/c/pp_instance.h" | 17 #include "ppapi/c/pp_instance.h" |
| 18 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/c/pp_resource.h" |
| 19 #include "ppapi/c/pp_stdint.h" | 19 #include "ppapi/c/pp_stdint.h" |
| 20 | 20 |
| 21 struct PP_InputEvent; | 21 struct PP_InputEvent; |
| 22 | 22 |
| 23 /// The C++ interface to the Pepper API. | 23 /// The C++ interface to the Pepper API. |
| 24 namespace pp { | 24 namespace pp { |
| 25 | 25 |
| 26 class Graphics2D; | 26 class Graphics2D; |
| 27 class InputEvent; |
| 27 class ImageData; | 28 class ImageData; |
| 28 class Point; | 29 class Point; |
| 29 class Rect; | 30 class Rect; |
| 30 class Rect; | 31 class Rect; |
| 31 class Resource; | 32 class Resource; |
| 32 class Surface3D_Dev; | 33 class Surface3D_Dev; |
| 33 class URLLoader; | 34 class URLLoader; |
| 34 class Var; | 35 class Var; |
| 35 class Widget_Dev; | 36 class Widget_Dev; |
| 36 | 37 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 /// that the click will be given to a lower part of the page and your module | 148 /// that the click will be given to a lower part of the page and your module |
| 148 /// will not receive focus. This allows an instance to be partially | 149 /// will not receive focus. This allows an instance to be partially |
| 149 /// transparent, where clicks on the transparent areas will behave like clicks | 150 /// transparent, where clicks on the transparent areas will behave like clicks |
| 150 /// to the underlying page. | 151 /// to the underlying page. |
| 151 /// | 152 /// |
| 152 /// @param[in] event The input event. | 153 /// @param[in] event The input event. |
| 153 /// | 154 /// |
| 154 /// @return true if @a event was handled, false otherwise. | 155 /// @return true if @a event was handled, false otherwise. |
| 155 virtual bool HandleInputEvent(const PP_InputEvent& event); | 156 virtual bool HandleInputEvent(const PP_InputEvent& event); |
| 156 | 157 |
| 158 virtual bool HandleInputEvent(const InputEvent& event); |
| 159 |
| 157 /// Notification of a data stream available after an instance was created | 160 /// Notification of a data stream available after an instance was created |
| 158 /// based on the MIME type of a DOMWindow navigation. This only applies to | 161 /// based on the MIME type of a DOMWindow navigation. This only applies to |
| 159 /// modules that are pre-registered to handle certain MIME types. If you | 162 /// modules that are pre-registered to handle certain MIME types. If you |
| 160 /// haven't specifically registered to handle a MIME type or aren't positive | 163 /// haven't specifically registered to handle a MIME type or aren't positive |
| 161 /// this applies to you, you can ignore this function. The default | 164 /// this applies to you, you can ignore this function. The default |
| 162 /// implementation just returns false. | 165 /// implementation just returns false. |
| 163 /// | 166 /// |
| 164 /// The given url_loader corresponds to a URLLoader object that is | 167 /// The given url_loader corresponds to a URLLoader object that is |
| 165 /// already opened. Its response headers may be queried using GetResponseInfo. | 168 /// already opened. Its response headers may be queried using GetResponseInfo. |
| 166 /// If you want to use the URLLoader to read data, you will need to save a | 169 /// If you want to use the URLLoader to read data, you will need to save a |
| (...skipping 30 matching lines...) Expand all Loading... |
| 197 | 200 |
| 198 /// See PPB_Instance.BindGraphics. | 201 /// See PPB_Instance.BindGraphics. |
| 199 bool BindGraphics(const Graphics2D& graphics); | 202 bool BindGraphics(const Graphics2D& graphics); |
| 200 | 203 |
| 201 /// See PPB_Instance.BindGraphics. | 204 /// See PPB_Instance.BindGraphics. |
| 202 bool BindGraphics(const Surface3D_Dev& graphics); | 205 bool BindGraphics(const Surface3D_Dev& graphics); |
| 203 | 206 |
| 204 /// See PPB_Instance.IsFullFrame. | 207 /// See PPB_Instance.IsFullFrame. |
| 205 bool IsFullFrame(); | 208 bool IsFullFrame(); |
| 206 | 209 |
| 210 int32_t RequestInputEvents(uint32_t event_classes); |
| 211 int32_t RequestFilteringInputEvents(uint32_t event_classes); |
| 212 void ClearInputEventRequest(uint32_t event_classes); |
| 213 |
| 207 // These functions use the PPP_Messaging and PPB_Messaging interfaces, so that | 214 // These functions use the PPP_Messaging and PPB_Messaging interfaces, so that |
| 208 // messaging can be done conveniently for a pp::Instance without using a | 215 // messaging can be done conveniently for a pp::Instance without using a |
| 209 // separate C++ class. | 216 // separate C++ class. |
| 210 | 217 |
| 211 /// See PPP_Messaging.HandleMessage. | 218 /// See PPP_Messaging.HandleMessage. |
| 212 virtual void HandleMessage(const Var& message); | 219 virtual void HandleMessage(const Var& message); |
| 213 /// See PPB_Messaging.PostMessage. | 220 /// See PPB_Messaging.PostMessage. |
| 214 void PostMessage(const Var& message); | 221 void PostMessage(const Var& message); |
| 215 | 222 |
| 216 /// @} | 223 /// @} |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 typedef std::map<std::string, void*> InterfaceNameToObjectMap; | 267 typedef std::map<std::string, void*> InterfaceNameToObjectMap; |
| 261 InterfaceNameToObjectMap interface_name_to_objects_; | 268 InterfaceNameToObjectMap interface_name_to_objects_; |
| 262 }; | 269 }; |
| 263 | 270 |
| 264 } // namespace pp | 271 } // namespace pp |
| 265 | 272 |
| 266 /// @} | 273 /// @} |
| 267 /// End addtogroup CPP | 274 /// End addtogroup CPP |
| 268 | 275 |
| 269 #endif // PPAPI_CPP_INSTANCE_H_ | 276 #endif // PPAPI_CPP_INSTANCE_H_ |
| OLD | NEW |