summaryrefslogtreecommitdiff
path: root/widget.proto
blob: ebe3f974aa515734bb80570d3d7db149a3928d51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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  {
        int64                 width        = 1;
        int64                 height       = 2;
}

message Location  {
        int64                 x            = 1;
        int64                 y            = 2;
}

message Tree {
        Widget                parent       = 1;
        repeated Widget       children     = 2;
}

message Widget {
        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;
                                                 // Size                  size         = 3;
                                                 // string                color        = 5;
}

message Widgets {                                // `autogenpb:marshal`
        string                uuid         = 1;  // `autogenpb:uuid:0331fcd7-3c8c-43e4-be1b-77db6a6bc58c`
        string                version      = 2;  // `autogenpb:version:v1`
        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; //
}