// Copyright (C) 2025 Rivos Inc.
//
// 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.

// Autogenerated by the ProtoZero Rust compiler plugin.
// Invoked by contrib/rust-sdk/tools/gen_rust_protos
// DO NOT EDIT.

use crate::pb_enum;
use crate::pb_msg;

pb_enum!(ChromeLatencyInfoStep {
    STEP_UNSPECIFIED: 0,
    STEP_SEND_INPUT_EVENT_UI: 3,
    STEP_HANDLE_INPUT_EVENT_IMPL: 5,
    STEP_DID_HANDLE_INPUT_AND_OVERSCROLL: 8,
    STEP_HANDLE_INPUT_EVENT_MAIN: 4,
    STEP_MAIN_THREAD_SCROLL_UPDATE: 2,
    STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT: 1,
    STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL: 9,
    STEP_HANDLED_INPUT_EVENT_IMPL: 10,
    STEP_SWAP_BUFFERS: 6,
    STEP_DRAW_AND_SWAP: 7,
    STEP_FINISHED_SWAP_BUFFERS: 11,
});

pb_enum!(ChromeLatencyInfoLatencyComponentType {
    COMPONENT_UNSPECIFIED: 0,
    COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH: 1,
    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL: 2,
    COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL: 3,
    COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL: 4,
    COMPONENT_INPUT_EVENT_LATENCY_UI: 5,
    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN: 6,
    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN: 7,
    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL: 8,
    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT: 9,
    COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH: 10,
    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP: 11,
    COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME: 12,
    COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER: 13,
    COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP: 14,
});

pb_enum!(ChromeLatencyInfoInputType {
    UNSPECIFIED_OR_OTHER: 0,
    TOUCH_MOVED: 1,
    GESTURE_SCROLL_BEGIN: 2,
    GESTURE_SCROLL_UPDATE: 3,
    GESTURE_SCROLL_END: 4,
    GESTURE_TAP: 5,
    GESTURE_TAP_CANCEL: 6,
});

pb_msg!(ChromeLatencyInfo {
    trace_id: i64, primitive, 1,
    step: ChromeLatencyInfoStep, enum, 2,
    frame_tree_node_id: i32, primitive, 3,
    component_info: ChromeLatencyInfoComponentInfo, msg, 4,
    is_coalesced: bool, primitive, 5,
    gesture_scroll_id: i64, primitive, 6,
    touch_id: i64, primitive, 7,
    input_type: ChromeLatencyInfoInputType, enum, 8,
});

pb_msg!(ChromeLatencyInfoComponentInfo {
    component_type: ChromeLatencyInfoLatencyComponentType, enum, 1,
    time_us: u64, primitive, 2,
});
