summaryrefslogtreecommitdiff
path: root/protobuf/widget.proto
blob: e20354bfca67161fdd43b2cba0e25b06481deaad (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
syntax = "proto3";
package guiProtobuf;

message Action {
	WidgetType widgetType	= 1;
	ActionType actionType	= 2;
	int64	widgetId	= 3;
	int64	parentId	= 4;
	string	text		= 5; // what is visable to the user
	string	name		= 6; // a name useful for programming

	// This is how the values are passed back and forth
	// values from things like checkboxes & dropdown's
	bool	b		= 7;
	int64	i		= 8;
	string	s		= 9;

	// This is used for things like a slider(0,100)
	int64	x		= 10;
	int64	y		= 11;

	// This is for the grid size & widget position
	int64	w		= 12;
	int64	h		= 13;
	int64	atw		= 14;
	int64	ath		= 15;

	bool	margin		= 16; // Put space around elements to improve look & feel
	bool	expand		= 17; // Make widgets fill up the space available

	repeated Response results = 18;
	repeated Network networks = 19;
	repeated VM vms = 20;

	enum WidgetType {
		Unknown	= 0;
		Root	= 1;	// the master 'root' node of the binary tree
		Flag	= 2;	// used to send configuration values to plugins
		Window	= 3;	// in certain gui's (ncurses), these are tabs
		Tab	= 4;	// internally, this is a window
		Frame	= 5;	// deprecate?
		Grid	= 6;	// like drawers in a chest
		Group	= 7;	// like the 'Appetizers' section on a menu
		Box	= 8;	// a vertical or horizontal stack of widgets
		Button	= 9;
		Checkbox = 10;	// select 'on' or 'off'
		Dropdown = 11;
		Combobox  = 12;	// dropdown with edit=true
		Label = 13;
		Textbox = 14;	// is this a Label with edit=true
		Slider = 15;	// like a progress bar
		Spinner = 16;	// like setting the oven temperature
		Separator = 17;	// TODO
		Image = 18;	// TODO
		Area = 19;	// TODO
		Form = 20;	// TODO
		Font = 21;	// TODO
		Color = 22;	// TODO
		Dialog = 23;	// TODO
		Stdout = 24;	// can be used to capture and display log output
	}

	enum ActionType {
		Health	= 0;
		Add	= 1;
		Delete	= 2;
		Get	= 3;
		Set	= 4;
		GetText	= 5;
		SetText	= 6;
		AddText	= 7;
		Show	= 8;
		Hide	= 9;
		Enable	= 10;
		Disable	= 11;
		Margin	= 12;
		Unmargin	= 13;
		Pad	= 14;
		Unpad	= 15;
		Append	= 16;
		Move	= 17;
		Dump	= 18;
		User	= 19; // the user did something (mouse, keyboard, etc)
		InitToolkit	= 20; // initializes the toolkit
		CloseToolkit	= 21; // closes the toolkit
		UserQuit	= 22; // the user closed the GUI
		EnableDebug	= 23; // open the debugging window
	}

	message Response {
		// ActionType type	= 1;
		int64	id	= 2;
		string	name	= 3;
		string	error	= 4;
		repeated string snippets = 5;
	}

	message Network {
		int64	id	= 1;
		string	name	= 2;
		int64	total_cpu = 3;
		int64	total_mem = 4;
		string	login_url = 5;
	}

	message VM {
		int64	id	= 1;
		string	name	= 2;
		string	hostname = 3;
		int64	cpus	= 4;
		int64	memory	= 5;
		int64	disk	= 6;
		string	IPv6	= 7;
		string	role	= 8;
		string	baseImage = 9;
	}
}