Pepper_31_C_interfaces
ppb_widget_dev.h
Go to the documentation of this file.
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
3  * found in the LICENSE file.
4  */
5 
6 /* From dev/ppb_widget_dev.idl modified Mon Aug 20 10:21:06 2012. */
7 
8 #ifndef PPAPI_C_DEV_PPB_WIDGET_DEV_H_
9 #define PPAPI_C_DEV_PPB_WIDGET_DEV_H_
10 
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_macros.h"
13 #include "ppapi/c/pp_point.h"
14 #include "ppapi/c/pp_rect.h"
15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_size.h"
17 #include "ppapi/c/pp_stdint.h"
18 
19 #define PPB_WIDGET_DEV_INTERFACE_0_3 "PPB_Widget(Dev);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
22 
23 /**
24  * @file
25  * Implementation of the widgets interface.
26  */
27 
28 
29 /**
30  * @addtogroup Interfaces
31  * @{
32  */
33 /**
34  * The interface for reusing browser widgets.
35  */
37  /**
38  * Returns PP_TRUE if the given resource is a Widget. Returns PP_FALSE if the
39  * resource is invalid or some type other than an Widget.
40  */
42  /**
43  * Paint the given rectangle of the widget into the given image.
44  * Returns PP_TRUE on success, PP_FALSE on failure.
45  */
47  const struct PP_Rect* rect,
48  PP_Resource image);
49  /**
50  * Pass in an event to a widget. It'll return PP_TRUE if the event was
51  * consumed.
52  */
53  PP_Bool (*HandleEvent)(PP_Resource widget, PP_Resource input_event);
54  /**
55  * Get the location of the widget.
56  */
57  PP_Bool (*GetLocation)(PP_Resource widget, struct PP_Rect* location);
58  /**
59  * Set the location of the widget.
60  */
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);
66 };
67 
69 
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 };
79 /**
80  * @}
81  */
82 
83 #endif /* PPAPI_C_DEV_PPB_WIDGET_DEV_H_ */
84 
void(* SetScale)(PP_Resource widget, float scale)
PP_Bool(* IsWidget)(PP_Resource resource)
void(* SetLocation)(PP_Resource widget, const struct PP_Rect *location)
PP_Bool(* HandleEvent)(PP_Resource widget, PP_Resource input_event)
int32_t PP_Resource
Definition: pp_resource.h:40
PP_Bool(* Paint)(PP_Resource widget, const struct PP_Rect *rect, PP_Resource image)
PP_Bool(* HandleEvent)(PP_Resource widget, PP_Resource input_event)
void(* SetLocation)(PP_Resource widget, const struct PP_Rect *location)
PP_Bool(* GetLocation)(PP_Resource widget, struct PP_Rect *location)
PP_Bool
Definition: pp_bool.h:30
PP_Bool(* IsWidget)(PP_Resource resource)
PP_Bool(* Paint)(PP_Resource widget, const struct PP_Rect *rect, PP_Resource image)
PP_Bool(* GetLocation)(PP_Resource widget, struct PP_Rect *location)