guipb/widget.proto

63 lines
2.4 KiB
Protocol Buffer
Raw Normal View History

2025-02-13 17:24:27 -06:00
syntax = "proto3";
// playing around with ideas here
package gitpb;
// import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
import "google/protobuf/any.proto"; // Import 'Any'
message Size {
2025-03-02 20:05:38 -06:00
int64 width = 1;
int64 height = 2;
2025-02-13 17:24:27 -06:00
}
2025-03-05 02:59:51 -06:00
// used for grid layouts
2025-02-13 17:24:27 -06:00
message Location {
2025-03-02 20:05:38 -06:00
int64 x = 1;
int64 y = 2;
2025-02-13 17:24:27 -06:00
}
2025-03-05 02:59:51 -06:00
message Tree { // `autogenpb:marshal`
2025-03-02 20:05:38 -06:00
Widget parent = 1;
repeated Widget children = 2;
2025-02-13 17:24:27 -06:00
}
message Widget {
2025-03-02 20:05:38 -06:00
int64 id = 1;
string name = 2;
int64 size = 3;
google.protobuf.Any val = 4;
google.protobuf.Any TK = 5;
WidgetType Type = 6;
Location location = 7;
2025-02-13 17:24:27 -06:00
}
2025-03-03 00:12:26 -06:00
message Widgets { // `autogenpb:marshal`
2025-03-02 20:05:38 -06:00
string uuid = 1; // `autogenpb:uuid:0331fcd7-3c8c-43e4-be1b-77db6a6bc58c`
string version = 2; // `autogenpb:version:v1`
2025-03-05 02:59:51 -06:00
repeated Widget Widgets = 3; // this never gets used, but it's not worth violating the autogenpb standard
Tree tree = 4; // everything is sent from go.wit.com/gui here
2025-03-02 20:05:38 -06:00
}
2025-03-05 02:59:51 -06:00
//
// Widget names should try to match [Wikipedia Graphical widget]
// TODO: fix autogenpb to look for enum
2025-03-02 20:05:38 -06:00
enum WidgetType {
Root = 0; // the master 'root' node of the binary tree
2025-03-05 02:59:51 -06:00
Flag = 1; // internal use
2025-03-02 20:05:38 -06:00
Window = 2; //
Tab = 3; // a tab like in firefox
2025-03-05 02:59:51 -06:00
Box = 4; // must be either Vertical or Horizontal arrangment
2025-03-02 20:05:38 -06:00
Group = 5; // think 'Appetizers' on a restaurant menu
2025-03-05 02:59:51 -06:00
Grid = 6; // like drawers in a chest or post office boxes
Button = 7; // user can click on this
Checkbox = 8; // true or false
2025-03-02 20:05:38 -06:00
Dropdown = 9; //
2025-03-05 02:59:51 -06:00
Combobox = 10; // a dropdown menu that can be edited by the user
Label = 11; // a simple label
Textbox = 12; // enter text
TablePB = 13; // special case to allow the arbitrary GUI display of any other protobuf
2025-02-13 17:24:27 -06:00
}