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

Side by Side Diff: ppapi/cpp/instance.h

Issue 7285010: Implement an input event resource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months 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 | Annotate | Revision Log
OLDNEW
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
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 /// @see InputEvent for an example
159 virtual bool HandleInputEvent(const InputEvent& event);
160
157 /// Notification of a data stream available after an instance was created 161 /// 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 162 /// 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 163 /// 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 164 /// 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 165 /// this applies to you, you can ignore this function. The default
162 /// implementation just returns false. 166 /// implementation just returns false.
163 /// 167 ///
164 /// The given url_loader corresponds to a URLLoader object that is 168 /// The given url_loader corresponds to a URLLoader object that is
165 /// already opened. Its response headers may be queried using GetResponseInfo. 169 /// 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 170 /// If you want to use the URLLoader to read data, you will need to save a
(...skipping 30 matching lines...) Expand all
197 201
198 /// See PPB_Instance.BindGraphics. 202 /// See PPB_Instance.BindGraphics.
199 bool BindGraphics(const Graphics2D& graphics); 203 bool BindGraphics(const Graphics2D& graphics);
200 204
201 /// See PPB_Instance.BindGraphics. 205 /// See PPB_Instance.BindGraphics.
202 bool BindGraphics(const Surface3D_Dev& graphics); 206 bool BindGraphics(const Surface3D_Dev& graphics);
203 207
204 /// See PPB_Instance.IsFullFrame. 208 /// See PPB_Instance.IsFullFrame.
205 bool IsFullFrame(); 209 bool IsFullFrame();
206 210
211 int32_t RequestInputEvents(uint32_t event_classes);
212 int32_t RequestFilteringInputEvents(uint32_t event_classes);
213 void ClearInputEventRequest(uint32_t event_classes);
214
207 // These functions use the PPP_Messaging and PPB_Messaging interfaces, so that 215 // 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 216 // messaging can be done conveniently for a pp::Instance without using a
209 // separate C++ class. 217 // separate C++ class.
210 218
211 /// See PPP_Messaging.HandleMessage. 219 /// See PPP_Messaging.HandleMessage.
212 virtual void HandleMessage(const Var& message); 220 virtual void HandleMessage(const Var& message);
213 /// See PPB_Messaging.PostMessage. 221 /// See PPB_Messaging.PostMessage.
214 void PostMessage(const Var& message); 222 void PostMessage(const Var& message);
215 223
216 /// @} 224 /// @}
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 typedef std::map<std::string, void*> InterfaceNameToObjectMap; 268 typedef std::map<std::string, void*> InterfaceNameToObjectMap;
261 InterfaceNameToObjectMap interface_name_to_objects_; 269 InterfaceNameToObjectMap interface_name_to_objects_;
262 }; 270 };
263 271
264 } // namespace pp 272 } // namespace pp
265 273
266 /// @} 274 /// @}
267 /// End addtogroup CPP 275 /// End addtogroup CPP
268 276
269 #endif // PPAPI_CPP_INSTANCE_H_ 277 #endif // PPAPI_CPP_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698