summaryrefslogtreecommitdiffstats
path: root/ppapi/c/dev/ppb_widget_dev.h
blob: 3c7293434174261694b056f7906e805847cf1a52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* From dev/ppb_widget_dev.idl modified Wed Oct  5 14:06:02 2011. */

#ifndef PPAPI_C_DEV_PPB_WIDGET_DEV_H_
#define PPAPI_C_DEV_PPB_WIDGET_DEV_H_

#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_point.h"
#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_stdint.h"

#define PPB_WIDGET_DEV_INTERFACE_0_3 "PPB_Widget(Dev);0.3"
#define PPB_WIDGET_DEV_INTERFACE PPB_WIDGET_DEV_INTERFACE_0_3

/**
 * @file
 * Implementation of the widgets interface.
 */


/**
 * @addtogroup Interfaces
 * @{
 */
/**
 * The interface for reusing browser widgets.
 */
struct PPB_Widget_Dev_0_3 {
  /**
   * Returns PP_TRUE if the given resource is a Widget. Returns PP_FALSE if the
   * resource is invalid or some type other than an Widget.
   */
  PP_Bool (*IsWidget)(PP_Resource resource);
  /**
   * Paint the given rectangle of the widget into the given image.
   * Returns PP_TRUE on success, PP_FALSE on failure.
   */
  PP_Bool (*Paint)(PP_Resource widget,
                   const struct PP_Rect* rect,
                   PP_Resource image);
  /**
   * Pass in an event to a widget.  It'll return PP_TRUE if the event was
   * consumed.
   */
  PP_Bool (*HandleEvent)(PP_Resource widget, PP_Resource input_event);
  /**
   * Get the location of the widget.
   */
  PP_Bool (*GetLocation)(PP_Resource widget, struct PP_Rect* location);
  /**
   * Set the location of the widget.
   */
  void (*SetLocation)(PP_Resource widget, const struct PP_Rect* location);
};

typedef struct PPB_Widget_Dev_0_3 PPB_Widget_Dev;
/**
 * @}
 */

#endif  /* PPAPI_C_DEV_PPB_WIDGET_DEV_H_ */