-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents.go
208 lines (196 loc) · 4.67 KB
/
events.go
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
package bspc
type EventType string
const (
// TODO: Uncomment this when "report" events are supported.
// EventTypeAll EventType = "all".
// Monitor
// "Please note that bspwm initializes monitors before
// it reads messages on its socket, therefore the initial
// monitor events can’t be received".
EventTypeMonitorAdd EventType = "monitor_add"
EventTypeMonitorRename EventType = "monitor_rename"
EventTypeMonitorRemove EventType = "monitor_remove"
EventTypeMonitorSwap EventType = "monitor_swap"
EventTypeMonitorFocus EventType = "monitor_focus"
EventTypeMonitorGeometry EventType = "monitor_geometry"
// Desktop.
EventTypeDesktopAdd EventType = "desktop_add"
EventTypeDesktopRename EventType = "desktop_rename"
EventTypeDesktopRemove EventType = "desktop_remove"
EventTypeDesktopSwap EventType = "desktop_swap"
EventTypeDesktopTransfer EventType = "desktop_transfer"
EventTypeDesktopFocus EventType = "desktop_focus"
EventTypeDesktopActivate EventType = "desktop_activate"
EventTypeDesktopLayout EventType = "desktop_layout"
// Node.
EventTypeNodeAdd EventType = "node_add"
EventTypeNodeRemove EventType = "node_remove"
EventTypeNodeSwap EventType = "node_swap"
EventTypeNodeTransfer EventType = "node_transfer"
EventTypeNodeFocus EventType = "node_focus"
EventTypeNodeActivate EventType = "node_activate"
EventTypeNodePreselect EventType = "node_presel"
EventTypeNodeStack EventType = "node_stack"
EventTypeNodeGeometry EventType = "node_geometry"
EventTypeNodeState EventType = "node_state"
EventTypeNodeFlag EventType = "node_flag"
EventTypeNodeLayer EventType = "node_layer"
// Pointer.
EventTypePointerAction EventType = "pointer_action"
)
type (
// Monitor.
EventMonitorAdd struct {
MonitorID ID
MonitorName string
MonitorGeometry rectangle
}
EventMonitorRename struct {
MonitorID ID
MonitorOldName string
MonitorNewName string
}
EventMonitorRemove struct {
MonitorID ID
}
EventMonitorSwap struct {
SourceMonitorID ID
DestinationMonitorID ID
}
EventMonitorFocus struct {
MonitorID ID
}
EventMonitorGeometry struct {
MonitorID ID
MonitorGeometry rectangle
}
// Desktop.
EventDesktopAdd struct {
MonitorID ID
DesktopID ID
DesktopName string
}
EventDesktopRename struct {
MonitorID ID
DesktopID ID
DesktopOldName string
DesktopNewName string
}
EventDesktopRemove struct {
MonitorID ID
DesktopID ID
}
EventDesktopSwap struct {
SourceMonitorID ID
SourceDesktopID ID
DestinationMonitorID ID
DestinationDesktopID ID
}
EventDesktopTransfer struct {
SourceMonitorID ID
SourceDesktopID ID
DestinationMonitorID ID
DestinationDesktopID ID
}
EventDesktopFocus struct {
MonitorID ID
DesktopID ID
}
EventDesktopActivate struct {
MonitorID ID
DesktopID ID
}
EventDesktopLayout struct {
MonitorID ID
DesktopID ID
DesktopLayout LayoutType
}
// Node.
EventNodeAdd struct {
MonitorID ID
DesktopID ID
IPID ID // TODO: What is this?
NodeID ID
}
EventNodeRemove struct {
MonitorID ID
DesktopID ID
NodeID ID
}
EventNodeSwap struct {
SourceMonitorID ID
SourceDesktopID ID
SourceNodeID ID
DestinationMonitorID ID
DestinationDesktopID ID
DestinationNodeID ID
}
EventNodeTransfer struct {
SourceMonitorID ID
SourceDesktopID ID
SourceNodeID ID
DestinationMonitorID ID
DestinationDesktopID ID
DestinationNodeID ID
}
EventNodeFocus struct {
MonitorID ID
DesktopID ID
NodeID ID
}
EventNodeActivate struct {
MonitorID ID
DesktopID ID
NodeID ID
}
EventNodePreselect struct {
MonitorID ID
DesktopID ID
NodeID ID
// Only one of the below will be available.
SplitDirection *SplitType
SplitRatio *float64
IsCancel *bool
}
EventNodeStack struct {
Node1ID ID
RelativePosition RelativePositionType
Node2ID ID
}
EventNodeGeometry struct {
MonitorID ID
DesktopID ID
NodeID ID
NodeGeometry rectangle
}
EventNodeState struct {
MonitorID ID
DesktopID ID
NodeID ID
State StateType
WasEnabled bool
}
EventNodeFlag struct {
MonitorID ID
DesktopID ID
NodeID ID
Flag FlagType
// WasEnabled will be true, if the flag was enabled.
// If the flag was disabled, it will be false.
WasEnabled bool
}
EventNodeLayer struct {
MonitorID ID
DesktopID ID
NodeID ID
Layer LayerType
}
// Pointer.
EventPointerAction struct {
MonitorID ID
DesktopID ID
NodeID ID
PointerAction PointerActionType
PointerActionState PointerActionStateType
}
)