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

// Protos for communication between `CuttlefishDisplayHandler` running inside
// of tests and `CuttlefishDisplayFeature` running in the TradefedFeatureServer.

syntax = "proto3";

package tradefed.feature.server.internal;

option java_package = "com.proto.tradefed.feature.internal";
option java_outer_classname = "CuttlefishDisplayFeatureProtos";

option java_multiple_files = true;
option java_generic_services = true;

message CuttlefishDisplayAddRequest {
    uint32 width = 1;
    uint32 height = 2;
    uint32 dpi = 3;
    uint32 refresh_rate_hz = 4;
}

message CuttlefishDisplayAddResponse {
    uint32 display_number = 1;
}

message CuttlefishDisplayListRequest {

}

message CuttlefishDisplay {
    uint32 width = 1;
    uint32 height = 2;
    uint32 dpi = 3;
    uint32 refresh_rate_hz = 4;
}

message CuttlefishDisplayListResponse {
    map<uint32, CuttlefishDisplay> displays = 1;
}

message CuttlefishDisplayRemoveRequest {
    uint32 display_number = 1;
}

message CuttlefishDisplayRemoveResponse {

}

message CuttlefishDisplayScreenshotRequest {
    uint32 display_number = 1;
}

message CuttlefishDisplayScreenshotResponse {
    string screenshot_mime_type = 1;
    string screenshot_bytes = 2;
}

// Top level message for sending a request to the tradefed server:
message CuttlefishDisplayFeatureRequest {
    oneof display_request_oneof {
        CuttlefishDisplayAddRequest add_display = 1;
        CuttlefishDisplayListRequest list_displays = 2;
        CuttlefishDisplayRemoveRequest remove_display = 3;
        CuttlefishDisplayScreenshotRequest screenshot_display = 4;
    }
}

// Top level message for the response from the tradefed server:
message CuttlefishDisplayFeatureResponse {
    oneof display_response_oneof {
        CuttlefishDisplayAddResponse add_display = 1;
        CuttlefishDisplayListResponse list_displays = 2;
        CuttlefishDisplayRemoveResponse remove_display = 3;
        CuttlefishDisplayScreenshotResponse screenshot_display = 4;
    }
}
