OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 framelet.mojom; |
| 6 |
| 7 import "components/mus/public/interfaces/input_events.mojom"; |
| 8 import "components/mus/public/interfaces/surface_id.mojom"; |
| 9 import "ui/mojo/geometry/geometry.mojom"; |
| 10 |
| 11 enum ResourceUsageLevel { |
| 12 LOW = 0, |
| 13 MEDIUM, |
| 14 HIGH, |
| 15 CRITICAL, |
| 16 MAX_VALUE |
| 17 }; |
| 18 |
| 19 enum FocusType { |
| 20 NONE, |
| 21 FORWARD, |
| 22 BACKWARD, |
| 23 UP, |
| 24 DOWN, |
| 25 LEFT, |
| 26 RIGHT, |
| 27 MOUSE, |
| 28 PAGE, |
| 29 LAST |
| 30 }; |
| 31 |
| 32 struct SurfaceId { |
| 33 uint32 local; |
| 34 uint32 id_namespace; |
| 35 }; |
| 36 |
| 37 enum ValueType { |
| 38 BOOLEAN, |
| 39 INTEGER, |
| 40 STRING |
| 41 }; |
| 42 |
| 43 struct StringValue { |
| 44 string value; |
| 45 }; |
| 46 |
| 47 struct IntegerValue { |
| 48 uint32 value; |
| 49 }; |
| 50 |
| 51 struct BooleanValue { |
| 52 bool value; |
| 53 }; |
| 54 |
| 55 struct Value { |
| 56 ValueType type; |
| 57 BooleanValue? boolean_value; |
| 58 IntegerValue? integer_value; |
| 59 StringValue? string_value; |
| 60 }; |
| 61 |
| 62 interface Framelet { |
| 63 Attach(FrameletClient client, map<string, Value> params); |
| 64 |
| 65 Destroy(); |
| 66 |
| 67 ForwardInput(array<uint8> event); |
| 68 |
| 69 Resize(mojo.Size new_size); |
| 70 |
| 71 SetFocus(bool focused, FocusType focus_type); |
| 72 |
| 73 SetVisible(bool visible); |
| 74 }; |
| 75 |
| 76 interface FrameletClient { |
| 77 ReportMemoryUsage(ResourceUsageLevel usage_level); |
| 78 |
| 79 SetChildFrameSurface(mus.mojom.SurfaceId surface_id, |
| 80 mojo.Size frame_size, |
| 81 float scale_factor); |
| 82 }; |
| 83 |
| 84 interface FrameletFactory { |
| 85 Create(Framelet& framelet, map<string, Value> params); |
| 86 }; |
OLD | NEW |