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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_CONSTANTS_H_
#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_CONSTANTS_H_
#include <cstddef>
namespace arc::input_overlay {
// About Json strings.
inline constexpr char kMouseAction[] = "mouse_action";
inline constexpr char kPrimaryClick[] = "primary_click";
inline constexpr char kSecondaryClick[] = "secondary_click";
inline constexpr char kHoverMove[] = "hover_move";
inline constexpr char kPrimaryDragMove[] = "primary_drag_move";
inline constexpr char kSecondaryDragMove[] = "secondary_drag_move";
// System version for AlphaV2+.
inline constexpr char kSystemVersionAlphaV2Plus[] = "0.2";
// The coordinates number, including Axis x and y.
inline constexpr int kAxisSize = 2;
// Total key size for ActionMoveKey.
inline constexpr size_t kActionMoveKeysSize = 4;
// Maximum of actions size.
inline constexpr size_t kMaxActionCount = 50;
inline constexpr char16_t kUnknownBind[] = u"?";
// Directions from up, left, down, right.
inline constexpr int kDirection[kActionMoveKeysSize][kAxisSize] = {{0, -1},
{-1, 0},
{0, 1},
{1, 0}};
// From ActionTap AlphaV2 design. There is the label offset to touch point in
// the edit mode.
//
// 2 - 3(kDotOutsideStrokeThickness)
inline constexpr int kOffsetToTouchPoint = -1;
// The space between EditingList and main window when EditingList is outside of
// the game window.
inline constexpr int kEditingListSpaceBetweenMainWindow = 5;
// The offset from the game window content when EditingList is inside of the
// game window.
inline constexpr int kEditingListOffsetInsideMainWindow = 24;
// The offset from the action view list item to the editing list border.
inline constexpr int kEditingListInsideBorderInsets = 16;
// Width of `EditingList`.
inline constexpr int kEditingListWidth = 296;
// Width of `ButtonOptionsMenu` minus the triangle height.
inline constexpr int kButtonOptionsMenuWidth = 296;
// Horizontal order inset for `ArrowContainer` and its children.
inline constexpr int kArrowContainerHorizontalBorderInset = 16;
// Arrow key move distance per key press event.
inline constexpr int kArrowKeyMoveDistance = 2;
// Display mode for display overlay.
enum class DisplayMode {
kNone,
// Display overlay can't receive any events. It shows input mappings as in
// view mode and menu anchor.
kView,
// Display overlay can receive events and action labels can be focused. It
// shows input mapping in edit mode.
kEdit,
};
// Binding options for different ui display stages.
enum class BindingOption {
// Current input binding in active.
kCurrent,
// Original default input binding provided by Google.
kOriginal,
// Pending input binding generated during the binding editing before it is
// saved.
kPending,
};
// Message types for UI displaying different types of messages.
enum class MessageType {
// `kInfo` is the type for info message.
kInfo,
// `kError` is the type for error message.
kError,
// `kInfoLabelFocus` is the type for info message when the `ActionLabel` is
// focused.
kInfoLabelFocus,
};
// Position type enum.
enum class PositionType {
// Default position type.
kDefault = 0,
// Dependent position type which x or y value depend on the other one.
kDependent = 1,
};
// The label position related to touch center for ActionTap.
enum class TapLabelPosition {
// Top-left of touch point. Starts to use in AlphaV2.
kTopLeft = 0,
// Top-right of touch point. Starts to use in AlphaV2.
kTopRight = 1,
// Bottom-left of touch point. Starts to use in Alpha.
kBottomLeft = 2,
// Bottom-right of touch point. Starts to use in Alpha.
kBottomRight = 3,
// Undefined label position. Starts to use in AlphaV2.
kNone = 4,
};
// The UI state related to user operations.
enum class UIState {
// UI is not hovered or dragged.
kDefault = 0,
// UI is under dragging.
kDrag,
// UI is mouse hovered.
kHover,
};
// These values are about how the reposition is achieved for the metrics record.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class RepositionType {
kTouchscreenDragRepostion = 0,
kMouseDragRepostion = 1,
kKeyboardArrowKeyReposition = 2,
kMaxValue = kKeyboardArrowKeyReposition
};
// This is about the window state types when recording metrics data for user UI
// reposition for the metrics record. These values are persisted to logs.
// Entries should not be renumbered and numeric values should never be reused.
enum class InputOverlayWindowStateType {
kInvalid = 0,
kNormal = 1,
kMaximized = 2,
kFullscreen = 3,
kSnapped = 4,
kMaxValue = kSnapped
};
// This is about the four directions of the ActionMove.
enum class Direction : size_t {
kUp = 0,
kLeft = 1,
kDown = 2,
kRight = 3,
kMaxValue = kRight
};
} // namespace arc::input_overlay
#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_CONSTANTS_H_
|