codemp-proto 0.8.0

protocol definitions for codemp -- code multiplexer
Documentation
syntax = "proto2";

package cursor;
import "common.proto";
import "files.proto";

// Handles cursor events and broadcasts them to all users.
service Cursor {
	// Retrieves all current cursor positions.	
	rpc List(common.Empty) returns (CursorEventList);
	// Subscribe to a workspace's cursor events.
	rpc Attach (stream cursor.CursorPosition) returns (stream cursor.CursorEvent);
}

// A message representing a list of cursor events.
message CursorEventList {
	// A vector of cursor events.
	repeated CursorEvent cursors = 1;
}

// 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.Identifier user = 1;
	// The new cursor position.
	repeated CursorPosition position = 2;
}