eef750c0e002cf391119c58bdd68c34b213c56a4
[platform/framework/web/crosswalk.git] / src / mojo / services / native_viewport / native_viewport.mojom
1 // Copyright 2013 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 module mojo {
6
7 struct Point {
8   float x;
9   float y;
10 };
11
12 struct Size {
13   float width;
14   float height;
15 };
16
17 struct Rect {
18   Point position;
19   Size size;
20 };
21
22 struct KeyData {
23   int32 key_code;
24   bool is_char;
25 };
26
27 struct TouchData {
28   int32 pointer_id;
29 };
30
31 struct Event {
32   int32 action;
33   int32 flags;
34   int64 time_stamp;
35   Point location;
36   KeyData key_data;
37   TouchData touch_data;
38 };
39
40 [Client=NativeViewportClient]
41 interface NativeViewport {
42   Create(Rect bounds);
43   Show();
44   Hide();
45   Close();
46   SetBounds(Rect bounds);
47   CreateGLES2Context(handle<message_pipe> gles2_client);
48 };
49
50 interface NativeViewportClient {
51   OnCreated();
52   OnBoundsChanged(Rect bounds);
53   OnDestroyed();
54   OnEvent(Event event) => ();
55 };
56
57 }