-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathSlabDefinition.lua
More file actions
807 lines (649 loc) · 15.6 KB
/
SlabDefinition.lua
File metadata and controls
807 lines (649 loc) · 15.6 KB
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
---@meta
---@class Slab
local Slab = {}
---@class Slab.BeginWindowOptions
---@field X? number
---@field Y? number
---@field W? number
---@field H? number
---@field ContentW? number
---@field ContentH? number
---@field BgColor? table
---@field Title? string
---@field TitleH? number
---@field TitleAlignX? "left" | "center" | "right"
---@field TitleAlignY? "top" | "center" | "bottom"
---@field AllowMove? boolean
---@field AllowResize? boolean
---@field AllowFocus? boolean
---@field Border? number
---@field NoOutline? boolean
---@field IsMenuBar? boolean
---@field AutoSizeWindow? boolean
---@field AutoSizeWindowW? boolean
---@field AutoSizeWindowH? boolean
---@field AutoSizeContent? boolean
---@field Layer? string
---@field ResetPosition? boolean
---@field ResetSize? boolean
---@field ResetContent? boolean
---@field ResetLayout? boolean
---@field SizerFilter? table
---@field CanObstruct? boolean
---@field Rounding? number
---@field IsOpen? boolean
---@field NoSaveSettings? boolean
---@field ConstrainPosition? boolean
---@field ShowMinimize? boolean
---@field ShowScrollbarX? boolean
---@field ShowScrollbarY? boolean
---@param id string
---@param options? Slab.BeginWindowOptions
---@return boolean
Slab.BeginWindow = function(id, options)
end
Slab.EndWindow = function()
end
---@return number, number
Slab.GetWindowPosition = function()
end
---@return number, number
Slab.GetWindowContentSize = function()
end
---@return number, number
Slab.GetWindowActiveSize = function()
end
---@return boolean
Slab.IsWindowAppearing = function()
end
---@param id string
Slab.PushID = function(id)
end
Slab.PopID = function()
end
---@return table
Slab.GetStyle = function()
end
---@param font love.graphics.Font
Slab.PushFont = function(font)
end
Slab.PopFont = function()
end
---@param path string
---@param set boolean
---@return table
Slab.LoadStyle = function(path, set)
end
---@param name string
---@return boolean
Slab.SetStyle = function(name)
end
---@return table
Slab.GetStyleNames = function()
end
---@return string
Slab.GetCurrentStyleName = function()
end
---@return boolean
Slab.BeginMainMenuBar = function()
end
Slab.EndMainMenuBar = function()
end
---@param isMainMenuBar boolean
---@return boolean
Slab.BeginMenuBar = function(isMainMenuBar)
end
---@class Slab.BeginMenuOptions
---@field Enabled? boolean
---@param label string
---@param options? Slab.BeginMenuOptions
---@return boolean
Slab.BeginMenu = function(label, options)
end
Slab.EndMenu = function()
end
---@param button number
---@return boolean
Slab.BeginContextMenuItem = function(button)
end
---@param button number
---@return boolean
Slab.BeginContextMenuWindow = function(button)
end
Slab.EndContextMenu = function()
end
---@class Slab.MenuItemOptions
---@field Enabled? boolean
---@param label string
---@param options? Slab.MenuItemOptions
Slab.MenuItem = function(label, options)
end
---@class Slab.MenuItemCheckedOptions
---@field Enabled? boolean
---@param label string
---@param isChecked boolean
---@param options? Slab.MenuItemCheckedOptions
---@return boolean
Slab.MenuItemChecked = function(label, isChecked, options)
end
---@param id string
Slab.OpenDialog = function(id)
end
---@param id string
---@param options Slab.BeginWindowOptions
Slab.BeginDialog = function(id, options)
end
Slab.EndDialog = function()
end
Slab.CloseDialog = function()
end
---@class Slab.MessageBoxOptions
---@field Button? table
---@param title string
---@param message string
---@param options? Slab.MessageBoxOptions
---@return string
Slab.MessageBox = function(title, message, options)
end
---@class Slab.FileDialogOptions
---@field Directry? string
---@field Type? string
---@field Filters? table
---@field IncludeParent? boolean
---@param options Slab.FileDialogOptions
---@return table
Slab.FileDialog = function(options)
end
---@class Slab.ColorPickerOptions
---@field Color? table
---@param options Slab.ColorPickerOptions
---@return table
Slab.ColorPicker = function(options)
end
---@param list string | table
Slab.EnableDocks = function(list)
end
---@param list string | table
Slab.DisableDocks = function(list)
end
---@class Slab.SetDockOptionsOptiond
---@field NoSaveSettings? boolean
---@param options Slab.SetDockOptionsOptiond
Slab.SetDockOptions = function(options)
end
---@param type string
Slab.WindowToDock = function(type)
end
---@class Slab.ButtonOptions
---@field Tooltip? string
---@field Rounding? number
---@field Invisible? boolean
---@field W? number
---@field H? number
---@field Disable? boolean
---@field Image? table
---@field Color? table
---@field HoverColor? table
---@field PressColor? table
---@field PadX? number
---@field PadY? number
---@field VLines? number
---@param label string
---@param options? Slab.ButtonOptions
---@return boolean
Slab.Button = function(label, options)
end
---@class Slab.RadioButtonOptions
---@field Index? number
---@field SelectedInxex? number
---@field Tooltip? string
---@param label string
---@param options? Slab.RadioButtonOptions
---@return boolean
Slab.RadioButton = function(label, options)
end
---@class Slab.TextOptions
---@field Color? table
---@field Pad? number
---@field IsSelectable? boolean
---@field IsSelectableTextOnly? boolean
---@field IsSelected? boolean
---@field SleectOnHover? boolean
---@field HoverColor? table
---@param label string
---@param options? Slab.TextOptions
---@return boolean
Slab.Text = function(label, options)
end
---@param label string
---@param options Slab.TextOptions
---@return boolean
Slab.TextSelectable = function(label, options)
end
---@class Slab.TextfOptions
---@field Color table
---@field W number
---@field Align "left" | "center" | "right"
---@param label string
---@param options Slab.TextOptions
Slab.Textf = function(label, options)
end
---@param label string
---@return number, number
Slab.GetTextSize = function(label)
end
---@param label string
---@return number
Slab.GetTextWidth = function(label)
end
---@return number
Slab.GetTextHeight = function()
end
---@class Slab.CheckBoxOptions
---@field Tooltip? string
---@field Id? string
---@field Rounding? number
---@field Size? number
---@field Disable? boolean
---@param enabled boolean
---@param label string
---@param options? Slab.CheckBoxOptions
---@return boolean
Slab.CheckBox = function(enabled, label, options)
end
---@class Slab.InputOptions
---@field Tooltip? string
---@field ReturnOnTexy? boolean
---@field Text? string | number
---@field TextColor? table
---@field BgColor? table
---@field SelectColor? table
---@field SelectOnFocus? boolean
---@field NumberOnly? boolean
---@field W? number
---@field H? number
---@field ReadOnly? boolean
---@field Align? "left" | "center" | "right"
---@field Rounding? number
---@field MinNumber? number
---@field MaxNumber? number
---@field MultiLine? boolean
---@field MultiLineW? number
---@field Highlight? table
---@field Step? number
---@field NoDrag? boolean
---@field UseSlider? boolean
---@field IsPassword? boolean
---@field PasswordChar? string
---@param id string
---@param options? Slab.InputOptions
---@return boolean
Slab.Input = function(id, options)
end
---@param id string
---@param value number
---@param min number
---@param max number
---@param step number
---@param options Slab.InputOptions
Slab.InputNumberDrag = function(id, value, min, max, step, options)
end
---@return string
Slab.GetInputText = function()
end
---@return number
Slab.GetInputNumber = function()
end
---@return number, number, number
Slab.GetInputCursorPos = function()
end
---@param id string
---@return boolean
Slab.IsInputFocused = function(id)
end
---@return boolean
Slab.IsAnyInputFocused = function()
end
---@param id string
Slab.SetInputFocus = function(id)
end
---@param pos number
Slab.SetInputCursorPos = function(pos)
end
---@param column number
---@param line number
Slab.SetInputCursorPosLine = function(column, line)
end
---@class Slab.BeginTreeOptions
---@field Label? string
---@field Tooltip? string
---@field IsLeaf? boolean
---@field OpenWithHighlight? boolean
---@field icon? table
---@field IsSelected? boolean
---@field IsOpen? boolean
---@field NoSaveSettings? boolean
---@param id string
---@param options? Slab.BeginTreeOptions
---@return boolean
Slab.BeginTree = function(id, options)
end
Slab.EndTree = function()
end
---@class Slab.BeginComboBoxOptions
---@field Tooltip? string
---@field Selected? string
---@field W? number
---@field Rounding? number
---@param id string
---@param options? Slab.BeginComboBoxOptions
---@return boolean
Slab.BeginComboBox = function(id, options)
end
Slab.EndComboBox = function()
end
---@class Slab.ImageOptions
---@field Image? love.graphics.Image
---@field Path? string
---@field Rotation? number
---@field Scale? number
---@field ScaleY? number
---@field ScaleX? number
---@field Color? table
---@field SubX? number
---@field SubY? number
---@field SubW? number
---@field SubH? number
---@field WrapX? string
---@field WrapY? string
---@field UseOutline? boolean
---@field OutlineColor? table
---@field OutlineWidth? number
---@field W? number
---@field H? number
---@param id string
---@param options? Slab.ImageOptions
Slab.Image = function(id, options)
end
---@class Slab.BeginListBoxOptions
---@field W? number
---@field H? number
---@field Clear? boolean
---@field Rounding? number
---@field StretchW? boolean
---@field StretchH? boolean
---@param id string
---@param options? Slab.BeginListBoxOptions
Slab.BeginListBox = function(id, options)
end
Slab.EndListBox = function()
end
---@class Slab.BeginListBoxItemOptions
---@field Selected? boolean
---@param id string
---@param options? Slab.BeginListBoxItemOptions
Slab.BeginListBoxItem = function(id, options)
end
---@param button number
---@param isDoubleClick boolean
Slab.IsListBoxItemClicked = function(button, isDoubleClick)
end
Slab.EndListBoxItem = function()
end
---@class Slab.RectangleOptions
---@field Mode? string
---@field W? number
---@field H? number
---@field Color? table
---@field Rounding? number | table
---@field Outline? boolean
---@field OutlineColor? table
---@field Segment? number
---@param options? Slab.RectangleOptions
Slab.Rectangle = function(options)
end
---@class Slab.CircleOptions
---@field Mode? string
---@field Radius? number
---@field Color? table
---@field Segment? number
---@param options? Slab.CircleOptions
Slab.Circle = function(options)
end
---@class Slab.TriangleOptions
---@field Mode? string
---@field Radius? number
---@field Rotation? number
---@field Color? table
---@param options? Slab.TriangleOptions
Slab.Triangle = function(options)
end
---@class Slab.LineOptions
---@field Width? number
---@field Color? table
---@param x2 number
---@param y2 number
---@param options? Slab.LineOptions
Slab.Line = function(x2, y2, options)
end
---@class Slab.CurveOptions
---@field Color? table
---@field Depth? number
---@param point table
---@param options? Slab.CurveOptions
Slab.Curve = function(point, options)
end
---@return number
Slab.GetCurveControlPointCount = function()
end
---@return number, number
Slab.GetCurveControlPoint = function()
end
---@class Slab.EvaluateCurveOptions
---@field LocalSpace? boolean
---@param time number
---@param options? Slab.EvaluateCurveOptions
---@return number, number
Slab.EvaluateCurve = function(time, options)
end
---@param options? Slab.EvaluateCurveOptions
---@return number, number
Slab.EvaluateCurveMouse = function(options)
end
---@class Slab.PolygonOptions
---@field Color? table
---@field Mode? string
---@param points table
---@param options? Slab.PolygonOptions
Slab.Polygon = function(points, options)
end
---@param number number
Slab.SetScrollSpeed = function(number)
end
---@return number
Slab.GetScrollSpeed = function()
end
---@class Slab.SeparatorOptions
---@field IncudeBorders? boolean
---@field H? number
---@field Thickness? number
---@param options? Slab.SeparatorOptions
Slab.Separator = function(options)
end
---@param shader love.graphics.Shader
Slab.PushShader = function(shader)
end
Slab.PopShader = function()
end
---@param table table
---@param options table
---@param fallback table
Slab.Properties = function(table, options, fallback)
end
---@param n? number
Slab.NewLine = function(n)
end
---@class Slab.SameLineOptions
---@field Pad? number
---@field CenterY? boolean
---@param options? Slab.SameLineOptions
Slab.SameLine = function(options)
end
---@class Slab.SetCursorPosOptions
---@field Absolute? boolean
---@param x number
---@param y number
---@param options Slab.SetCursorPosOptions
Slab.SetCursorPos = function(x, y, options)
end
---@param width number
Slab.Indent = function(width)
end
---@param width number
Slab.UnIndent = function(width)
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsMouseDown = function(button)
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsMouseClicked = function(button)
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsMouseReleased = function(button)
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsMouseDoubleClicked = function(button)
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsMouseDragging = function(button)
end
---@return number, number
Slab.GetMousePosition = function()
end
---@return number, number
Slab.GetMousePositionWindow = function()
end
---@return number, number
Slab.GetMouseDelta = function()
end
---@alias CursorCustomType
---| "arrow"
---| "sizewe"
---| "sizens"
---| "sizenesw"
---| "ibeam"
---| "hand"
---@param type CursorCustomType
---@param image love.graphics.Image
---@param quad love.graphics.Quad
Slab.SetCustomMouseCursor = function(type, image, quad)
end
---@param type CursorCustomType
Slab.ClearCustomMouseCursor = function(type)
end
---@return boolean
Slab.IsControlHovered = function()
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsControlClicked = function(button)
end
---@return number, number
Slab.GetControlSize = function()
end
---@return boolean
Slab.IsVoidHovered = function()
end
---@param button number | 1 | 2 | 3
---@return boolean
Slab.IsVoidClicked = function(button)
end
---@param key string
---@return boolean
Slab.IsKeyDown = function(key)
end
---@param key string
---@return boolean
Slab.IsKeyPressed = function(key)
end
---@param key string
---@return boolean
Slab.IsKeyReleased = function(key)
end
---@class Slab.BeginLayoutOptions
---@field AlignX? "left" | "center" | "right"
---@field AlignY? "top" | "center" | "botton"
---@field AlignRowY? "top" | "center" | "botton"
---@field Ignore? boolean
---@field ExpandW? boolean
---@field ExpandH? boolean
---@field AnchorX? boolean
---@field AnchorT? boolean
---@field Columns? number
---@param id string
---@param options? Slab.BeginLayoutOptions
Slab.BeginLayout = function(id, options)
end
Slab.EndLayout = function()
end
---@param index number
Slab.SetLayoutColumn = function(index)
end
---@return number, number
Slab.GetLayoutSize = function()
end
---@return number
Slab.GetCurrentColumnIndex = function()
end
---@param args table
Slab.Initialize = function(args)
end
---@return string
Slab.GetVersion = function()
end
---@return string
Slab.GetLoveVersion = function()
end
---@param dt number
Slab.Update = function(dt)
end
Slab.Draw = function()
end
---@param isVerbose boolean
Slab.SetVerbose = function(isVerbose)
end
---@param name string
---@param category string
---@return number
Slab.BeginStat = function(name, category)
end
---@param number number
Slab.EndStat = function(number)
end
---@param enable boolean
Slab.EnableStats = function(enable)
end
---@return boolean
Slab.IsStatsEnabled = function()
end
---@return table
Slab.GetStats = function()
end
---@param loveStats table
---@return table
Slab.CalculateStats = function(loveStats)
end
---@param path string
Slab.SetINIStatePath = function(path)
end
---@return string
Slab.GetINIStatePath = function()
end
---@return table
Slab.GetMassages = function()
end