-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
107 lines (88 loc) · 2.83 KB
/
types.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
package bspc
type (
LayoutType string
SplitType string
DirectionType string
StateType string
FlagType string
RelativePositionType string
LayerType string
PointerActionType string
PointerActionStateType string
)
const (
LayoutTypeTiled LayoutType = "tiled"
LayoutTypeMonocle LayoutType = "monocle"
SplitTypeHorizontal SplitType = "horizontal"
SplitTypeVertical SplitType = "vertical"
DirectionTypeUp DirectionType = "north"
DirectionTypeDown DirectionType = "south"
DirectionTypeLeft DirectionType = "west"
DirectionTypeRight DirectionType = "east"
StateTypeTiled StateType = "tiled"
StateTypePseudoTiled StateType = "pseudo_tiled"
StateTypeFloating StateType = "floating"
StateTypeFullscreen StateType = "fullscreen"
FlagTypeHidden FlagType = "hidden"
FlagTypeSticky FlagType = "sticky"
FlagTypePrivate FlagType = "private"
FlagTypeLocked FlagType = "locked"
FlagTypeMarked FlagType = "marked"
FlagTypeUrgent FlagType = "urgent"
RelativePositionTypeAbove RelativePositionType = "above"
RelativePositionTypeBelow RelativePositionType = "below"
LayerTypeAbove LayerType = "above"
LayerTypeNormal LayerType = "normal"
LayerTypeBelow LayerType = "below"
PointerActionTypeMove PointerActionType = "move"
PointerActionTypeResizeCorner PointerActionType = "resize_corner"
PointerActionTypeResizeSide PointerActionType = "resize_side"
PointerActionStateTypeBegin PointerActionStateType = "begin"
PointerActionStateTypeEnd PointerActionStateType = "end"
)
func (lt LayoutType) IsValid() bool {
return lt == LayoutTypeTiled ||
lt == LayoutTypeMonocle
}
func (st SplitType) IsValid() bool {
return st == SplitTypeHorizontal ||
st == SplitTypeVertical
}
func (dt DirectionType) IsValid() bool {
return dt == DirectionTypeUp ||
dt == DirectionTypeDown ||
dt == DirectionTypeLeft ||
dt == DirectionTypeRight
}
func (st StateType) IsValid() bool {
return st == StateTypeTiled ||
st == StateTypePseudoTiled ||
st == StateTypeFloating ||
st == StateTypeFullscreen
}
func (ft FlagType) IsValid() bool {
return ft == FlagTypeHidden ||
ft == FlagTypeLocked ||
ft == FlagTypeMarked ||
ft == FlagTypePrivate ||
ft == FlagTypeSticky ||
ft == FlagTypeUrgent
}
func (rpt RelativePositionType) IsValid() bool {
return rpt == RelativePositionTypeAbove ||
rpt == RelativePositionTypeBelow
}
func (lt LayerType) IsValid() bool {
return lt == LayerTypeAbove ||
lt == LayerTypeBelow ||
lt == LayerTypeNormal
}
func (pat PointerActionType) IsValid() bool {
return pat == PointerActionTypeMove ||
pat == PointerActionTypeResizeCorner ||
pat == PointerActionTypeResizeSide
}
func (past PointerActionStateType) IsValid() bool {
return past == PointerActionStateTypeBegin ||
past == PointerActionStateTypeEnd
}