start switch to widgetpb
This commit is contained in:
parent
339265e31a
commit
59a796c1af
8
Makefile
8
Makefile
|
@ -1,4 +1,4 @@
|
||||||
all: clean proto goimports vet
|
all: proto goimports vet
|
||||||
|
|
||||||
redo: clean proto goimports vet
|
redo: clean proto goimports vet
|
||||||
|
|
||||||
|
@ -9,8 +9,12 @@ vet:
|
||||||
goimports:
|
goimports:
|
||||||
goimports -w *.go
|
goimports -w *.go
|
||||||
|
|
||||||
proto:
|
proto: widget.pb.go table.pb.go
|
||||||
|
|
||||||
|
widget.pb.go: widget.proto
|
||||||
autogenpb --proto widget.proto
|
autogenpb --proto widget.proto
|
||||||
|
|
||||||
|
table.pb.go: table.proto
|
||||||
autogenpb --proto table.proto
|
autogenpb --proto table.proto
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
54
widget.proto
54
widget.proto
|
@ -9,33 +9,53 @@ import "google/protobuf/any.proto"; // Import 'Any'
|
||||||
|
|
||||||
|
|
||||||
message Size {
|
message Size {
|
||||||
int64 width = 1;
|
int64 width = 1;
|
||||||
int64 height = 2;
|
int64 height = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Location {
|
message Location {
|
||||||
int64 x = 1;
|
int64 x = 1;
|
||||||
int64 y = 2;
|
int64 y = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Tree {
|
message Tree {
|
||||||
Widget parent = 1;
|
Widget parent = 1;
|
||||||
repeated Widget children = 2;
|
repeated Widget children = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Widget {
|
message Widget {
|
||||||
int64 id = 1;
|
int64 id = 1;
|
||||||
string name = 2;
|
string name = 2;
|
||||||
int64 size = 3;
|
int64 size = 3;
|
||||||
google.protobuf.Any val = 4;
|
google.protobuf.Any val = 4;
|
||||||
// Size size = 3;
|
google.protobuf.Any TK = 5;
|
||||||
// Location location = 4;
|
WidgetType Type = 6;
|
||||||
// string color = 5;
|
Location location = 7;
|
||||||
// google.protobuf.Any TK = 6;
|
// Size size = 3;
|
||||||
|
// string color = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Widgets {
|
message Widgets {
|
||||||
string uuid = 1; // `autogenpb:uuid:0331fcd7-3c8c-43e4-be1b-77db6a6bc58c`
|
string uuid = 1; // `autogenpb:uuid:0331fcd7-3c8c-43e4-be1b-77db6a6bc58c`
|
||||||
string version = 2; // `autogenpb:version:v1`
|
string version = 2; // `autogenpb:version:v1`
|
||||||
repeated Widget Widgets = 3;
|
repeated Widget Widgets = 3;
|
||||||
|
Tree tree = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo: fix autogenpb to look for enum
|
||||||
|
enum WidgetType {
|
||||||
|
Root = 0; // the master 'root' node of the binary tree
|
||||||
|
Flag = 1; //
|
||||||
|
Window = 2; //
|
||||||
|
Tab = 3; // a tab like in firefox
|
||||||
|
Box = 4; //
|
||||||
|
Group = 5; // think 'Appetizers' on a restaurant menu
|
||||||
|
Grid = 6; // like drawers in a chest
|
||||||
|
Button = 7; //
|
||||||
|
Checkbox = 8; //
|
||||||
|
Dropdown = 9; //
|
||||||
|
Combobox = 10; //
|
||||||
|
Label = 11; //
|
||||||
|
Textbox = 12; //
|
||||||
|
TablePB = 13; //
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue