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