| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module ui.mojom; | 5 module ui.mojom; |
| 6 | 6 |
| 7 import "ui/gfx/geometry/mojo/geometry.mojom"; | 7 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 8 | 8 |
| 9 // Contains state of a single window. | 9 // Contains state of a single window. |
| 10 struct WindowData { | 10 struct WindowData { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Arbitrary key/value pairs. The interpretation of these is left to the | 23 // Arbitrary key/value pairs. The interpretation of these is left to the |
| 24 // client. See SetWindowProperty() for more information. | 24 // client. See SetWindowProperty() for more information. |
| 25 map<string, array<uint8>> properties; | 25 map<string, array<uint8>> properties; |
| 26 | 26 |
| 27 // True if this window is visible. The window may not be drawn on screen (see | 27 // True if this window is visible. The window may not be drawn on screen (see |
| 28 // OnWindowParentDrawnStateChanged() for details). | 28 // OnWindowParentDrawnStateChanged() for details). |
| 29 bool visible; | 29 bool visible; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // Each Window has support for two surfaces. Generally the |DEFAULT| surface | |
| 33 // is used. The |UNDERLAY| surface is useful if the owner of a window wants to | |
| 34 // to Embed() another client and at the same time draw something under the | |
| 35 // embedded apps representation. | |
| 36 // TODO(fsamuel): Remove this once window decorations are no longer underlay | |
| 37 // surfaces. http://crbug.com/647852. | |
| 38 enum CompositorFrameSinkType { | |
| 39 // Only the owner of a window may obtain this surface. | |
| 40 // The window manager can change the offset of this by way of | |
| 41 // SetUnderlaySurfaceOffsetAndExtendedHitArea(). | |
| 42 UNDERLAY, | |
| 43 | |
| 44 // Only the embedded app may obtain this surface. If an app is not embedded | |
| 45 // in the Window than the owner may also render to this surface as well. | |
| 46 DEFAULT, | |
| 47 }; | |
| 48 | |
| 49 // The result of an input event sent to a client app. | 32 // The result of an input event sent to a client app. |
| 50 enum EventResult { | 33 enum EventResult { |
| 51 HANDLED, | 34 HANDLED, |
| 52 UNHANDLED, | 35 UNHANDLED, |
| 53 }; | 36 }; |
| 54 | 37 |
| 55 // A bitfield of what drag operations are possible. | 38 // A bitfield of what drag operations are possible. |
| 56 const uint32 kDropEffectNone = 0; | 39 const uint32 kDropEffectNone = 0; |
| 57 const uint32 kDropEffectMove = 1; | 40 const uint32 kDropEffectMove = 1; |
| 58 const uint32 kDropEffectCopy = 2; | 41 const uint32 kDropEffectCopy = 2; |
| 59 const uint32 kDropEffectLink = 4; | 42 const uint32 kDropEffectLink = 4; |
| 60 | 43 |
| 61 // When this flag is set in a call to Embed(), the embedder (i.e. the client | 44 // When this flag is set in a call to Embed(), the embedder (i.e. the client |
| 62 // that is making the call to Embed()) will receive events that are targeted to | 45 // that is making the call to Embed()) will receive events that are targeted to |
| 63 // the embedded client. The embedded client will not receive any input events | 46 // the embedded client. The embedded client will not receive any input events |
| 64 // from the window server. However, the embedder can choose to dispatch events | 47 // from the window server. However, the embedder can choose to dispatch events |
| 65 // to the embedded client through other mechanism. | 48 // to the embedded client through other mechanism. |
| 66 // TODO(sad): Provide an API in mus for the embedder to dispatch events to the | 49 // TODO(sad): Provide an API in mus for the embedder to dispatch events to the |
| 67 // embedded client. https://crbug.com/621085 | 50 // embedded client. https://crbug.com/621085 |
| 68 const uint32 kEmbedFlagEmbedderInterceptsEvents = 0x01; | 51 const uint32 kEmbedFlagEmbedderInterceptsEvents = 0x01; |
| OLD | NEW |