syntax = "proto3";

package vncnetwork;
option go_package="./;vncnetwork";

message image_data {
    bool       ok = 1;
    string    msg = 2;
    uint32   bits = 3;
    uint32  width = 4;
    uint32 height = 5;
    bytes    data = 6;
}

enum status {
    unset_st = 0;
    down     = 1;
    up       = 2;
}

message mouse_data {
    enum button {
        unset_btn = 0;
        left      = 1;
        middle    = 2;
        right     = 3;
    }
    status type = 1;
    button  btn = 2;
    uint32    x = 3;
    uint32    y = 4;
}

message keyboard_data {
    status type = 1;
    string  key = 2;
}

message scroll_data {
    int32 x = 1;
    int32 y = 2;
}

message vnc_msg {
    enum type {
        capture_req    = 0;
        capture_data   = 1;
        mouse_event    = 2;
        keyboard_event = 3;
        set_cursor     = 4;
        scroll_event   = 5;
    }
    type _type = 1;
    oneof payload {
        image_data        data = 2;
        mouse_data       mouse = 3;
        keyboard_data keyboard = 4;
        bool       show_cursor = 5;
        scroll_data     scroll = 6;
    }
}