codemp-proto/proto/cursor.proto

38 lines
910 B
Protocol Buffer
Raw Normal View History

syntax = "proto2";
package cursor;
import "common.proto";
import "files.proto";
// Handles cursor events and broadcasts them to all users.
service Cursor {
// Subscribe to a workspace's cursor events.
rpc Attach (stream cursor.CursorPosition) returns (stream cursor.CursorEvent);
}
// A message representing a position in a buffer.
message RowCol {
// The row.
required int32 row = 1;
// The column.
required int32 col = 2;
}
// A message representing cursor position.
message CursorPosition {
// The buffer where the cursor is located.
required files.BufferNode buffer = 1;
// The cursor's start position.
required RowCol start = 2;
// The cursor's end position.
required RowCol end = 3;
}
// A message representing a cursor event.
message CursorEvent {
// The user moving the cursor.
required common.Identity user = 1;
// The new cursor position.
required CursorPosition position = 2;
}