summaryrefslogtreecommitdiff
path: root/chromium/ppapi/api/dev/ppb_widget_dev.idl
blob: c26cb4e4bb33f9f0509da36733e71d320f4323ef (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
/* 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.
 */

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

[generate_thunk]

label Chrome {
  M14 = 0.3,
  M23 = 0.4
};

/**
 * The interface for reusing browser widgets.
 */
interface PPB_Widget_Dev {
  /**
   * 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([in] PP_Resource resource);

  /**
   * Paint the given rectangle of the widget into the given image.
   * Returns PP_TRUE on success, PP_FALSE on failure.
   */
  [report_errors=False]
  PP_Bool Paint([in] PP_Resource widget,
                [in] PP_Rect rect,
                [in] PP_Resource image);

  /**
   * Pass in an event to a widget.  It'll return PP_TRUE if the event was
   * consumed.
   */
  [report_errors=False]
  PP_Bool HandleEvent([in] PP_Resource widget, [in] PP_Resource input_event);

  /**
   * Get the location of the widget.
   */
  [report_errors=False]
  PP_Bool GetLocation([in] PP_Resource widget,
                      [out] PP_Rect location);

  /**
   * Set the location of the widget.
   */
  [report_errors=False]
  void SetLocation([in] PP_Resource widget,
                   [in] PP_Rect location);

  /**
   * Set scale used during paint operations.
   */
  [version=0.4, report_errors=False]
  void SetScale([in] PP_Resource widget,
                [in] float_t scale);
};