-
-
Notifications
You must be signed in to change notification settings - Fork 138
/
stylevarid_enumer.go
206 lines (192 loc) · 9.2 KB
/
stylevarid_enumer.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
// Code generated by "enumer -linecomment -type=StyleVarID ."; DO NOT EDIT.
package giu
import (
"fmt"
"strings"
)
const (
_StyleVarIDName_0 = "alphadisabled-alphawindow-paddingwindow-roundingwindow-border-sizewindow-minValue-sizewindow-title-alignchild-roundingchild-border-sizepopup-roundingpopup-border-sizeframe-paddingframe-roundingframe-border-sizeitem-spacingitem-inner-spacingindent-spacingStyleVarCellPaddingscrollbar-sizescrollbar-roundinggrab-minValue-sizegrab-roundingtab-rounding"
_StyleVarIDLowerName_0 = "alphadisabled-alphawindow-paddingwindow-roundingwindow-border-sizewindow-minvalue-sizewindow-title-alignchild-roundingchild-border-sizepopup-roundingpopup-border-sizeframe-paddingframe-roundingframe-border-sizeitem-spacingitem-inner-spacingindent-spacingstylevarcellpaddingscrollbar-sizescrollbar-roundinggrab-minvalue-sizegrab-roundingtab-rounding"
_StyleVarIDName_1 = "StyleVarTabBarBorderSize"
_StyleVarIDLowerName_1 = "stylevartabbarbordersize"
_StyleVarIDName_2 = "button-text-alignselectable-text-alignStyleVarSeparatorTextBorderSizeStyleVarSeparatorTextAlignStyleVarSeparatorTextPaddingStyleVarDockingSeparatorSize"
_StyleVarIDLowerName_2 = "button-text-alignselectable-text-alignstylevarseparatortextbordersizestylevarseparatortextalignstylevarseparatortextpaddingstylevardockingseparatorsize"
)
var (
_StyleVarIDIndex_0 = [...]uint16{0, 5, 19, 33, 48, 66, 86, 104, 118, 135, 149, 166, 179, 193, 210, 222, 240, 254, 273, 287, 305, 323, 336, 348}
_StyleVarIDIndex_1 = [...]uint8{0, 24}
_StyleVarIDIndex_2 = [...]uint8{0, 17, 38, 69, 95, 123, 151}
)
func (i StyleVarID) String() string {
switch {
case 0 <= i && i <= 22:
return _StyleVarIDName_0[_StyleVarIDIndex_0[i]:_StyleVarIDIndex_0[i+1]]
case i == 24:
return _StyleVarIDName_1
case 28 <= i && i <= 33:
i -= 28
return _StyleVarIDName_2[_StyleVarIDIndex_2[i]:_StyleVarIDIndex_2[i+1]]
default:
return fmt.Sprintf("StyleVarID(%d)", i)
}
}
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _StyleVarIDNoOp() {
var x [1]struct{}
_ = x[StyleVarAlpha-(0)]
_ = x[StyleVarDisabledAlpha-(1)]
_ = x[StyleVarWindowPadding-(2)]
_ = x[StyleVarWindowRounding-(3)]
_ = x[StyleVarWindowBorderSize-(4)]
_ = x[StyleVarWindowMinSize-(5)]
_ = x[StyleVarWindowTitleAlign-(6)]
_ = x[StyleVarChildRounding-(7)]
_ = x[StyleVarChildBorderSize-(8)]
_ = x[StyleVarPopupRounding-(9)]
_ = x[StyleVarPopupBorderSize-(10)]
_ = x[StyleVarFramePadding-(11)]
_ = x[StyleVarFrameRounding-(12)]
_ = x[StyleVarFrameBorderSize-(13)]
_ = x[StyleVarItemSpacing-(14)]
_ = x[StyleVarItemInnerSpacing-(15)]
_ = x[StyleVarIndentSpacing-(16)]
_ = x[StyleVarCellPadding-(17)]
_ = x[StyleVarScrollbarSize-(18)]
_ = x[StyleVarScrollbarRounding-(19)]
_ = x[StyleVarGrabMinSize-(20)]
_ = x[StyleVarGrabRounding-(21)]
_ = x[StyleVarTabRounding-(22)]
_ = x[StyleVarTabBarBorderSize-(24)]
_ = x[StyleVarButtonTextAlign-(28)]
_ = x[StyleVarSelectableTextAlign-(29)]
_ = x[StyleVarSeparatorTextBorderSize-(30)]
_ = x[StyleVarSeparatorTextAlign-(31)]
_ = x[StyleVarSeparatorTextPadding-(32)]
_ = x[StyleVarDockingSeparatorSize-(33)]
}
var _StyleVarIDValues = []StyleVarID{StyleVarAlpha, StyleVarDisabledAlpha, StyleVarWindowPadding, StyleVarWindowRounding, StyleVarWindowBorderSize, StyleVarWindowMinSize, StyleVarWindowTitleAlign, StyleVarChildRounding, StyleVarChildBorderSize, StyleVarPopupRounding, StyleVarPopupBorderSize, StyleVarFramePadding, StyleVarFrameRounding, StyleVarFrameBorderSize, StyleVarItemSpacing, StyleVarItemInnerSpacing, StyleVarIndentSpacing, StyleVarCellPadding, StyleVarScrollbarSize, StyleVarScrollbarRounding, StyleVarGrabMinSize, StyleVarGrabRounding, StyleVarTabRounding, StyleVarTabBarBorderSize, StyleVarButtonTextAlign, StyleVarSelectableTextAlign, StyleVarSeparatorTextBorderSize, StyleVarSeparatorTextAlign, StyleVarSeparatorTextPadding, StyleVarDockingSeparatorSize}
var _StyleVarIDNameToValueMap = map[string]StyleVarID{
_StyleVarIDName_0[0:5]: StyleVarAlpha,
_StyleVarIDLowerName_0[0:5]: StyleVarAlpha,
_StyleVarIDName_0[5:19]: StyleVarDisabledAlpha,
_StyleVarIDLowerName_0[5:19]: StyleVarDisabledAlpha,
_StyleVarIDName_0[19:33]: StyleVarWindowPadding,
_StyleVarIDLowerName_0[19:33]: StyleVarWindowPadding,
_StyleVarIDName_0[33:48]: StyleVarWindowRounding,
_StyleVarIDLowerName_0[33:48]: StyleVarWindowRounding,
_StyleVarIDName_0[48:66]: StyleVarWindowBorderSize,
_StyleVarIDLowerName_0[48:66]: StyleVarWindowBorderSize,
_StyleVarIDName_0[66:86]: StyleVarWindowMinSize,
_StyleVarIDLowerName_0[66:86]: StyleVarWindowMinSize,
_StyleVarIDName_0[86:104]: StyleVarWindowTitleAlign,
_StyleVarIDLowerName_0[86:104]: StyleVarWindowTitleAlign,
_StyleVarIDName_0[104:118]: StyleVarChildRounding,
_StyleVarIDLowerName_0[104:118]: StyleVarChildRounding,
_StyleVarIDName_0[118:135]: StyleVarChildBorderSize,
_StyleVarIDLowerName_0[118:135]: StyleVarChildBorderSize,
_StyleVarIDName_0[135:149]: StyleVarPopupRounding,
_StyleVarIDLowerName_0[135:149]: StyleVarPopupRounding,
_StyleVarIDName_0[149:166]: StyleVarPopupBorderSize,
_StyleVarIDLowerName_0[149:166]: StyleVarPopupBorderSize,
_StyleVarIDName_0[166:179]: StyleVarFramePadding,
_StyleVarIDLowerName_0[166:179]: StyleVarFramePadding,
_StyleVarIDName_0[179:193]: StyleVarFrameRounding,
_StyleVarIDLowerName_0[179:193]: StyleVarFrameRounding,
_StyleVarIDName_0[193:210]: StyleVarFrameBorderSize,
_StyleVarIDLowerName_0[193:210]: StyleVarFrameBorderSize,
_StyleVarIDName_0[210:222]: StyleVarItemSpacing,
_StyleVarIDLowerName_0[210:222]: StyleVarItemSpacing,
_StyleVarIDName_0[222:240]: StyleVarItemInnerSpacing,
_StyleVarIDLowerName_0[222:240]: StyleVarItemInnerSpacing,
_StyleVarIDName_0[240:254]: StyleVarIndentSpacing,
_StyleVarIDLowerName_0[240:254]: StyleVarIndentSpacing,
_StyleVarIDName_0[254:273]: StyleVarCellPadding,
_StyleVarIDLowerName_0[254:273]: StyleVarCellPadding,
_StyleVarIDName_0[273:287]: StyleVarScrollbarSize,
_StyleVarIDLowerName_0[273:287]: StyleVarScrollbarSize,
_StyleVarIDName_0[287:305]: StyleVarScrollbarRounding,
_StyleVarIDLowerName_0[287:305]: StyleVarScrollbarRounding,
_StyleVarIDName_0[305:323]: StyleVarGrabMinSize,
_StyleVarIDLowerName_0[305:323]: StyleVarGrabMinSize,
_StyleVarIDName_0[323:336]: StyleVarGrabRounding,
_StyleVarIDLowerName_0[323:336]: StyleVarGrabRounding,
_StyleVarIDName_0[336:348]: StyleVarTabRounding,
_StyleVarIDLowerName_0[336:348]: StyleVarTabRounding,
_StyleVarIDName_1[0:24]: StyleVarTabBarBorderSize,
_StyleVarIDLowerName_1[0:24]: StyleVarTabBarBorderSize,
_StyleVarIDName_2[0:17]: StyleVarButtonTextAlign,
_StyleVarIDLowerName_2[0:17]: StyleVarButtonTextAlign,
_StyleVarIDName_2[17:38]: StyleVarSelectableTextAlign,
_StyleVarIDLowerName_2[17:38]: StyleVarSelectableTextAlign,
_StyleVarIDName_2[38:69]: StyleVarSeparatorTextBorderSize,
_StyleVarIDLowerName_2[38:69]: StyleVarSeparatorTextBorderSize,
_StyleVarIDName_2[69:95]: StyleVarSeparatorTextAlign,
_StyleVarIDLowerName_2[69:95]: StyleVarSeparatorTextAlign,
_StyleVarIDName_2[95:123]: StyleVarSeparatorTextPadding,
_StyleVarIDLowerName_2[95:123]: StyleVarSeparatorTextPadding,
_StyleVarIDName_2[123:151]: StyleVarDockingSeparatorSize,
_StyleVarIDLowerName_2[123:151]: StyleVarDockingSeparatorSize,
}
var _StyleVarIDNames = []string{
_StyleVarIDName_0[0:5],
_StyleVarIDName_0[5:19],
_StyleVarIDName_0[19:33],
_StyleVarIDName_0[33:48],
_StyleVarIDName_0[48:66],
_StyleVarIDName_0[66:86],
_StyleVarIDName_0[86:104],
_StyleVarIDName_0[104:118],
_StyleVarIDName_0[118:135],
_StyleVarIDName_0[135:149],
_StyleVarIDName_0[149:166],
_StyleVarIDName_0[166:179],
_StyleVarIDName_0[179:193],
_StyleVarIDName_0[193:210],
_StyleVarIDName_0[210:222],
_StyleVarIDName_0[222:240],
_StyleVarIDName_0[240:254],
_StyleVarIDName_0[254:273],
_StyleVarIDName_0[273:287],
_StyleVarIDName_0[287:305],
_StyleVarIDName_0[305:323],
_StyleVarIDName_0[323:336],
_StyleVarIDName_0[336:348],
_StyleVarIDName_1[0:24],
_StyleVarIDName_2[0:17],
_StyleVarIDName_2[17:38],
_StyleVarIDName_2[38:69],
_StyleVarIDName_2[69:95],
_StyleVarIDName_2[95:123],
_StyleVarIDName_2[123:151],
}
// StyleVarIDString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func StyleVarIDString(s string) (StyleVarID, error) {
if val, ok := _StyleVarIDNameToValueMap[s]; ok {
return val, nil
}
if val, ok := _StyleVarIDNameToValueMap[strings.ToLower(s)]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to StyleVarID values", s)
}
// StyleVarIDValues returns all values of the enum
func StyleVarIDValues() []StyleVarID {
return _StyleVarIDValues
}
// StyleVarIDStrings returns a slice of all String values of the enum
func StyleVarIDStrings() []string {
strs := make([]string, len(_StyleVarIDNames))
copy(strs, _StyleVarIDNames)
return strs
}
// IsAStyleVarID returns "true" if the value is listed in the enum definition. "false" otherwise
func (i StyleVarID) IsAStyleVarID() bool {
for _, v := range _StyleVarIDValues {
if i == v {
return true
}
}
return false
}