mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
alemi
1cf17dc151
reuse as much as possible, keep rpc messages close with their rpc, helper struct for uuid with into() and from(). also replaced the simple things, such as imports and struct fields
36 lines
830 B
Protocol Buffer
36 lines
830 B
Protocol Buffer
syntax = "proto2";
|
|
|
|
package cursor;
|
|
import "common.proto";
|
|
import "files.proto";
|
|
|
|
// handle cursor events and broadcast to all users
|
|
service Cursor {
|
|
// subscribe to a workspace's cursor events
|
|
rpc Attach (stream cursor.CursorPosition) returns (stream cursor.CursorEvent);
|
|
}
|
|
|
|
|
|
// a tuple indicating row and column
|
|
message RowCol {
|
|
required int32 row = 1;
|
|
required int32 col = 2;
|
|
}
|
|
|
|
// cursor position object
|
|
message CursorPosition {
|
|
// path of current buffer this cursor is into
|
|
required files.BufferNode buffer = 1;
|
|
// cursor start position
|
|
required RowCol start = 2;
|
|
// cursor end position
|
|
required RowCol end = 3;
|
|
}
|
|
|
|
// cursor event, with user id and cursor position
|
|
message CursorEvent {
|
|
// user moving the cursor
|
|
required common.Identity user = 1;
|
|
// new cursor position
|
|
required CursorPosition position = 2;
|
|
}
|