//
// Copyright 2024 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// @generated by protoc-gen-es v2.2.2 with parameter "target=ts"
// @generated from file protos/perfetto/trace/android/android_input_event.proto (package perfetto.protos, syntax proto2)
/* eslint-disable */

import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
import { file_protos_perfetto_trace_android_typedef } from "./typedef_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file protos/perfetto/trace/android/android_input_event.proto.
 */
export const file_protos_perfetto_trace_android_android_input_event: GenFile = /*@__PURE__*/
  fileDesc("Cjdwcm90b3MvcGVyZmV0dG8vdHJhY2UvYW5kcm9pZC9hbmRyb2lkX2lucHV0X2V2ZW50LnByb3RvEg9wZXJmZXR0by5wcm90b3Mi3AcKEkFuZHJvaWRNb3Rpb25FdmVudBIQCghldmVudF9pZBgBIAEoBxIYChBldmVudF90aW1lX25hbm9zGAIgASgDEjMKBnNvdXJjZRgDIAEoDUIjiqYdH2FuZHJvaWQudmlldy5JbnB1dERldmljZS5Tb3VyY2USOQoGYWN0aW9uGAQgASgFQimKph0lYW5kcm9pZC52aWV3Lk1vdGlvbkV2ZW50LkFjdGlvbk1hc2tlZBIRCglkZXZpY2VfaWQYBSABKAUSEgoKZGlzcGxheV9pZBgGIAEoERJDCg5jbGFzc2lmaWNhdGlvbhgHIAEoBUIriqYdJ2FuZHJvaWQudmlldy5Nb3Rpb25FdmVudC5DbGFzc2lmaWNhdGlvbhIwCgVmbGFncxgIIAEoDUIhiqYdHWFuZHJvaWQudmlldy5Nb3Rpb25FdmVudC5Gb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GFjdGVkGAIgASgLMiMucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRNb3Rpb25FdmVudEgAEkAKFGRpc3BhdGNoZXJfa2V5X2V2ZW50GAMgASgLMiAucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRLZXlFdmVudEgAEkkKHWRpc3BhdGNoZXJfa2V5X2V2ZW50X3JlZGFjdGVkGAQgASgLMiAucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRLZXlFdmVudEgAElwKIGRpc3BhdGNoZXJfd2luZG93X2Rpc3BhdGNoX2V2ZW50GAUgASgLMjAucGVyZmV0dG8ucHJvdG9zLkFuZHJvaWRXaW5kb3dJbnB1dERpc3BhdGNoRXZlbnRIABJlCilkaXNwYXRjaGVyX3dpbmRvd19kaXNwYXRjaF9ldmVudF9yZWRhY3RlZBgGIAEoCzIwLnBlcmZldHRvLnByb3Rvcy5BbmRyb2lkV2luZG93SW5wdXREaXNwYXRjaEV2ZW50SABCBwoFZXZlbnQ", [file_protos_perfetto_trace_android_typedef]);

/**
 * A representation of an Android MotionEvent.
 * See: https://developer.android.com/reference/android/view/MotionEvent
 *
 * The timestamp of the TracePacket that contains this event corresponds to the time at which
 * this event was processed by InputDispatcher.
 *
 * @generated from message perfetto.protos.AndroidMotionEvent
 */
export type AndroidMotionEvent = Message<"perfetto.protos.AndroidMotionEvent"> & {
  /**
   * The randomly-generated ID used to track the event through the pipeline.
   *
   * @generated from field: optional fixed32 event_id = 1;
   */
  eventId: number;

  /**
   * The event's timestamp - generated by the kernel.
   *
   * @generated from field: optional int64 event_time_nanos = 2;
   */
  eventTimeNanos: bigint;

  /**
   * @generated from field: optional uint32 source = 3;
   */
  source: number;

  /**
   * @generated from field: optional int32 action = 4;
   */
  action: number;

  /**
   * @generated from field: optional int32 device_id = 5;
   */
  deviceId: number;

  /**
   * Use a signed int for display_id, because -1 (DISPLAY_IS_NONE) is a common value.
   *
   * @generated from field: optional sint32 display_id = 6;
   */
  displayId: number;

  /**
   * @generated from field: optional int32 classification = 7;
   */
  classification: number;

  /**
   * @generated from field: optional uint32 flags = 8;
   */
  flags: number;

  /**
   * @generated from field: repeated perfetto.protos.AndroidMotionEvent.Pointer pointer = 9;
   */
  pointer: AndroidMotionEvent_Pointer[];

  /**
   * If this event was synthesized as a result of one or more different
   * event, original_event_ids are the event_ids associated with the original events.
   * For example, if this is an ACTION_HOVER_ENTER event that is synthesized
   * due to an ACTION_HOVER_MOVE event entering the bounds of a window, the
   * id of the original hover move event will be listed here.
   *
   * @generated from field: repeated fixed32 original_event_id = 16 [packed = true];
   */
  originalEventId: number[];

  /**
   * The timestamp of the ACTION_DOWN event associated with this gesture.
   *
   * @generated from field: optional int64 down_time_nanos = 17;
   */
  downTimeNanos: bigint;

  /**
   * @generated from field: optional float cursor_position_x = 18;
   */
  cursorPositionX: number;

  /**
   * @generated from field: optional float cursor_position_y = 19;
   */
  cursorPositionY: number;

  /**
   * @generated from field: optional int32 action_button = 20;
   */
  actionButton: number;

  /**
   * @generated from field: optional uint32 button_state = 21;
   */
  buttonState: number;

  /**
   * @generated from field: optional uint32 meta_state = 22;
   */
  metaState: number;

  /**
   * @generated from field: optional uint32 policy_flags = 23;
   */
  policyFlags: number;

  /**
   * @generated from field: optional float precision_x = 24;
   */
  precisionX: number;

  /**
   * @generated from field: optional float precision_y = 25;
   */
  precisionY: number;
};

/**
 * Describes the message perfetto.protos.AndroidMotionEvent.
 * Use `create(AndroidMotionEventSchema)` to create a new message.
 */
export const AndroidMotionEventSchema: GenMessage<AndroidMotionEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 0);

/**
 * A representation of one pointer inside a MotionEvent.
 * Each Pointer contains the values present in its corresponding
 * MotionEvent.PointerCoords and MotionEvent.PointerProperties.
 *
 * @generated from message perfetto.protos.AndroidMotionEvent.Pointer
 */
export type AndroidMotionEvent_Pointer = Message<"perfetto.protos.AndroidMotionEvent.Pointer"> & {
  /**
   * @generated from field: repeated perfetto.protos.AndroidMotionEvent.Pointer.AxisValue axis_value = 1;
   */
  axisValue: AndroidMotionEvent_Pointer_AxisValue[];

  /**
   * @generated from field: optional int32 pointer_id = 2;
   */
  pointerId: number;

  /**
   * @generated from field: optional int32 tool_type = 3;
   */
  toolType: number;
};

/**
 * Describes the message perfetto.protos.AndroidMotionEvent.Pointer.
 * Use `create(AndroidMotionEvent_PointerSchema)` to create a new message.
 */
export const AndroidMotionEvent_PointerSchema: GenMessage<AndroidMotionEvent_Pointer> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 0, 0);

/**
 * @generated from message perfetto.protos.AndroidMotionEvent.Pointer.AxisValue
 */
export type AndroidMotionEvent_Pointer_AxisValue = Message<"perfetto.protos.AndroidMotionEvent.Pointer.AxisValue"> & {
  /**
   * @generated from field: optional int32 axis = 1;
   */
  axis: number;

  /**
   * @generated from field: optional float value = 2;
   */
  value: number;
};

/**
 * Describes the message perfetto.protos.AndroidMotionEvent.Pointer.AxisValue.
 * Use `create(AndroidMotionEvent_Pointer_AxisValueSchema)` to create a new message.
 */
export const AndroidMotionEvent_Pointer_AxisValueSchema: GenMessage<AndroidMotionEvent_Pointer_AxisValue> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 0, 0, 0);

/**
 * A representation of an Android KeyEvent.
 * See: https://developer.android.com/reference/android/view/KeyEvent
 *
 * The timestamp of the TracePacket that contains this event corresponds to the time at which
 * this event was processed by InputDispatcher.
 *
 * @generated from message perfetto.protos.AndroidKeyEvent
 */
export type AndroidKeyEvent = Message<"perfetto.protos.AndroidKeyEvent"> & {
  /**
   * The randomly-generated ID used to track the event through the pipeline.
   *
   * @generated from field: optional fixed32 event_id = 1;
   */
  eventId: number;

  /**
   * The event's timestamp - generated by the kernel.
   *
   * @generated from field: optional int64 event_time_nanos = 2;
   */
  eventTimeNanos: bigint;

  /**
   * The timestamp of the ACTION_DOWN event associated with this gesture.
   *
   * @generated from field: optional int64 down_time_nanos = 3;
   */
  downTimeNanos: bigint;

  /**
   * @generated from field: optional uint32 source = 4;
   */
  source: number;

  /**
   * @generated from field: optional int32 action = 5;
   */
  action: number;

  /**
   * @generated from field: optional int32 device_id = 6;
   */
  deviceId: number;

  /**
   * Use a signed int for display_id, because -1 (DISPLAY_IS_NONE) is a common value.
   *
   * @generated from field: optional sint32 display_id = 7;
   */
  displayId: number;

  /**
   * @generated from field: optional int32 key_code = 8;
   */
  keyCode: number;

  /**
   * @generated from field: optional uint32 scan_code = 9;
   */
  scanCode: number;

  /**
   * @generated from field: optional uint32 meta_state = 10;
   */
  metaState: number;

  /**
   * @generated from field: optional int32 repeat_count = 11;
   */
  repeatCount: number;

  /**
   * @generated from field: optional uint32 flags = 12;
   */
  flags: number;

  /**
   * @generated from field: optional uint32 policy_flags = 13;
   */
  policyFlags: number;
};

/**
 * Describes the message perfetto.protos.AndroidKeyEvent.
 * Use `create(AndroidKeyEventSchema)` to create a new message.
 */
export const AndroidKeyEventSchema: GenMessage<AndroidKeyEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 1);

/**
 * An event that traces an input event being dispatched by the system to one window.
 *
 * The timestamp of the TracePacket that contains this event corresponds to the time at which
 * this event was dispatched to the target window by InputDispatcher, also known as "delivery time".
 *
 * @generated from message perfetto.protos.AndroidWindowInputDispatchEvent
 */
export type AndroidWindowInputDispatchEvent = Message<"perfetto.protos.AndroidWindowInputDispatchEvent"> & {
  /**
   * The event_id of the event that was dispatched to the window.
   *
   * @generated from field: optional fixed32 event_id = 1;
   */
  eventId: number;

  /**
   * The vsync_id of the frame in which the decision was made to dispatch the event to
   * the window.
   *
   * @generated from field: optional int64 vsync_id = 2;
   */
  vsyncId: bigint;

  /**
   * The id of the window to which the event was dispatched.
   *
   * @generated from field: optional int32 window_id = 3;
   */
  windowId: number;

  /**
   * Only relevant for MotionEvents that are dispatched to a screen location.
   * Each DispatchedPointer has a 1:1 correspondence with the Pointers in the AndroidMotionEvent.
   *
   * @generated from field: repeated perfetto.protos.AndroidWindowInputDispatchEvent.DispatchedPointer dispatched_pointer = 4;
   */
  dispatchedPointer: AndroidWindowInputDispatchEvent_DispatchedPointer[];

  /**
   * The event flags that were used when dispatching the event to this window.
   * If the same event is dispatched to more than one window, it is possible that they
   * were dispatched using different flag values for each window.
   *
   * @generated from field: optional uint32 resolved_flags = 5;
   */
  resolvedFlags: number;
};

/**
 * Describes the message perfetto.protos.AndroidWindowInputDispatchEvent.
 * Use `create(AndroidWindowInputDispatchEventSchema)` to create a new message.
 */
export const AndroidWindowInputDispatchEventSchema: GenMessage<AndroidWindowInputDispatchEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 2);

/**
 * Stores x/y values for each pointer sent to the window for events
 * that are dispatched to a certain location on the screen. This is not relevant
 * for KeyEvents and MotionEvents that are dispatched to focused windows.
 *
 * @generated from message perfetto.protos.AndroidWindowInputDispatchEvent.DispatchedPointer
 */
export type AndroidWindowInputDispatchEvent_DispatchedPointer = Message<"perfetto.protos.AndroidWindowInputDispatchEvent.DispatchedPointer"> & {
  /**
   * @generated from field: optional int32 pointer_id = 1;
   */
  pointerId: number;

  /**
   * The coordinates of the pointer in the logical display space, AKA "raw coordinates".
   *
   * @generated from field: optional float x_in_display = 2;
   */
  xInDisplay: number;

  /**
   * @generated from field: optional float y_in_display = 3;
   */
  yInDisplay: number;

  /**
   * The axis values for this pointer that were modified by the window transform.
   *
   * @generated from field: repeated perfetto.protos.AndroidMotionEvent.Pointer.AxisValue axis_value_in_window = 4;
   */
  axisValueInWindow: AndroidMotionEvent_Pointer_AxisValue[];
};

/**
 * Describes the message perfetto.protos.AndroidWindowInputDispatchEvent.DispatchedPointer.
 * Use `create(AndroidWindowInputDispatchEvent_DispatchedPointerSchema)` to create a new message.
 */
export const AndroidWindowInputDispatchEvent_DispatchedPointerSchema: GenMessage<AndroidWindowInputDispatchEvent_DispatchedPointer> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 2, 0);

/**
 * A wrapper type for input tracing on Android.
 * The meaning of the timestamp of the TracePacket that contains this message will depend on
 * the event that this message contains.
 *
 * @generated from message perfetto.protos.AndroidInputEvent
 */
export type AndroidInputEvent = Message<"perfetto.protos.AndroidInputEvent"> & {
  /**
   * @generated from oneof perfetto.protos.AndroidInputEvent.event
   */
  event: {
    /**
     * Traces input events received by or generated by InputDispatcher
     *
     * @generated from field: perfetto.protos.AndroidMotionEvent dispatcher_motion_event = 1;
     */
    value: AndroidMotionEvent;
    case: "dispatcherMotionEvent";
  } | {
    /**
     * @generated from field: perfetto.protos.AndroidMotionEvent dispatcher_motion_event_redacted = 2;
     */
    value: AndroidMotionEvent;
    case: "dispatcherMotionEventRedacted";
  } | {
    /**
     * @generated from field: perfetto.protos.AndroidKeyEvent dispatcher_key_event = 3;
     */
    value: AndroidKeyEvent;
    case: "dispatcherKeyEvent";
  } | {
    /**
     * @generated from field: perfetto.protos.AndroidKeyEvent dispatcher_key_event_redacted = 4;
     */
    value: AndroidKeyEvent;
    case: "dispatcherKeyEventRedacted";
  } | {
    /**
     * Traces an event being dispatched to a window.
     *
     * @generated from field: perfetto.protos.AndroidWindowInputDispatchEvent dispatcher_window_dispatch_event = 5;
     */
    value: AndroidWindowInputDispatchEvent;
    case: "dispatcherWindowDispatchEvent";
  } | {
    /**
     * @generated from field: perfetto.protos.AndroidWindowInputDispatchEvent dispatcher_window_dispatch_event_redacted = 6;
     */
    value: AndroidWindowInputDispatchEvent;
    case: "dispatcherWindowDispatchEventRedacted";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message perfetto.protos.AndroidInputEvent.
 * Use `create(AndroidInputEventSchema)` to create a new message.
 */
export const AndroidInputEventSchema: GenMessage<AndroidInputEvent> = /*@__PURE__*/
  messageDesc(file_protos_perfetto_trace_android_android_input_event, 3);

