| 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 | 5 |
| 6 /* From dev/ppb_widget_dev.idl modified Wed Oct 5 14:06:02 2011. */ | 6 /* From dev/ppb_widget_dev.idl modified Mon Aug 20 10:21:06 2012. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_WIDGET_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_WIDGET_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_WIDGET_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_WIDGET_DEV_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" | 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_point.h" | 13 #include "ppapi/c/pp_point.h" |
| 14 #include "ppapi/c/pp_rect.h" | 14 #include "ppapi/c/pp_rect.h" |
| 15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
| 16 #include "ppapi/c/pp_size.h" | 16 #include "ppapi/c/pp_size.h" |
| 17 #include "ppapi/c/pp_stdint.h" | 17 #include "ppapi/c/pp_stdint.h" |
| 18 | 18 |
| 19 #define PPB_WIDGET_DEV_INTERFACE_0_3 "PPB_Widget(Dev);0.3" | 19 #define PPB_WIDGET_DEV_INTERFACE_0_3 "PPB_Widget(Dev);0.3" |
| 20 #define PPB_WIDGET_DEV_INTERFACE PPB_WIDGET_DEV_INTERFACE_0_3 | 20 #define PPB_WIDGET_DEV_INTERFACE_0_4 "PPB_Widget(Dev);0.4" |
| 21 #define PPB_WIDGET_DEV_INTERFACE PPB_WIDGET_DEV_INTERFACE_0_4 |
| 21 | 22 |
| 22 /** | 23 /** |
| 23 * @file | 24 * @file |
| 24 * Implementation of the widgets interface. | 25 * Implementation of the widgets interface. |
| 25 */ | 26 */ |
| 26 | 27 |
| 27 | 28 |
| 28 /** | 29 /** |
| 29 * @addtogroup Interfaces | 30 * @addtogroup Interfaces |
| 30 * @{ | 31 * @{ |
| 31 */ | 32 */ |
| 32 /** | 33 /** |
| 33 * The interface for reusing browser widgets. | 34 * The interface for reusing browser widgets. |
| 34 */ | 35 */ |
| 35 struct PPB_Widget_Dev_0_3 { | 36 struct PPB_Widget_Dev_0_4 { |
| 36 /** | 37 /** |
| 37 * Returns PP_TRUE if the given resource is a Widget. Returns PP_FALSE if the | 38 * Returns PP_TRUE if the given resource is a Widget. Returns PP_FALSE if the |
| 38 * resource is invalid or some type other than an Widget. | 39 * resource is invalid or some type other than an Widget. |
| 39 */ | 40 */ |
| 40 PP_Bool (*IsWidget)(PP_Resource resource); | 41 PP_Bool (*IsWidget)(PP_Resource resource); |
| 41 /** | 42 /** |
| 42 * Paint the given rectangle of the widget into the given image. | 43 * Paint the given rectangle of the widget into the given image. |
| 43 * Returns PP_TRUE on success, PP_FALSE on failure. | 44 * Returns PP_TRUE on success, PP_FALSE on failure. |
| 44 */ | 45 */ |
| 45 PP_Bool (*Paint)(PP_Resource widget, | 46 PP_Bool (*Paint)(PP_Resource widget, |
| 46 const struct PP_Rect* rect, | 47 const struct PP_Rect* rect, |
| 47 PP_Resource image); | 48 PP_Resource image); |
| 48 /** | 49 /** |
| 49 * Pass in an event to a widget. It'll return PP_TRUE if the event was | 50 * Pass in an event to a widget. It'll return PP_TRUE if the event was |
| 50 * consumed. | 51 * consumed. |
| 51 */ | 52 */ |
| 52 PP_Bool (*HandleEvent)(PP_Resource widget, PP_Resource input_event); | 53 PP_Bool (*HandleEvent)(PP_Resource widget, PP_Resource input_event); |
| 53 /** | 54 /** |
| 54 * Get the location of the widget. | 55 * Get the location of the widget. |
| 55 */ | 56 */ |
| 56 PP_Bool (*GetLocation)(PP_Resource widget, struct PP_Rect* location); | 57 PP_Bool (*GetLocation)(PP_Resource widget, struct PP_Rect* location); |
| 57 /** | 58 /** |
| 58 * Set the location of the widget. | 59 * Set the location of the widget. |
| 59 */ | 60 */ |
| 60 void (*SetLocation)(PP_Resource widget, const struct PP_Rect* location); | 61 void (*SetLocation)(PP_Resource widget, const struct PP_Rect* location); |
| 62 /** |
| 63 * Set scale used during paint operations. |
| 64 */ |
| 65 void (*SetScale)(PP_Resource widget, float scale); |
| 61 }; | 66 }; |
| 62 | 67 |
| 63 typedef struct PPB_Widget_Dev_0_3 PPB_Widget_Dev; | 68 typedef struct PPB_Widget_Dev_0_4 PPB_Widget_Dev; |
| 69 |
| 70 struct PPB_Widget_Dev_0_3 { |
| 71 PP_Bool (*IsWidget)(PP_Resource resource); |
| 72 PP_Bool (*Paint)(PP_Resource widget, |
| 73 const struct PP_Rect* rect, |
| 74 PP_Resource image); |
| 75 PP_Bool (*HandleEvent)(PP_Resource widget, PP_Resource input_event); |
| 76 PP_Bool (*GetLocation)(PP_Resource widget, struct PP_Rect* location); |
| 77 void (*SetLocation)(PP_Resource widget, const struct PP_Rect* location); |
| 78 }; |
| 64 /** | 79 /** |
| 65 * @} | 80 * @} |
| 66 */ | 81 */ |
| 67 | 82 |
| 68 #endif /* PPAPI_C_DEV_PPB_WIDGET_DEV_H_ */ | 83 #endif /* PPAPI_C_DEV_PPB_WIDGET_DEV_H_ */ |
| 69 | 84 |
| OLD | NEW |