| // Copyright 2024 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=HEAD) |
| library fuchsia.session.window; |
| |
| using fuchsia.element; |
| |
| // Unique ID generated by the Window Manager if one is not given by |
| // the [fuchsia.element/AnnotationValue] keyed under |
| // [fuchsia.element/ANNOTATION_KEY_NAME]. |
| alias ViewId = string:fuchsia.element.MAX_ANNOTATION_KEY_VALUE_SIZE; |
| |
| type ListedView = struct { |
| position uint64; |
| id ViewId; |
| }; |
| |
| @available(added=HEAD) |
| @discoverable(client="platform") |
| open protocol Manager { |
| /// List ids of all views in the order they are being presented. |
| flexible List() -> (struct { |
| views vector<ListedView>:MAX; |
| }); |
| |
| /// Moves the view at the given `old_position` to the given `new_position`. |
| /// Items in between are shifted and all other views keep their same relative order. |
| /// Window Manager expects both positions to be within the range of the length of |
| /// views currently presented. If invalid args are provided, the command will not |
| /// execute and an error message will be logged. |
| flexible SetOrder(struct { |
| old_position uint64; |
| new_position uint64; |
| }) -> (); |
| |
| /// Shifts all views forward by one position, view at position 0 is moved to the end. |
| flexible Cycle() -> (); |
| |
| /// Sets keyboard focus to the view at `position` and makes that view visible. |
| flexible Focus(struct { |
| position uint64; |
| }) -> (); |
| }; |