OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_C_DEV_PPB_WIDGET_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_WIDGET_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_WIDGET_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_WIDGET_DEV_H_ |
7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" |
8 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
9 | 10 |
10 struct PP_Rect; | 11 struct PP_Rect; |
11 struct PP_InputEvent; | 12 struct PP_InputEvent; |
12 | 13 |
13 #define PPB_WIDGET_DEV_INTERFACE "PPB_Widget(Dev);0.1" | 14 #define PPB_WIDGET_DEV_INTERFACE "PPB_Widget(Dev);0.2" |
14 | 15 |
15 // The interface for reusing browser widgets. | 16 // The interface for reusing browser widgets. |
16 struct PPB_Widget_Dev { | 17 struct PPB_Widget_Dev { |
17 // Returns true if the given resource is a Widget. Returns false if the | 18 // Returns PP_TRUE if the given resource is a Widget. Returns PP_FALSE if the |
18 // resource is invalid or some type other than an Widget. | 19 // resource is invalid or some type other than an Widget. |
19 bool (*IsWidget)(PP_Resource resource); | 20 PP_Bool (*IsWidget)(PP_Resource resource); |
20 | 21 |
21 // Paint the given rectangle of the widget into the given image. | 22 // Paint the given rectangle of the widget into the given image. |
22 // Returns true on success, false on failure | 23 // Returns PP_TRUE on success, PP_FALSE on failure |
23 bool (*Paint)(PP_Resource widget, | 24 PP_Bool (*Paint)(PP_Resource widget, |
24 const struct PP_Rect* rect, | 25 const struct PP_Rect* rect, |
25 PP_Resource image); | 26 PP_Resource image); |
26 | 27 |
27 // Pass in an event to a widget. It'll return true if the event was consumed. | 28 // Pass in an event to a widget. It'll return PP_TRUE if the event was |
28 bool (*HandleEvent)(PP_Resource widget, | 29 // consumed. |
29 const struct PP_InputEvent* event); | 30 PP_Bool (*HandleEvent)(PP_Resource widget, |
| 31 const struct PP_InputEvent* event); |
30 | 32 |
31 // Get/set the location of the widget. | 33 // Get/set the location of the widget. |
32 bool (*GetLocation)(PP_Resource widget, | 34 PP_Bool (*GetLocation)(PP_Resource widget, |
33 struct PP_Rect* location); | 35 struct PP_Rect* location); |
34 | 36 |
35 void (*SetLocation)(PP_Resource widget, | 37 void (*SetLocation)(PP_Resource widget, |
36 const struct PP_Rect* location); | 38 const struct PP_Rect* location); |
37 }; | 39 }; |
38 | 40 |
39 #endif // PPAPI_C_DEV_PPB_WIDGET_DEV_H_ | 41 #endif // PPAPI_C_DEV_PPB_WIDGET_DEV_H_ |
OLD | NEW |