diff --git a/nk/cgo_helpers.c b/nk/cgo_helpers.c index deb9125..87d079d 100644 --- a/nk/cgo_helpers.c +++ b/nk/cgo_helpers.c @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "_cgo_export.h" diff --git a/nk/cgo_helpers.go b/nk/cgo_helpers.go index 08e3d1b..69e24aa 100644 --- a/nk/cgo_helpers.go +++ b/nk/cgo_helpers.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package nk @@ -885,6 +885,13 @@ func (s *ChartSlot) GetIndex() *int32 { return ret } +// GetShowMarkers returns a reference to C object within a struct +func (s *ChartSlot) GetShowMarkers() *Bool { + var ret *Bool + ret = (*Bool)(unsafe.Pointer(&s.show_markers)) + return ret +} + // Ref returns a reference to C object as it is. func (x *Clipboard) Ref() *C.struct_nk_clipboard { if x == nil { @@ -2730,9 +2737,9 @@ func (s *CommandText) GetLength() *int32 { } // GetString returns a reference to C object within a struct -func (s *CommandText) GetString() [1]byte { - var ret [1]byte - ret = *(*[1]byte)(unsafe.Pointer(&s.string)) +func (s *CommandText) GetString() [2]byte { + var ret [2]byte + ret = *(*[2]byte)(unsafe.Pointer(&s.string)) return ret } @@ -7520,6 +7527,13 @@ func (s *Style) GetSlider() *StyleSlider { return ret } +// GetKnob returns a reference to C object within a struct +func (s *Style) GetKnob() *StyleKnob { + var ret *StyleKnob + ret = (*StyleKnob)(unsafe.Pointer(&s.knob)) + return ret +} + // GetProgress returns a reference to C object within a struct func (s *Style) GetProgress() *StyleProgress { var ret *StyleProgress @@ -7657,6 +7671,13 @@ func (s *StyleButton) GetBorderColor() *Color { return ret } +// GetColorFactorBackground returns a reference to C object within a struct +func (s *StyleButton) GetColorFactorBackground() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor_background)) + return ret +} + // GetTextBackground returns a reference to C object within a struct func (s *StyleButton) GetTextBackground() *Color { var ret *Color @@ -7692,6 +7713,13 @@ func (s *StyleButton) GetTextAlignment() *Flags { return ret } +// GetColorFactorText returns a reference to C object within a struct +func (s *StyleButton) GetColorFactorText() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor_text)) + return ret +} + // GetBorder returns a reference to C object within a struct func (s *StyleButton) GetBorder() *float32 { var ret *float32 @@ -7727,6 +7755,13 @@ func (s *StyleButton) GetTouchPadding() *Vec2 { return ret } +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleButton) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetUserdata returns a reference to C object within a struct func (s *StyleButton) GetUserdata() *Handle { var ret *Handle @@ -7829,6 +7864,27 @@ func (s *StyleChart) GetPadding() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleChart) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleChart) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + +// GetShowMarkers returns a reference to C object within a struct +func (s *StyleChart) GetShowMarkers() *Bool { + var ret *Bool + ret = (*Bool)(unsafe.Pointer(&s.show_markers)) + return ret +} + // Ref returns a reference to C object as it is. func (x *StyleCombo) Ref() *C.struct_nk_style_combo { if x == nil { @@ -7987,6 +8043,20 @@ func (s *StyleCombo) GetSpacing() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleCombo) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleCombo) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // Ref returns a reference to C object as it is. func (x *StyleEdit) Ref() *C.struct_nk_style_edit { if x == nil { @@ -8187,6 +8257,20 @@ func (s *StyleEdit) GetRowPadding() *float32 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleEdit) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleEdit) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // Ref returns a reference to C object as it is. func (x *StyleItem) Ref() *C.struct_nk_style_item { if x == nil { @@ -8240,6 +8324,185 @@ func (s *StyleItem) GetData() *StyleItemData { return ret } +// Ref returns a reference to C object as it is. +func (x *StyleKnob) Ref() *C.struct_nk_style_knob { + if x == nil { + return nil + } + return (*C.struct_nk_style_knob)(unsafe.Pointer(x)) +} + +// Free cleanups the referenced memory using C free. +func (x *StyleKnob) Free() { + if x != nil { + C.free(unsafe.Pointer(x)) + } +} + +// NewStyleKnobRef converts the C object reference into a raw struct reference without wrapping. +func NewStyleKnobRef(ref unsafe.Pointer) *StyleKnob { + return (*StyleKnob)(ref) +} + +// NewStyleKnob allocates a new C object of this type and converts the reference into +// a raw struct reference without wrapping. +func NewStyleKnob() *StyleKnob { + return (*StyleKnob)(allocStructNkStyleKnobMemory(1)) +} + +// allocStructNkStyleKnobMemory allocates memory for type C.struct_nk_style_knob in C. +// The caller is responsible for freeing the this memory via C.free. +func allocStructNkStyleKnobMemory(n int) unsafe.Pointer { + mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleKnobValue)) + if mem == nil { + panic(fmt.Sprintln("memory alloc error: ", err)) + } + return mem +} + +const sizeOfStructNkStyleKnobValue = unsafe.Sizeof([1]C.struct_nk_style_knob{}) + +// PassRef returns a reference to C object as it is or allocates a new C object of this type. +func (x *StyleKnob) PassRef() *C.struct_nk_style_knob { + if x == nil { + x = (*StyleKnob)(allocStructNkStyleKnobMemory(1)) + } + return (*C.struct_nk_style_knob)(unsafe.Pointer(x)) +} + +// GetNormal returns a reference to C object within a struct +func (s *StyleKnob) GetNormal() *StyleItem { + var ret *StyleItem + ret = (*StyleItem)(unsafe.Pointer(&s.normal)) + return ret +} + +// GetHover returns a reference to C object within a struct +func (s *StyleKnob) GetHover() *StyleItem { + var ret *StyleItem + ret = (*StyleItem)(unsafe.Pointer(&s.hover)) + return ret +} + +// GetActive returns a reference to C object within a struct +func (s *StyleKnob) GetActive() *StyleItem { + var ret *StyleItem + ret = (*StyleItem)(unsafe.Pointer(&s.active)) + return ret +} + +// GetBorderColor returns a reference to C object within a struct +func (s *StyleKnob) GetBorderColor() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.border_color)) + return ret +} + +// GetKnobNormal returns a reference to C object within a struct +func (s *StyleKnob) GetKnobNormal() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.knob_normal)) + return ret +} + +// GetKnobHover returns a reference to C object within a struct +func (s *StyleKnob) GetKnobHover() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.knob_hover)) + return ret +} + +// GetKnobActive returns a reference to C object within a struct +func (s *StyleKnob) GetKnobActive() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.knob_active)) + return ret +} + +// GetKnobBorderColor returns a reference to C object within a struct +func (s *StyleKnob) GetKnobBorderColor() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.knob_border_color)) + return ret +} + +// GetCursorNormal returns a reference to C object within a struct +func (s *StyleKnob) GetCursorNormal() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.cursor_normal)) + return ret +} + +// GetCursorHover returns a reference to C object within a struct +func (s *StyleKnob) GetCursorHover() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.cursor_hover)) + return ret +} + +// GetCursorActive returns a reference to C object within a struct +func (s *StyleKnob) GetCursorActive() *Color { + var ret *Color + ret = (*Color)(unsafe.Pointer(&s.cursor_active)) + return ret +} + +// GetBorder returns a reference to C object within a struct +func (s *StyleKnob) GetBorder() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.border)) + return ret +} + +// GetKnobBorder returns a reference to C object within a struct +func (s *StyleKnob) GetKnobBorder() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.knob_border)) + return ret +} + +// GetPadding returns a reference to C object within a struct +func (s *StyleKnob) GetPadding() *Vec2 { + var ret *Vec2 + ret = (*Vec2)(unsafe.Pointer(&s.padding)) + return ret +} + +// GetSpacing returns a reference to C object within a struct +func (s *StyleKnob) GetSpacing() *Vec2 { + var ret *Vec2 + ret = (*Vec2)(unsafe.Pointer(&s.spacing)) + return ret +} + +// GetCursorWidth returns a reference to C object within a struct +func (s *StyleKnob) GetCursorWidth() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.cursor_width)) + return ret +} + +// GetColorFactor returns a reference to C object within a struct +func (s *StyleKnob) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleKnob) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + +// GetUserdata returns a reference to C object within a struct +func (s *StyleKnob) GetUserdata() *Handle { + var ret *Handle + ret = (*Handle)(unsafe.Pointer(&s.userdata)) + return ret +} + // Ref returns a reference to C object as it is. func (x *StyleProgress) Ref() *C.struct_nk_style_progress { if x == nil { @@ -8377,6 +8640,20 @@ func (s *StyleProgress) GetPadding() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleProgress) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleProgress) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetUserdata returns a reference to C object within a struct func (s *StyleProgress) GetUserdata() *Handle { var ret *Handle @@ -8500,6 +8777,20 @@ func (s *StyleProperty) GetPadding() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleProperty) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleProperty) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetEdit returns a reference to C object within a struct func (s *StyleProperty) GetEdit() *StyleEdit { var ret *StyleEdit @@ -8665,6 +8956,20 @@ func (s *StyleScrollbar) GetPadding() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleScrollbar) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleScrollbar) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetShowButtons returns a reference to C object within a struct func (s *StyleScrollbar) GetShowButtons() *int32 { var ret *int32 @@ -8865,6 +9170,20 @@ func (s *StyleSelectable) GetImagePadding() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleSelectable) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleSelectable) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetUserdata returns a reference to C object within a struct func (s *StyleSelectable) GetUserdata() *Handle { var ret *Handle @@ -9083,6 +9402,20 @@ func (s *StyleSlider) GetCursorSize() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleSlider) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleSlider) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetShowButtons returns a reference to C object within a struct func (s *StyleSlider) GetShowButtons() *int32 { var ret *int32 @@ -9241,6 +9574,20 @@ func (s *StyleTab) GetSpacing() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleTab) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleTab) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // Ref returns a reference to C object as it is. func (x *StyleText) Ref() *C.struct_nk_style_text { if x == nil { @@ -9301,6 +9648,20 @@ func (s *StyleText) GetPadding() *Vec2 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleText) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleText) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // Ref returns a reference to C object as it is. func (x *StyleToggle) Ref() *C.struct_nk_style_toggle { if x == nil { @@ -9452,6 +9813,20 @@ func (s *StyleToggle) GetBorder() *float32 { return ret } +// GetColorFactor returns a reference to C object within a struct +func (s *StyleToggle) GetColorFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.color_factor)) + return ret +} + +// GetDisabledFactor returns a reference to C object within a struct +func (s *StyleToggle) GetDisabledFactor() *float32 { + var ret *float32 + ret = (*float32)(unsafe.Pointer(&s.disabled_factor)) + return ret +} + // GetUserdata returns a reference to C object within a struct func (s *StyleToggle) GetUserdata() *Handle { var ret *Handle @@ -9899,16 +10274,16 @@ func (s *Table) GetSize() *uint32 { } // GetKeys returns a reference to C object within a struct -func (s *Table) GetKeys() [59]Hash { - var ret [59]Hash - ret = *(*[59]Hash)(unsafe.Pointer(&s.keys)) +func (s *Table) GetKeys() [60]Hash { + var ret [60]Hash + ret = *(*[60]Hash)(unsafe.Pointer(&s.keys)) return ret } // GetValues returns a reference to C object within a struct -func (s *Table) GetValues() [59]Uint { - var ret [59]Uint - ret = *(*[59]Uint)(unsafe.Pointer(&s.values)) +func (s *Table) GetValues() [60]Uint { + var ret [60]Uint + ret = *(*[60]Uint)(unsafe.Pointer(&s.values)) return ret } @@ -10693,6 +11068,13 @@ func (s *Window) GetScrolled() *uint32 { return ret } +// GetWidgetsDisabled returns a reference to C object within a struct +func (s *Window) GetWidgetsDisabled() *Bool { + var ret *Bool + ret = (*Bool)(unsafe.Pointer(&s.widgets_disabled)) + return ret +} + // GetTables returns a reference to C object within a struct func (s *Window) GetTables() **Table { var ret **Table diff --git a/nk/cgo_helpers.h b/nk/cgo_helpers.h index 0aab4cf..a06a580 100644 --- a/nk/cgo_helpers.h +++ b/nk/cgo_helpers.h @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "nk.h" diff --git a/nk/const.go b/nk/const.go index 2071d34..609b63b 100644 --- a/nk/const.go +++ b/nk/const.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package nk @@ -13,753 +13,799 @@ package nk import "C" const ( - // IncludeDefaultAllocator as defined in nuklear/:397 - IncludeDefaultAllocator = 1 - // IncludeFontBaking as defined in nuklear/:398 + // IncludeFontBaking as defined in nuklear/:410 IncludeFontBaking = 1 - // IncludeDefaultFont as defined in nuklear/:399 + // IncludeDefaultFont as defined in nuklear/:411 IncludeDefaultFont = 1 - // IncludeVertexBufferOutput as defined in nuklear/:400 + // IncludeVertexBufferOutput as defined in nuklear/:412 IncludeVertexBufferOutput = 1 - // IncludeFixedTypes as defined in nuklear/:401 + // IncludeFixedTypes as defined in nuklear/:413 IncludeFixedTypes = 1 - // IncludeStandardIo as defined in nuklear/:402 + // IncludeStandardIo as defined in nuklear/:414 IncludeStandardIo = 1 - // SingleFile as defined in nk/nuklear.h:220 + // IncludeDefaultAllocator as defined in nuklear/:415 + IncludeDefaultAllocator = 1 + // SingleFile as defined in nk/nuklear.h:221 - // NuklearH as defined in nk/nuklear.h:224 + // NuklearH as defined in nk/nuklear.h:230 - // Undefined as defined in nk/nuklear.h:236 + // Undefined as defined in nk/nuklear.h:243 Undefined = (-1.0) - // UtfSize as defined in nk/nuklear.h:238 + // UtfSize as defined in nk/nuklear.h:245 UtfSize = 4 - // InputMax as defined in nk/nuklear.h:240 + // InputMax as defined in nk/nuklear.h:247 InputMax = 16 - // MaxNumberBuffer as defined in nk/nuklear.h:243 + // MaxNumberBuffer as defined in nk/nuklear.h:250 MaxNumberBuffer = 64 - // ScrollbarHidingTimeout as defined in nk/nuklear.h:246 + // ScrollbarHidingTimeout as defined in nk/nuklear.h:253 ScrollbarHidingTimeout = 4.0 - // Lib as defined in nk/nuklear.h:270 - Lib = 0x5f8840 - // FileLine as defined in nk/nuklear.h:301 - FileLine = 0x5f8840 - // Bool as defined in nk/nuklear.h:407 - Bool = 0x5f8840 - // Strtod as defined in nk/nuklear.h:3781 - Strtod = 0x5f8840 - // TexteditUndostatecount as defined in nk/nuklear.h:4297 + // Lib as defined in nk/nuklear.h:278 + Lib = 0x650840 + // FileLine as defined in nk/nuklear.h:309 + FileLine = 0x650840 + // Bool as defined in nk/nuklear.h:415 + Bool = 0x650840 + // WidgetDisabledFactor as defined in nk/nuklear.h:3850 + WidgetDisabledFactor = 0.5 + // Strtod as defined in nk/nuklear.h:4042 + Strtod = 0x650840 + // TexteditUndostatecount as defined in nk/nuklear.h:4527 TexteditUndostatecount = 99 - // TexteditUndocharcount as defined in nk/nuklear.h:4301 + // TexteditUndocharcount as defined in nk/nuklear.h:4531 TexteditUndocharcount = 999 - // MaxLayoutRowTemplateColumns as defined in nk/nuklear.h:5316 + // MaxLayoutRowTemplateColumns as defined in nk/nuklear.h:5605 MaxLayoutRowTemplateColumns = 16 - // ChartMaxSlot as defined in nk/nuklear.h:5319 + // ChartMaxSlot as defined in nk/nuklear.h:5608 ChartMaxSlot = 4 - // WindowMaxName as defined in nk/nuklear.h:5418 + // WindowMaxName as defined in nk/nuklear.h:5708 WindowMaxName = 64 - // ButtonBehaviorStackSize as defined in nk/nuklear.h:5532 + // ButtonBehaviorStackSize as defined in nk/nuklear.h:5819 ButtonBehaviorStackSize = 8 - // FontStackSize as defined in nk/nuklear.h:5536 + // FontStackSize as defined in nk/nuklear.h:5823 FontStackSize = 8 - // StyleItemStackSize as defined in nk/nuklear.h:5540 + // StyleItemStackSize as defined in nk/nuklear.h:5827 StyleItemStackSize = 16 - // FloatStackSize as defined in nk/nuklear.h:5544 + // FloatStackSize as defined in nk/nuklear.h:5831 FloatStackSize = 32 - // VectorStackSize as defined in nk/nuklear.h:5548 + // VectorStackSize as defined in nk/nuklear.h:5835 VectorStackSize = 16 - // FlagsStackSize as defined in nk/nuklear.h:5552 + // FlagsStackSize as defined in nk/nuklear.h:5839 FlagsStackSize = 32 - // ColorStackSize as defined in nk/nuklear.h:5556 + // ColorStackSize as defined in nk/nuklear.h:5843 ColorStackSize = 32 - // Float as defined in nk/nuklear.h:5570 - Float = 0x5f8840 - // ValuePageCapacity as defined in nk/nuklear.h:5600 - ValuePageCapacity = 0x5f8840 - // Pi as defined in nk/nuklear.h:5684 + // Float as defined in nk/nuklear.h:5857 + Float = 0x650840 + // ValuePageCapacity as defined in nk/nuklear.h:5887 + ValuePageCapacity = 0x650840 + // Pi as defined in nk/nuklear.h:5971 Pi = 3.141592654 - // UtfInvalid as defined in nk/nuklear.h:5685 + // PiHalf as defined in nk/nuklear.h:5972 + PiHalf = 1.570796326 + // UtfInvalid as defined in nk/nuklear.h:5973 UtfInvalid = 0xFFFD - // MaxFloatPrecision as defined in nk/nuklear.h:5686 + // MaxFloatPrecision as defined in nk/nuklear.h:5974 MaxFloatPrecision = 2 ) const ( - // False as declared in nk/nuklear.h:475 + // False as declared in nk/nuklear.h:483 False = iota - // True as declared in nk/nuklear.h:475 + // True as declared in nk/nuklear.h:483 True = 1 ) const ( - // Up as declared in nk/nuklear.h:489 + // Up as declared in nk/nuklear.h:497 Up = iota - // Right as declared in nk/nuklear.h:489 + // Right as declared in nk/nuklear.h:497 Right = 1 - // Down as declared in nk/nuklear.h:489 + // Down as declared in nk/nuklear.h:497 Down = 2 - // Left as declared in nk/nuklear.h:489 + // Left as declared in nk/nuklear.h:497 Left = 3 ) const ( - // ButtonDefault as declared in nk/nuklear.h:490 + // ButtonDefault as declared in nk/nuklear.h:498 ButtonDefault = iota - // ButtonRepeater as declared in nk/nuklear.h:490 + // ButtonRepeater as declared in nk/nuklear.h:498 ButtonRepeater = 1 ) const ( - // Fixed as declared in nk/nuklear.h:491 + // Fixed as declared in nk/nuklear.h:499 Fixed = False - // Modifiable as declared in nk/nuklear.h:491 + // Modifiable as declared in nk/nuklear.h:499 Modifiable = True ) const ( - // Vertical as declared in nk/nuklear.h:492 + // Vertical as declared in nk/nuklear.h:500 Vertical = iota - // Horizontal as declared in nk/nuklear.h:492 + // Horizontal as declared in nk/nuklear.h:500 Horizontal = 1 ) const ( - // Minimized as declared in nk/nuklear.h:493 + // Minimized as declared in nk/nuklear.h:501 Minimized = False - // Maximized as declared in nk/nuklear.h:493 + // Maximized as declared in nk/nuklear.h:501 Maximized = True ) const ( - // Hidden as declared in nk/nuklear.h:494 + // Hidden as declared in nk/nuklear.h:502 Hidden = False - // Shown as declared in nk/nuklear.h:494 + // Shown as declared in nk/nuklear.h:502 Shown = True ) const ( - // ChartLines as declared in nk/nuklear.h:495 + // ChartLines as declared in nk/nuklear.h:503 ChartLines = iota - // ChartColumn as declared in nk/nuklear.h:495 + // ChartColumn as declared in nk/nuklear.h:503 ChartColumn = 1 - // ChartMax as declared in nk/nuklear.h:495 + // ChartMax as declared in nk/nuklear.h:503 ChartMax = 2 ) const ( - // ChartHovering as declared in nk/nuklear.h:496 + // ChartHovering as declared in nk/nuklear.h:504 ChartHovering = 0x01 - // ChartClicked as declared in nk/nuklear.h:496 + // ChartClicked as declared in nk/nuklear.h:504 ChartClicked = 0x02 ) const ( - // ColorFormatRGB as declared in nk/nuklear.h:497 + // ColorFormatRGB as declared in nk/nuklear.h:505 ColorFormatRGB = iota - // ColorFormatRGBA as declared in nk/nuklear.h:497 + // ColorFormatRGBA as declared in nk/nuklear.h:505 ColorFormatRGBA = 1 ) const ( - // PopupStatic as declared in nk/nuklear.h:498 + // PopupStatic as declared in nk/nuklear.h:506 PopupStatic = iota - // PopupDynamic as declared in nk/nuklear.h:498 + // PopupDynamic as declared in nk/nuklear.h:506 PopupDynamic = 1 ) const ( - // Dynamic as declared in nk/nuklear.h:499 + // Dynamic as declared in nk/nuklear.h:507 Dynamic = iota - // Static as declared in nk/nuklear.h:499 + // Static as declared in nk/nuklear.h:507 Static = 1 ) const ( - // TreeNode as declared in nk/nuklear.h:500 + // TreeNode as declared in nk/nuklear.h:508 TreeNode = iota - // TreeTab as declared in nk/nuklear.h:500 + // TreeTab as declared in nk/nuklear.h:508 TreeTab = 1 ) const ( - // SymbolNone as declared in nk/nuklear.h:514 + // SymbolNone as declared in nk/nuklear.h:522 SymbolNone = iota - // SymbolX as declared in nk/nuklear.h:515 + // SymbolX as declared in nk/nuklear.h:523 SymbolX = 1 - // SymbolUnderscore as declared in nk/nuklear.h:516 + // SymbolUnderscore as declared in nk/nuklear.h:524 SymbolUnderscore = 2 - // SymbolCircleSolid as declared in nk/nuklear.h:517 + // SymbolCircleSolid as declared in nk/nuklear.h:525 SymbolCircleSolid = 3 - // SymbolCircleOutline as declared in nk/nuklear.h:518 + // SymbolCircleOutline as declared in nk/nuklear.h:526 SymbolCircleOutline = 4 - // SymbolRectSolid as declared in nk/nuklear.h:519 + // SymbolRectSolid as declared in nk/nuklear.h:527 SymbolRectSolid = 5 - // SymbolRectOutline as declared in nk/nuklear.h:520 + // SymbolRectOutline as declared in nk/nuklear.h:528 SymbolRectOutline = 6 - // SymbolTriangleUp as declared in nk/nuklear.h:521 + // SymbolTriangleUp as declared in nk/nuklear.h:529 SymbolTriangleUp = 7 - // SymbolTriangleDown as declared in nk/nuklear.h:522 + // SymbolTriangleDown as declared in nk/nuklear.h:530 SymbolTriangleDown = 8 - // SymbolTriangleLeft as declared in nk/nuklear.h:523 + // SymbolTriangleLeft as declared in nk/nuklear.h:531 SymbolTriangleLeft = 9 - // SymbolTriangleRight as declared in nk/nuklear.h:524 + // SymbolTriangleRight as declared in nk/nuklear.h:532 SymbolTriangleRight = 10 - // SymbolPlus as declared in nk/nuklear.h:525 + // SymbolPlus as declared in nk/nuklear.h:533 SymbolPlus = 11 - // SymbolMinus as declared in nk/nuklear.h:526 + // SymbolMinus as declared in nk/nuklear.h:534 SymbolMinus = 12 - // SymbolMax as declared in nk/nuklear.h:527 - SymbolMax = 13 + // SymbolTriangleUpOutline as declared in nk/nuklear.h:535 + SymbolTriangleUpOutline = 13 + // SymbolTriangleDownOutline as declared in nk/nuklear.h:536 + SymbolTriangleDownOutline = 14 + // SymbolTriangleLeftOutline as declared in nk/nuklear.h:537 + SymbolTriangleLeftOutline = 15 + // SymbolTriangleRightOutline as declared in nk/nuklear.h:538 + SymbolTriangleRightOutline = 16 + // SymbolMax as declared in nk/nuklear.h:539 + SymbolMax = 17 ) const ( - // KeyNone as declared in nk/nuklear.h:756 + // KeyNone as declared in nk/nuklear.h:778 KeyNone = iota - // KeyShift as declared in nk/nuklear.h:757 + // KeyShift as declared in nk/nuklear.h:779 KeyShift = 1 - // KeyCtrl as declared in nk/nuklear.h:758 + // KeyCtrl as declared in nk/nuklear.h:780 KeyCtrl = 2 - // KeyDel as declared in nk/nuklear.h:759 + // KeyDel as declared in nk/nuklear.h:781 KeyDel = 3 - // KeyEnter as declared in nk/nuklear.h:760 + // KeyEnter as declared in nk/nuklear.h:782 KeyEnter = 4 - // KeyTab as declared in nk/nuklear.h:761 + // KeyTab as declared in nk/nuklear.h:783 KeyTab = 5 - // KeyBackspace as declared in nk/nuklear.h:762 + // KeyBackspace as declared in nk/nuklear.h:784 KeyBackspace = 6 - // KeyCopy as declared in nk/nuklear.h:763 + // KeyCopy as declared in nk/nuklear.h:785 KeyCopy = 7 - // KeyCut as declared in nk/nuklear.h:764 + // KeyCut as declared in nk/nuklear.h:786 KeyCut = 8 - // KeyPaste as declared in nk/nuklear.h:765 + // KeyPaste as declared in nk/nuklear.h:787 KeyPaste = 9 - // KeyUp as declared in nk/nuklear.h:766 + // KeyUp as declared in nk/nuklear.h:788 KeyUp = 10 - // KeyDown as declared in nk/nuklear.h:767 + // KeyDown as declared in nk/nuklear.h:789 KeyDown = 11 - // KeyLeft as declared in nk/nuklear.h:768 + // KeyLeft as declared in nk/nuklear.h:790 KeyLeft = 12 - // KeyRight as declared in nk/nuklear.h:769 + // KeyRight as declared in nk/nuklear.h:791 KeyRight = 13 - // KeyTextInsertMode as declared in nk/nuklear.h:771 + // KeyTextInsertMode as declared in nk/nuklear.h:793 KeyTextInsertMode = 14 - // KeyTextReplaceMode as declared in nk/nuklear.h:772 + // KeyTextReplaceMode as declared in nk/nuklear.h:794 KeyTextReplaceMode = 15 - // KeyTextResetMode as declared in nk/nuklear.h:773 + // KeyTextResetMode as declared in nk/nuklear.h:795 KeyTextResetMode = 16 - // KeyTextLineStart as declared in nk/nuklear.h:774 + // KeyTextLineStart as declared in nk/nuklear.h:796 KeyTextLineStart = 17 - // KeyTextLineEnd as declared in nk/nuklear.h:775 + // KeyTextLineEnd as declared in nk/nuklear.h:797 KeyTextLineEnd = 18 - // KeyTextStart as declared in nk/nuklear.h:776 + // KeyTextStart as declared in nk/nuklear.h:798 KeyTextStart = 19 - // KeyTextEnd as declared in nk/nuklear.h:777 + // KeyTextEnd as declared in nk/nuklear.h:799 KeyTextEnd = 20 - // KeyTextUndo as declared in nk/nuklear.h:778 + // KeyTextUndo as declared in nk/nuklear.h:800 KeyTextUndo = 21 - // KeyTextRedo as declared in nk/nuklear.h:779 + // KeyTextRedo as declared in nk/nuklear.h:801 KeyTextRedo = 22 - // KeyTextSelectAll as declared in nk/nuklear.h:780 + // KeyTextSelectAll as declared in nk/nuklear.h:802 KeyTextSelectAll = 23 - // KeyTextWordLeft as declared in nk/nuklear.h:781 + // KeyTextWordLeft as declared in nk/nuklear.h:803 KeyTextWordLeft = 24 - // KeyTextWordRight as declared in nk/nuklear.h:782 + // KeyTextWordRight as declared in nk/nuklear.h:804 KeyTextWordRight = 25 - // KeyScrollStart as declared in nk/nuklear.h:784 + // KeyScrollStart as declared in nk/nuklear.h:806 KeyScrollStart = 26 - // KeyScrollEnd as declared in nk/nuklear.h:785 + // KeyScrollEnd as declared in nk/nuklear.h:807 KeyScrollEnd = 27 - // KeyScrollDown as declared in nk/nuklear.h:786 + // KeyScrollDown as declared in nk/nuklear.h:808 KeyScrollDown = 28 - // KeyScrollUp as declared in nk/nuklear.h:787 + // KeyScrollUp as declared in nk/nuklear.h:809 KeyScrollUp = 29 - // KeyMax as declared in nk/nuklear.h:788 + // KeyMax as declared in nk/nuklear.h:810 KeyMax = 30 ) const ( - // ButtonLeft as declared in nk/nuklear.h:791 + // ButtonLeft as declared in nk/nuklear.h:813 ButtonLeft = iota - // ButtonMiddle as declared in nk/nuklear.h:792 + // ButtonMiddle as declared in nk/nuklear.h:814 ButtonMiddle = 1 - // ButtonRight as declared in nk/nuklear.h:793 + // ButtonRight as declared in nk/nuklear.h:815 ButtonRight = 2 - // ButtonDouble as declared in nk/nuklear.h:794 + // ButtonDouble as declared in nk/nuklear.h:816 ButtonDouble = 3 - // ButtonMax as declared in nk/nuklear.h:795 + // ButtonMax as declared in nk/nuklear.h:817 ButtonMax = 4 ) const ( - // AntiAliasingOff as declared in nk/nuklear.h:1162 + // AntiAliasingOff as declared in nk/nuklear.h:1189 AntiAliasingOff = iota - // AntiAliasingOn as declared in nk/nuklear.h:1162 + // AntiAliasingOn as declared in nk/nuklear.h:1189 AntiAliasingOn = 1 ) const ( - // ConvertSuccess as declared in nk/nuklear.h:1164 + // ConvertSuccess as declared in nk/nuklear.h:1191 ConvertSuccess = iota - // ConvertInvalidParam as declared in nk/nuklear.h:1165 + // ConvertInvalidParam as declared in nk/nuklear.h:1192 ConvertInvalidParam = 1 - // ConvertCommandBufferFull as declared in nk/nuklear.h:1166 + // ConvertCommandBufferFull as declared in nk/nuklear.h:1193 ConvertCommandBufferFull = (1 << (1)) - // ConvertVertexBufferFull as declared in nk/nuklear.h:1167 + // ConvertVertexBufferFull as declared in nk/nuklear.h:1194 ConvertVertexBufferFull = (1 << (2)) - // ConvertElementBufferFull as declared in nk/nuklear.h:1168 + // ConvertElementBufferFull as declared in nk/nuklear.h:1195 ConvertElementBufferFull = (1 << (3)) ) const ( - // WindowBorder as declared in nk/nuklear.h:1471 + // WindowBorder as declared in nk/nuklear.h:1508 WindowBorder = (1 << (0)) - // WindowMovable as declared in nk/nuklear.h:1472 + // WindowMovable as declared in nk/nuklear.h:1509 WindowMovable = (1 << (1)) - // WindowScalable as declared in nk/nuklear.h:1473 + // WindowScalable as declared in nk/nuklear.h:1510 WindowScalable = (1 << (2)) - // WindowClosable as declared in nk/nuklear.h:1474 + // WindowClosable as declared in nk/nuklear.h:1511 WindowClosable = (1 << (3)) - // WindowMinimizable as declared in nk/nuklear.h:1475 + // WindowMinimizable as declared in nk/nuklear.h:1512 WindowMinimizable = (1 << (4)) - // WindowNoScrollbar as declared in nk/nuklear.h:1476 + // WindowNoScrollbar as declared in nk/nuklear.h:1513 WindowNoScrollbar = (1 << (5)) - // WindowTitle as declared in nk/nuklear.h:1477 + // WindowTitle as declared in nk/nuklear.h:1514 WindowTitle = (1 << (6)) - // WindowScrollAutoHide as declared in nk/nuklear.h:1478 + // WindowScrollAutoHide as declared in nk/nuklear.h:1515 WindowScrollAutoHide = (1 << (7)) - // WindowBackground as declared in nk/nuklear.h:1479 + // WindowBackground as declared in nk/nuklear.h:1516 WindowBackground = (1 << (8)) - // WindowScaleLeft as declared in nk/nuklear.h:1480 + // WindowScaleLeft as declared in nk/nuklear.h:1517 WindowScaleLeft = (1 << (9)) - // WindowNoInput as declared in nk/nuklear.h:1481 + // WindowNoInput as declared in nk/nuklear.h:1518 WindowNoInput = (1 << (10)) ) const ( - // WidgetInvalid as declared in nk/nuklear.h:3077 + // WidgetAlignLeft as declared in nk/nuklear.h:2430 + WidgetAlignLeft = 0x01 + // WidgetAlignCentered as declared in nk/nuklear.h:2431 + WidgetAlignCentered = 0x02 + // WidgetAlignRight as declared in nk/nuklear.h:2432 + WidgetAlignRight = 0x04 + // WidgetAlignTop as declared in nk/nuklear.h:2433 + WidgetAlignTop = 0x08 + // WidgetAlignMiddle as declared in nk/nuklear.h:2434 + WidgetAlignMiddle = 0x10 + // WidgetAlignBottom as declared in nk/nuklear.h:2435 + WidgetAlignBottom = 0x20 +) + +const ( + // WidgetLeft as declared in nk/nuklear.h:2438 + WidgetLeft = WidgetAlignMiddle | WidgetAlignLeft + // WidgetCentered as declared in nk/nuklear.h:2439 + WidgetCentered = WidgetAlignMiddle | WidgetAlignCentered + // WidgetRight as declared in nk/nuklear.h:2440 + WidgetRight = WidgetAlignMiddle | WidgetAlignRight +) + +const ( + // WidgetInvalid as declared in nk/nuklear.h:3305 WidgetInvalid = iota - // WidgetValid as declared in nk/nuklear.h:3078 + // WidgetValid as declared in nk/nuklear.h:3306 WidgetValid = 1 - // WidgetRom as declared in nk/nuklear.h:3079 + // WidgetRom as declared in nk/nuklear.h:3307 WidgetRom = 2 + // WidgetDisabled as declared in nk/nuklear.h:3308 + WidgetDisabled = 3 ) const ( - // WidgetStateModified as declared in nk/nuklear.h:3082 + // WidgetStateModified as declared in nk/nuklear.h:3311 WidgetStateModified = (1 << (1)) - // WidgetStateInactive as declared in nk/nuklear.h:3083 + // WidgetStateInactive as declared in nk/nuklear.h:3312 WidgetStateInactive = (1 << (2)) - // WidgetStateEntered as declared in nk/nuklear.h:3084 + // WidgetStateEntered as declared in nk/nuklear.h:3313 WidgetStateEntered = (1 << (3)) - // WidgetStateHover as declared in nk/nuklear.h:3085 + // WidgetStateHover as declared in nk/nuklear.h:3314 WidgetStateHover = (1 << (4)) - // WidgetStateActived as declared in nk/nuklear.h:3086 + // WidgetStateActived as declared in nk/nuklear.h:3315 WidgetStateActived = (1 << (5)) - // WidgetStateLeft as declared in nk/nuklear.h:3087 + // WidgetStateLeft as declared in nk/nuklear.h:3316 WidgetStateLeft = (1 << (6)) - // WidgetStateHovered as declared in nk/nuklear.h:3088 + // WidgetStateHovered as declared in nk/nuklear.h:3317 WidgetStateHovered = WidgetStateHover | WidgetStateModified - // WidgetStateActive as declared in nk/nuklear.h:3089 + // WidgetStateActive as declared in nk/nuklear.h:3318 WidgetStateActive = WidgetStateActived | WidgetStateModified ) const ( - // TextAlignLeft as declared in nk/nuklear.h:3108 + // TextAlignLeft as declared in nk/nuklear.h:3339 TextAlignLeft = 0x01 - // TextAlignCentered as declared in nk/nuklear.h:3109 + // TextAlignCentered as declared in nk/nuklear.h:3340 TextAlignCentered = 0x02 - // TextAlignRight as declared in nk/nuklear.h:3110 + // TextAlignRight as declared in nk/nuklear.h:3341 TextAlignRight = 0x04 - // TextAlignTop as declared in nk/nuklear.h:3111 + // TextAlignTop as declared in nk/nuklear.h:3342 TextAlignTop = 0x08 - // TextAlignMiddle as declared in nk/nuklear.h:3112 + // TextAlignMiddle as declared in nk/nuklear.h:3343 TextAlignMiddle = 0x10 - // TextAlignBottom as declared in nk/nuklear.h:3113 + // TextAlignBottom as declared in nk/nuklear.h:3344 TextAlignBottom = 0x20 ) const ( - // TextLeft as declared in nk/nuklear.h:3116 + // TextLeft as declared in nk/nuklear.h:3347 TextLeft = TextAlignMiddle | TextAlignLeft - // TextCentered as declared in nk/nuklear.h:3117 + // TextCentered as declared in nk/nuklear.h:3348 TextCentered = TextAlignMiddle | TextAlignCentered - // TextRight as declared in nk/nuklear.h:3118 + // TextRight as declared in nk/nuklear.h:3349 TextRight = TextAlignMiddle | TextAlignRight ) const ( - // EditDefault as declared in nk/nuklear.h:3451 + // EditDefault as declared in nk/nuklear.h:3704 EditDefault = iota - // EditReadOnly as declared in nk/nuklear.h:3452 + // EditReadOnly as declared in nk/nuklear.h:3705 EditReadOnly = (1 << (0)) - // EditAutoSelect as declared in nk/nuklear.h:3453 + // EditAutoSelect as declared in nk/nuklear.h:3706 EditAutoSelect = (1 << (1)) - // EditSigEnter as declared in nk/nuklear.h:3454 + // EditSigEnter as declared in nk/nuklear.h:3707 EditSigEnter = (1 << (2)) - // EditAllowTab as declared in nk/nuklear.h:3455 + // EditAllowTab as declared in nk/nuklear.h:3708 EditAllowTab = (1 << (3)) - // EditNoCursor as declared in nk/nuklear.h:3456 + // EditNoCursor as declared in nk/nuklear.h:3709 EditNoCursor = (1 << (4)) - // EditSelectable as declared in nk/nuklear.h:3457 + // EditSelectable as declared in nk/nuklear.h:3710 EditSelectable = (1 << (5)) - // EditClipboard as declared in nk/nuklear.h:3458 + // EditClipboard as declared in nk/nuklear.h:3711 EditClipboard = (1 << (6)) - // EditCtrlEnterNewline as declared in nk/nuklear.h:3459 + // EditCtrlEnterNewline as declared in nk/nuklear.h:3712 EditCtrlEnterNewline = (1 << (7)) - // EditNoHorizontalScroll as declared in nk/nuklear.h:3460 + // EditNoHorizontalScroll as declared in nk/nuklear.h:3713 EditNoHorizontalScroll = (1 << (8)) - // EditAlwaysInsertMode as declared in nk/nuklear.h:3461 + // EditAlwaysInsertMode as declared in nk/nuklear.h:3714 EditAlwaysInsertMode = (1 << (9)) - // EditMultiline as declared in nk/nuklear.h:3462 + // EditMultiline as declared in nk/nuklear.h:3715 EditMultiline = (1 << (10)) - // EditGotoEndOnActivate as declared in nk/nuklear.h:3463 + // EditGotoEndOnActivate as declared in nk/nuklear.h:3716 EditGotoEndOnActivate = (1 << (11)) ) const ( - // EditSimple as declared in nk/nuklear.h:3466 + // EditSimple as declared in nk/nuklear.h:3719 EditSimple = EditAlwaysInsertMode - // EditField as declared in nk/nuklear.h:3467 + // EditField as declared in nk/nuklear.h:3720 EditField = EditSimple | EditSelectable | EditClipboard - // EditBox as declared in nk/nuklear.h:3468 + // EditBox as declared in nk/nuklear.h:3721 EditBox = EditAlwaysInsertMode | EditSelectable | EditMultiline | EditAllowTab | EditClipboard - // EditEditor as declared in nk/nuklear.h:3469 + // EditEditor as declared in nk/nuklear.h:3722 EditEditor = EditSelectable | EditMultiline | EditAllowTab | EditClipboard ) const ( - // EditActive as declared in nk/nuklear.h:3472 + // EditActive as declared in nk/nuklear.h:3725 EditActive = (1 << (0)) - // EditInactive as declared in nk/nuklear.h:3473 + // EditInactive as declared in nk/nuklear.h:3726 EditInactive = (1 << (1)) - // EditActivated as declared in nk/nuklear.h:3474 + // EditActivated as declared in nk/nuklear.h:3727 EditActivated = (1 << (2)) - // EditDeactivated as declared in nk/nuklear.h:3475 + // EditDeactivated as declared in nk/nuklear.h:3728 EditDeactivated = (1 << (3)) - // EditCommited as declared in nk/nuklear.h:3476 + // EditCommited as declared in nk/nuklear.h:3729 EditCommited = (1 << (4)) ) const ( - // ColorText as declared in nk/nuklear.h:3597 + // ColorText as declared in nk/nuklear.h:3853 ColorText = iota - // ColorWindow as declared in nk/nuklear.h:3598 + // ColorWindow as declared in nk/nuklear.h:3854 ColorWindow = 1 - // ColorHeader as declared in nk/nuklear.h:3599 + // ColorHeader as declared in nk/nuklear.h:3855 ColorHeader = 2 - // ColorBorder as declared in nk/nuklear.h:3600 + // ColorBorder as declared in nk/nuklear.h:3856 ColorBorder = 3 - // ColorButton as declared in nk/nuklear.h:3601 + // ColorButton as declared in nk/nuklear.h:3857 ColorButton = 4 - // ColorButtonHover as declared in nk/nuklear.h:3602 + // ColorButtonHover as declared in nk/nuklear.h:3858 ColorButtonHover = 5 - // ColorButtonActive as declared in nk/nuklear.h:3603 + // ColorButtonActive as declared in nk/nuklear.h:3859 ColorButtonActive = 6 - // ColorToggle as declared in nk/nuklear.h:3604 + // ColorToggle as declared in nk/nuklear.h:3860 ColorToggle = 7 - // ColorToggleHover as declared in nk/nuklear.h:3605 + // ColorToggleHover as declared in nk/nuklear.h:3861 ColorToggleHover = 8 - // ColorToggleCursor as declared in nk/nuklear.h:3606 + // ColorToggleCursor as declared in nk/nuklear.h:3862 ColorToggleCursor = 9 - // ColorSelect as declared in nk/nuklear.h:3607 + // ColorSelect as declared in nk/nuklear.h:3863 ColorSelect = 10 - // ColorSelectActive as declared in nk/nuklear.h:3608 + // ColorSelectActive as declared in nk/nuklear.h:3864 ColorSelectActive = 11 - // ColorSlider as declared in nk/nuklear.h:3609 + // ColorSlider as declared in nk/nuklear.h:3865 ColorSlider = 12 - // ColorSliderCursor as declared in nk/nuklear.h:3610 + // ColorSliderCursor as declared in nk/nuklear.h:3866 ColorSliderCursor = 13 - // ColorSliderCursorHover as declared in nk/nuklear.h:3611 + // ColorSliderCursorHover as declared in nk/nuklear.h:3867 ColorSliderCursorHover = 14 - // ColorSliderCursorActive as declared in nk/nuklear.h:3612 + // ColorSliderCursorActive as declared in nk/nuklear.h:3868 ColorSliderCursorActive = 15 - // ColorProperty as declared in nk/nuklear.h:3613 + // ColorProperty as declared in nk/nuklear.h:3869 ColorProperty = 16 - // ColorEdit as declared in nk/nuklear.h:3614 + // ColorEdit as declared in nk/nuklear.h:3870 ColorEdit = 17 - // ColorEditCursor as declared in nk/nuklear.h:3615 + // ColorEditCursor as declared in nk/nuklear.h:3871 ColorEditCursor = 18 - // ColorCombo as declared in nk/nuklear.h:3616 + // ColorCombo as declared in nk/nuklear.h:3872 ColorCombo = 19 - // ColorChart as declared in nk/nuklear.h:3617 + // ColorChart as declared in nk/nuklear.h:3873 ColorChart = 20 - // ColorChartColor as declared in nk/nuklear.h:3618 + // ColorChartColor as declared in nk/nuklear.h:3874 ColorChartColor = 21 - // ColorChartColorHighlight as declared in nk/nuklear.h:3619 + // ColorChartColorHighlight as declared in nk/nuklear.h:3875 ColorChartColorHighlight = 22 - // ColorScrollbar as declared in nk/nuklear.h:3620 + // ColorScrollbar as declared in nk/nuklear.h:3876 ColorScrollbar = 23 - // ColorScrollbarCursor as declared in nk/nuklear.h:3621 + // ColorScrollbarCursor as declared in nk/nuklear.h:3877 ColorScrollbarCursor = 24 - // ColorScrollbarCursorHover as declared in nk/nuklear.h:3622 + // ColorScrollbarCursorHover as declared in nk/nuklear.h:3878 ColorScrollbarCursorHover = 25 - // ColorScrollbarCursorActive as declared in nk/nuklear.h:3623 + // ColorScrollbarCursorActive as declared in nk/nuklear.h:3879 ColorScrollbarCursorActive = 26 - // ColorTabHeader as declared in nk/nuklear.h:3624 + // ColorTabHeader as declared in nk/nuklear.h:3880 ColorTabHeader = 27 - // ColorCount as declared in nk/nuklear.h:3625 - ColorCount = 28 + // ColorKnob as declared in nk/nuklear.h:3881 + ColorKnob = 28 + // ColorKnobCursor as declared in nk/nuklear.h:3882 + ColorKnobCursor = 29 + // ColorKnobCursorHover as declared in nk/nuklear.h:3883 + ColorKnobCursorHover = 30 + // ColorKnobCursorActive as declared in nk/nuklear.h:3884 + ColorKnobCursorActive = 31 + // ColorCount as declared in nk/nuklear.h:3885 + ColorCount = 32 ) const ( - // CursorArrow as declared in nk/nuklear.h:3628 + // CursorArrow as declared in nk/nuklear.h:3888 CursorArrow = iota - // CursorText as declared in nk/nuklear.h:3629 + // CursorText as declared in nk/nuklear.h:3889 CursorText = 1 - // CursorMove as declared in nk/nuklear.h:3630 + // CursorMove as declared in nk/nuklear.h:3890 CursorMove = 2 - // CursorResizeVertical as declared in nk/nuklear.h:3631 + // CursorResizeVertical as declared in nk/nuklear.h:3891 CursorResizeVertical = 3 - // CursorResizeHorizontal as declared in nk/nuklear.h:3632 + // CursorResizeHorizontal as declared in nk/nuklear.h:3892 CursorResizeHorizontal = 4 - // CursorResizeTopLeftDownRight as declared in nk/nuklear.h:3633 + // CursorResizeTopLeftDownRight as declared in nk/nuklear.h:3893 CursorResizeTopLeftDownRight = 5 - // CursorResizeTopRightDownLeft as declared in nk/nuklear.h:3634 + // CursorResizeTopRightDownLeft as declared in nk/nuklear.h:3894 CursorResizeTopRightDownLeft = 6 - // CursorCount as declared in nk/nuklear.h:3635 + // CursorCount as declared in nk/nuklear.h:3895 CursorCount = 7 ) const ( - // CoordUv as declared in nk/nuklear.h:3987 + // CoordUv as declared in nk/nuklear.h:4241 CoordUv = iota - // CoordPixel as declared in nk/nuklear.h:3988 + // CoordPixel as declared in nk/nuklear.h:4242 CoordPixel = 1 ) const ( - // FontAtlasAlpha8 as declared in nk/nuklear.h:4061 + // FontAtlasAlpha8 as declared in nk/nuklear.h:4296 FontAtlasAlpha8 = iota - // FontAtlasRgba32 as declared in nk/nuklear.h:4062 + // FontAtlasRgba32 as declared in nk/nuklear.h:4297 FontAtlasRgba32 = 1 ) const ( - // BufferFixed as declared in nk/nuklear.h:4159 + // BufferFixed as declared in nk/nuklear.h:4396 BufferFixed = iota - // BufferDynamic as declared in nk/nuklear.h:4160 + // BufferDynamic as declared in nk/nuklear.h:4397 BufferDynamic = 1 ) const ( - // BufferFront as declared in nk/nuklear.h:4164 + // BufferFront as declared in nk/nuklear.h:4401 BufferFront = iota - // BufferBack as declared in nk/nuklear.h:4165 + // BufferBack as declared in nk/nuklear.h:4402 BufferBack = 1 - // BufferMax as declared in nk/nuklear.h:4166 + // BufferMax as declared in nk/nuklear.h:4403 BufferMax = 2 ) const ( - // TextEditSingleLine as declared in nk/nuklear.h:4328 + // TextEditSingleLine as declared in nk/nuklear.h:4558 TextEditSingleLine = iota - // TextEditMultiLine as declared in nk/nuklear.h:4329 + // TextEditMultiLine as declared in nk/nuklear.h:4559 TextEditMultiLine = 1 ) const ( - // TextEditModeView as declared in nk/nuklear.h:4333 + // TextEditModeView as declared in nk/nuklear.h:4563 TextEditModeView = iota - // TextEditModeInsert as declared in nk/nuklear.h:4334 + // TextEditModeInsert as declared in nk/nuklear.h:4564 TextEditModeInsert = 1 - // TextEditModeReplace as declared in nk/nuklear.h:4335 + // TextEditModeReplace as declared in nk/nuklear.h:4565 TextEditModeReplace = 2 ) const ( - // CommandTypeNop as declared in nk/nuklear.h:4436 + // CommandTypeNop as declared in nk/nuklear.h:4668 CommandTypeNop = iota - // CommandTypeScissor as declared in nk/nuklear.h:4437 + // CommandTypeScissor as declared in nk/nuklear.h:4669 CommandTypeScissor = 1 - // CommandTypeLine as declared in nk/nuklear.h:4438 + // CommandTypeLine as declared in nk/nuklear.h:4670 CommandTypeLine = 2 - // CommandTypeCurve as declared in nk/nuklear.h:4439 + // CommandTypeCurve as declared in nk/nuklear.h:4671 CommandTypeCurve = 3 - // CommandTypeRect as declared in nk/nuklear.h:4440 + // CommandTypeRect as declared in nk/nuklear.h:4672 CommandTypeRect = 4 - // CommandTypeRectFilled as declared in nk/nuklear.h:4441 + // CommandTypeRectFilled as declared in nk/nuklear.h:4673 CommandTypeRectFilled = 5 - // CommandTypeRectMultiColor as declared in nk/nuklear.h:4442 + // CommandTypeRectMultiColor as declared in nk/nuklear.h:4674 CommandTypeRectMultiColor = 6 - // CommandTypeCircle as declared in nk/nuklear.h:4443 + // CommandTypeCircle as declared in nk/nuklear.h:4675 CommandTypeCircle = 7 - // CommandTypeCircleFilled as declared in nk/nuklear.h:4444 + // CommandTypeCircleFilled as declared in nk/nuklear.h:4676 CommandTypeCircleFilled = 8 - // CommandTypeArc as declared in nk/nuklear.h:4445 + // CommandTypeArc as declared in nk/nuklear.h:4677 CommandTypeArc = 9 - // CommandTypeArcFilled as declared in nk/nuklear.h:4446 + // CommandTypeArcFilled as declared in nk/nuklear.h:4678 CommandTypeArcFilled = 10 - // CommandTypeTriangle as declared in nk/nuklear.h:4447 + // CommandTypeTriangle as declared in nk/nuklear.h:4679 CommandTypeTriangle = 11 - // CommandTypeTriangleFilled as declared in nk/nuklear.h:4448 + // CommandTypeTriangleFilled as declared in nk/nuklear.h:4680 CommandTypeTriangleFilled = 12 - // CommandTypePolygon as declared in nk/nuklear.h:4449 + // CommandTypePolygon as declared in nk/nuklear.h:4681 CommandTypePolygon = 13 - // CommandTypePolygonFilled as declared in nk/nuklear.h:4450 + // CommandTypePolygonFilled as declared in nk/nuklear.h:4682 CommandTypePolygonFilled = 14 - // CommandTypePolyline as declared in nk/nuklear.h:4451 + // CommandTypePolyline as declared in nk/nuklear.h:4683 CommandTypePolyline = 15 - // CommandTypeText as declared in nk/nuklear.h:4452 + // CommandTypeText as declared in nk/nuklear.h:4684 CommandTypeText = 16 - // CommandTypeImage as declared in nk/nuklear.h:4453 + // CommandTypeImage as declared in nk/nuklear.h:4685 CommandTypeImage = 17 - // CommandTypeCustom as declared in nk/nuklear.h:4454 + // CommandTypeCustom as declared in nk/nuklear.h:4686 CommandTypeCustom = 18 ) const ( - // ClippingOff as declared in nk/nuklear.h:4619 + // ClippingOff as declared in nk/nuklear.h:4851 ClippingOff = False - // ClippingOn as declared in nk/nuklear.h:4620 + // ClippingOn as declared in nk/nuklear.h:4852 ClippingOn = True ) const ( - // StrokeOpen as declared in nk/nuklear.h:4738 + // StrokeOpen as declared in nk/nuklear.h:4972 StrokeOpen = False - // StrokeClosed as declared in nk/nuklear.h:4740 + // StrokeClosed as declared in nk/nuklear.h:4973 StrokeClosed = True ) const ( - // VertexPosition as declared in nk/nuklear.h:4745 + // VertexPosition as declared in nk/nuklear.h:4977 VertexPosition = iota - // VertexColor as declared in nk/nuklear.h:4746 + // VertexColor as declared in nk/nuklear.h:4978 VertexColor = 1 - // VertexTexcoord as declared in nk/nuklear.h:4747 + // VertexTexcoord as declared in nk/nuklear.h:4979 VertexTexcoord = 2 - // VertexAttributeCount as declared in nk/nuklear.h:4748 + // VertexAttributeCount as declared in nk/nuklear.h:4980 VertexAttributeCount = 3 ) const ( - // FormatSchar as declared in nk/nuklear.h:4752 + // FormatSchar as declared in nk/nuklear.h:4984 FormatSchar = iota - // FormatSshort as declared in nk/nuklear.h:4753 + // FormatSshort as declared in nk/nuklear.h:4985 FormatSshort = 1 - // FormatSint as declared in nk/nuklear.h:4754 + // FormatSint as declared in nk/nuklear.h:4986 FormatSint = 2 - // FormatUchar as declared in nk/nuklear.h:4755 + // FormatUchar as declared in nk/nuklear.h:4987 FormatUchar = 3 - // FormatUshort as declared in nk/nuklear.h:4756 + // FormatUshort as declared in nk/nuklear.h:4988 FormatUshort = 4 - // FormatUint as declared in nk/nuklear.h:4757 + // FormatUint as declared in nk/nuklear.h:4989 FormatUint = 5 - // FormatFloat as declared in nk/nuklear.h:4758 + // FormatFloat as declared in nk/nuklear.h:4990 FormatFloat = 6 - // FormatDouble as declared in nk/nuklear.h:4759 + // FormatDouble as declared in nk/nuklear.h:4991 FormatDouble = 7 - // FormatColorBegin as declared in nk/nuklear.h:4761 + // FormatColorBegin as declared in nk/nuklear.h:4993 FormatColorBegin = 8 - // FormatR8g8b8 as declared in nk/nuklear.h:4762 + // FormatR8g8b8 as declared in nk/nuklear.h:4994 FormatR8g8b8 = FormatColorBegin - // FormatR16g15b16 as declared in nk/nuklear.h:4763 + // FormatR16g15b16 as declared in nk/nuklear.h:4995 FormatR16g15b16 = 9 - // FormatR32g32b32 as declared in nk/nuklear.h:4764 + // FormatR32g32b32 as declared in nk/nuklear.h:4996 FormatR32g32b32 = 10 - // FormatR8g8b8a8 as declared in nk/nuklear.h:4766 + // FormatR8g8b8a8 as declared in nk/nuklear.h:4998 FormatR8g8b8a8 = 11 - // FormatB8g8r8a8 as declared in nk/nuklear.h:4767 + // FormatB8g8r8a8 as declared in nk/nuklear.h:4999 FormatB8g8r8a8 = 12 - // FormatR16g15b16a16 as declared in nk/nuklear.h:4768 + // FormatR16g15b16a16 as declared in nk/nuklear.h:5000 FormatR16g15b16a16 = 13 - // FormatR32g32b32a32 as declared in nk/nuklear.h:4769 + // FormatR32g32b32a32 as declared in nk/nuklear.h:5001 FormatR32g32b32a32 = 14 - // FormatR32g32b32a32Float as declared in nk/nuklear.h:4770 + // FormatR32g32b32a32Float as declared in nk/nuklear.h:5002 FormatR32g32b32a32Float = 15 - // FormatR32g32b32a32Double as declared in nk/nuklear.h:4771 + // FormatR32g32b32a32Double as declared in nk/nuklear.h:5003 FormatR32g32b32a32Double = 16 - // FormatRgb32 as declared in nk/nuklear.h:4773 + // FormatRgb32 as declared in nk/nuklear.h:5005 FormatRgb32 = 17 - // FormatRgba32 as declared in nk/nuklear.h:4774 + // FormatRgba32 as declared in nk/nuklear.h:5006 FormatRgba32 = 18 - // FormatColorEnd as declared in nk/nuklear.h:4775 + // FormatColorEnd as declared in nk/nuklear.h:5007 FormatColorEnd = FormatRgba32 - // FormatCount as declared in nk/nuklear.h:4776 + // FormatCount as declared in nk/nuklear.h:5008 FormatCount = 19 ) const ( - // StyleItemColor as declared in nk/nuklear.h:4873 + // StyleItemColor as declared in nk/nuklear.h:5102 StyleItemColor = iota - // StyleItemImage as declared in nk/nuklear.h:4874 + // StyleItemImage as declared in nk/nuklear.h:5103 StyleItemImage = 1 - // StyleItemNineSlice as declared in nk/nuklear.h:4875 + // StyleItemNineSlice as declared in nk/nuklear.h:5104 StyleItemNineSlice = 2 ) const ( - // HeaderLeft as declared in nk/nuklear.h:5216 + // HeaderLeft as declared in nk/nuklear.h:5504 HeaderLeft = iota - // HeaderRight as declared in nk/nuklear.h:5217 + // HeaderRight as declared in nk/nuklear.h:5505 HeaderRight = 1 ) const ( - // PanelNone as declared in nk/nuklear.h:5323 + // PanelNone as declared in nk/nuklear.h:5612 PanelNone = iota - // PanelWindow as declared in nk/nuklear.h:5324 + // PanelWindow as declared in nk/nuklear.h:5613 PanelWindow = (1 << (0)) - // PanelGroup as declared in nk/nuklear.h:5325 + // PanelGroup as declared in nk/nuklear.h:5614 PanelGroup = (1 << (1)) - // PanelPopup as declared in nk/nuklear.h:5326 + // PanelPopup as declared in nk/nuklear.h:5615 PanelPopup = (1 << (2)) - // PanelContextual as declared in nk/nuklear.h:5327 + // PanelContextual as declared in nk/nuklear.h:5616 PanelContextual = (1 << (4)) - // PanelCombo as declared in nk/nuklear.h:5328 + // PanelCombo as declared in nk/nuklear.h:5617 PanelCombo = (1 << (5)) - // PanelMenu as declared in nk/nuklear.h:5329 + // PanelMenu as declared in nk/nuklear.h:5618 PanelMenu = (1 << (6)) - // PanelTooltip as declared in nk/nuklear.h:5330 + // PanelTooltip as declared in nk/nuklear.h:5619 PanelTooltip = (1 << (7)) ) const ( - // PanelSetNonblock as declared in nk/nuklear.h:5333 + // PanelSetNonblock as declared in nk/nuklear.h:5622 PanelSetNonblock = PanelContextual | PanelCombo | PanelMenu | PanelTooltip - // PanelSetPopup as declared in nk/nuklear.h:5334 + // PanelSetPopup as declared in nk/nuklear.h:5623 PanelSetPopup = PanelSetNonblock | PanelPopup - // PanelSetSub as declared in nk/nuklear.h:5335 + // PanelSetSub as declared in nk/nuklear.h:5624 PanelSetSub = PanelSetPopup | PanelGroup ) const ( - // LayoutDynamicFixed as declared in nk/nuklear.h:5355 + // LayoutDynamicFixed as declared in nk/nuklear.h:5645 LayoutDynamicFixed = iota - // LayoutDynamicRow as declared in nk/nuklear.h:5356 + // LayoutDynamicRow as declared in nk/nuklear.h:5646 LayoutDynamicRow = 1 - // LayoutDynamicFree as declared in nk/nuklear.h:5357 + // LayoutDynamicFree as declared in nk/nuklear.h:5647 LayoutDynamicFree = 2 - // LayoutDynamic as declared in nk/nuklear.h:5358 + // LayoutDynamic as declared in nk/nuklear.h:5648 LayoutDynamic = 3 - // LayoutStaticFixed as declared in nk/nuklear.h:5359 + // LayoutStaticFixed as declared in nk/nuklear.h:5649 LayoutStaticFixed = 4 - // LayoutStaticRow as declared in nk/nuklear.h:5360 + // LayoutStaticRow as declared in nk/nuklear.h:5650 LayoutStaticRow = 5 - // LayoutStaticFree as declared in nk/nuklear.h:5361 + // LayoutStaticFree as declared in nk/nuklear.h:5651 LayoutStaticFree = 6 - // LayoutStatic as declared in nk/nuklear.h:5362 + // LayoutStatic as declared in nk/nuklear.h:5652 LayoutStatic = 7 - // LayoutTemplate as declared in nk/nuklear.h:5363 + // LayoutTemplate as declared in nk/nuklear.h:5653 LayoutTemplate = 8 - // LayoutCount as declared in nk/nuklear.h:5364 + // LayoutCount as declared in nk/nuklear.h:5654 LayoutCount = 9 ) const ( - // WindowPrivate as declared in nk/nuklear.h:5423 + // WindowPrivate as declared in nk/nuklear.h:5713 WindowPrivate = (1 << (11)) - // WindowDynamic as declared in nk/nuklear.h:5424 + // WindowDynamic as declared in nk/nuklear.h:5714 WindowDynamic = WindowPrivate - // WindowRom as declared in nk/nuklear.h:5426 + // WindowRom as declared in nk/nuklear.h:5715 WindowRom = (1 << (12)) - // WindowNotInteractive as declared in nk/nuklear.h:5428 + // WindowNotInteractive as declared in nk/nuklear.h:5716 WindowNotInteractive = WindowRom | WindowNoInput - // WindowHidden as declared in nk/nuklear.h:5430 + // WindowHidden as declared in nk/nuklear.h:5717 WindowHidden = (1 << (13)) - // WindowClosed as declared in nk/nuklear.h:5432 + // WindowClosed as declared in nk/nuklear.h:5718 WindowClosed = (1 << (14)) - // WindowMinimized as declared in nk/nuklear.h:5434 + // WindowMinimized as declared in nk/nuklear.h:5719 WindowMinimized = (1 << (15)) - // WindowRemoveRom as declared in nk/nuklear.h:5436 + // WindowRemoveRom as declared in nk/nuklear.h:5720 WindowRemoveRom = (1 << (16)) ) diff --git a/nk/doc.go b/nk/doc.go index 4ea9434..7d21d44 100644 --- a/nk/doc.go +++ b/nk/doc.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. /* diff --git a/nk/nk.go b/nk/nk.go index aa67966..0b17380 100644 --- a/nk/nk.go +++ b/nk/nk.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package nk @@ -23,7 +23,7 @@ func NkRegisterClipboard(ctx *Context) { runtime.KeepAlive(cctxAllocMap) } -// NkInitDefault function as declared in nk/nuklear.h:584 +// NkInitDefault function as declared in nk/nuklear.h:599 func NkInitDefault(arg0 *Context, arg1 *UserFont) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := arg1.PassRef() @@ -34,7 +34,7 @@ func NkInitDefault(arg0 *Context, arg1 *UserFont) Bool { return __v } -// NkInitFixed function as declared in nk/nuklear.h:609 +// NkInitFixed function as declared in nk/nuklear.h:625 func NkInitFixed(arg0 *Context, memory unsafe.Pointer, size Size, arg3 *UserFont) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmemory, cmemoryAllocMap := memory, cgoAllocsUnknown @@ -49,7 +49,7 @@ func NkInitFixed(arg0 *Context, memory unsafe.Pointer, size Size, arg3 *UserFont return __v } -// NkInit function as declared in nk/nuklear.h:627 +// NkInit function as declared in nk/nuklear.h:645 func NkInit(arg0 *Context, arg1 *Allocator, arg2 *UserFont) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_allocator)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -62,7 +62,7 @@ func NkInit(arg0 *Context, arg1 *Allocator, arg2 *UserFont) Bool { return __v } -// NkInitCustom function as declared in nk/nuklear.h:646 +// NkInitCustom function as declared in nk/nuklear.h:665 func NkInitCustom(arg0 *Context, cmds *Buffer, pool *Buffer, arg3 *UserFont) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccmds, ccmdsAllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(cmds)), cgoAllocsUnknown @@ -77,28 +77,28 @@ func NkInitCustom(arg0 *Context, cmds *Buffer, pool *Buffer, arg3 *UserFont) Boo return __v } -// NkClear function as declared in nk/nuklear.h:660 +// NkClear function as declared in nk/nuklear.h:680 func NkClear(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_clear(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkFree function as declared in nk/nuklear.h:673 +// NkFree function as declared in nk/nuklear.h:692 func NkFree(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_free(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkInputBegin function as declared in nk/nuklear.h:809 +// NkInputBegin function as declared in nk/nuklear.h:831 func NkInputBegin(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_input_begin(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkInputMotion function as declared in nk/nuklear.h:823 +// NkInputMotion function as declared in nk/nuklear.h:845 func NkInputMotion(arg0 *Context, x int32, y int32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cx, cxAllocMap := (C.int)(x), cgoAllocsUnknown @@ -109,7 +109,7 @@ func NkInputMotion(arg0 *Context, x int32, y int32) { runtime.KeepAlive(carg0AllocMap) } -// NkInputKey function as declared in nk/nuklear.h:837 +// NkInputKey function as declared in nk/nuklear.h:859 func NkInputKey(arg0 *Context, arg1 C.enum_, down Bool) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -120,7 +120,7 @@ func NkInputKey(arg0 *Context, arg1 C.enum_, down Bool) { runtime.KeepAlive(carg0AllocMap) } -// NkInputButton function as declared in nk/nuklear.h:853 +// NkInputButton function as declared in nk/nuklear.h:875 func NkInputButton(arg0 *Context, arg1 C.enum_, x int32, y int32, down Bool) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -135,7 +135,7 @@ func NkInputButton(arg0 *Context, arg1 C.enum_, x int32, y int32, down Bool) { runtime.KeepAlive(carg0AllocMap) } -// NkInputScroll function as declared in nk/nuklear.h:868 +// NkInputScroll function as declared in nk/nuklear.h:891 func NkInputScroll(arg0 *Context, val Vec2) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cval, cvalAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&val)), cgoAllocsUnknown @@ -144,7 +144,7 @@ func NkInputScroll(arg0 *Context, val Vec2) { runtime.KeepAlive(carg0AllocMap) } -// NkInputChar function as declared in nk/nuklear.h:886 +// NkInputChar function as declared in nk/nuklear.h:910 func NkInputChar(arg0 *Context, arg1 byte) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.char)(arg1), cgoAllocsUnknown @@ -153,7 +153,7 @@ func NkInputChar(arg0 *Context, arg1 byte) { runtime.KeepAlive(carg0AllocMap) } -// NkInputUnicode function as declared in nk/nuklear.h:919 +// NkInputUnicode function as declared in nk/nuklear.h:943 func NkInputUnicode(arg0 *Context, arg1 Rune) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.nk_rune)(arg1), cgoAllocsUnknown @@ -162,14 +162,14 @@ func NkInputUnicode(arg0 *Context, arg1 Rune) { runtime.KeepAlive(carg0AllocMap) } -// NkInputEnd function as declared in nk/nuklear.h:932 +// NkInputEnd function as declared in nk/nuklear.h:956 func NkInputEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_input_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// Nk_Begin function as declared in nk/nuklear.h:1200 +// Nk_Begin function as declared in nk/nuklear.h:1227 func Nk_Begin(arg0 *Context) *Command { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk__begin(carg0) @@ -178,7 +178,7 @@ func Nk_Begin(arg0 *Context) *Command { return __v } -// Nk_Next function as declared in nk/nuklear.h:1215 +// Nk_Next function as declared in nk/nuklear.h:1242 func Nk_Next(arg0 *Context, arg1 *Command) *Command { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_command)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -189,7 +189,7 @@ func Nk_Next(arg0 *Context, arg1 *Command) *Command { return __v } -// NkConvert function as declared in nk/nuklear.h:1261 +// NkConvert function as declared in nk/nuklear.h:1287 func NkConvert(arg0 *Context, cmds *Buffer, vertices *Buffer, elements *Buffer, arg4 *ConvertConfig) Flags { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccmds, ccmdsAllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(cmds)), cgoAllocsUnknown @@ -206,7 +206,7 @@ func NkConvert(arg0 *Context, cmds *Buffer, vertices *Buffer, elements *Buffer, return __v } -// Nk_DrawBegin function as declared in nk/nuklear.h:1276 +// Nk_DrawBegin function as declared in nk/nuklear.h:1302 func Nk_DrawBegin(arg0 *Context, arg1 *Buffer) *DrawCommand { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -217,7 +217,7 @@ func Nk_DrawBegin(arg0 *Context, arg1 *Buffer) *DrawCommand { return __v } -// Nk_DrawEnd function as declared in nk/nuklear.h:1291 +// Nk_DrawEnd function as declared in nk/nuklear.h:1321 func Nk_DrawEnd(arg0 *Context, arg1 *Buffer) *DrawCommand { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -228,7 +228,7 @@ func Nk_DrawEnd(arg0 *Context, arg1 *Buffer) *DrawCommand { return __v } -// Nk_DrawNext function as declared in nk/nuklear.h:1307 +// Nk_DrawNext function as declared in nk/nuklear.h:1340 func Nk_DrawNext(arg0 *DrawCommand, arg1 *Buffer, arg2 *Context) *DrawCommand { carg0, carg0AllocMap := (*C.struct_nk_draw_command)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -241,7 +241,7 @@ func Nk_DrawNext(arg0 *DrawCommand, arg1 *Buffer, arg2 *Context) *DrawCommand { return __v } -// NkBegin function as declared in nk/nuklear.h:1501 +// NkBegin function as declared in nk/nuklear.h:1541 func NkBegin(ctx *Context, title string, bounds Rect, flags Flags) Bool { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown title = safeString(title) @@ -258,7 +258,7 @@ func NkBegin(ctx *Context, title string, bounds Rect, flags Flags) Bool { return __v } -// NkBeginTitled function as declared in nk/nuklear.h:1521 +// NkBeginTitled function as declared in nk/nuklear.h:1564 func NkBeginTitled(ctx *Context, name string, title string, bounds Rect, flags Flags) Bool { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) @@ -279,14 +279,14 @@ func NkBeginTitled(ctx *Context, name string, title string, bounds Rect, flags F return __v } -// NkEnd function as declared in nk/nuklear.h:1534 +// NkEnd function as declared in nk/nuklear.h:1580 func NkEnd(ctx *Context) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown C.nk_end(cctx) runtime.KeepAlive(cctxAllocMap) } -// NkWindowFind function as declared in nk/nuklear.h:1550 +// NkWindowFind function as declared in nk/nuklear.h:1598 func NkWindowFind(ctx *Context, name string) *Window { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) @@ -299,7 +299,7 @@ func NkWindowFind(ctx *Context, name string) *Window { return __v } -// NkWindowGetBounds function as declared in nk/nuklear.h:1566 +// NkWindowGetBounds function as declared in nk/nuklear.h:1617 func NkWindowGetBounds(ctx *Context) Rect { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown __ret := C.nk_window_get_bounds(cctx) @@ -308,7 +308,7 @@ func NkWindowGetBounds(ctx *Context) Rect { return __v } -// NkWindowGetPosition function as declared in nk/nuklear.h:1582 +// NkWindowGetPosition function as declared in nk/nuklear.h:1636 func NkWindowGetPosition(ctx *Context) Vec2 { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown __ret := C.nk_window_get_position(cctx) @@ -317,117 +317,117 @@ func NkWindowGetPosition(ctx *Context) Vec2 { return __v } -// NkWindowGetSize function as declared in nk/nuklear.h:1598 -func NkWindowGetSize(arg0 *Context) Vec2 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_size(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetSize function as declared in nk/nuklear.h:1655 +func NkWindowGetSize(ctx *Context) Vec2 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_size(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Vec2)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetWidth function as declared in nk/nuklear.h:1614 -func NkWindowGetWidth(arg0 *Context) float32 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_width(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetWidth function as declared in nk/nuklear.h:1673 +func NkWindowGetWidth(ctx *Context) float32 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_width(cctx) + runtime.KeepAlive(cctxAllocMap) __v := (float32)(__ret) return __v } -// NkWindowGetHeight function as declared in nk/nuklear.h:1630 -func NkWindowGetHeight(arg0 *Context) float32 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_height(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetHeight function as declared in nk/nuklear.h:1692 +func NkWindowGetHeight(ctx *Context) float32 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_height(cctx) + runtime.KeepAlive(cctxAllocMap) __v := (float32)(__ret) return __v } -// NkWindowGetPanel function as declared in nk/nuklear.h:1648 -func NkWindowGetPanel(arg0 *Context) *Panel { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_panel(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetPanel function as declared in nk/nuklear.h:1713 +func NkWindowGetPanel(ctx *Context) *Panel { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_panel(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(**Panel)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetContentRegion function as declared in nk/nuklear.h:1667 -func NkWindowGetContentRegion(arg0 *Context) Rect { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_content_region(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetContentRegion function as declared in nk/nuklear.h:1735 +func NkWindowGetContentRegion(ctx *Context) Rect { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_content_region(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Rect)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetContentRegionMin function as declared in nk/nuklear.h:1686 -func NkWindowGetContentRegionMin(arg0 *Context) Vec2 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_content_region_min(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetContentRegionMin function as declared in nk/nuklear.h:1757 +func NkWindowGetContentRegionMin(ctx *Context) Vec2 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_content_region_min(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Vec2)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetContentRegionMax function as declared in nk/nuklear.h:1705 -func NkWindowGetContentRegionMax(arg0 *Context) Vec2 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_content_region_max(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetContentRegionMax function as declared in nk/nuklear.h:1779 +func NkWindowGetContentRegionMax(ctx *Context) Vec2 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_content_region_max(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Vec2)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetContentRegionSize function as declared in nk/nuklear.h:1723 -func NkWindowGetContentRegionSize(arg0 *Context) Vec2 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_content_region_size(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetContentRegionSize function as declared in nk/nuklear.h:1800 +func NkWindowGetContentRegionSize(ctx *Context) Vec2 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_content_region_size(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Vec2)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetCanvas function as declared in nk/nuklear.h:1742 -func NkWindowGetCanvas(arg0 *Context) *CommandBuffer { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_get_canvas(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowGetCanvas function as declared in nk/nuklear.h:1821 +func NkWindowGetCanvas(ctx *Context) *CommandBuffer { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_get_canvas(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(**CommandBuffer)(unsafe.Pointer(&__ret)) return __v } -// NkWindowGetScroll function as declared in nk/nuklear.h:1758 -func NkWindowGetScroll(arg0 *Context, offsetX *Uint, offsetY *Uint) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowGetScroll function as declared in nk/nuklear.h:1840 +func NkWindowGetScroll(ctx *Context, offsetX *Uint, offsetY *Uint) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown coffsetX, coffsetXAllocMap := (*C.nk_uint)(unsafe.Pointer(offsetX)), cgoAllocsUnknown coffsetY, coffsetYAllocMap := (*C.nk_uint)(unsafe.Pointer(offsetY)), cgoAllocsUnknown - C.nk_window_get_scroll(carg0, coffsetX, coffsetY) + C.nk_window_get_scroll(cctx, coffsetX, coffsetY) runtime.KeepAlive(coffsetYAllocMap) runtime.KeepAlive(coffsetXAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowHasFocus function as declared in nk/nuklear.h:1773 -func NkWindowHasFocus(arg0 *Context) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_has_focus(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowHasFocus function as declared in nk/nuklear.h:1858 +func NkWindowHasFocus(ctx *Context) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_has_focus(cctx) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkWindowIsHovered function as declared in nk/nuklear.h:1788 -func NkWindowIsHovered(arg0 *Context) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_is_hovered(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowIsHovered function as declared in nk/nuklear.h:1876 +func NkWindowIsHovered(ctx *Context) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_is_hovered(cctx) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkWindowIsCollapsed function as declared in nk/nuklear.h:1803 +// NkWindowIsCollapsed function as declared in nk/nuklear.h:1894 func NkWindowIsCollapsed(ctx *Context, name string) Bool { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) @@ -440,119 +440,125 @@ func NkWindowIsCollapsed(ctx *Context, name string) Bool { return __v } -// NkWindowIsClosed function as declared in nk/nuklear.h:1817 -func NkWindowIsClosed(arg0 *Context, arg1 *byte) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown - __ret := C.nk_window_is_closed(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkWindowIsClosed function as declared in nk/nuklear.h:1911 +func NkWindowIsClosed(ctx *Context, name string) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + name = safeString(name) + cname, cnameAllocMap := unpackPCharString(name) + __ret := C.nk_window_is_closed(cctx, cname) + runtime.KeepAlive(name) + runtime.KeepAlive(cnameAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkWindowIsHidden function as declared in nk/nuklear.h:1831 -func NkWindowIsHidden(arg0 *Context, arg1 *byte) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown - __ret := C.nk_window_is_hidden(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkWindowIsHidden function as declared in nk/nuklear.h:1928 +func NkWindowIsHidden(ctx *Context, name string) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + name = safeString(name) + cname, cnameAllocMap := unpackPCharString(name) + __ret := C.nk_window_is_hidden(cctx, cname) + runtime.KeepAlive(name) + runtime.KeepAlive(cnameAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkWindowIsActive function as declared in nk/nuklear.h:1845 -func NkWindowIsActive(arg0 *Context, arg1 *byte) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown - __ret := C.nk_window_is_active(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkWindowIsActive function as declared in nk/nuklear.h:1944 +func NkWindowIsActive(ctx *Context, name string) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + name = safeString(name) + cname, cnameAllocMap := unpackPCharString(name) + __ret := C.nk_window_is_active(cctx, cname) + runtime.KeepAlive(name) + runtime.KeepAlive(cnameAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkWindowIsAnyHovered function as declared in nk/nuklear.h:1858 -func NkWindowIsAnyHovered(arg0 *Context) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_window_is_any_hovered(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkWindowIsAnyHovered function as declared in nk/nuklear.h:1959 +func NkWindowIsAnyHovered(ctx *Context) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_window_is_any_hovered(cctx) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkItemIsAnyActive function as declared in nk/nuklear.h:1873 -func NkItemIsAnyActive(arg0 *Context) Bool { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_item_is_any_active(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkItemIsAnyActive function as declared in nk/nuklear.h:1977 +func NkItemIsAnyActive(ctx *Context) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_item_is_any_active(cctx) + runtime.KeepAlive(cctxAllocMap) __v := (Bool)(__ret) return __v } -// NkWindowSetBounds function as declared in nk/nuklear.h:1886 -func NkWindowSetBounds(arg0 *Context, name string, bounds Rect) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowSetBounds function as declared in nk/nuklear.h:1993 +func NkWindowSetBounds(ctx *Context, name string, bounds Rect) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) cbounds, cboundsAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&bounds)), cgoAllocsUnknown - C.nk_window_set_bounds(carg0, cname, cbounds) + C.nk_window_set_bounds(cctx, cname, cbounds) runtime.KeepAlive(cboundsAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowSetPosition function as declared in nk/nuklear.h:1899 -func NkWindowSetPosition(arg0 *Context, name string, pos Vec2) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowSetPosition function as declared in nk/nuklear.h:2009 +func NkWindowSetPosition(ctx *Context, name string, pos Vec2) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) cpos, cposAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&pos)), cgoAllocsUnknown - C.nk_window_set_position(carg0, cname, cpos) + C.nk_window_set_position(cctx, cname, cpos) runtime.KeepAlive(cposAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowSetSize function as declared in nk/nuklear.h:1912 -func NkWindowSetSize(arg0 *Context, name string, arg2 Vec2) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowSetSize function as declared in nk/nuklear.h:2025 +func NkWindowSetSize(ctx *Context, name string, size Vec2) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) - carg2, carg2AllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&arg2)), cgoAllocsUnknown - C.nk_window_set_size(carg0, cname, carg2) - runtime.KeepAlive(carg2AllocMap) + csize, csizeAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&size)), cgoAllocsUnknown + C.nk_window_set_size(cctx, cname, csize) + runtime.KeepAlive(csizeAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowSetFocus function as declared in nk/nuklear.h:1924 -func NkWindowSetFocus(arg0 *Context, name string) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowSetFocus function as declared in nk/nuklear.h:2040 +func NkWindowSetFocus(ctx *Context, name string) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) - C.nk_window_set_focus(carg0, cname) + C.nk_window_set_focus(cctx, cname) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowSetScroll function as declared in nk/nuklear.h:1940 -func NkWindowSetScroll(arg0 *Context, offsetX Uint, offsetY Uint) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowSetScroll function as declared in nk/nuklear.h:2059 +func NkWindowSetScroll(ctx *Context, offsetX Uint, offsetY Uint) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown coffsetX, coffsetXAllocMap := (C.nk_uint)(offsetX), cgoAllocsUnknown coffsetY, coffsetYAllocMap := (C.nk_uint)(offsetY), cgoAllocsUnknown - C.nk_window_set_scroll(carg0, coffsetX, coffsetY) + C.nk_window_set_scroll(cctx, coffsetX, coffsetY) runtime.KeepAlive(coffsetYAllocMap) runtime.KeepAlive(coffsetXAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowClose function as declared in nk/nuklear.h:1952 +// NkWindowClose function as declared in nk/nuklear.h:2074 func NkWindowClose(ctx *Context, name string) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) @@ -563,63 +569,74 @@ func NkWindowClose(ctx *Context, name string) { runtime.KeepAlive(cctxAllocMap) } -// NkWindowCollapse function as declared in nk/nuklear.h:1965 -func NkWindowCollapse(arg0 *Context, name string, state C.enum_) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowCollapse function as declared in nk/nuklear.h:2090 +func NkWindowCollapse(ctx *Context, name string, state C.enum_) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) cstate, cstateAllocMap := (C.enum_)(state), cgoAllocsUnknown - C.nk_window_collapse(carg0, cname, cstate) + C.nk_window_collapse(cctx, cname, cstate) runtime.KeepAlive(cstateAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowCollapseIf function as declared in nk/nuklear.h:1979 -func NkWindowCollapseIf(arg0 *Context, name string, arg2 C.enum_, cond int32) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowCollapseIf function as declared in nk/nuklear.h:2107 +func NkWindowCollapseIf(ctx *Context, name string, state C.enum_, cond int32) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) - carg2, carg2AllocMap := (C.enum_)(arg2), cgoAllocsUnknown + cstate, cstateAllocMap := (C.enum_)(state), cgoAllocsUnknown ccond, ccondAllocMap := (C.int)(cond), cgoAllocsUnknown - C.nk_window_collapse_if(carg0, cname, carg2, ccond) + C.nk_window_collapse_if(cctx, cname, cstate, ccond) runtime.KeepAlive(ccondAllocMap) - runtime.KeepAlive(carg2AllocMap) + runtime.KeepAlive(cstateAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowShow function as declared in nk/nuklear.h:1992 -func NkWindowShow(arg0 *Context, name string, arg2 C.enum_) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowShow function as declared in nk/nuklear.h:2122 +func NkWindowShow(ctx *Context, name string, state C.enum_) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) - carg2, carg2AllocMap := (C.enum_)(arg2), cgoAllocsUnknown - C.nk_window_show(carg0, cname, carg2) - runtime.KeepAlive(carg2AllocMap) + cstate, cstateAllocMap := (C.enum_)(state), cgoAllocsUnknown + C.nk_window_show(cctx, cname, cstate) + runtime.KeepAlive(cstateAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkWindowShowIf function as declared in nk/nuklear.h:2006 -func NkWindowShowIf(arg0 *Context, name string, arg2 C.enum_, cond int32) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkWindowShowIf function as declared in nk/nuklear.h:2139 +func NkWindowShowIf(ctx *Context, name string, state C.enum_, cond int32) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown name = safeString(name) cname, cnameAllocMap := unpackPCharString(name) - carg2, carg2AllocMap := (C.enum_)(arg2), cgoAllocsUnknown + cstate, cstateAllocMap := (C.enum_)(state), cgoAllocsUnknown ccond, ccondAllocMap := (C.int)(cond), cgoAllocsUnknown - C.nk_window_show_if(carg0, cname, carg2, ccond) + C.nk_window_show_if(cctx, cname, cstate, ccond) runtime.KeepAlive(ccondAllocMap) - runtime.KeepAlive(carg2AllocMap) + runtime.KeepAlive(cstateAllocMap) runtime.KeepAlive(name) runtime.KeepAlive(cnameAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) } -// NkLayoutSetMinRowHeight function as declared in nk/nuklear.h:2295 +// NkRuleHorizontal function as declared in nk/nuklear.h:2154 +func NkRuleHorizontal(ctx *Context, color Color, rounding Bool) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + ccolor, ccolorAllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&color)), cgoAllocsUnknown + crounding, croundingAllocMap := (C.nk_bool)(rounding), cgoAllocsUnknown + C.nk_rule_horizontal(cctx, ccolor, crounding) + runtime.KeepAlive(croundingAllocMap) + runtime.KeepAlive(ccolorAllocMap) + runtime.KeepAlive(cctxAllocMap) +} + +// NkLayoutSetMinRowHeight function as declared in nk/nuklear.h:2456 func NkLayoutSetMinRowHeight(arg0 *Context, height float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cheight, cheightAllocMap := (C.float)(height), cgoAllocsUnknown @@ -628,34 +645,34 @@ func NkLayoutSetMinRowHeight(arg0 *Context, height float32) { runtime.KeepAlive(carg0AllocMap) } -// NkLayoutResetMinRowHeight function as declared in nk/nuklear.h:2306 +// NkLayoutResetMinRowHeight function as declared in nk/nuklear.h:2466 func NkLayoutResetMinRowHeight(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_layout_reset_min_row_height(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkLayoutWidgetBounds function as declared in nk/nuklear.h:2319 -func NkLayoutWidgetBounds(arg0 *Context) Rect { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_layout_widget_bounds(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkLayoutWidgetBounds function as declared in nk/nuklear.h:2480 +func NkLayoutWidgetBounds(ctx *Context) Rect { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_layout_widget_bounds(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Rect)(unsafe.Pointer(&__ret)) return __v } -// NkLayoutRatioFromPixel function as declared in nk/nuklear.h:2333 -func NkLayoutRatioFromPixel(arg0 *Context, pixelWidth float32) float32 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown +// NkLayoutRatioFromPixel function as declared in nk/nuklear.h:2495 +func NkLayoutRatioFromPixel(ctx *Context, pixelWidth float32) float32 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown cpixelWidth, cpixelWidthAllocMap := (C.float)(pixelWidth), cgoAllocsUnknown - __ret := C.nk_layout_ratio_from_pixel(carg0, cpixelWidth) + __ret := C.nk_layout_ratio_from_pixel(cctx, cpixelWidth) runtime.KeepAlive(cpixelWidthAllocMap) - runtime.KeepAlive(carg0AllocMap) + runtime.KeepAlive(cctxAllocMap) __v := (float32)(__ret) return __v } -// NkLayoutRowDynamic function as declared in nk/nuklear.h:2348 +// NkLayoutRowDynamic function as declared in nk/nuklear.h:2511 func NkLayoutRowDynamic(ctx *Context, height float32, cols int32) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown cheight, cheightAllocMap := (C.float)(height), cgoAllocsUnknown @@ -666,7 +683,7 @@ func NkLayoutRowDynamic(ctx *Context, height float32, cols int32) { runtime.KeepAlive(cctxAllocMap) } -// NkLayoutRowStatic function as declared in nk/nuklear.h:2364 +// NkLayoutRowStatic function as declared in nk/nuklear.h:2528 func NkLayoutRowStatic(ctx *Context, height float32, itemWidth int32, cols int32) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown cheight, cheightAllocMap := (C.float)(height), cgoAllocsUnknown @@ -679,7 +696,7 @@ func NkLayoutRowStatic(ctx *Context, height float32, itemWidth int32, cols int32 runtime.KeepAlive(cctxAllocMap) } -// NkLayoutRowBegin function as declared in nk/nuklear.h:2378 +// NkLayoutRowBegin function as declared in nk/nuklear.h:2543 func NkLayoutRowBegin(ctx *Context, fmt C.enum_, rowHeight float32, cols int32) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown cfmt, cfmtAllocMap := (C.enum_)(fmt), cgoAllocsUnknown @@ -692,7 +709,7 @@ func NkLayoutRowBegin(ctx *Context, fmt C.enum_, rowHeight float32, cols int32) runtime.KeepAlive(cctxAllocMap) } -// NkLayoutRowPush function as declared in nk/nuklear.h:2390 +// NkLayoutRowPush function as declared in nk/nuklear.h:2556 func NkLayoutRowPush(arg0 *Context, value float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cvalue, cvalueAllocMap := (C.float)(value), cgoAllocsUnknown @@ -701,20 +718,20 @@ func NkLayoutRowPush(arg0 *Context, value float32) { runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRowEnd function as declared in nk/nuklear.h:2401 +// NkLayoutRowEnd function as declared in nk/nuklear.h:2568 func NkLayoutRowEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_layout_row_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRow function as declared in nk/nuklear.h:2415 +// NkLayoutRow function as declared in nk/nuklear.h:2583 func NkLayoutRow(arg0 *Context, arg1 C.enum_, height float32, cols int32, ratio []float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown cheight, cheightAllocMap := (C.float)(height), cgoAllocsUnknown ccols, ccolsAllocMap := (C.int)(cols), cgoAllocsUnknown - cratio, cratioAllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&ratio))) + cratio, cratioAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&ratio)).Data)), cgoAllocsUnknown C.nk_layout_row(carg0, carg1, cheight, ccols, cratio) runtime.KeepAlive(cratioAllocMap) runtime.KeepAlive(ccolsAllocMap) @@ -723,7 +740,7 @@ func NkLayoutRow(arg0 *Context, arg1 C.enum_, height float32, cols int32, ratio runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRowTemplateBegin function as declared in nk/nuklear.h:2427 +// NkLayoutRowTemplateBegin function as declared in nk/nuklear.h:2597 func NkLayoutRowTemplateBegin(arg0 *Context, rowHeight float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown crowHeight, crowHeightAllocMap := (C.float)(rowHeight), cgoAllocsUnknown @@ -732,14 +749,14 @@ func NkLayoutRowTemplateBegin(arg0 *Context, rowHeight float32) { runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRowTemplatePushDynamic function as declared in nk/nuklear.h:2439 +// NkLayoutRowTemplatePushDynamic function as declared in nk/nuklear.h:2611 func NkLayoutRowTemplatePushDynamic(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_layout_row_template_push_dynamic(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRowTemplatePushVariable function as declared in nk/nuklear.h:2451 +// NkLayoutRowTemplatePushVariable function as declared in nk/nuklear.h:2625 func NkLayoutRowTemplatePushVariable(arg0 *Context, minWidth float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cminWidth, cminWidthAllocMap := (C.float)(minWidth), cgoAllocsUnknown @@ -748,7 +765,7 @@ func NkLayoutRowTemplatePushVariable(arg0 *Context, minWidth float32) { runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRowTemplatePushStatic function as declared in nk/nuklear.h:2463 +// NkLayoutRowTemplatePushStatic function as declared in nk/nuklear.h:2639 func NkLayoutRowTemplatePushStatic(arg0 *Context, width float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cwidth, cwidthAllocMap := (C.float)(width), cgoAllocsUnknown @@ -757,14 +774,14 @@ func NkLayoutRowTemplatePushStatic(arg0 *Context, width float32) { runtime.KeepAlive(carg0AllocMap) } -// NkLayoutRowTemplateEnd function as declared in nk/nuklear.h:2474 +// NkLayoutRowTemplateEnd function as declared in nk/nuklear.h:2652 func NkLayoutRowTemplateEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_layout_row_template_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkLayoutSpaceBegin function as declared in nk/nuklear.h:2488 +// NkLayoutSpaceBegin function as declared in nk/nuklear.h:2668 func NkLayoutSpaceBegin(arg0 *Context, arg1 C.enum_, height float32, widgetCount int32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -777,7 +794,7 @@ func NkLayoutSpaceBegin(arg0 *Context, arg1 C.enum_, height float32, widgetCount runtime.KeepAlive(carg0AllocMap) } -// NkLayoutSpacePush function as declared in nk/nuklear.h:2500 +// NkLayoutSpacePush function as declared in nk/nuklear.h:2682 func NkLayoutSpacePush(arg0 *Context, bounds Rect) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cbounds, cboundsAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&bounds)), cgoAllocsUnknown @@ -786,74 +803,74 @@ func NkLayoutSpacePush(arg0 *Context, bounds Rect) { runtime.KeepAlive(carg0AllocMap) } -// NkLayoutSpaceEnd function as declared in nk/nuklear.h:2511 +// NkLayoutSpaceEnd function as declared in nk/nuklear.h:2695 func NkLayoutSpaceEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_layout_space_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkLayoutSpaceBounds function as declared in nk/nuklear.h:2524 -func NkLayoutSpaceBounds(arg0 *Context) Rect { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - __ret := C.nk_layout_space_bounds(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkLayoutSpaceBounds function as declared in nk/nuklear.h:2710 +func NkLayoutSpaceBounds(ctx *Context) Rect { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + __ret := C.nk_layout_space_bounds(cctx) + runtime.KeepAlive(cctxAllocMap) __v := *(*Rect)(unsafe.Pointer(&__ret)) return __v } -// NkLayoutSpaceToScreen function as declared in nk/nuklear.h:2538 -func NkLayoutSpaceToScreen(arg0 *Context, arg1 Vec2) Vec2 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&arg1)), cgoAllocsUnknown - __ret := C.nk_layout_space_to_screen(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkLayoutSpaceToScreen function as declared in nk/nuklear.h:2726 +func NkLayoutSpaceToScreen(ctx *Context, vec Vec2) Vec2 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + cvec, cvecAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&vec)), cgoAllocsUnknown + __ret := C.nk_layout_space_to_screen(cctx, cvec) + runtime.KeepAlive(cvecAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := *(*Vec2)(unsafe.Pointer(&__ret)) return __v } -// NkLayoutSpaceToLocal function as declared in nk/nuklear.h:2552 -func NkLayoutSpaceToLocal(arg0 *Context, arg1 Vec2) Vec2 { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&arg1)), cgoAllocsUnknown - __ret := C.nk_layout_space_to_local(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkLayoutSpaceToLocal function as declared in nk/nuklear.h:2742 +func NkLayoutSpaceToLocal(ctx *Context, vec Vec2) Vec2 { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + cvec, cvecAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&vec)), cgoAllocsUnknown + __ret := C.nk_layout_space_to_local(cctx, cvec) + runtime.KeepAlive(cvecAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := *(*Vec2)(unsafe.Pointer(&__ret)) return __v } -// NkLayoutSpaceRectToScreen function as declared in nk/nuklear.h:2566 -func NkLayoutSpaceRectToScreen(arg0 *Context, arg1 Rect) Rect { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown - __ret := C.nk_layout_space_rect_to_screen(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkLayoutSpaceRectToScreen function as declared in nk/nuklear.h:2758 +func NkLayoutSpaceRectToScreen(ctx *Context, bounds Rect) Rect { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + cbounds, cboundsAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&bounds)), cgoAllocsUnknown + __ret := C.nk_layout_space_rect_to_screen(cctx, cbounds) + runtime.KeepAlive(cboundsAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := *(*Rect)(unsafe.Pointer(&__ret)) return __v } -// NkLayoutSpaceRectToLocal function as declared in nk/nuklear.h:2580 -func NkLayoutSpaceRectToLocal(arg0 *Context, arg1 Rect) Rect { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown - __ret := C.nk_layout_space_rect_to_local(carg0, carg1) - runtime.KeepAlive(carg1AllocMap) - runtime.KeepAlive(carg0AllocMap) +// NkLayoutSpaceRectToLocal function as declared in nk/nuklear.h:2774 +func NkLayoutSpaceRectToLocal(ctx *Context, bounds Rect) Rect { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + cbounds, cboundsAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&bounds)), cgoAllocsUnknown + __ret := C.nk_layout_space_rect_to_local(cctx, cbounds) + runtime.KeepAlive(cboundsAllocMap) + runtime.KeepAlive(cctxAllocMap) __v := *(*Rect)(unsafe.Pointer(&__ret)) return __v } -// NkSpacer function as declared in nk/nuklear.h:2593 -func NkSpacer(arg0 *Context) { - carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - C.nk_spacer(carg0) - runtime.KeepAlive(carg0AllocMap) +// NkSpacer function as declared in nk/nuklear.h:2788 +func NkSpacer(ctx *Context) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + C.nk_spacer(cctx) + runtime.KeepAlive(cctxAllocMap) } -// NkGroupBegin function as declared in nk/nuklear.h:2698 +// NkGroupBegin function as declared in nk/nuklear.h:2895 func NkGroupBegin(arg0 *Context, title string, arg2 Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown title = safeString(title) @@ -868,7 +885,7 @@ func NkGroupBegin(arg0 *Context, title string, arg2 Flags) Bool { return __v } -// NkGroupBeginTitled function as declared in nk/nuklear.h:2714 +// NkGroupBeginTitled function as declared in nk/nuklear.h:2910 func NkGroupBeginTitled(arg0 *Context, name string, title string, arg3 Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -887,14 +904,14 @@ func NkGroupBeginTitled(arg0 *Context, name string, title string, arg3 Flags) Bo return __v } -// NkGroupEnd function as declared in nk/nuklear.h:2725 +// NkGroupEnd function as declared in nk/nuklear.h:2923 func NkGroupEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_group_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkGroupScrolledOffsetBegin function as declared in nk/nuklear.h:2743 +// NkGroupScrolledOffsetBegin function as declared in nk/nuklear.h:2943 func NkGroupScrolledOffsetBegin(arg0 *Context, xOffset *Uint, yOffset *Uint, title string, flags Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cxOffset, cxOffsetAllocMap := (*C.nk_uint)(unsafe.Pointer(xOffset)), cgoAllocsUnknown @@ -913,7 +930,7 @@ func NkGroupScrolledOffsetBegin(arg0 *Context, xOffset *Uint, yOffset *Uint, tit return __v } -// NkGroupScrolledBegin function as declared in nk/nuklear.h:2760 +// NkGroupScrolledBegin function as declared in nk/nuklear.h:2962 func NkGroupScrolledBegin(arg0 *Context, off *Scroll, title string, arg3 Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown coff, coffAllocMap := (*C.struct_nk_scroll)(unsafe.Pointer(off)), cgoAllocsUnknown @@ -930,14 +947,14 @@ func NkGroupScrolledBegin(arg0 *Context, off *Scroll, title string, arg3 Flags) return __v } -// NkGroupScrolledEnd function as declared in nk/nuklear.h:2771 +// NkGroupScrolledEnd function as declared in nk/nuklear.h:2975 func NkGroupScrolledEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_group_scrolled_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkGroupGetScroll function as declared in nk/nuklear.h:2785 +// NkGroupGetScroll function as declared in nk/nuklear.h:2991 func NkGroupGetScroll(arg0 *Context, id string, xOffset *Uint, yOffset *Uint) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown id = safeString(id) @@ -952,7 +969,7 @@ func NkGroupGetScroll(arg0 *Context, id string, xOffset *Uint, yOffset *Uint) { runtime.KeepAlive(carg0AllocMap) } -// NkGroupSetScroll function as declared in nk/nuklear.h:2799 +// NkGroupSetScroll function as declared in nk/nuklear.h:3007 func NkGroupSetScroll(arg0 *Context, id string, xOffset Uint, yOffset Uint) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown id = safeString(id) @@ -967,7 +984,7 @@ func NkGroupSetScroll(arg0 *Context, id string, xOffset Uint, yOffset Uint) { runtime.KeepAlive(carg0AllocMap) } -// NkTreePushHashed function as declared in nk/nuklear.h:2928 +// NkTreePushHashed function as declared in nk/nuklear.h:3143 func NkTreePushHashed(arg0 *Context, arg1 C.enum_, title string, initialState C.enum_, hash string, len int32, seed int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -992,7 +1009,7 @@ func NkTreePushHashed(arg0 *Context, arg1 C.enum_, title string, initialState C. return __v } -// NkTreeImagePushHashed function as declared in nk/nuklear.h:2992 +// NkTreeImagePushHashed function as declared in nk/nuklear.h:3212 func NkTreeImagePushHashed(arg0 *Context, arg1 C.enum_, arg2 Image, title string, initialState C.enum_, hash string, len int32, seed int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1019,14 +1036,14 @@ func NkTreeImagePushHashed(arg0 *Context, arg1 C.enum_, arg2 Image, title string return __v } -// NkTreePop function as declared in nk/nuklear.h:3003 +// NkTreePop function as declared in nk/nuklear.h:3225 func NkTreePop(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_tree_pop(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTreeStatePush function as declared in nk/nuklear.h:3019 +// NkTreeStatePush function as declared in nk/nuklear.h:3243 func NkTreeStatePush(arg0 *Context, arg1 C.enum_, title string, state *C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1043,14 +1060,14 @@ func NkTreeStatePush(arg0 *Context, arg1 C.enum_, title string, state *C.enum_) return __v } -// NkTreeStateImagePush function as declared in nk/nuklear.h:3036 +// NkTreeStateImagePush function as declared in nk/nuklear.h:3262 func NkTreeStateImagePush(arg0 *Context, arg1 C.enum_, arg2 Image, title string, state []C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown carg2, carg2AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg2)), cgoAllocsUnknown title = safeString(title) ctitle, ctitleAllocMap := unpackPCharString(title) - cstate, cstateAllocMap := copyPEnumBytes((*sliceHeader)(unsafe.Pointer(&state))) + cstate, cstateAllocMap := (*C.enum_)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&state)).Data)), cgoAllocsUnknown __ret := C.nk_tree_state_image_push(carg0, carg1, carg2, ctitle, cstate) runtime.KeepAlive(cstateAllocMap) runtime.KeepAlive(title) @@ -1062,21 +1079,21 @@ func NkTreeStateImagePush(arg0 *Context, arg1 C.enum_, arg2 Image, title string, return __v } -// NkTreeStatePop function as declared in nk/nuklear.h:3047 +// NkTreeStatePop function as declared in nk/nuklear.h:3275 func NkTreeStatePop(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_tree_state_pop(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTreeElementPushHashed function as declared in nk/nuklear.h:3051 +// NkTreeElementPushHashed function as declared in nk/nuklear.h:3279 func NkTreeElementPushHashed(arg0 *Context, arg1 C.enum_, title string, initialState C.enum_, selected []Bool, hash string, len int32, seed int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown title = safeString(title) ctitle, ctitleAllocMap := unpackPCharString(title) cinitialState, cinitialStateAllocMap := (C.enum_)(initialState), cgoAllocsUnknown - cselected, cselectedAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&selected))) + cselected, cselectedAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&selected)).Data)), cgoAllocsUnknown hash = safeString(hash) chash, chashAllocMap := unpackPCharString(hash) clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown @@ -1096,7 +1113,7 @@ func NkTreeElementPushHashed(arg0 *Context, arg1 C.enum_, title string, initialS return __v } -// NkTreeElementImagePushHashed function as declared in nk/nuklear.h:3052 +// NkTreeElementImagePushHashed function as declared in nk/nuklear.h:3280 func NkTreeElementImagePushHashed(arg0 *Context, arg1 C.enum_, arg2 Image, title string, initialState C.enum_, selected []Bool, hash string, len int32, seed int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1104,7 +1121,7 @@ func NkTreeElementImagePushHashed(arg0 *Context, arg1 C.enum_, arg2 Image, title title = safeString(title) ctitle, ctitleAllocMap := unpackPCharString(title) cinitialState, cinitialStateAllocMap := (C.enum_)(initialState), cgoAllocsUnknown - cselected, cselectedAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&selected))) + cselected, cselectedAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&selected)).Data)), cgoAllocsUnknown hash = safeString(hash) chash, chashAllocMap := unpackPCharString(hash) clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown @@ -1125,14 +1142,14 @@ func NkTreeElementImagePushHashed(arg0 *Context, arg1 C.enum_, arg2 Image, title return __v } -// NkTreeElementPop function as declared in nk/nuklear.h:3053 +// NkTreeElementPop function as declared in nk/nuklear.h:3281 func NkTreeElementPop(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_tree_element_pop(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkListViewBegin function as declared in nk/nuklear.h:3069 +// NkListViewBegin function as declared in nk/nuklear.h:3297 func NkListViewBegin(arg0 *Context, out *ListView, id string, arg3 Flags, rowHeight int32, rowCount int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cout, coutAllocMap := (*C.struct_nk_list_view)(unsafe.Pointer(out)), cgoAllocsUnknown @@ -1153,14 +1170,14 @@ func NkListViewBegin(arg0 *Context, out *ListView, id string, arg3 Flags, rowHei return __v } -// NkListViewEnd function as declared in nk/nuklear.h:3070 +// NkListViewEnd function as declared in nk/nuklear.h:3298 func NkListViewEnd(arg0 *ListView) { carg0, carg0AllocMap := (*C.struct_nk_list_view)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_list_view_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkWidget function as declared in nk/nuklear.h:3091 +// NkWidget function as declared in nk/nuklear.h:3320 func NkWidget(arg0 *Rect, arg1 *Context) C.enum_ { carg0, carg0AllocMap := (*C.struct_nk_rect)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1171,7 +1188,7 @@ func NkWidget(arg0 *Rect, arg1 *Context) C.enum_ { return __v } -// NkWidgetFitting function as declared in nk/nuklear.h:3092 +// NkWidgetFitting function as declared in nk/nuklear.h:3321 func NkWidgetFitting(arg0 *Rect, arg1 *Context, arg2 Vec2) C.enum_ { carg0, carg0AllocMap := (*C.struct_nk_rect)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1184,7 +1201,7 @@ func NkWidgetFitting(arg0 *Rect, arg1 *Context, arg2 Vec2) C.enum_ { return __v } -// NkWidgetBounds function as declared in nk/nuklear.h:3093 +// NkWidgetBounds function as declared in nk/nuklear.h:3322 func NkWidgetBounds(arg0 *Context) Rect { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_widget_bounds(carg0) @@ -1193,7 +1210,7 @@ func NkWidgetBounds(arg0 *Context) Rect { return __v } -// NkWidgetPosition function as declared in nk/nuklear.h:3094 +// NkWidgetPosition function as declared in nk/nuklear.h:3323 func NkWidgetPosition(arg0 *Context) Vec2 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_widget_position(carg0) @@ -1202,7 +1219,7 @@ func NkWidgetPosition(arg0 *Context) Vec2 { return __v } -// NkWidgetSize function as declared in nk/nuklear.h:3095 +// NkWidgetSize function as declared in nk/nuklear.h:3324 func NkWidgetSize(arg0 *Context) Vec2 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_widget_size(carg0) @@ -1211,7 +1228,7 @@ func NkWidgetSize(arg0 *Context) Vec2 { return __v } -// NkWidgetWidth function as declared in nk/nuklear.h:3096 +// NkWidgetWidth function as declared in nk/nuklear.h:3325 func NkWidgetWidth(arg0 *Context) float32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_widget_width(carg0) @@ -1220,7 +1237,7 @@ func NkWidgetWidth(arg0 *Context) float32 { return __v } -// NkWidgetHeight function as declared in nk/nuklear.h:3097 +// NkWidgetHeight function as declared in nk/nuklear.h:3326 func NkWidgetHeight(arg0 *Context) float32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_widget_height(carg0) @@ -1229,7 +1246,7 @@ func NkWidgetHeight(arg0 *Context) float32 { return __v } -// NkWidgetIsHovered function as declared in nk/nuklear.h:3098 +// NkWidgetIsHovered function as declared in nk/nuklear.h:3327 func NkWidgetIsHovered(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_widget_is_hovered(carg0) @@ -1238,7 +1255,7 @@ func NkWidgetIsHovered(arg0 *Context) Bool { return __v } -// NkWidgetIsMouseClicked function as declared in nk/nuklear.h:3099 +// NkWidgetIsMouseClicked function as declared in nk/nuklear.h:3328 func NkWidgetIsMouseClicked(arg0 *Context, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1249,7 +1266,7 @@ func NkWidgetIsMouseClicked(arg0 *Context, arg1 C.enum_) Bool { return __v } -// NkWidgetHasMouseClickDown function as declared in nk/nuklear.h:3100 +// NkWidgetHasMouseClickDown function as declared in nk/nuklear.h:3329 func NkWidgetHasMouseClickDown(arg0 *Context, arg1 C.enum_, down Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1262,7 +1279,7 @@ func NkWidgetHasMouseClickDown(arg0 *Context, arg1 C.enum_, down Bool) Bool { return __v } -// NkSpacing function as declared in nk/nuklear.h:3101 +// NkSpacing function as declared in nk/nuklear.h:3330 func NkSpacing(arg0 *Context, cols int32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccols, ccolsAllocMap := (C.int)(cols), cgoAllocsUnknown @@ -1271,7 +1288,21 @@ func NkSpacing(arg0 *Context, cols int32) { runtime.KeepAlive(carg0AllocMap) } -// NkText function as declared in nk/nuklear.h:3120 +// NkWidgetDisableBegin function as declared in nk/nuklear.h:3331 +func NkWidgetDisableBegin(ctx *Context) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + C.nk_widget_disable_begin(cctx) + runtime.KeepAlive(cctxAllocMap) +} + +// NkWidgetDisableEnd function as declared in nk/nuklear.h:3332 +func NkWidgetDisableEnd(ctx *Context) { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + C.nk_widget_disable_end(cctx) + runtime.KeepAlive(cctxAllocMap) +} + +// NkText function as declared in nk/nuklear.h:3351 func NkText(arg0 *Context, arg1 *byte, arg2 int32, arg3 Flags) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1284,7 +1315,7 @@ func NkText(arg0 *Context, arg1 *byte, arg2 int32, arg3 Flags) { runtime.KeepAlive(carg0AllocMap) } -// NkTextColored function as declared in nk/nuklear.h:3121 +// NkTextColored function as declared in nk/nuklear.h:3352 func NkTextColored(arg0 *Context, arg1 *byte, arg2 int32, arg3 Flags, arg4 Color) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1299,7 +1330,7 @@ func NkTextColored(arg0 *Context, arg1 *byte, arg2 int32, arg3 Flags, arg4 Color runtime.KeepAlive(carg0AllocMap) } -// NkTextWrap function as declared in nk/nuklear.h:3122 +// NkTextWrap function as declared in nk/nuklear.h:3353 func NkTextWrap(arg0 *Context, arg1 *byte, arg2 int32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1310,7 +1341,7 @@ func NkTextWrap(arg0 *Context, arg1 *byte, arg2 int32) { runtime.KeepAlive(carg0AllocMap) } -// NkTextWrapColored function as declared in nk/nuklear.h:3123 +// NkTextWrapColored function as declared in nk/nuklear.h:3354 func NkTextWrapColored(arg0 *Context, arg1 *byte, arg2 int32, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1323,7 +1354,7 @@ func NkTextWrapColored(arg0 *Context, arg1 *byte, arg2 int32, arg3 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkLabel function as declared in nk/nuklear.h:3124 +// NkLabel function as declared in nk/nuklear.h:3355 func NkLabel(arg0 *Context, arg1 *byte, align Flags) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1334,7 +1365,7 @@ func NkLabel(arg0 *Context, arg1 *byte, align Flags) { runtime.KeepAlive(carg0AllocMap) } -// NkLabelColored function as declared in nk/nuklear.h:3125 +// NkLabelColored function as declared in nk/nuklear.h:3356 func NkLabelColored(arg0 *Context, arg1 *byte, align Flags, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1347,7 +1378,7 @@ func NkLabelColored(arg0 *Context, arg1 *byte, align Flags, arg3 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkLabelWrap function as declared in nk/nuklear.h:3126 +// NkLabelWrap function as declared in nk/nuklear.h:3357 func NkLabelWrap(arg0 *Context, arg1 *byte) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1356,7 +1387,7 @@ func NkLabelWrap(arg0 *Context, arg1 *byte) { runtime.KeepAlive(carg0AllocMap) } -// NkLabelColoredWrap function as declared in nk/nuklear.h:3127 +// NkLabelColoredWrap function as declared in nk/nuklear.h:3358 func NkLabelColoredWrap(arg0 *Context, arg1 *byte, arg2 Color) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1367,7 +1398,7 @@ func NkLabelColoredWrap(arg0 *Context, arg1 *byte, arg2 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkImage function as declared in nk/nuklear.h:3128 +// NkImage function as declared in nk/nuklear.h:3359 func NkImage(arg0 *Context, arg1 Image) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -1376,7 +1407,7 @@ func NkImage(arg0 *Context, arg1 Image) { runtime.KeepAlive(carg0AllocMap) } -// NkImageColor function as declared in nk/nuklear.h:3129 +// NkImageColor function as declared in nk/nuklear.h:3360 func NkImageColor(arg0 *Context, arg1 Image, arg2 Color) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -1387,7 +1418,7 @@ func NkImageColor(arg0 *Context, arg1 Image, arg2 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkButtonText function as declared in nk/nuklear.h:3152 +// NkButtonText function as declared in nk/nuklear.h:3383 func NkButtonText(arg0 *Context, title string, len int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown title = safeString(title) @@ -1402,7 +1433,7 @@ func NkButtonText(arg0 *Context, title string, len int32) Bool { return __v } -// NkButtonLabel function as declared in nk/nuklear.h:3153 +// NkButtonLabel function as declared in nk/nuklear.h:3384 func NkButtonLabel(arg0 *Context, title string) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown title = safeString(title) @@ -1415,7 +1446,7 @@ func NkButtonLabel(arg0 *Context, title string) Bool { return __v } -// NkButtonColor function as declared in nk/nuklear.h:3154 +// NkButtonColor function as declared in nk/nuklear.h:3385 func NkButtonColor(arg0 *Context, arg1 Color) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -1426,7 +1457,7 @@ func NkButtonColor(arg0 *Context, arg1 Color) Bool { return __v } -// NkButtonSymbol function as declared in nk/nuklear.h:3155 +// NkButtonSymbol function as declared in nk/nuklear.h:3386 func NkButtonSymbol(arg0 *Context, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1437,7 +1468,7 @@ func NkButtonSymbol(arg0 *Context, arg1 C.enum_) Bool { return __v } -// NkButtonImage function as declared in nk/nuklear.h:3156 +// NkButtonImage function as declared in nk/nuklear.h:3387 func NkButtonImage(arg0 *Context, img Image) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cimg, cimgAllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&img)), cgoAllocsUnknown @@ -1448,7 +1479,7 @@ func NkButtonImage(arg0 *Context, img Image) Bool { return __v } -// NkButtonSymbolLabel function as declared in nk/nuklear.h:3157 +// NkButtonSymbolLabel function as declared in nk/nuklear.h:3388 func NkButtonSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, textAlignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1463,7 +1494,7 @@ func NkButtonSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, textAlignment return __v } -// NkButtonSymbolText function as declared in nk/nuklear.h:3158 +// NkButtonSymbolText function as declared in nk/nuklear.h:3389 func NkButtonSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1480,7 +1511,7 @@ func NkButtonSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, ali return __v } -// NkButtonImageLabel function as declared in nk/nuklear.h:3159 +// NkButtonImageLabel function as declared in nk/nuklear.h:3390 func NkButtonImageLabel(arg0 *Context, img Image, arg2 *byte, textAlignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cimg, cimgAllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&img)), cgoAllocsUnknown @@ -1495,7 +1526,7 @@ func NkButtonImageLabel(arg0 *Context, img Image, arg2 *byte, textAlignment Flag return __v } -// NkButtonImageText function as declared in nk/nuklear.h:3160 +// NkButtonImageText function as declared in nk/nuklear.h:3391 func NkButtonImageText(arg0 *Context, img Image, arg2 *byte, arg3 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cimg, cimgAllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&img)), cgoAllocsUnknown @@ -1512,7 +1543,7 @@ func NkButtonImageText(arg0 *Context, img Image, arg2 *byte, arg3 int32, alignme return __v } -// NkButtonTextStyled function as declared in nk/nuklear.h:3161 +// NkButtonTextStyled function as declared in nk/nuklear.h:3392 func NkButtonTextStyled(arg0 *Context, arg1 *StyleButton, title string, len int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1529,7 +1560,7 @@ func NkButtonTextStyled(arg0 *Context, arg1 *StyleButton, title string, len int3 return __v } -// NkButtonLabelStyled function as declared in nk/nuklear.h:3162 +// NkButtonLabelStyled function as declared in nk/nuklear.h:3393 func NkButtonLabelStyled(arg0 *Context, arg1 *StyleButton, title string) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1544,7 +1575,7 @@ func NkButtonLabelStyled(arg0 *Context, arg1 *StyleButton, title string) Bool { return __v } -// NkButtonSymbolStyled function as declared in nk/nuklear.h:3163 +// NkButtonSymbolStyled function as declared in nk/nuklear.h:3394 func NkButtonSymbolStyled(arg0 *Context, arg1 *StyleButton, arg2 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1557,7 +1588,7 @@ func NkButtonSymbolStyled(arg0 *Context, arg1 *StyleButton, arg2 C.enum_) Bool { return __v } -// NkButtonImageStyled function as declared in nk/nuklear.h:3164 +// NkButtonImageStyled function as declared in nk/nuklear.h:3395 func NkButtonImageStyled(arg0 *Context, arg1 *StyleButton, img Image) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1570,7 +1601,7 @@ func NkButtonImageStyled(arg0 *Context, arg1 *StyleButton, img Image) Bool { return __v } -// NkButtonSymbolTextStyled function as declared in nk/nuklear.h:3165 +// NkButtonSymbolTextStyled function as declared in nk/nuklear.h:3396 func NkButtonSymbolTextStyled(arg0 *Context, arg1 *StyleButton, arg2 C.enum_, arg3 *byte, arg4 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1589,7 +1620,7 @@ func NkButtonSymbolTextStyled(arg0 *Context, arg1 *StyleButton, arg2 C.enum_, ar return __v } -// NkButtonSymbolLabelStyled function as declared in nk/nuklear.h:3166 +// NkButtonSymbolLabelStyled function as declared in nk/nuklear.h:3397 func NkButtonSymbolLabelStyled(ctx *Context, style *StyleButton, symbol C.enum_, title string, align Flags) Bool { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown cstyle, cstyleAllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(style)), cgoAllocsUnknown @@ -1608,7 +1639,7 @@ func NkButtonSymbolLabelStyled(ctx *Context, style *StyleButton, symbol C.enum_, return __v } -// NkButtonImageLabelStyled function as declared in nk/nuklear.h:3167 +// NkButtonImageLabelStyled function as declared in nk/nuklear.h:3398 func NkButtonImageLabelStyled(arg0 *Context, arg1 *StyleButton, img Image, arg3 *byte, textAlignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1625,7 +1656,7 @@ func NkButtonImageLabelStyled(arg0 *Context, arg1 *StyleButton, img Image, arg3 return __v } -// NkButtonImageTextStyled function as declared in nk/nuklear.h:3168 +// NkButtonImageTextStyled function as declared in nk/nuklear.h:3399 func NkButtonImageTextStyled(arg0 *Context, arg1 *StyleButton, img Image, arg3 *byte, arg4 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_button)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1644,7 +1675,7 @@ func NkButtonImageTextStyled(arg0 *Context, arg1 *StyleButton, img Image, arg3 * return __v } -// NkButtonSetBehavior function as declared in nk/nuklear.h:3169 +// NkButtonSetBehavior function as declared in nk/nuklear.h:3400 func NkButtonSetBehavior(arg0 *Context, arg1 C.enum_) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1653,7 +1684,7 @@ func NkButtonSetBehavior(arg0 *Context, arg1 C.enum_) { runtime.KeepAlive(carg0AllocMap) } -// NkButtonPushBehavior function as declared in nk/nuklear.h:3170 +// NkButtonPushBehavior function as declared in nk/nuklear.h:3401 func NkButtonPushBehavior(arg0 *Context, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -1664,7 +1695,7 @@ func NkButtonPushBehavior(arg0 *Context, arg1 C.enum_) Bool { return __v } -// NkButtonPopBehavior function as declared in nk/nuklear.h:3171 +// NkButtonPopBehavior function as declared in nk/nuklear.h:3402 func NkButtonPopBehavior(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_button_pop_behavior(carg0) @@ -1673,7 +1704,7 @@ func NkButtonPopBehavior(arg0 *Context) Bool { return __v } -// NkCheckLabel function as declared in nk/nuklear.h:3177 +// NkCheckLabel function as declared in nk/nuklear.h:3408 func NkCheckLabel(arg0 *Context, arg1 *byte, active Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1686,7 +1717,7 @@ func NkCheckLabel(arg0 *Context, arg1 *byte, active Bool) Bool { return __v } -// NkCheckText function as declared in nk/nuklear.h:3178 +// NkCheckText function as declared in nk/nuklear.h:3409 func NkCheckText(arg0 *Context, arg1 *byte, arg2 int32, active Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1701,7 +1732,26 @@ func NkCheckText(arg0 *Context, arg1 *byte, arg2 int32, active Bool) Bool { return __v } -// NkCheckFlagsLabel function as declared in nk/nuklear.h:3179 +// NkCheckTextAlign function as declared in nk/nuklear.h:3410 +func NkCheckTextAlign(arg0 *Context, arg1 *byte, arg2 int32, active Bool, widgetAlignment Flags, textAlignment Flags) Bool { + carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown + carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown + carg2, carg2AllocMap := (C.int)(arg2), cgoAllocsUnknown + cactive, cactiveAllocMap := (C.nk_bool)(active), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_check_text_align(carg0, carg1, carg2, cactive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cactiveAllocMap) + runtime.KeepAlive(carg2AllocMap) + runtime.KeepAlive(carg1AllocMap) + runtime.KeepAlive(carg0AllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkCheckFlagsLabel function as declared in nk/nuklear.h:3411 func NkCheckFlagsLabel(arg0 *Context, arg1 *byte, flags uint32, value uint32) uint32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1716,7 +1766,7 @@ func NkCheckFlagsLabel(arg0 *Context, arg1 *byte, flags uint32, value uint32) ui return __v } -// NkCheckFlagsText function as declared in nk/nuklear.h:3180 +// NkCheckFlagsText function as declared in nk/nuklear.h:3412 func NkCheckFlagsText(arg0 *Context, arg1 *byte, arg2 int32, flags uint32, value uint32) uint32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1733,7 +1783,7 @@ func NkCheckFlagsText(arg0 *Context, arg1 *byte, arg2 int32, flags uint32, value return __v } -// NkCheckboxLabel function as declared in nk/nuklear.h:3181 +// NkCheckboxLabel function as declared in nk/nuklear.h:3413 func NkCheckboxLabel(arg0 *Context, arg1 *byte, active *Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1746,7 +1796,26 @@ func NkCheckboxLabel(arg0 *Context, arg1 *byte, active *Bool) Bool { return __v } -// NkCheckboxText function as declared in nk/nuklear.h:3182 +// NkCheckboxLabelAlign function as declared in nk/nuklear.h:3414 +func NkCheckboxLabelAlign(ctx *Context, label string, active *Bool, widgetAlignment Flags, textAlignment Flags) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + label = safeString(label) + clabel, clabelAllocMap := unpackPCharString(label) + cactive, cactiveAllocMap := (*C.nk_bool)(unsafe.Pointer(active)), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_checkbox_label_align(cctx, clabel, cactive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cactiveAllocMap) + runtime.KeepAlive(label) + runtime.KeepAlive(clabelAllocMap) + runtime.KeepAlive(cctxAllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkCheckboxText function as declared in nk/nuklear.h:3415 func NkCheckboxText(arg0 *Context, arg1 *byte, arg2 int32, active *Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1761,7 +1830,28 @@ func NkCheckboxText(arg0 *Context, arg1 *byte, arg2 int32, active *Bool) Bool { return __v } -// NkCheckboxFlagsLabel function as declared in nk/nuklear.h:3183 +// NkCheckboxTextAlign function as declared in nk/nuklear.h:3416 +func NkCheckboxTextAlign(ctx *Context, text string, len int32, active *Bool, widgetAlignment Flags, textAlignment Flags) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + text = safeString(text) + ctext, ctextAllocMap := unpackPCharString(text) + clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown + cactive, cactiveAllocMap := (*C.nk_bool)(unsafe.Pointer(active)), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_checkbox_text_align(cctx, ctext, clen, cactive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cactiveAllocMap) + runtime.KeepAlive(clenAllocMap) + runtime.KeepAlive(text) + runtime.KeepAlive(ctextAllocMap) + runtime.KeepAlive(cctxAllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkCheckboxFlagsLabel function as declared in nk/nuklear.h:3417 func NkCheckboxFlagsLabel(arg0 *Context, arg1 *byte, flags *uint32, value uint32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1776,7 +1866,7 @@ func NkCheckboxFlagsLabel(arg0 *Context, arg1 *byte, flags *uint32, value uint32 return __v } -// NkCheckboxFlagsText function as declared in nk/nuklear.h:3184 +// NkCheckboxFlagsText function as declared in nk/nuklear.h:3418 func NkCheckboxFlagsText(arg0 *Context, arg1 *byte, arg2 int32, flags *uint32, value uint32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1793,7 +1883,7 @@ func NkCheckboxFlagsText(arg0 *Context, arg1 *byte, arg2 int32, flags *uint32, v return __v } -// NkRadioLabel function as declared in nk/nuklear.h:3190 +// NkRadioLabel function as declared in nk/nuklear.h:3424 func NkRadioLabel(arg0 *Context, arg1 *byte, active *Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1806,7 +1896,26 @@ func NkRadioLabel(arg0 *Context, arg1 *byte, active *Bool) Bool { return __v } -// NkRadioText function as declared in nk/nuklear.h:3191 +// NkRadioLabelAlign function as declared in nk/nuklear.h:3425 +func NkRadioLabelAlign(ctx *Context, label string, active *Bool, widgetAlignment Flags, textAlignment Flags) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + label = safeString(label) + clabel, clabelAllocMap := unpackPCharString(label) + cactive, cactiveAllocMap := (*C.nk_bool)(unsafe.Pointer(active)), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_radio_label_align(cctx, clabel, cactive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cactiveAllocMap) + runtime.KeepAlive(label) + runtime.KeepAlive(clabelAllocMap) + runtime.KeepAlive(cctxAllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkRadioText function as declared in nk/nuklear.h:3426 func NkRadioText(arg0 *Context, arg1 *byte, arg2 int32, active *Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1821,7 +1930,28 @@ func NkRadioText(arg0 *Context, arg1 *byte, arg2 int32, active *Bool) Bool { return __v } -// NkOptionLabel function as declared in nk/nuklear.h:3192 +// NkRadioTextAlign function as declared in nk/nuklear.h:3427 +func NkRadioTextAlign(ctx *Context, text string, len int32, active *Bool, widgetAlignment Flags, textAlignment Flags) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + text = safeString(text) + ctext, ctextAllocMap := unpackPCharString(text) + clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown + cactive, cactiveAllocMap := (*C.nk_bool)(unsafe.Pointer(active)), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_radio_text_align(cctx, ctext, clen, cactive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cactiveAllocMap) + runtime.KeepAlive(clenAllocMap) + runtime.KeepAlive(text) + runtime.KeepAlive(ctextAllocMap) + runtime.KeepAlive(cctxAllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkOptionLabel function as declared in nk/nuklear.h:3428 func NkOptionLabel(arg0 *Context, arg1 *byte, active Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1834,7 +1964,26 @@ func NkOptionLabel(arg0 *Context, arg1 *byte, active Bool) Bool { return __v } -// NkOptionText function as declared in nk/nuklear.h:3193 +// NkOptionLabelAlign function as declared in nk/nuklear.h:3429 +func NkOptionLabelAlign(ctx *Context, label string, active Bool, widgetAlignment Flags, textAlignment Flags) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + label = safeString(label) + clabel, clabelAllocMap := unpackPCharString(label) + cactive, cactiveAllocMap := (C.nk_bool)(active), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_option_label_align(cctx, clabel, cactive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cactiveAllocMap) + runtime.KeepAlive(label) + runtime.KeepAlive(clabelAllocMap) + runtime.KeepAlive(cctxAllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkOptionText function as declared in nk/nuklear.h:3430 func NkOptionText(arg0 *Context, arg1 *byte, arg2 int32, active Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1849,7 +1998,28 @@ func NkOptionText(arg0 *Context, arg1 *byte, arg2 int32, active Bool) Bool { return __v } -// NkSelectableLabel function as declared in nk/nuklear.h:3199 +// NkOptionTextAlign function as declared in nk/nuklear.h:3431 +func NkOptionTextAlign(ctx *Context, text string, len int32, isActive Bool, widgetAlignment Flags, textAlignment Flags) Bool { + cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown + text = safeString(text) + ctext, ctextAllocMap := unpackPCharString(text) + clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown + cisActive, cisActiveAllocMap := (C.nk_bool)(isActive), cgoAllocsUnknown + cwidgetAlignment, cwidgetAlignmentAllocMap := (C.nk_flags)(widgetAlignment), cgoAllocsUnknown + ctextAlignment, ctextAlignmentAllocMap := (C.nk_flags)(textAlignment), cgoAllocsUnknown + __ret := C.nk_option_text_align(cctx, ctext, clen, cisActive, cwidgetAlignment, ctextAlignment) + runtime.KeepAlive(ctextAlignmentAllocMap) + runtime.KeepAlive(cwidgetAlignmentAllocMap) + runtime.KeepAlive(cisActiveAllocMap) + runtime.KeepAlive(clenAllocMap) + runtime.KeepAlive(text) + runtime.KeepAlive(ctextAllocMap) + runtime.KeepAlive(cctxAllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkSelectableLabel function as declared in nk/nuklear.h:3437 func NkSelectableLabel(arg0 *Context, arg1 *byte, align Flags, value *Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1864,13 +2034,13 @@ func NkSelectableLabel(arg0 *Context, arg1 *byte, align Flags, value *Bool) Bool return __v } -// NkSelectableText function as declared in nk/nuklear.h:3200 +// NkSelectableText function as declared in nk/nuklear.h:3438 func NkSelectableText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, value []Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown carg2, carg2AllocMap := (C.int)(arg2), cgoAllocsUnknown calign, calignAllocMap := (C.nk_flags)(align), cgoAllocsUnknown - cvalue, cvalueAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&value))) + cvalue, cvalueAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&value)).Data)), cgoAllocsUnknown __ret := C.nk_selectable_text(carg0, carg1, carg2, calign, cvalue) runtime.KeepAlive(cvalueAllocMap) runtime.KeepAlive(calignAllocMap) @@ -1881,13 +2051,13 @@ func NkSelectableText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, value return __v } -// NkSelectableImageLabel function as declared in nk/nuklear.h:3201 +// NkSelectableImageLabel function as declared in nk/nuklear.h:3439 func NkSelectableImageLabel(arg0 *Context, arg1 Image, arg2 *byte, align Flags, value []Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown carg2, carg2AllocMap := (*C.char)(unsafe.Pointer(arg2)), cgoAllocsUnknown calign, calignAllocMap := (C.nk_flags)(align), cgoAllocsUnknown - cvalue, cvalueAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&value))) + cvalue, cvalueAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&value)).Data)), cgoAllocsUnknown __ret := C.nk_selectable_image_label(carg0, carg1, carg2, calign, cvalue) runtime.KeepAlive(cvalueAllocMap) runtime.KeepAlive(calignAllocMap) @@ -1898,14 +2068,14 @@ func NkSelectableImageLabel(arg0 *Context, arg1 Image, arg2 *byte, align Flags, return __v } -// NkSelectableImageText function as declared in nk/nuklear.h:3202 +// NkSelectableImageText function as declared in nk/nuklear.h:3440 func NkSelectableImageText(arg0 *Context, arg1 Image, arg2 *byte, arg3 int32, align Flags, value []Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown carg2, carg2AllocMap := (*C.char)(unsafe.Pointer(arg2)), cgoAllocsUnknown carg3, carg3AllocMap := (C.int)(arg3), cgoAllocsUnknown calign, calignAllocMap := (C.nk_flags)(align), cgoAllocsUnknown - cvalue, cvalueAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&value))) + cvalue, cvalueAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&value)).Data)), cgoAllocsUnknown __ret := C.nk_selectable_image_text(carg0, carg1, carg2, carg3, calign, cvalue) runtime.KeepAlive(cvalueAllocMap) runtime.KeepAlive(calignAllocMap) @@ -1917,13 +2087,13 @@ func NkSelectableImageText(arg0 *Context, arg1 Image, arg2 *byte, arg3 int32, al return __v } -// NkSelectableSymbolLabel function as declared in nk/nuklear.h:3203 +// NkSelectableSymbolLabel function as declared in nk/nuklear.h:3441 func NkSelectableSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, align Flags, value []Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown carg2, carg2AllocMap := (*C.char)(unsafe.Pointer(arg2)), cgoAllocsUnknown calign, calignAllocMap := (C.nk_flags)(align), cgoAllocsUnknown - cvalue, cvalueAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&value))) + cvalue, cvalueAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&value)).Data)), cgoAllocsUnknown __ret := C.nk_selectable_symbol_label(carg0, carg1, carg2, calign, cvalue) runtime.KeepAlive(cvalueAllocMap) runtime.KeepAlive(calignAllocMap) @@ -1934,14 +2104,14 @@ func NkSelectableSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, align Flag return __v } -// NkSelectableSymbolText function as declared in nk/nuklear.h:3204 +// NkSelectableSymbolText function as declared in nk/nuklear.h:3442 func NkSelectableSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, align Flags, value []Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown carg2, carg2AllocMap := (*C.char)(unsafe.Pointer(arg2)), cgoAllocsUnknown carg3, carg3AllocMap := (C.int)(arg3), cgoAllocsUnknown calign, calignAllocMap := (C.nk_flags)(align), cgoAllocsUnknown - cvalue, cvalueAllocMap := copyPBoolBytes((*sliceHeader)(unsafe.Pointer(&value))) + cvalue, cvalueAllocMap := (*C.nk_bool)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&value)).Data)), cgoAllocsUnknown __ret := C.nk_selectable_symbol_text(carg0, carg1, carg2, carg3, calign, cvalue) runtime.KeepAlive(cvalueAllocMap) runtime.KeepAlive(calignAllocMap) @@ -1953,7 +2123,7 @@ func NkSelectableSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, return __v } -// NkSelectLabel function as declared in nk/nuklear.h:3206 +// NkSelectLabel function as declared in nk/nuklear.h:3444 func NkSelectLabel(arg0 *Context, arg1 *byte, align Flags, value Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1968,7 +2138,7 @@ func NkSelectLabel(arg0 *Context, arg1 *byte, align Flags, value Bool) Bool { return __v } -// NkSelectText function as declared in nk/nuklear.h:3207 +// NkSelectText function as declared in nk/nuklear.h:3445 func NkSelectText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, value Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -1985,7 +2155,7 @@ func NkSelectText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, value Bool return __v } -// NkSelectImageLabel function as declared in nk/nuklear.h:3208 +// NkSelectImageLabel function as declared in nk/nuklear.h:3446 func NkSelectImageLabel(arg0 *Context, arg1 Image, arg2 *byte, align Flags, value Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2002,7 +2172,7 @@ func NkSelectImageLabel(arg0 *Context, arg1 Image, arg2 *byte, align Flags, valu return __v } -// NkSelectImageText function as declared in nk/nuklear.h:3209 +// NkSelectImageText function as declared in nk/nuklear.h:3447 func NkSelectImageText(arg0 *Context, arg1 Image, arg2 *byte, arg3 int32, align Flags, value Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2021,7 +2191,7 @@ func NkSelectImageText(arg0 *Context, arg1 Image, arg2 *byte, arg3 int32, align return __v } -// NkSelectSymbolLabel function as declared in nk/nuklear.h:3210 +// NkSelectSymbolLabel function as declared in nk/nuklear.h:3448 func NkSelectSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, align Flags, value Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2038,7 +2208,7 @@ func NkSelectSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, align Flags, v return __v } -// NkSelectSymbolText function as declared in nk/nuklear.h:3211 +// NkSelectSymbolText function as declared in nk/nuklear.h:3449 func NkSelectSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, align Flags, value Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2057,7 +2227,7 @@ func NkSelectSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, ali return __v } -// NkSlideFloat function as declared in nk/nuklear.h:3218 +// NkSlideFloat function as declared in nk/nuklear.h:3456 func NkSlideFloat(arg0 *Context, min float32, val float32, max float32, step float32) float32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmin, cminAllocMap := (C.float)(min), cgoAllocsUnknown @@ -2074,7 +2244,7 @@ func NkSlideFloat(arg0 *Context, min float32, val float32, max float32, step flo return __v } -// NkSlideInt function as declared in nk/nuklear.h:3219 +// NkSlideInt function as declared in nk/nuklear.h:3457 func NkSlideInt(arg0 *Context, min int32, val int32, max int32, step int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmin, cminAllocMap := (C.int)(min), cgoAllocsUnknown @@ -2091,7 +2261,7 @@ func NkSlideInt(arg0 *Context, min int32, val int32, max int32, step int32) int3 return __v } -// NkSliderFloat function as declared in nk/nuklear.h:3220 +// NkSliderFloat function as declared in nk/nuklear.h:3458 func NkSliderFloat(arg0 *Context, min float32, val *float32, max float32, step float32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmin, cminAllocMap := (C.float)(min), cgoAllocsUnknown @@ -2108,7 +2278,7 @@ func NkSliderFloat(arg0 *Context, min float32, val *float32, max float32, step f return __v } -// NkSliderInt function as declared in nk/nuklear.h:3221 +// NkSliderInt function as declared in nk/nuklear.h:3459 func NkSliderInt(arg0 *Context, min int32, val *int32, max int32, step int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmin, cminAllocMap := (C.int)(min), cgoAllocsUnknown @@ -2125,7 +2295,49 @@ func NkSliderInt(arg0 *Context, min int32, val *int32, max int32, step int32) Bo return __v } -// NkProgress function as declared in nk/nuklear.h:3227 +// NkKnobFloat function as declared in nk/nuklear.h:3466 +func NkKnobFloat(arg0 *Context, min float32, val *float32, max float32, step float32, zeroDirection C.enum_, deadZoneDegrees float32) Bool { + carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown + cmin, cminAllocMap := (C.float)(min), cgoAllocsUnknown + cval, cvalAllocMap := (*C.float)(unsafe.Pointer(val)), cgoAllocsUnknown + cmax, cmaxAllocMap := (C.float)(max), cgoAllocsUnknown + cstep, cstepAllocMap := (C.float)(step), cgoAllocsUnknown + czeroDirection, czeroDirectionAllocMap := (C.enum_)(zeroDirection), cgoAllocsUnknown + cdeadZoneDegrees, cdeadZoneDegreesAllocMap := (C.float)(deadZoneDegrees), cgoAllocsUnknown + __ret := C.nk_knob_float(carg0, cmin, cval, cmax, cstep, czeroDirection, cdeadZoneDegrees) + runtime.KeepAlive(cdeadZoneDegreesAllocMap) + runtime.KeepAlive(czeroDirectionAllocMap) + runtime.KeepAlive(cstepAllocMap) + runtime.KeepAlive(cmaxAllocMap) + runtime.KeepAlive(cvalAllocMap) + runtime.KeepAlive(cminAllocMap) + runtime.KeepAlive(carg0AllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkKnobInt function as declared in nk/nuklear.h:3467 +func NkKnobInt(arg0 *Context, min int32, val *int32, max int32, step int32, zeroDirection C.enum_, deadZoneDegrees float32) Bool { + carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown + cmin, cminAllocMap := (C.int)(min), cgoAllocsUnknown + cval, cvalAllocMap := (*C.int)(unsafe.Pointer(val)), cgoAllocsUnknown + cmax, cmaxAllocMap := (C.int)(max), cgoAllocsUnknown + cstep, cstepAllocMap := (C.int)(step), cgoAllocsUnknown + czeroDirection, czeroDirectionAllocMap := (C.enum_)(zeroDirection), cgoAllocsUnknown + cdeadZoneDegrees, cdeadZoneDegreesAllocMap := (C.float)(deadZoneDegrees), cgoAllocsUnknown + __ret := C.nk_knob_int(carg0, cmin, cval, cmax, cstep, czeroDirection, cdeadZoneDegrees) + runtime.KeepAlive(cdeadZoneDegreesAllocMap) + runtime.KeepAlive(czeroDirectionAllocMap) + runtime.KeepAlive(cstepAllocMap) + runtime.KeepAlive(cmaxAllocMap) + runtime.KeepAlive(cvalAllocMap) + runtime.KeepAlive(cminAllocMap) + runtime.KeepAlive(carg0AllocMap) + __v := (Bool)(__ret) + return __v +} + +// NkProgress function as declared in nk/nuklear.h:3474 func NkProgress(arg0 *Context, cur *Size, max Size, modifyable Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccur, ccurAllocMap := (*C.nk_size)(unsafe.Pointer(cur)), cgoAllocsUnknown @@ -2140,7 +2352,7 @@ func NkProgress(arg0 *Context, cur *Size, max Size, modifyable Bool) Bool { return __v } -// NkProg function as declared in nk/nuklear.h:3228 +// NkProg function as declared in nk/nuklear.h:3475 func NkProg(arg0 *Context, cur Size, max Size, modifyable Bool) Size { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccur, ccurAllocMap := (C.nk_size)(cur), cgoAllocsUnknown @@ -2155,7 +2367,7 @@ func NkProg(arg0 *Context, cur Size, max Size, modifyable Bool) Size { return __v } -// NkColorPicker function as declared in nk/nuklear.h:3235 +// NkColorPicker function as declared in nk/nuklear.h:3482 func NkColorPicker(arg0 *Context, arg1 Colorf, arg2 C.enum_) Colorf { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_colorf)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2168,7 +2380,7 @@ func NkColorPicker(arg0 *Context, arg1 Colorf, arg2 C.enum_) Colorf { return __v } -// NkColorPick function as declared in nk/nuklear.h:3236 +// NkColorPick function as declared in nk/nuklear.h:3483 func NkColorPick(arg0 *Context, arg1 *Colorf, arg2 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_colorf)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -2181,7 +2393,7 @@ func NkColorPick(arg0 *Context, arg1 *Colorf, arg2 C.enum_) Bool { return __v } -// NkPropertyInt function as declared in nk/nuklear.h:3333 +// NkPropertyInt function as declared in nk/nuklear.h:3581 func NkPropertyInt(arg0 *Context, name string, min int32, val *int32, max int32, step int32, incPerPixel float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -2202,7 +2414,7 @@ func NkPropertyInt(arg0 *Context, name string, min int32, val *int32, max int32, runtime.KeepAlive(carg0AllocMap) } -// NkPropertyFloat function as declared in nk/nuklear.h:3354 +// NkPropertyFloat function as declared in nk/nuklear.h:3604 func NkPropertyFloat(arg0 *Context, name string, min float32, val *float32, max float32, step float32, incPerPixel float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -2223,7 +2435,7 @@ func NkPropertyFloat(arg0 *Context, name string, min float32, val *float32, max runtime.KeepAlive(carg0AllocMap) } -// NkPropertyDouble function as declared in nk/nuklear.h:3375 +// NkPropertyDouble function as declared in nk/nuklear.h:3627 func NkPropertyDouble(arg0 *Context, name string, min float64, val *float64, max float64, step float64, incPerPixel float32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -2244,7 +2456,7 @@ func NkPropertyDouble(arg0 *Context, name string, min float64, val *float64, max runtime.KeepAlive(carg0AllocMap) } -// NkPropertyi function as declared in nk/nuklear.h:3398 +// NkPropertyi function as declared in nk/nuklear.h:3650 func NkPropertyi(arg0 *Context, name string, min int32, val int32, max int32, step int32, incPerPixel float32) int32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -2267,7 +2479,7 @@ func NkPropertyi(arg0 *Context, name string, min int32, val int32, max int32, st return __v } -// NkPropertyf function as declared in nk/nuklear.h:3421 +// NkPropertyf function as declared in nk/nuklear.h:3673 func NkPropertyf(arg0 *Context, name string, min float32, val float32, max float32, step float32, incPerPixel float32) float32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -2290,7 +2502,7 @@ func NkPropertyf(arg0 *Context, name string, min float32, val float32, max float return __v } -// NkPropertyd function as declared in nk/nuklear.h:3444 +// NkPropertyd function as declared in nk/nuklear.h:3696 func NkPropertyd(arg0 *Context, name string, min float64, val float64, max float64, step float64, incPerPixel float32) float64 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown name = safeString(name) @@ -2313,11 +2525,11 @@ func NkPropertyd(arg0 *Context, name string, min float64, val float64, max float return __v } -// NkEditString function as declared in nk/nuklear.h:3478 +// NkEditString function as declared in nk/nuklear.h:3731 func NkEditString(arg0 *Context, arg1 Flags, buffer []byte, len *int32, max int32, arg5 PluginFilter) Flags { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.nk_flags)(arg1), cgoAllocsUnknown - cbuffer, cbufferAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&buffer))) + cbuffer, cbufferAllocMap := (*C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&buffer)).Data)), cgoAllocsUnknown clen, clenAllocMap := (*C.int)(unsafe.Pointer(len)), cgoAllocsUnknown cmax, cmaxAllocMap := (C.int)(max), cgoAllocsUnknown carg5, carg5AllocMap := arg5.PassValue() @@ -2332,11 +2544,11 @@ func NkEditString(arg0 *Context, arg1 Flags, buffer []byte, len *int32, max int3 return __v } -// NkEditStringZeroTerminated function as declared in nk/nuklear.h:3479 +// NkEditStringZeroTerminated function as declared in nk/nuklear.h:3732 func NkEditStringZeroTerminated(arg0 *Context, arg1 Flags, buffer []byte, max int32, arg4 PluginFilter) Flags { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.nk_flags)(arg1), cgoAllocsUnknown - cbuffer, cbufferAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&buffer))) + cbuffer, cbufferAllocMap := (*C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&buffer)).Data)), cgoAllocsUnknown cmax, cmaxAllocMap := (C.int)(max), cgoAllocsUnknown carg4, carg4AllocMap := arg4.PassValue() __ret := C.nk_edit_string_zero_terminated(carg0, carg1, cbuffer, cmax, carg4) @@ -2349,7 +2561,7 @@ func NkEditStringZeroTerminated(arg0 *Context, arg1 Flags, buffer []byte, max in return __v } -// NkEditBuffer function as declared in nk/nuklear.h:3480 +// NkEditBuffer function as declared in nk/nuklear.h:3733 func NkEditBuffer(arg0 *Context, arg1 Flags, arg2 *TextEdit, arg3 PluginFilter) Flags { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.nk_flags)(arg1), cgoAllocsUnknown @@ -2364,7 +2576,7 @@ func NkEditBuffer(arg0 *Context, arg1 Flags, arg2 *TextEdit, arg3 PluginFilter) return __v } -// NkEditFocus function as declared in nk/nuklear.h:3481 +// NkEditFocus function as declared in nk/nuklear.h:3734 func NkEditFocus(arg0 *Context, flags Flags) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cflags, cflagsAllocMap := (C.nk_flags)(flags), cgoAllocsUnknown @@ -2373,14 +2585,14 @@ func NkEditFocus(arg0 *Context, flags Flags) { runtime.KeepAlive(carg0AllocMap) } -// NkEditUnfocus function as declared in nk/nuklear.h:3482 +// NkEditUnfocus function as declared in nk/nuklear.h:3735 func NkEditUnfocus(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_edit_unfocus(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkChartBegin function as declared in nk/nuklear.h:3488 +// NkChartBegin function as declared in nk/nuklear.h:3741 func NkChartBegin(arg0 *Context, arg1 C.enum_, num int32, min float32, max float32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2397,7 +2609,7 @@ func NkChartBegin(arg0 *Context, arg1 C.enum_, num int32, min float32, max float return __v } -// NkChartBeginColored function as declared in nk/nuklear.h:3489 +// NkChartBeginColored function as declared in nk/nuklear.h:3742 func NkChartBeginColored(arg0 *Context, arg1 C.enum_, arg2 Color, active Color, num int32, min float32, max float32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2418,7 +2630,7 @@ func NkChartBeginColored(arg0 *Context, arg1 C.enum_, arg2 Color, active Color, return __v } -// NkChartAddSlot function as declared in nk/nuklear.h:3490 +// NkChartAddSlot function as declared in nk/nuklear.h:3743 func NkChartAddSlot(ctx *Context, arg1 C.enum_, count int32, minValue float32, maxValue float32) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2433,7 +2645,7 @@ func NkChartAddSlot(ctx *Context, arg1 C.enum_, count int32, minValue float32, m runtime.KeepAlive(cctxAllocMap) } -// NkChartAddSlotColored function as declared in nk/nuklear.h:3491 +// NkChartAddSlotColored function as declared in nk/nuklear.h:3744 func NkChartAddSlotColored(ctx *Context, arg1 C.enum_, arg2 Color, active Color, count int32, minValue float32, maxValue float32) { cctx, cctxAllocMap := (*C.struct_nk_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2452,7 +2664,7 @@ func NkChartAddSlotColored(ctx *Context, arg1 C.enum_, arg2 Color, active Color, runtime.KeepAlive(cctxAllocMap) } -// NkChartPush function as declared in nk/nuklear.h:3492 +// NkChartPush function as declared in nk/nuklear.h:3745 func NkChartPush(arg0 *Context, arg1 float32) Flags { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.float)(arg1), cgoAllocsUnknown @@ -2463,7 +2675,7 @@ func NkChartPush(arg0 *Context, arg1 float32) Flags { return __v } -// NkChartPushSlot function as declared in nk/nuklear.h:3493 +// NkChartPushSlot function as declared in nk/nuklear.h:3746 func NkChartPushSlot(arg0 *Context, arg1 float32, arg2 int32) Flags { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.float)(arg1), cgoAllocsUnknown @@ -2476,14 +2688,14 @@ func NkChartPushSlot(arg0 *Context, arg1 float32, arg2 int32) Flags { return __v } -// NkChartEnd function as declared in nk/nuklear.h:3494 +// NkChartEnd function as declared in nk/nuklear.h:3747 func NkChartEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_chart_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkPlot function as declared in nk/nuklear.h:3495 +// NkPlot function as declared in nk/nuklear.h:3748 func NkPlot(arg0 *Context, arg1 C.enum_, values *float32, count int32, offset int32) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2498,7 +2710,7 @@ func NkPlot(arg0 *Context, arg1 C.enum_, values *float32, count int32, offset in runtime.KeepAlive(carg0AllocMap) } -// NkPopupBegin function as declared in nk/nuklear.h:3502 +// NkPopupBegin function as declared in nk/nuklear.h:3755 func NkPopupBegin(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 Flags, bounds Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2515,21 +2727,21 @@ func NkPopupBegin(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 Flags, bounds Re return __v } -// NkPopupClose function as declared in nk/nuklear.h:3503 +// NkPopupClose function as declared in nk/nuklear.h:3756 func NkPopupClose(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_popup_close(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkPopupEnd function as declared in nk/nuklear.h:3504 +// NkPopupEnd function as declared in nk/nuklear.h:3757 func NkPopupEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_popup_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkPopupGetScroll function as declared in nk/nuklear.h:3505 +// NkPopupGetScroll function as declared in nk/nuklear.h:3758 func NkPopupGetScroll(arg0 *Context, offsetX *Uint, offsetY *Uint) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown coffsetX, coffsetXAllocMap := (*C.nk_uint)(unsafe.Pointer(offsetX)), cgoAllocsUnknown @@ -2540,7 +2752,7 @@ func NkPopupGetScroll(arg0 *Context, offsetX *Uint, offsetY *Uint) { runtime.KeepAlive(carg0AllocMap) } -// NkPopupSetScroll function as declared in nk/nuklear.h:3506 +// NkPopupSetScroll function as declared in nk/nuklear.h:3759 func NkPopupSetScroll(arg0 *Context, offsetX Uint, offsetY Uint) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown coffsetX, coffsetXAllocMap := (C.nk_uint)(offsetX), cgoAllocsUnknown @@ -2551,7 +2763,7 @@ func NkPopupSetScroll(arg0 *Context, offsetX Uint, offsetY Uint) { runtime.KeepAlive(carg0AllocMap) } -// NkCombo function as declared in nk/nuklear.h:3512 +// NkCombo function as declared in nk/nuklear.h:3765 func NkCombo(arg0 *Context, items []string, count int32, selected int32, itemHeight int32, size Vec2) int32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown citems, citemsAllocMap := unpackArgSString(items) @@ -2571,7 +2783,7 @@ func NkCombo(arg0 *Context, items []string, count int32, selected int32, itemHei return __v } -// NkComboSeparator function as declared in nk/nuklear.h:3513 +// NkComboSeparator function as declared in nk/nuklear.h:3766 func NkComboSeparator(arg0 *Context, itemsSeparatedBySeparator string, separator int32, selected int32, count int32, itemHeight int32, size Vec2) int32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown itemsSeparatedBySeparator = safeString(itemsSeparatedBySeparator) @@ -2594,7 +2806,7 @@ func NkComboSeparator(arg0 *Context, itemsSeparatedBySeparator string, separator return __v } -// NkComboString function as declared in nk/nuklear.h:3514 +// NkComboString function as declared in nk/nuklear.h:3767 func NkComboString(arg0 *Context, itemsSeparatedByZeros string, selected int32, count int32, itemHeight int32, size Vec2) int32 { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown itemsSeparatedByZeros = safeString(itemsSeparatedByZeros) @@ -2615,7 +2827,7 @@ func NkComboString(arg0 *Context, itemsSeparatedByZeros string, selected int32, return __v } -// NkCombobox function as declared in nk/nuklear.h:3516 +// NkCombobox function as declared in nk/nuklear.h:3769 func NkCombobox(arg0 *Context, items []string, count int32, selected *int32, itemHeight int32, size Vec2) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown citems, citemsAllocMap := unpackArgSString(items) @@ -2633,7 +2845,7 @@ func NkCombobox(arg0 *Context, items []string, count int32, selected *int32, ite runtime.KeepAlive(carg0AllocMap) } -// NkComboboxString function as declared in nk/nuklear.h:3517 +// NkComboboxString function as declared in nk/nuklear.h:3770 func NkComboboxString(arg0 *Context, itemsSeparatedByZeros string, selected *int32, count int32, itemHeight int32, size Vec2) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown itemsSeparatedByZeros = safeString(itemsSeparatedByZeros) @@ -2652,7 +2864,7 @@ func NkComboboxString(arg0 *Context, itemsSeparatedByZeros string, selected *int runtime.KeepAlive(carg0AllocMap) } -// NkComboboxSeparator function as declared in nk/nuklear.h:3518 +// NkComboboxSeparator function as declared in nk/nuklear.h:3771 func NkComboboxSeparator(arg0 *Context, itemsSeparatedBySeparator string, separator int32, selected *int32, count int32, itemHeight int32, size Vec2) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown itemsSeparatedBySeparator = safeString(itemsSeparatedBySeparator) @@ -2673,7 +2885,7 @@ func NkComboboxSeparator(arg0 *Context, itemsSeparatedBySeparator string, separa runtime.KeepAlive(carg0AllocMap) } -// NkComboBeginText function as declared in nk/nuklear.h:3525 +// NkComboBeginText function as declared in nk/nuklear.h:3778 func NkComboBeginText(arg0 *Context, selected string, arg2 int32, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown selected = safeString(selected) @@ -2690,7 +2902,7 @@ func NkComboBeginText(arg0 *Context, selected string, arg2 int32, size Vec2) Boo return __v } -// NkComboBeginLabel function as declared in nk/nuklear.h:3526 +// NkComboBeginLabel function as declared in nk/nuklear.h:3779 func NkComboBeginLabel(arg0 *Context, selected string, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown selected = safeString(selected) @@ -2705,7 +2917,7 @@ func NkComboBeginLabel(arg0 *Context, selected string, size Vec2) Bool { return __v } -// NkComboBeginColor function as declared in nk/nuklear.h:3527 +// NkComboBeginColor function as declared in nk/nuklear.h:3780 func NkComboBeginColor(arg0 *Context, color Color, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccolor, ccolorAllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&color)), cgoAllocsUnknown @@ -2718,7 +2930,7 @@ func NkComboBeginColor(arg0 *Context, color Color, size Vec2) Bool { return __v } -// NkComboBeginSymbol function as declared in nk/nuklear.h:3528 +// NkComboBeginSymbol function as declared in nk/nuklear.h:3781 func NkComboBeginSymbol(arg0 *Context, arg1 C.enum_, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2731,7 +2943,7 @@ func NkComboBeginSymbol(arg0 *Context, arg1 C.enum_, size Vec2) Bool { return __v } -// NkComboBeginSymbolLabel function as declared in nk/nuklear.h:3529 +// NkComboBeginSymbolLabel function as declared in nk/nuklear.h:3782 func NkComboBeginSymbolLabel(arg0 *Context, selected string, arg2 C.enum_, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown selected = safeString(selected) @@ -2748,7 +2960,7 @@ func NkComboBeginSymbolLabel(arg0 *Context, selected string, arg2 C.enum_, size return __v } -// NkComboBeginSymbolText function as declared in nk/nuklear.h:3530 +// NkComboBeginSymbolText function as declared in nk/nuklear.h:3783 func NkComboBeginSymbolText(arg0 *Context, selected string, arg2 int32, arg3 C.enum_, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown selected = safeString(selected) @@ -2767,7 +2979,7 @@ func NkComboBeginSymbolText(arg0 *Context, selected string, arg2 int32, arg3 C.e return __v } -// NkComboBeginImage function as declared in nk/nuklear.h:3531 +// NkComboBeginImage function as declared in nk/nuklear.h:3784 func NkComboBeginImage(arg0 *Context, img Image, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cimg, cimgAllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&img)), cgoAllocsUnknown @@ -2780,7 +2992,7 @@ func NkComboBeginImage(arg0 *Context, img Image, size Vec2) Bool { return __v } -// NkComboBeginImageLabel function as declared in nk/nuklear.h:3532 +// NkComboBeginImageLabel function as declared in nk/nuklear.h:3785 func NkComboBeginImageLabel(arg0 *Context, selected string, arg2 Image, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown selected = safeString(selected) @@ -2797,7 +3009,7 @@ func NkComboBeginImageLabel(arg0 *Context, selected string, arg2 Image, size Vec return __v } -// NkComboBeginImageText function as declared in nk/nuklear.h:3533 +// NkComboBeginImageText function as declared in nk/nuklear.h:3786 func NkComboBeginImageText(arg0 *Context, selected string, arg2 int32, arg3 Image, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown selected = safeString(selected) @@ -2816,7 +3028,7 @@ func NkComboBeginImageText(arg0 *Context, selected string, arg2 int32, arg3 Imag return __v } -// NkComboItemLabel function as declared in nk/nuklear.h:3534 +// NkComboItemLabel function as declared in nk/nuklear.h:3787 func NkComboItemLabel(arg0 *Context, arg1 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -2829,7 +3041,7 @@ func NkComboItemLabel(arg0 *Context, arg1 *byte, alignment Flags) Bool { return __v } -// NkComboItemText function as declared in nk/nuklear.h:3535 +// NkComboItemText function as declared in nk/nuklear.h:3788 func NkComboItemText(arg0 *Context, arg1 *byte, arg2 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -2844,7 +3056,7 @@ func NkComboItemText(arg0 *Context, arg1 *byte, arg2 int32, alignment Flags) Boo return __v } -// NkComboItemImageLabel function as declared in nk/nuklear.h:3536 +// NkComboItemImageLabel function as declared in nk/nuklear.h:3789 func NkComboItemImageLabel(arg0 *Context, arg1 Image, arg2 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2859,7 +3071,7 @@ func NkComboItemImageLabel(arg0 *Context, arg1 Image, arg2 *byte, alignment Flag return __v } -// NkComboItemImageText function as declared in nk/nuklear.h:3537 +// NkComboItemImageText function as declared in nk/nuklear.h:3790 func NkComboItemImageText(arg0 *Context, arg1 Image, arg2 *byte, arg3 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2876,7 +3088,7 @@ func NkComboItemImageText(arg0 *Context, arg1 Image, arg2 *byte, arg3 int32, ali return __v } -// NkComboItemSymbolLabel function as declared in nk/nuklear.h:3538 +// NkComboItemSymbolLabel function as declared in nk/nuklear.h:3791 func NkComboItemSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2891,7 +3103,7 @@ func NkComboItemSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, alignment F return __v } -// NkComboItemSymbolText function as declared in nk/nuklear.h:3539 +// NkComboItemSymbolText function as declared in nk/nuklear.h:3792 func NkComboItemSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -2908,21 +3120,21 @@ func NkComboItemSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, return __v } -// NkComboClose function as declared in nk/nuklear.h:3540 +// NkComboClose function as declared in nk/nuklear.h:3793 func NkComboClose(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_combo_close(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkComboEnd function as declared in nk/nuklear.h:3541 +// NkComboEnd function as declared in nk/nuklear.h:3794 func NkComboEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_combo_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkContextualBegin function as declared in nk/nuklear.h:3547 +// NkContextualBegin function as declared in nk/nuklear.h:3800 func NkContextualBegin(arg0 *Context, arg1 Flags, arg2 Vec2, triggerBounds Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.nk_flags)(arg1), cgoAllocsUnknown @@ -2937,7 +3149,7 @@ func NkContextualBegin(arg0 *Context, arg1 Flags, arg2 Vec2, triggerBounds Rect) return __v } -// NkContextualItemText function as declared in nk/nuklear.h:3548 +// NkContextualItemText function as declared in nk/nuklear.h:3801 func NkContextualItemText(arg0 *Context, arg1 *byte, arg2 int32, align Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -2952,7 +3164,7 @@ func NkContextualItemText(arg0 *Context, arg1 *byte, arg2 int32, align Flags) Bo return __v } -// NkContextualItemLabel function as declared in nk/nuklear.h:3549 +// NkContextualItemLabel function as declared in nk/nuklear.h:3802 func NkContextualItemLabel(arg0 *Context, arg1 *byte, align Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -2965,7 +3177,7 @@ func NkContextualItemLabel(arg0 *Context, arg1 *byte, align Flags) Bool { return __v } -// NkContextualItemImageLabel function as declared in nk/nuklear.h:3550 +// NkContextualItemImageLabel function as declared in nk/nuklear.h:3803 func NkContextualItemImageLabel(arg0 *Context, arg1 Image, arg2 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2980,7 +3192,7 @@ func NkContextualItemImageLabel(arg0 *Context, arg1 Image, arg2 *byte, alignment return __v } -// NkContextualItemImageText function as declared in nk/nuklear.h:3551 +// NkContextualItemImageText function as declared in nk/nuklear.h:3804 func NkContextualItemImageText(arg0 *Context, arg1 Image, arg2 *byte, len int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -2997,7 +3209,7 @@ func NkContextualItemImageText(arg0 *Context, arg1 Image, arg2 *byte, len int32, return __v } -// NkContextualItemSymbolLabel function as declared in nk/nuklear.h:3552 +// NkContextualItemSymbolLabel function as declared in nk/nuklear.h:3805 func NkContextualItemSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -3012,7 +3224,7 @@ func NkContextualItemSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, alignm return __v } -// NkContextualItemSymbolText function as declared in nk/nuklear.h:3553 +// NkContextualItemSymbolText function as declared in nk/nuklear.h:3806 func NkContextualItemSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -3029,21 +3241,21 @@ func NkContextualItemSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 in return __v } -// NkContextualClose function as declared in nk/nuklear.h:3554 +// NkContextualClose function as declared in nk/nuklear.h:3807 func NkContextualClose(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_contextual_close(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkContextualEnd function as declared in nk/nuklear.h:3555 +// NkContextualEnd function as declared in nk/nuklear.h:3808 func NkContextualEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_contextual_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTooltip function as declared in nk/nuklear.h:3561 +// NkTooltip function as declared in nk/nuklear.h:3814 func NkTooltip(arg0 *Context, arg1 *byte) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3052,7 +3264,7 @@ func NkTooltip(arg0 *Context, arg1 *byte) { runtime.KeepAlive(carg0AllocMap) } -// NkTooltipBegin function as declared in nk/nuklear.h:3566 +// NkTooltipBegin function as declared in nk/nuklear.h:3819 func NkTooltipBegin(arg0 *Context, width float32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown cwidth, cwidthAllocMap := (C.float)(width), cgoAllocsUnknown @@ -3063,28 +3275,28 @@ func NkTooltipBegin(arg0 *Context, width float32) Bool { return __v } -// NkTooltipEnd function as declared in nk/nuklear.h:3567 +// NkTooltipEnd function as declared in nk/nuklear.h:3820 func NkTooltipEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_tooltip_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkMenubarBegin function as declared in nk/nuklear.h:3573 +// NkMenubarBegin function as declared in nk/nuklear.h:3826 func NkMenubarBegin(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_menubar_begin(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkMenubarEnd function as declared in nk/nuklear.h:3574 +// NkMenubarEnd function as declared in nk/nuklear.h:3827 func NkMenubarEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_menubar_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkMenuBeginText function as declared in nk/nuklear.h:3575 +// NkMenuBeginText function as declared in nk/nuklear.h:3828 func NkMenuBeginText(arg0 *Context, title string, titleLen int32, align Flags, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown title = safeString(title) @@ -3103,7 +3315,7 @@ func NkMenuBeginText(arg0 *Context, title string, titleLen int32, align Flags, s return __v } -// NkMenuBeginLabel function as declared in nk/nuklear.h:3576 +// NkMenuBeginLabel function as declared in nk/nuklear.h:3829 func NkMenuBeginLabel(arg0 *Context, arg1 *byte, align Flags, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3118,7 +3330,7 @@ func NkMenuBeginLabel(arg0 *Context, arg1 *byte, align Flags, size Vec2) Bool { return __v } -// NkMenuBeginImage function as declared in nk/nuklear.h:3577 +// NkMenuBeginImage function as declared in nk/nuklear.h:3830 func NkMenuBeginImage(arg0 *Context, arg1 *byte, arg2 Image, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3133,7 +3345,7 @@ func NkMenuBeginImage(arg0 *Context, arg1 *byte, arg2 Image, size Vec2) Bool { return __v } -// NkMenuBeginImageText function as declared in nk/nuklear.h:3578 +// NkMenuBeginImageText function as declared in nk/nuklear.h:3831 func NkMenuBeginImageText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, arg4 Image, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3152,7 +3364,7 @@ func NkMenuBeginImageText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, ar return __v } -// NkMenuBeginImageLabel function as declared in nk/nuklear.h:3579 +// NkMenuBeginImageLabel function as declared in nk/nuklear.h:3832 func NkMenuBeginImageLabel(arg0 *Context, arg1 *byte, align Flags, arg3 Image, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3169,7 +3381,7 @@ func NkMenuBeginImageLabel(arg0 *Context, arg1 *byte, align Flags, arg3 Image, s return __v } -// NkMenuBeginSymbol function as declared in nk/nuklear.h:3580 +// NkMenuBeginSymbol function as declared in nk/nuklear.h:3833 func NkMenuBeginSymbol(arg0 *Context, arg1 *byte, arg2 C.enum_, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3184,7 +3396,7 @@ func NkMenuBeginSymbol(arg0 *Context, arg1 *byte, arg2 C.enum_, size Vec2) Bool return __v } -// NkMenuBeginSymbolText function as declared in nk/nuklear.h:3581 +// NkMenuBeginSymbolText function as declared in nk/nuklear.h:3834 func NkMenuBeginSymbolText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, arg4 C.enum_, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3203,7 +3415,7 @@ func NkMenuBeginSymbolText(arg0 *Context, arg1 *byte, arg2 int32, align Flags, a return __v } -// NkMenuBeginSymbolLabel function as declared in nk/nuklear.h:3582 +// NkMenuBeginSymbolLabel function as declared in nk/nuklear.h:3835 func NkMenuBeginSymbolLabel(arg0 *Context, arg1 *byte, align Flags, arg3 C.enum_, size Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3220,7 +3432,7 @@ func NkMenuBeginSymbolLabel(arg0 *Context, arg1 *byte, align Flags, arg3 C.enum_ return __v } -// NkMenuItemText function as declared in nk/nuklear.h:3583 +// NkMenuItemText function as declared in nk/nuklear.h:3836 func NkMenuItemText(arg0 *Context, arg1 *byte, arg2 int32, align Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3235,7 +3447,7 @@ func NkMenuItemText(arg0 *Context, arg1 *byte, arg2 int32, align Flags) Bool { return __v } -// NkMenuItemLabel function as declared in nk/nuklear.h:3584 +// NkMenuItemLabel function as declared in nk/nuklear.h:3837 func NkMenuItemLabel(arg0 *Context, arg1 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3248,7 +3460,7 @@ func NkMenuItemLabel(arg0 *Context, arg1 *byte, alignment Flags) Bool { return __v } -// NkMenuItemImageLabel function as declared in nk/nuklear.h:3585 +// NkMenuItemImageLabel function as declared in nk/nuklear.h:3838 func NkMenuItemImageLabel(arg0 *Context, arg1 Image, arg2 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -3263,7 +3475,7 @@ func NkMenuItemImageLabel(arg0 *Context, arg1 Image, arg2 *byte, alignment Flags return __v } -// NkMenuItemImageText function as declared in nk/nuklear.h:3586 +// NkMenuItemImageText function as declared in nk/nuklear.h:3839 func NkMenuItemImageText(arg0 *Context, arg1 Image, arg2 *byte, len int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -3280,7 +3492,7 @@ func NkMenuItemImageText(arg0 *Context, arg1 Image, arg2 *byte, len int32, align return __v } -// NkMenuItemSymbolText function as declared in nk/nuklear.h:3587 +// NkMenuItemSymbolText function as declared in nk/nuklear.h:3840 func NkMenuItemSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -3297,7 +3509,7 @@ func NkMenuItemSymbolText(arg0 *Context, arg1 C.enum_, arg2 *byte, arg3 int32, a return __v } -// NkMenuItemSymbolLabel function as declared in nk/nuklear.h:3588 +// NkMenuItemSymbolLabel function as declared in nk/nuklear.h:3841 func NkMenuItemSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, alignment Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -3312,37 +3524,37 @@ func NkMenuItemSymbolLabel(arg0 *Context, arg1 C.enum_, arg2 *byte, alignment Fl return __v } -// NkMenuClose function as declared in nk/nuklear.h:3589 +// NkMenuClose function as declared in nk/nuklear.h:3842 func NkMenuClose(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_menu_close(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkMenuEnd function as declared in nk/nuklear.h:3590 +// NkMenuEnd function as declared in nk/nuklear.h:3843 func NkMenuEnd(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_menu_end(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStyleDefault function as declared in nk/nuklear.h:3637 +// NkStyleDefault function as declared in nk/nuklear.h:3897 func NkStyleDefault(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_style_default(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStyleFromTable function as declared in nk/nuklear.h:3638 +// NkStyleFromTable function as declared in nk/nuklear.h:3898 func NkStyleFromTable(arg0 *Context, arg1 []Color) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := copyPStructNkColorBytes((*sliceHeader)(unsafe.Pointer(&arg1))) + carg1, carg1AllocMap := (*C.struct_nk_color)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&arg1)).Data)), cgoAllocsUnknown C.nk_style_from_table(carg0, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(carg0AllocMap) } -// NkStyleLoadCursor function as declared in nk/nuklear.h:3639 +// NkStyleLoadCursor function as declared in nk/nuklear.h:3899 func NkStyleLoadCursor(arg0 *Context, arg1 C.enum_, arg2 *Cursor) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -3353,7 +3565,7 @@ func NkStyleLoadCursor(arg0 *Context, arg1 C.enum_, arg2 *Cursor) { runtime.KeepAlive(carg0AllocMap) } -// NkStyleLoadAllCursors function as declared in nk/nuklear.h:3640 +// NkStyleLoadAllCursors function as declared in nk/nuklear.h:3900 func NkStyleLoadAllCursors(arg0 *Context, arg1 *Cursor) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_cursor)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3362,16 +3574,16 @@ func NkStyleLoadAllCursors(arg0 *Context, arg1 *Cursor) { runtime.KeepAlive(carg0AllocMap) } -// NkStyleGetColorByName function as declared in nk/nuklear.h:3641 -func NkStyleGetColorByName(arg0 C.enum_) string { +// NkStyleGetColorByName function as declared in nk/nuklear.h:3901 +func NkStyleGetColorByName(arg0 C.enum_) *byte { carg0, carg0AllocMap := (C.enum_)(arg0), cgoAllocsUnknown __ret := C.nk_style_get_color_by_name(carg0) runtime.KeepAlive(carg0AllocMap) - __v := packPCharString(__ret) + __v := *(**byte)(unsafe.Pointer(&__ret)) return __v } -// NkStyleSetFont function as declared in nk/nuklear.h:3642 +// NkStyleSetFont function as declared in nk/nuklear.h:3902 func NkStyleSetFont(arg0 *Context, arg1 *UserFont) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := arg1.PassRef() @@ -3380,7 +3592,7 @@ func NkStyleSetFont(arg0 *Context, arg1 *UserFont) { runtime.KeepAlive(carg0AllocMap) } -// NkStyleSetCursor function as declared in nk/nuklear.h:3643 +// NkStyleSetCursor function as declared in nk/nuklear.h:3903 func NkStyleSetCursor(arg0 *Context, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -3391,21 +3603,21 @@ func NkStyleSetCursor(arg0 *Context, arg1 C.enum_) Bool { return __v } -// NkStyleShowCursor function as declared in nk/nuklear.h:3644 +// NkStyleShowCursor function as declared in nk/nuklear.h:3904 func NkStyleShowCursor(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_style_show_cursor(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStyleHideCursor function as declared in nk/nuklear.h:3645 +// NkStyleHideCursor function as declared in nk/nuklear.h:3905 func NkStyleHideCursor(arg0 *Context) { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_style_hide_cursor(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStylePushFont function as declared in nk/nuklear.h:3647 +// NkStylePushFont function as declared in nk/nuklear.h:3907 func NkStylePushFont(arg0 *Context, arg1 *UserFont) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := arg1.PassRef() @@ -3416,7 +3628,7 @@ func NkStylePushFont(arg0 *Context, arg1 *UserFont) Bool { return __v } -// NkStylePushFloat function as declared in nk/nuklear.h:3648 +// NkStylePushFloat function as declared in nk/nuklear.h:3908 func NkStylePushFloat(arg0 *Context, arg1 *float32, arg2 float32) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.float)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3429,7 +3641,7 @@ func NkStylePushFloat(arg0 *Context, arg1 *float32, arg2 float32) Bool { return __v } -// NkStylePushVec2 function as declared in nk/nuklear.h:3649 +// NkStylePushVec2 function as declared in nk/nuklear.h:3909 func NkStylePushVec2(arg0 *Context, arg1 *Vec2, arg2 Vec2) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_vec2)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3442,7 +3654,7 @@ func NkStylePushVec2(arg0 *Context, arg1 *Vec2, arg2 Vec2) Bool { return __v } -// NkStylePushStyleItem function as declared in nk/nuklear.h:3650 +// NkStylePushStyleItem function as declared in nk/nuklear.h:3910 func NkStylePushStyleItem(arg0 *Context, arg1 *StyleItem, arg2 StyleItem) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_style_item)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3455,7 +3667,7 @@ func NkStylePushStyleItem(arg0 *Context, arg1 *StyleItem, arg2 StyleItem) Bool { return __v } -// NkStylePushFlags function as declared in nk/nuklear.h:3651 +// NkStylePushFlags function as declared in nk/nuklear.h:3911 func NkStylePushFlags(arg0 *Context, arg1 *Flags, arg2 Flags) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.nk_flags)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3468,7 +3680,7 @@ func NkStylePushFlags(arg0 *Context, arg1 *Flags, arg2 Flags) Bool { return __v } -// NkStylePushColor function as declared in nk/nuklear.h:3652 +// NkStylePushColor function as declared in nk/nuklear.h:3912 func NkStylePushColor(arg0 *Context, arg1 *Color, arg2 Color) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_color)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -3481,7 +3693,7 @@ func NkStylePushColor(arg0 *Context, arg1 *Color, arg2 Color) Bool { return __v } -// NkStylePopFont function as declared in nk/nuklear.h:3654 +// NkStylePopFont function as declared in nk/nuklear.h:3914 func NkStylePopFont(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_style_pop_font(carg0) @@ -3490,7 +3702,7 @@ func NkStylePopFont(arg0 *Context) Bool { return __v } -// NkStylePopFloat function as declared in nk/nuklear.h:3655 +// NkStylePopFloat function as declared in nk/nuklear.h:3915 func NkStylePopFloat(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_style_pop_float(carg0) @@ -3499,7 +3711,7 @@ func NkStylePopFloat(arg0 *Context) Bool { return __v } -// NkStylePopVec2 function as declared in nk/nuklear.h:3656 +// NkStylePopVec2 function as declared in nk/nuklear.h:3916 func NkStylePopVec2(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_style_pop_vec2(carg0) @@ -3508,7 +3720,7 @@ func NkStylePopVec2(arg0 *Context) Bool { return __v } -// NkStylePopStyleItem function as declared in nk/nuklear.h:3657 +// NkStylePopStyleItem function as declared in nk/nuklear.h:3917 func NkStylePopStyleItem(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_style_pop_style_item(carg0) @@ -3517,7 +3729,7 @@ func NkStylePopStyleItem(arg0 *Context) Bool { return __v } -// NkStylePopFlags function as declared in nk/nuklear.h:3658 +// NkStylePopFlags function as declared in nk/nuklear.h:3918 func NkStylePopFlags(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_style_pop_flags(carg0) @@ -3526,7 +3738,7 @@ func NkStylePopFlags(arg0 *Context) Bool { return __v } -// NkStylePopColor function as declared in nk/nuklear.h:3659 +// NkStylePopColor function as declared in nk/nuklear.h:3919 func NkStylePopColor(arg0 *Context) Bool { carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_style_pop_color(carg0) @@ -3535,7 +3747,7 @@ func NkStylePopColor(arg0 *Context) Bool { return __v } -// NkRgb function as declared in nk/nuklear.h:3665 +// NkRgb function as declared in nk/nuklear.h:3925 func NkRgb(r int32, g int32, b int32) Color { cr, crAllocMap := (C.int)(r), cgoAllocsUnknown cg, cgAllocMap := (C.int)(g), cgoAllocsUnknown @@ -3548,7 +3760,7 @@ func NkRgb(r int32, g int32, b int32) Color { return __v } -// NkRgbIv function as declared in nk/nuklear.h:3666 +// NkRgbIv function as declared in nk/nuklear.h:3926 func NkRgbIv(rgb *int32) Color { crgb, crgbAllocMap := (*C.int)(unsafe.Pointer(rgb)), cgoAllocsUnknown __ret := C.nk_rgb_iv(crgb) @@ -3557,7 +3769,7 @@ func NkRgbIv(rgb *int32) Color { return __v } -// NkRgbBv function as declared in nk/nuklear.h:3667 +// NkRgbBv function as declared in nk/nuklear.h:3927 func NkRgbBv(rgb *byte) Color { crgb, crgbAllocMap := (*C.nk_byte)(unsafe.Pointer(rgb)), cgoAllocsUnknown __ret := C.nk_rgb_bv(crgb) @@ -3566,7 +3778,7 @@ func NkRgbBv(rgb *byte) Color { return __v } -// NkRgbF function as declared in nk/nuklear.h:3668 +// NkRgbF function as declared in nk/nuklear.h:3928 func NkRgbF(r float32, g float32, b float32) Color { cr, crAllocMap := (C.float)(r), cgoAllocsUnknown cg, cgAllocMap := (C.float)(g), cgoAllocsUnknown @@ -3579,7 +3791,7 @@ func NkRgbF(r float32, g float32, b float32) Color { return __v } -// NkRgbFv function as declared in nk/nuklear.h:3669 +// NkRgbFv function as declared in nk/nuklear.h:3929 func NkRgbFv(rgb *float32) Color { crgb, crgbAllocMap := (*C.float)(unsafe.Pointer(rgb)), cgoAllocsUnknown __ret := C.nk_rgb_fv(crgb) @@ -3588,7 +3800,7 @@ func NkRgbFv(rgb *float32) Color { return __v } -// NkRgbCf function as declared in nk/nuklear.h:3670 +// NkRgbCf function as declared in nk/nuklear.h:3930 func NkRgbCf(c Colorf) Color { cc, ccAllocMap := *(*C.struct_nk_colorf)(unsafe.Pointer(&c)), cgoAllocsUnknown __ret := C.nk_rgb_cf(cc) @@ -3597,7 +3809,7 @@ func NkRgbCf(c Colorf) Color { return __v } -// NkRgbHex function as declared in nk/nuklear.h:3671 +// NkRgbHex function as declared in nk/nuklear.h:3931 func NkRgbHex(rgb string) Color { rgb = safeString(rgb) crgb, crgbAllocMap := unpackPCharString(rgb) @@ -3608,7 +3820,18 @@ func NkRgbHex(rgb string) Color { return __v } -// NkRgba function as declared in nk/nuklear.h:3673 +// NkRgbFactor function as declared in nk/nuklear.h:3932 +func NkRgbFactor(col Color, factor float32) Color { + ccol, ccolAllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&col)), cgoAllocsUnknown + cfactor, cfactorAllocMap := (C.float)(factor), cgoAllocsUnknown + __ret := C.nk_rgb_factor(ccol, cfactor) + runtime.KeepAlive(cfactorAllocMap) + runtime.KeepAlive(ccolAllocMap) + __v := *(*Color)(unsafe.Pointer(&__ret)) + return __v +} + +// NkRgba function as declared in nk/nuklear.h:3934 func NkRgba(r int32, g int32, b int32, a int32) Color { cr, crAllocMap := (C.int)(r), cgoAllocsUnknown cg, cgAllocMap := (C.int)(g), cgoAllocsUnknown @@ -3623,7 +3846,7 @@ func NkRgba(r int32, g int32, b int32, a int32) Color { return __v } -// NkRgbaU32 function as declared in nk/nuklear.h:3674 +// NkRgbaU32 function as declared in nk/nuklear.h:3935 func NkRgbaU32(arg0 Uint) Color { carg0, carg0AllocMap := (C.nk_uint)(arg0), cgoAllocsUnknown __ret := C.nk_rgba_u32(carg0) @@ -3632,7 +3855,7 @@ func NkRgbaU32(arg0 Uint) Color { return __v } -// NkRgbaIv function as declared in nk/nuklear.h:3675 +// NkRgbaIv function as declared in nk/nuklear.h:3936 func NkRgbaIv(rgba *int32) Color { crgba, crgbaAllocMap := (*C.int)(unsafe.Pointer(rgba)), cgoAllocsUnknown __ret := C.nk_rgba_iv(crgba) @@ -3641,7 +3864,7 @@ func NkRgbaIv(rgba *int32) Color { return __v } -// NkRgbaBv function as declared in nk/nuklear.h:3676 +// NkRgbaBv function as declared in nk/nuklear.h:3937 func NkRgbaBv(rgba *byte) Color { crgba, crgbaAllocMap := (*C.nk_byte)(unsafe.Pointer(rgba)), cgoAllocsUnknown __ret := C.nk_rgba_bv(crgba) @@ -3650,7 +3873,7 @@ func NkRgbaBv(rgba *byte) Color { return __v } -// NkRgbaF function as declared in nk/nuklear.h:3677 +// NkRgbaF function as declared in nk/nuklear.h:3938 func NkRgbaF(r float32, g float32, b float32, a float32) Color { cr, crAllocMap := (C.float)(r), cgoAllocsUnknown cg, cgAllocMap := (C.float)(g), cgoAllocsUnknown @@ -3665,7 +3888,7 @@ func NkRgbaF(r float32, g float32, b float32, a float32) Color { return __v } -// NkRgbaFv function as declared in nk/nuklear.h:3678 +// NkRgbaFv function as declared in nk/nuklear.h:3939 func NkRgbaFv(rgba *float32) Color { crgba, crgbaAllocMap := (*C.float)(unsafe.Pointer(rgba)), cgoAllocsUnknown __ret := C.nk_rgba_fv(crgba) @@ -3674,7 +3897,7 @@ func NkRgbaFv(rgba *float32) Color { return __v } -// NkRgbaCf function as declared in nk/nuklear.h:3679 +// NkRgbaCf function as declared in nk/nuklear.h:3940 func NkRgbaCf(c Colorf) Color { cc, ccAllocMap := *(*C.struct_nk_colorf)(unsafe.Pointer(&c)), cgoAllocsUnknown __ret := C.nk_rgba_cf(cc) @@ -3683,7 +3906,7 @@ func NkRgbaCf(c Colorf) Color { return __v } -// NkRgbaHex function as declared in nk/nuklear.h:3680 +// NkRgbaHex function as declared in nk/nuklear.h:3941 func NkRgbaHex(rgb string) Color { rgb = safeString(rgb) crgb, crgbAllocMap := unpackPCharString(rgb) @@ -3694,7 +3917,7 @@ func NkRgbaHex(rgb string) Color { return __v } -// NkHsvaColorf function as declared in nk/nuklear.h:3682 +// NkHsvaColorf function as declared in nk/nuklear.h:3943 func NkHsvaColorf(h float32, s float32, v float32, a float32) Colorf { ch, chAllocMap := (C.float)(h), cgoAllocsUnknown cs, csAllocMap := (C.float)(s), cgoAllocsUnknown @@ -3709,7 +3932,7 @@ func NkHsvaColorf(h float32, s float32, v float32, a float32) Colorf { return __v } -// NkHsvaColorfv function as declared in nk/nuklear.h:3683 +// NkHsvaColorfv function as declared in nk/nuklear.h:3944 func NkHsvaColorfv(c *float32) Colorf { cc, ccAllocMap := (*C.float)(unsafe.Pointer(c)), cgoAllocsUnknown __ret := C.nk_hsva_colorfv(cc) @@ -3718,7 +3941,7 @@ func NkHsvaColorfv(c *float32) Colorf { return __v } -// NkColorfHsvaF function as declared in nk/nuklear.h:3684 +// NkColorfHsvaF function as declared in nk/nuklear.h:3945 func NkColorfHsvaF(outH *float32, outS *float32, outV *float32, outA *float32, in Colorf) { coutH, coutHAllocMap := (*C.float)(unsafe.Pointer(outH)), cgoAllocsUnknown coutS, coutSAllocMap := (*C.float)(unsafe.Pointer(outS)), cgoAllocsUnknown @@ -3733,7 +3956,7 @@ func NkColorfHsvaF(outH *float32, outS *float32, outV *float32, outA *float32, i runtime.KeepAlive(coutHAllocMap) } -// NkColorfHsvaFv function as declared in nk/nuklear.h:3685 +// NkColorfHsvaFv function as declared in nk/nuklear.h:3946 func NkColorfHsvaFv(hsva *float32, in Colorf) { chsva, chsvaAllocMap := (*C.float)(unsafe.Pointer(hsva)), cgoAllocsUnknown cin, cinAllocMap := *(*C.struct_nk_colorf)(unsafe.Pointer(&in)), cgoAllocsUnknown @@ -3742,7 +3965,7 @@ func NkColorfHsvaFv(hsva *float32, in Colorf) { runtime.KeepAlive(chsvaAllocMap) } -// NkHsv function as declared in nk/nuklear.h:3687 +// NkHsv function as declared in nk/nuklear.h:3948 func NkHsv(h int32, s int32, v int32) Color { ch, chAllocMap := (C.int)(h), cgoAllocsUnknown cs, csAllocMap := (C.int)(s), cgoAllocsUnknown @@ -3755,7 +3978,7 @@ func NkHsv(h int32, s int32, v int32) Color { return __v } -// NkHsvIv function as declared in nk/nuklear.h:3688 +// NkHsvIv function as declared in nk/nuklear.h:3949 func NkHsvIv(hsv *int32) Color { chsv, chsvAllocMap := (*C.int)(unsafe.Pointer(hsv)), cgoAllocsUnknown __ret := C.nk_hsv_iv(chsv) @@ -3764,7 +3987,7 @@ func NkHsvIv(hsv *int32) Color { return __v } -// NkHsvBv function as declared in nk/nuklear.h:3689 +// NkHsvBv function as declared in nk/nuklear.h:3950 func NkHsvBv(hsv *byte) Color { chsv, chsvAllocMap := (*C.nk_byte)(unsafe.Pointer(hsv)), cgoAllocsUnknown __ret := C.nk_hsv_bv(chsv) @@ -3773,7 +3996,7 @@ func NkHsvBv(hsv *byte) Color { return __v } -// NkHsvF function as declared in nk/nuklear.h:3690 +// NkHsvF function as declared in nk/nuklear.h:3951 func NkHsvF(h float32, s float32, v float32) Color { ch, chAllocMap := (C.float)(h), cgoAllocsUnknown cs, csAllocMap := (C.float)(s), cgoAllocsUnknown @@ -3786,7 +4009,7 @@ func NkHsvF(h float32, s float32, v float32) Color { return __v } -// NkHsvFv function as declared in nk/nuklear.h:3691 +// NkHsvFv function as declared in nk/nuklear.h:3952 func NkHsvFv(hsv *float32) Color { chsv, chsvAllocMap := (*C.float)(unsafe.Pointer(hsv)), cgoAllocsUnknown __ret := C.nk_hsv_fv(chsv) @@ -3795,7 +4018,7 @@ func NkHsvFv(hsv *float32) Color { return __v } -// NkHsva function as declared in nk/nuklear.h:3693 +// NkHsva function as declared in nk/nuklear.h:3954 func NkHsva(h int32, s int32, v int32, a int32) Color { ch, chAllocMap := (C.int)(h), cgoAllocsUnknown cs, csAllocMap := (C.int)(s), cgoAllocsUnknown @@ -3810,7 +4033,7 @@ func NkHsva(h int32, s int32, v int32, a int32) Color { return __v } -// NkHsvaIv function as declared in nk/nuklear.h:3694 +// NkHsvaIv function as declared in nk/nuklear.h:3955 func NkHsvaIv(hsva *int32) Color { chsva, chsvaAllocMap := (*C.int)(unsafe.Pointer(hsva)), cgoAllocsUnknown __ret := C.nk_hsva_iv(chsva) @@ -3819,7 +4042,7 @@ func NkHsvaIv(hsva *int32) Color { return __v } -// NkHsvaBv function as declared in nk/nuklear.h:3695 +// NkHsvaBv function as declared in nk/nuklear.h:3956 func NkHsvaBv(hsva *byte) Color { chsva, chsvaAllocMap := (*C.nk_byte)(unsafe.Pointer(hsva)), cgoAllocsUnknown __ret := C.nk_hsva_bv(chsva) @@ -3828,7 +4051,7 @@ func NkHsvaBv(hsva *byte) Color { return __v } -// NkHsvaF function as declared in nk/nuklear.h:3696 +// NkHsvaF function as declared in nk/nuklear.h:3957 func NkHsvaF(h float32, s float32, v float32, a float32) Color { ch, chAllocMap := (C.float)(h), cgoAllocsUnknown cs, csAllocMap := (C.float)(s), cgoAllocsUnknown @@ -3843,7 +4066,7 @@ func NkHsvaF(h float32, s float32, v float32, a float32) Color { return __v } -// NkHsvaFv function as declared in nk/nuklear.h:3697 +// NkHsvaFv function as declared in nk/nuklear.h:3958 func NkHsvaFv(hsva *float32) Color { chsva, chsvaAllocMap := (*C.float)(unsafe.Pointer(hsva)), cgoAllocsUnknown __ret := C.nk_hsva_fv(chsva) @@ -3852,7 +4075,7 @@ func NkHsvaFv(hsva *float32) Color { return __v } -// NkColorF function as declared in nk/nuklear.h:3700 +// NkColorF function as declared in nk/nuklear.h:3961 func NkColorF(r *float32, g *float32, b *float32, a *float32, arg4 Color) { cr, crAllocMap := (*C.float)(unsafe.Pointer(r)), cgoAllocsUnknown cg, cgAllocMap := (*C.float)(unsafe.Pointer(g)), cgoAllocsUnknown @@ -3867,16 +4090,16 @@ func NkColorF(r *float32, g *float32, b *float32, a *float32, arg4 Color) { runtime.KeepAlive(crAllocMap) } -// NkColorFv function as declared in nk/nuklear.h:3701 +// NkColorFv function as declared in nk/nuklear.h:3962 func NkColorFv(rgbaOut []float32, arg1 Color) { - crgbaOut, crgbaOutAllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&rgbaOut))) + crgbaOut, crgbaOutAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&rgbaOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_fv(crgbaOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(crgbaOutAllocMap) } -// NkColorCf function as declared in nk/nuklear.h:3702 +// NkColorCf function as declared in nk/nuklear.h:3963 func NkColorCf(arg0 Color) Colorf { carg0, carg0AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg0)), cgoAllocsUnknown __ret := C.nk_color_cf(carg0) @@ -3885,7 +4108,7 @@ func NkColorCf(arg0 Color) Colorf { return __v } -// NkColorD function as declared in nk/nuklear.h:3703 +// NkColorD function as declared in nk/nuklear.h:3964 func NkColorD(r *float64, g *float64, b *float64, a *float64, arg4 Color) { cr, crAllocMap := (*C.double)(unsafe.Pointer(r)), cgoAllocsUnknown cg, cgAllocMap := (*C.double)(unsafe.Pointer(g)), cgoAllocsUnknown @@ -3900,16 +4123,16 @@ func NkColorD(r *float64, g *float64, b *float64, a *float64, arg4 Color) { runtime.KeepAlive(crAllocMap) } -// NkColorDv function as declared in nk/nuklear.h:3704 +// NkColorDv function as declared in nk/nuklear.h:3965 func NkColorDv(rgbaOut []float64, arg1 Color) { - crgbaOut, crgbaOutAllocMap := copyPDoubleBytes((*sliceHeader)(unsafe.Pointer(&rgbaOut))) + crgbaOut, crgbaOutAllocMap := (*C.double)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&rgbaOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_dv(crgbaOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(crgbaOutAllocMap) } -// NkColorU32 function as declared in nk/nuklear.h:3706 +// NkColorU32 function as declared in nk/nuklear.h:3967 func NkColorU32(arg0 Color) Uint { carg0, carg0AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg0)), cgoAllocsUnknown __ret := C.nk_color_u32(carg0) @@ -3918,25 +4141,25 @@ func NkColorU32(arg0 Color) Uint { return __v } -// NkColorHexRgba function as declared in nk/nuklear.h:3707 +// NkColorHexRgba function as declared in nk/nuklear.h:3968 func NkColorHexRgba(output []byte, arg1 Color) { - coutput, coutputAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&output))) + coutput, coutputAllocMap := (*C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&output)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hex_rgba(coutput, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(coutputAllocMap) } -// NkColorHexRgb function as declared in nk/nuklear.h:3708 +// NkColorHexRgb function as declared in nk/nuklear.h:3969 func NkColorHexRgb(output []byte, arg1 Color) { - coutput, coutputAllocMap := copyPCharBytes((*sliceHeader)(unsafe.Pointer(&output))) + coutput, coutputAllocMap := (*C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&output)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hex_rgb(coutput, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(coutputAllocMap) } -// NkColorHsvI function as declared in nk/nuklear.h:3710 +// NkColorHsvI function as declared in nk/nuklear.h:3971 func NkColorHsvI(outH *int32, outS *int32, outV *int32, arg3 Color) { coutH, coutHAllocMap := (*C.int)(unsafe.Pointer(outH)), cgoAllocsUnknown coutS, coutSAllocMap := (*C.int)(unsafe.Pointer(outS)), cgoAllocsUnknown @@ -3949,7 +4172,7 @@ func NkColorHsvI(outH *int32, outS *int32, outV *int32, arg3 Color) { runtime.KeepAlive(coutHAllocMap) } -// NkColorHsvB function as declared in nk/nuklear.h:3711 +// NkColorHsvB function as declared in nk/nuklear.h:3972 func NkColorHsvB(outH *byte, outS *byte, outV *byte, arg3 Color) { coutH, coutHAllocMap := (*C.nk_byte)(unsafe.Pointer(outH)), cgoAllocsUnknown coutS, coutSAllocMap := (*C.nk_byte)(unsafe.Pointer(outS)), cgoAllocsUnknown @@ -3962,25 +4185,25 @@ func NkColorHsvB(outH *byte, outS *byte, outV *byte, arg3 Color) { runtime.KeepAlive(coutHAllocMap) } -// NkColorHsvIv function as declared in nk/nuklear.h:3712 +// NkColorHsvIv function as declared in nk/nuklear.h:3973 func NkColorHsvIv(hsvOut []int32, arg1 Color) { - chsvOut, chsvOutAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&hsvOut))) + chsvOut, chsvOutAllocMap := (*C.int)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&hsvOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hsv_iv(chsvOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(chsvOutAllocMap) } -// NkColorHsvBv function as declared in nk/nuklear.h:3713 +// NkColorHsvBv function as declared in nk/nuklear.h:3974 func NkColorHsvBv(hsvOut []byte, arg1 Color) { - chsvOut, chsvOutAllocMap := copyPByteBytes((*sliceHeader)(unsafe.Pointer(&hsvOut))) + chsvOut, chsvOutAllocMap := (*C.nk_byte)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&hsvOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hsv_bv(chsvOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(chsvOutAllocMap) } -// NkColorHsvF function as declared in nk/nuklear.h:3714 +// NkColorHsvF function as declared in nk/nuklear.h:3975 func NkColorHsvF(outH *float32, outS *float32, outV *float32, arg3 Color) { coutH, coutHAllocMap := (*C.float)(unsafe.Pointer(outH)), cgoAllocsUnknown coutS, coutSAllocMap := (*C.float)(unsafe.Pointer(outS)), cgoAllocsUnknown @@ -3993,16 +4216,16 @@ func NkColorHsvF(outH *float32, outS *float32, outV *float32, arg3 Color) { runtime.KeepAlive(coutHAllocMap) } -// NkColorHsvFv function as declared in nk/nuklear.h:3715 +// NkColorHsvFv function as declared in nk/nuklear.h:3976 func NkColorHsvFv(hsvOut []float32, arg1 Color) { - chsvOut, chsvOutAllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&hsvOut))) + chsvOut, chsvOutAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&hsvOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hsv_fv(chsvOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(chsvOutAllocMap) } -// NkColorHsvaI function as declared in nk/nuklear.h:3717 +// NkColorHsvaI function as declared in nk/nuklear.h:3978 func NkColorHsvaI(h *int32, s *int32, v *int32, a *int32, arg4 Color) { ch, chAllocMap := (*C.int)(unsafe.Pointer(h)), cgoAllocsUnknown cs, csAllocMap := (*C.int)(unsafe.Pointer(s)), cgoAllocsUnknown @@ -4017,7 +4240,7 @@ func NkColorHsvaI(h *int32, s *int32, v *int32, a *int32, arg4 Color) { runtime.KeepAlive(chAllocMap) } -// NkColorHsvaB function as declared in nk/nuklear.h:3718 +// NkColorHsvaB function as declared in nk/nuklear.h:3979 func NkColorHsvaB(h *byte, s *byte, v *byte, a *Byte, arg4 Color) { ch, chAllocMap := (*C.nk_byte)(unsafe.Pointer(h)), cgoAllocsUnknown cs, csAllocMap := (*C.nk_byte)(unsafe.Pointer(s)), cgoAllocsUnknown @@ -4032,25 +4255,25 @@ func NkColorHsvaB(h *byte, s *byte, v *byte, a *Byte, arg4 Color) { runtime.KeepAlive(chAllocMap) } -// NkColorHsvaIv function as declared in nk/nuklear.h:3719 +// NkColorHsvaIv function as declared in nk/nuklear.h:3980 func NkColorHsvaIv(hsvaOut []int32, arg1 Color) { - chsvaOut, chsvaOutAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&hsvaOut))) + chsvaOut, chsvaOutAllocMap := (*C.int)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&hsvaOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hsva_iv(chsvaOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(chsvaOutAllocMap) } -// NkColorHsvaBv function as declared in nk/nuklear.h:3720 +// NkColorHsvaBv function as declared in nk/nuklear.h:3981 func NkColorHsvaBv(hsvaOut []byte, arg1 Color) { - chsvaOut, chsvaOutAllocMap := copyPByteBytes((*sliceHeader)(unsafe.Pointer(&hsvaOut))) + chsvaOut, chsvaOutAllocMap := (*C.nk_byte)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&hsvaOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hsva_bv(chsvaOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(chsvaOutAllocMap) } -// NkColorHsvaF function as declared in nk/nuklear.h:3721 +// NkColorHsvaF function as declared in nk/nuklear.h:3982 func NkColorHsvaF(outH *float32, outS *float32, outV *float32, outA *float32, arg4 Color) { coutH, coutHAllocMap := (*C.float)(unsafe.Pointer(outH)), cgoAllocsUnknown coutS, coutSAllocMap := (*C.float)(unsafe.Pointer(outS)), cgoAllocsUnknown @@ -4065,16 +4288,16 @@ func NkColorHsvaF(outH *float32, outS *float32, outV *float32, outA *float32, ar runtime.KeepAlive(coutHAllocMap) } -// NkColorHsvaFv function as declared in nk/nuklear.h:3722 +// NkColorHsvaFv function as declared in nk/nuklear.h:3983 func NkColorHsvaFv(hsvaOut []float32, arg1 Color) { - chsvaOut, chsvaOutAllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&hsvaOut))) + chsvaOut, chsvaOutAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&hsvaOut)).Data)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown C.nk_color_hsva_fv(chsvaOut, carg1) runtime.KeepAlive(carg1AllocMap) runtime.KeepAlive(chsvaOutAllocMap) } -// NkHandlePtr function as declared in nk/nuklear.h:3728 +// NkHandlePtr function as declared in nk/nuklear.h:3989 func NkHandlePtr(arg0 unsafe.Pointer) Handle { carg0, carg0AllocMap := arg0, cgoAllocsUnknown __ret := C.nk_handle_ptr(carg0) @@ -4083,7 +4306,7 @@ func NkHandlePtr(arg0 unsafe.Pointer) Handle { return __v } -// NkHandleId function as declared in nk/nuklear.h:3729 +// NkHandleId function as declared in nk/nuklear.h:3990 func NkHandleId(arg0 int32) Handle { carg0, carg0AllocMap := (C.int)(arg0), cgoAllocsUnknown __ret := C.nk_handle_id(carg0) @@ -4092,7 +4315,7 @@ func NkHandleId(arg0 int32) Handle { return __v } -// NkImageHandle function as declared in nk/nuklear.h:3730 +// NkImageHandle function as declared in nk/nuklear.h:3991 func NkImageHandle(arg0 Handle) Image { carg0, carg0AllocMap := *(*C.nk_handle)(unsafe.Pointer(&arg0)), cgoAllocsUnknown __ret := C.nk_image_handle(carg0) @@ -4101,7 +4324,7 @@ func NkImageHandle(arg0 Handle) Image { return __v } -// NkImagePtr function as declared in nk/nuklear.h:3731 +// NkImagePtr function as declared in nk/nuklear.h:3992 func NkImagePtr(arg0 unsafe.Pointer) Image { carg0, carg0AllocMap := arg0, cgoAllocsUnknown __ret := C.nk_image_ptr(carg0) @@ -4110,7 +4333,7 @@ func NkImagePtr(arg0 unsafe.Pointer) Image { return __v } -// NkImageId function as declared in nk/nuklear.h:3732 +// NkImageId function as declared in nk/nuklear.h:3993 func NkImageId(arg0 int32) Image { carg0, carg0AllocMap := (C.int)(arg0), cgoAllocsUnknown __ret := C.nk_image_id(carg0) @@ -4119,7 +4342,7 @@ func NkImageId(arg0 int32) Image { return __v } -// NkImageIsSubimage function as declared in nk/nuklear.h:3733 +// NkImageIsSubimage function as declared in nk/nuklear.h:3994 func NkImageIsSubimage(img *Image) Bool { cimg, cimgAllocMap := (*C.struct_nk_image)(unsafe.Pointer(img)), cgoAllocsUnknown __ret := C.nk_image_is_subimage(cimg) @@ -4128,7 +4351,7 @@ func NkImageIsSubimage(img *Image) Bool { return __v } -// NkSubimagePtr function as declared in nk/nuklear.h:3734 +// NkSubimagePtr function as declared in nk/nuklear.h:3995 func NkSubimagePtr(arg0 unsafe.Pointer, w Ushort, h Ushort, subRegion Rect) Image { carg0, carg0AllocMap := arg0, cgoAllocsUnknown cw, cwAllocMap := (C.nk_ushort)(w), cgoAllocsUnknown @@ -4143,7 +4366,7 @@ func NkSubimagePtr(arg0 unsafe.Pointer, w Ushort, h Ushort, subRegion Rect) Imag return __v } -// NkSubimageId function as declared in nk/nuklear.h:3735 +// NkSubimageId function as declared in nk/nuklear.h:3996 func NkSubimageId(arg0 int32, w Ushort, h Ushort, subRegion Rect) Image { carg0, carg0AllocMap := (C.int)(arg0), cgoAllocsUnknown cw, cwAllocMap := (C.nk_ushort)(w), cgoAllocsUnknown @@ -4158,7 +4381,7 @@ func NkSubimageId(arg0 int32, w Ushort, h Ushort, subRegion Rect) Image { return __v } -// NkSubimageHandle function as declared in nk/nuklear.h:3736 +// NkSubimageHandle function as declared in nk/nuklear.h:3997 func NkSubimageHandle(arg0 Handle, w Ushort, h Ushort, subRegion Rect) Image { carg0, carg0AllocMap := *(*C.nk_handle)(unsafe.Pointer(&arg0)), cgoAllocsUnknown cw, cwAllocMap := (C.nk_ushort)(w), cgoAllocsUnknown @@ -4173,7 +4396,7 @@ func NkSubimageHandle(arg0 Handle, w Ushort, h Ushort, subRegion Rect) Image { return __v } -// NkNineSliceHandle function as declared in nk/nuklear.h:3742 +// NkNineSliceHandle function as declared in nk/nuklear.h:4003 func NkNineSliceHandle(arg0 Handle, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice { carg0, carg0AllocMap := *(*C.nk_handle)(unsafe.Pointer(&arg0)), cgoAllocsUnknown cl, clAllocMap := (C.nk_ushort)(l), cgoAllocsUnknown @@ -4190,7 +4413,7 @@ func NkNineSliceHandle(arg0 Handle, l Ushort, t Ushort, r Ushort, b Ushort) Nine return __v } -// NkNineSlicePtr function as declared in nk/nuklear.h:3743 +// NkNineSlicePtr function as declared in nk/nuklear.h:4004 func NkNineSlicePtr(arg0 unsafe.Pointer, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice { carg0, carg0AllocMap := arg0, cgoAllocsUnknown cl, clAllocMap := (C.nk_ushort)(l), cgoAllocsUnknown @@ -4207,7 +4430,7 @@ func NkNineSlicePtr(arg0 unsafe.Pointer, l Ushort, t Ushort, r Ushort, b Ushort) return __v } -// NkNineSliceId function as declared in nk/nuklear.h:3744 +// NkNineSliceId function as declared in nk/nuklear.h:4005 func NkNineSliceId(arg0 int32, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice { carg0, carg0AllocMap := (C.int)(arg0), cgoAllocsUnknown cl, clAllocMap := (C.nk_ushort)(l), cgoAllocsUnknown @@ -4224,7 +4447,7 @@ func NkNineSliceId(arg0 int32, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice return __v } -// NkNineSliceIsSub9slice function as declared in nk/nuklear.h:3745 +// NkNineSliceIsSub9slice function as declared in nk/nuklear.h:4006 func NkNineSliceIsSub9slice(img *NineSlice) int32 { cimg, cimgAllocMap := (*C.struct_nk_nine_slice)(unsafe.Pointer(img)), cgoAllocsUnknown __ret := C.nk_nine_slice_is_sub9slice(cimg) @@ -4233,7 +4456,7 @@ func NkNineSliceIsSub9slice(img *NineSlice) int32 { return __v } -// NkSub9slicePtr function as declared in nk/nuklear.h:3746 +// NkSub9slicePtr function as declared in nk/nuklear.h:4007 func NkSub9slicePtr(arg0 unsafe.Pointer, w Ushort, h Ushort, subRegion Rect, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice { carg0, carg0AllocMap := arg0, cgoAllocsUnknown cw, cwAllocMap := (C.nk_ushort)(w), cgoAllocsUnknown @@ -4256,7 +4479,7 @@ func NkSub9slicePtr(arg0 unsafe.Pointer, w Ushort, h Ushort, subRegion Rect, l U return __v } -// NkSub9sliceId function as declared in nk/nuklear.h:3747 +// NkSub9sliceId function as declared in nk/nuklear.h:4008 func NkSub9sliceId(arg0 int32, w Ushort, h Ushort, subRegion Rect, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice { carg0, carg0AllocMap := (C.int)(arg0), cgoAllocsUnknown cw, cwAllocMap := (C.nk_ushort)(w), cgoAllocsUnknown @@ -4279,7 +4502,7 @@ func NkSub9sliceId(arg0 int32, w Ushort, h Ushort, subRegion Rect, l Ushort, t U return __v } -// NkSub9sliceHandle function as declared in nk/nuklear.h:3748 +// NkSub9sliceHandle function as declared in nk/nuklear.h:4009 func NkSub9sliceHandle(arg0 Handle, w Ushort, h Ushort, subRegion Rect, l Ushort, t Ushort, r Ushort, b Ushort) NineSlice { carg0, carg0AllocMap := *(*C.nk_handle)(unsafe.Pointer(&arg0)), cgoAllocsUnknown cw, cwAllocMap := (C.nk_ushort)(w), cgoAllocsUnknown @@ -4302,7 +4525,7 @@ func NkSub9sliceHandle(arg0 Handle, w Ushort, h Ushort, subRegion Rect, l Ushort return __v } -// NkMurmurHash function as declared in nk/nuklear.h:3754 +// NkMurmurHash function as declared in nk/nuklear.h:4015 func NkMurmurHash(key unsafe.Pointer, len int32, seed Hash) Hash { ckey, ckeyAllocMap := key, cgoAllocsUnknown clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown @@ -4315,7 +4538,7 @@ func NkMurmurHash(key unsafe.Pointer, len int32, seed Hash) Hash { return __v } -// NkTriangleFromDirection function as declared in nk/nuklear.h:3755 +// NkTriangleFromDirection function as declared in nk/nuklear.h:4016 func NkTriangleFromDirection(result *Vec2, r Rect, padX float32, padY float32, arg4 C.enum_) { cresult, cresultAllocMap := (*C.struct_nk_vec2)(unsafe.Pointer(result)), cgoAllocsUnknown cr, crAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&r)), cgoAllocsUnknown @@ -4330,7 +4553,7 @@ func NkTriangleFromDirection(result *Vec2, r Rect, padX float32, padY float32, a runtime.KeepAlive(cresultAllocMap) } -// NkVec2 function as declared in nk/nuklear.h:3757 +// NkVec2 function as declared in nk/nuklear.h:4018 func NkVec2(x float32, y float32) Vec2 { cx, cxAllocMap := (C.float)(x), cgoAllocsUnknown cy, cyAllocMap := (C.float)(y), cgoAllocsUnknown @@ -4341,7 +4564,7 @@ func NkVec2(x float32, y float32) Vec2 { return __v } -// NkVec2i function as declared in nk/nuklear.h:3758 +// NkVec2i function as declared in nk/nuklear.h:4019 func NkVec2i(x int32, y int32) Vec2 { cx, cxAllocMap := (C.int)(x), cgoAllocsUnknown cy, cyAllocMap := (C.int)(y), cgoAllocsUnknown @@ -4352,7 +4575,7 @@ func NkVec2i(x int32, y int32) Vec2 { return __v } -// NkVec2v function as declared in nk/nuklear.h:3759 +// NkVec2v function as declared in nk/nuklear.h:4020 func NkVec2v(xy *float32) Vec2 { cxy, cxyAllocMap := (*C.float)(unsafe.Pointer(xy)), cgoAllocsUnknown __ret := C.nk_vec2v(cxy) @@ -4361,7 +4584,7 @@ func NkVec2v(xy *float32) Vec2 { return __v } -// NkVec2iv function as declared in nk/nuklear.h:3760 +// NkVec2iv function as declared in nk/nuklear.h:4021 func NkVec2iv(xy *int32) Vec2 { cxy, cxyAllocMap := (*C.int)(unsafe.Pointer(xy)), cgoAllocsUnknown __ret := C.nk_vec2iv(cxy) @@ -4370,14 +4593,14 @@ func NkVec2iv(xy *int32) Vec2 { return __v } -// NkGetNullRect function as declared in nk/nuklear.h:3762 +// NkGetNullRect function as declared in nk/nuklear.h:4023 func NkGetNullRect() Rect { __ret := C.nk_get_null_rect() __v := *(*Rect)(unsafe.Pointer(&__ret)) return __v } -// NkRect function as declared in nk/nuklear.h:3763 +// NkRect function as declared in nk/nuklear.h:4024 func NkRect(x float32, y float32, w float32, h float32) Rect { cx, cxAllocMap := (C.float)(x), cgoAllocsUnknown cy, cyAllocMap := (C.float)(y), cgoAllocsUnknown @@ -4392,7 +4615,7 @@ func NkRect(x float32, y float32, w float32, h float32) Rect { return __v } -// NkRecti function as declared in nk/nuklear.h:3764 +// NkRecti function as declared in nk/nuklear.h:4025 func NkRecti(x int32, y int32, w int32, h int32) Rect { cx, cxAllocMap := (C.int)(x), cgoAllocsUnknown cy, cyAllocMap := (C.int)(y), cgoAllocsUnknown @@ -4407,7 +4630,7 @@ func NkRecti(x int32, y int32, w int32, h int32) Rect { return __v } -// NkRecta function as declared in nk/nuklear.h:3765 +// NkRecta function as declared in nk/nuklear.h:4026 func NkRecta(pos Vec2, size Vec2) Rect { cpos, cposAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&pos)), cgoAllocsUnknown csize, csizeAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&size)), cgoAllocsUnknown @@ -4418,7 +4641,7 @@ func NkRecta(pos Vec2, size Vec2) Rect { return __v } -// NkRectv function as declared in nk/nuklear.h:3766 +// NkRectv function as declared in nk/nuklear.h:4027 func NkRectv(xywh *float32) Rect { cxywh, cxywhAllocMap := (*C.float)(unsafe.Pointer(xywh)), cgoAllocsUnknown __ret := C.nk_rectv(cxywh) @@ -4427,7 +4650,7 @@ func NkRectv(xywh *float32) Rect { return __v } -// NkRectiv function as declared in nk/nuklear.h:3767 +// NkRectiv function as declared in nk/nuklear.h:4028 func NkRectiv(xywh *int32) Rect { cxywh, cxywhAllocMap := (*C.int)(unsafe.Pointer(xywh)), cgoAllocsUnknown __ret := C.nk_rectiv(cxywh) @@ -4436,7 +4659,7 @@ func NkRectiv(xywh *int32) Rect { return __v } -// NkRectPos function as declared in nk/nuklear.h:3768 +// NkRectPos function as declared in nk/nuklear.h:4029 func NkRectPos(arg0 Rect) Vec2 { carg0, carg0AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg0)), cgoAllocsUnknown __ret := C.nk_rect_pos(carg0) @@ -4445,7 +4668,7 @@ func NkRectPos(arg0 Rect) Vec2 { return __v } -// NkRectSize function as declared in nk/nuklear.h:3769 +// NkRectSize function as declared in nk/nuklear.h:4030 func NkRectSize(arg0 Rect) Vec2 { carg0, carg0AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg0)), cgoAllocsUnknown __ret := C.nk_rect_size(carg0) @@ -4454,7 +4677,7 @@ func NkRectSize(arg0 Rect) Vec2 { return __v } -// NkStrlen function as declared in nk/nuklear.h:3775 +// NkStrlen function as declared in nk/nuklear.h:4036 func NkStrlen(str string) int32 { str = safeString(str) cstr, cstrAllocMap := unpackPCharString(str) @@ -4465,7 +4688,7 @@ func NkStrlen(str string) int32 { return __v } -// NkStricmp function as declared in nk/nuklear.h:3776 +// NkStricmp function as declared in nk/nuklear.h:4037 func NkStricmp(s1 string, s2 string) int32 { s1 = safeString(s1) cs1, cs1AllocMap := unpackPCharString(s1) @@ -4480,7 +4703,7 @@ func NkStricmp(s1 string, s2 string) int32 { return __v } -// NkStricmpn function as declared in nk/nuklear.h:3777 +// NkStricmpn function as declared in nk/nuklear.h:4038 func NkStricmpn(s1 string, s2 string, n int32) int32 { s1 = safeString(s1) cs1, cs1AllocMap := unpackPCharString(s1) @@ -4497,13 +4720,12 @@ func NkStricmpn(s1 string, s2 string, n int32) int32 { return __v } -// NkStrtoi function as declared in nk/nuklear.h:3778 -func NkStrtoi(str string, endptr []string) int32 { +// NkStrtoi function as declared in nk/nuklear.h:4039 +func NkStrtoi(str string, endptr []*byte) int32 { str = safeString(str) cstr, cstrAllocMap := unpackPCharString(str) - cendptr, cendptrAllocMap := unpackArgSString(endptr) + cendptr, cendptrAllocMap := (**C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&endptr)).Data)), cgoAllocsUnknown __ret := C.nk_strtoi(cstr, cendptr) - packSString(endptr, cendptr) runtime.KeepAlive(cendptrAllocMap) runtime.KeepAlive(str) runtime.KeepAlive(cstrAllocMap) @@ -4511,13 +4733,12 @@ func NkStrtoi(str string, endptr []string) int32 { return __v } -// NkStrtof function as declared in nk/nuklear.h:3779 -func NkStrtof(str string, endptr []string) float32 { +// NkStrtof function as declared in nk/nuklear.h:4040 +func NkStrtof(str string, endptr []*byte) float32 { str = safeString(str) cstr, cstrAllocMap := unpackPCharString(str) - cendptr, cendptrAllocMap := unpackArgSString(endptr) + cendptr, cendptrAllocMap := (**C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&endptr)).Data)), cgoAllocsUnknown __ret := C.nk_strtof(cstr, cendptr) - packSString(endptr, cendptr) runtime.KeepAlive(cendptrAllocMap) runtime.KeepAlive(str) runtime.KeepAlive(cstrAllocMap) @@ -4525,13 +4746,12 @@ func NkStrtof(str string, endptr []string) float32 { return __v } -// NkStrtod function as declared in nk/nuklear.h:3782 -func NkStrtod(str string, endptr []string) float64 { +// NkStrtod function as declared in nk/nuklear.h:4043 +func NkStrtod(str string, endptr []*byte) float64 { str = safeString(str) cstr, cstrAllocMap := unpackPCharString(str) - cendptr, cendptrAllocMap := unpackArgSString(endptr) + cendptr, cendptrAllocMap := (**C.char)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&endptr)).Data)), cgoAllocsUnknown __ret := C.nk_strtod(cstr, cendptr) - packSString(endptr, cendptr) runtime.KeepAlive(cendptrAllocMap) runtime.KeepAlive(str) runtime.KeepAlive(cstrAllocMap) @@ -4539,7 +4759,7 @@ func NkStrtod(str string, endptr []string) float64 { return __v } -// NkStrfilter function as declared in nk/nuklear.h:3784 +// NkStrfilter function as declared in nk/nuklear.h:4045 func NkStrfilter(text string, regexp string) int32 { text = safeString(text) ctext, ctextAllocMap := unpackPCharString(text) @@ -4554,7 +4774,7 @@ func NkStrfilter(text string, regexp string) int32 { return __v } -// NkStrmatchFuzzyString function as declared in nk/nuklear.h:3785 +// NkStrmatchFuzzyString function as declared in nk/nuklear.h:4046 func NkStrmatchFuzzyString(str string, pattern string, outScore *int32) int32 { str = safeString(str) cstr, cstrAllocMap := unpackPCharString(str) @@ -4571,7 +4791,7 @@ func NkStrmatchFuzzyString(str string, pattern string, outScore *int32) int32 { return __v } -// NkStrmatchFuzzyText function as declared in nk/nuklear.h:3786 +// NkStrmatchFuzzyText function as declared in nk/nuklear.h:4047 func NkStrmatchFuzzyText(txt string, txtLen int32, pattern string, outScore *int32) int32 { txt = safeString(txt) ctxt, ctxtAllocMap := unpackPCharString(txt) @@ -4590,7 +4810,7 @@ func NkStrmatchFuzzyText(txt string, txtLen int32, pattern string, outScore *int return __v } -// NkUtfDecode function as declared in nk/nuklear.h:3792 +// NkUtfDecode function as declared in nk/nuklear.h:4053 func NkUtfDecode(arg0 *byte, arg1 *Rune, arg2 int32) int32 { carg0, carg0AllocMap := (*C.char)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.nk_rune)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4603,7 +4823,7 @@ func NkUtfDecode(arg0 *byte, arg1 *Rune, arg2 int32) int32 { return __v } -// NkUtfEncode function as declared in nk/nuklear.h:3793 +// NkUtfEncode function as declared in nk/nuklear.h:4054 func NkUtfEncode(arg0 Rune, arg1 *byte, arg2 int32) int32 { carg0, carg0AllocMap := (C.nk_rune)(arg0), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4616,7 +4836,7 @@ func NkUtfEncode(arg0 Rune, arg1 *byte, arg2 int32) int32 { return __v } -// NkUtfLen function as declared in nk/nuklear.h:3794 +// NkUtfLen function as declared in nk/nuklear.h:4055 func NkUtfLen(arg0 *byte, byteLen int32) int32 { carg0, carg0AllocMap := (*C.char)(unsafe.Pointer(arg0)), cgoAllocsUnknown cbyteLen, cbyteLenAllocMap := (C.int)(byteLen), cgoAllocsUnknown @@ -4627,14 +4847,14 @@ func NkUtfLen(arg0 *byte, byteLen int32) int32 { return __v } -// NkUtfAt function as declared in nk/nuklear.h:3795 -func NkUtfAt(buffer string, length int32, index int32, unicode *Rune, len []int32) string { +// NkUtfAt function as declared in nk/nuklear.h:4056 +func NkUtfAt(buffer string, length int32, index int32, unicode *Rune, len []int32) *byte { buffer = safeString(buffer) cbuffer, cbufferAllocMap := unpackPCharString(buffer) clength, clengthAllocMap := (C.int)(length), cgoAllocsUnknown cindex, cindexAllocMap := (C.int)(index), cgoAllocsUnknown cunicode, cunicodeAllocMap := (*C.nk_rune)(unsafe.Pointer(unicode)), cgoAllocsUnknown - clen, clenAllocMap := copyPIntBytes((*sliceHeader)(unsafe.Pointer(&len))) + clen, clenAllocMap := (*C.int)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&len)).Data)), cgoAllocsUnknown __ret := C.nk_utf_at(cbuffer, clength, cindex, cunicode, clen) runtime.KeepAlive(clenAllocMap) runtime.KeepAlive(cunicodeAllocMap) @@ -4642,46 +4862,46 @@ func NkUtfAt(buffer string, length int32, index int32, unicode *Rune, len []int3 runtime.KeepAlive(clengthAllocMap) runtime.KeepAlive(buffer) runtime.KeepAlive(cbufferAllocMap) - __v := packPCharString(__ret) + __v := *(**byte)(unsafe.Pointer(&__ret)) return __v } -// NkFontDefaultGlyphRanges function as declared in nk/nuklear.h:4085 +// NkFontDefaultGlyphRanges function as declared in nk/nuklear.h:4320 func NkFontDefaultGlyphRanges() *Rune { __ret := C.nk_font_default_glyph_ranges() __v := *(**Rune)(unsafe.Pointer(&__ret)) return __v } -// NkFontChineseGlyphRanges function as declared in nk/nuklear.h:4086 +// NkFontChineseGlyphRanges function as declared in nk/nuklear.h:4321 func NkFontChineseGlyphRanges() *Rune { __ret := C.nk_font_chinese_glyph_ranges() __v := *(**Rune)(unsafe.Pointer(&__ret)) return __v } -// NkFontCyrillicGlyphRanges function as declared in nk/nuklear.h:4087 +// NkFontCyrillicGlyphRanges function as declared in nk/nuklear.h:4322 func NkFontCyrillicGlyphRanges() *Rune { __ret := C.nk_font_cyrillic_glyph_ranges() __v := *(**Rune)(unsafe.Pointer(&__ret)) return __v } -// NkFontKoreanGlyphRanges function as declared in nk/nuklear.h:4088 +// NkFontKoreanGlyphRanges function as declared in nk/nuklear.h:4323 func NkFontKoreanGlyphRanges() *Rune { __ret := C.nk_font_korean_glyph_ranges() __v := *(**Rune)(unsafe.Pointer(&__ret)) return __v } -// NkFontAtlasInitDefault function as declared in nk/nuklear.h:4091 +// NkFontAtlasInitDefault function as declared in nk/nuklear.h:4326 func NkFontAtlasInitDefault(arg0 *FontAtlas) { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_font_atlas_init_default(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkFontAtlasInit function as declared in nk/nuklear.h:4093 +// NkFontAtlasInit function as declared in nk/nuklear.h:4328 func NkFontAtlasInit(arg0 *FontAtlas, arg1 *Allocator) { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_allocator)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4690,7 +4910,7 @@ func NkFontAtlasInit(arg0 *FontAtlas, arg1 *Allocator) { runtime.KeepAlive(carg0AllocMap) } -// NkFontAtlasInitCustom function as declared in nk/nuklear.h:4094 +// NkFontAtlasInitCustom function as declared in nk/nuklear.h:4329 func NkFontAtlasInitCustom(arg0 *FontAtlas, persistent *Allocator, transient *Allocator) { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpersistent, cpersistentAllocMap := (*C.struct_nk_allocator)(unsafe.Pointer(persistent)), cgoAllocsUnknown @@ -4701,14 +4921,14 @@ func NkFontAtlasInitCustom(arg0 *FontAtlas, persistent *Allocator, transient *Al runtime.KeepAlive(carg0AllocMap) } -// NkFontAtlasBegin function as declared in nk/nuklear.h:4095 +// NkFontAtlasBegin function as declared in nk/nuklear.h:4330 func NkFontAtlasBegin(arg0 *FontAtlas) { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_font_atlas_begin(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkFontConfig function as declared in nk/nuklear.h:4096 +// NkFontConfig function as declared in nk/nuklear.h:4331 func NkFontConfig(pixelHeight float32) FontConfig { cpixelHeight, cpixelHeightAllocMap := (C.float)(pixelHeight), cgoAllocsUnknown __ret := C.nk_font_config(cpixelHeight) @@ -4717,7 +4937,7 @@ func NkFontConfig(pixelHeight float32) FontConfig { return __v } -// NkFontAtlasAdd function as declared in nk/nuklear.h:4097 +// NkFontAtlasAdd function as declared in nk/nuklear.h:4332 func NkFontAtlasAdd(arg0 *FontAtlas, arg1 *FontConfig) *Font { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_font_config)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4728,7 +4948,7 @@ func NkFontAtlasAdd(arg0 *FontAtlas, arg1 *FontConfig) *Font { return __v } -// NkFontAtlasAddDefault function as declared in nk/nuklear.h:4099 +// NkFontAtlasAddDefault function as declared in nk/nuklear.h:4334 func NkFontAtlasAddDefault(arg0 *FontAtlas, height float32, arg2 *FontConfig) *Font { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown cheight, cheightAllocMap := (C.float)(height), cgoAllocsUnknown @@ -4741,7 +4961,7 @@ func NkFontAtlasAddDefault(arg0 *FontAtlas, height float32, arg2 *FontConfig) *F return __v } -// NkFontAtlasAddFromMemory function as declared in nk/nuklear.h:4101 +// NkFontAtlasAddFromMemory function as declared in nk/nuklear.h:4336 func NkFontAtlasAddFromMemory(atlas *FontAtlas, memory unsafe.Pointer, size Size, height float32, config *FontConfig) *Font { catlas, catlasAllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(atlas)), cgoAllocsUnknown cmemory, cmemoryAllocMap := memory, cgoAllocsUnknown @@ -4758,7 +4978,7 @@ func NkFontAtlasAddFromMemory(atlas *FontAtlas, memory unsafe.Pointer, size Size return __v } -// NkFontAtlasAddFromFile function as declared in nk/nuklear.h:4103 +// NkFontAtlasAddFromFile function as declared in nk/nuklear.h:4338 func NkFontAtlasAddFromFile(atlas *FontAtlas, filePath string, height float32, arg3 *FontConfig) *Font { catlas, catlasAllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(atlas)), cgoAllocsUnknown filePath = safeString(filePath) @@ -4775,13 +4995,13 @@ func NkFontAtlasAddFromFile(atlas *FontAtlas, filePath string, height float32, a return __v } -// NkFontAtlasAddCompressed function as declared in nk/nuklear.h:4105 +// NkFontAtlasAddCompressed function as declared in nk/nuklear.h:4340 func NkFontAtlasAddCompressed(arg0 *FontAtlas, memory unsafe.Pointer, size Size, height float32, arg4 []FontConfig) *Font { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmemory, cmemoryAllocMap := memory, cgoAllocsUnknown csize, csizeAllocMap := (C.nk_size)(size), cgoAllocsUnknown cheight, cheightAllocMap := (C.float)(height), cgoAllocsUnknown - carg4, carg4AllocMap := copyPStructNkFontConfigBytes((*sliceHeader)(unsafe.Pointer(&arg4))) + carg4, carg4AllocMap := (*C.struct_nk_font_config)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&arg4)).Data)), cgoAllocsUnknown __ret := C.nk_font_atlas_add_compressed(carg0, cmemory, csize, cheight, carg4) runtime.KeepAlive(carg4AllocMap) runtime.KeepAlive(cheightAllocMap) @@ -4792,7 +5012,7 @@ func NkFontAtlasAddCompressed(arg0 *FontAtlas, memory unsafe.Pointer, size Size, return __v } -// NkFontAtlasAddCompressedBase85 function as declared in nk/nuklear.h:4106 +// NkFontAtlasAddCompressedBase85 function as declared in nk/nuklear.h:4341 func NkFontAtlasAddCompressedBase85(arg0 *FontAtlas, data string, height float32, config *FontConfig) *Font { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown data = safeString(data) @@ -4809,7 +5029,7 @@ func NkFontAtlasAddCompressedBase85(arg0 *FontAtlas, data string, height float32 return __v } -// NkFontAtlasBake function as declared in nk/nuklear.h:4107 +// NkFontAtlasBake function as declared in nk/nuklear.h:4342 func NkFontAtlasBake(arg0 *FontAtlas, width *int32, height *int32, arg3 C.enum_) unsafe.Pointer { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown cwidth, cwidthAllocMap := (*C.int)(unsafe.Pointer(width)), cgoAllocsUnknown @@ -4824,7 +5044,7 @@ func NkFontAtlasBake(arg0 *FontAtlas, width *int32, height *int32, arg3 C.enum_) return __v } -// NkFontAtlasEnd function as declared in nk/nuklear.h:4108 +// NkFontAtlasEnd function as declared in nk/nuklear.h:4343 func NkFontAtlasEnd(arg0 *FontAtlas, tex Handle, arg2 *DrawNullTexture) { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown ctex, ctexAllocMap := *(*C.nk_handle)(unsafe.Pointer(&tex)), cgoAllocsUnknown @@ -4835,7 +5055,7 @@ func NkFontAtlasEnd(arg0 *FontAtlas, tex Handle, arg2 *DrawNullTexture) { runtime.KeepAlive(carg0AllocMap) } -// NkFontFindGlyph function as declared in nk/nuklear.h:4109 +// NkFontFindGlyph function as declared in nk/nuklear.h:4344 func NkFontFindGlyph(arg0 *Font, unicode Rune) *FontGlyph { carg0, carg0AllocMap := (*C.struct_nk_font)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -4846,28 +5066,28 @@ func NkFontFindGlyph(arg0 *Font, unicode Rune) *FontGlyph { return __v } -// NkFontAtlasCleanup function as declared in nk/nuklear.h:4110 +// NkFontAtlasCleanup function as declared in nk/nuklear.h:4345 func NkFontAtlasCleanup(atlas *FontAtlas) { catlas, catlasAllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(atlas)), cgoAllocsUnknown C.nk_font_atlas_cleanup(catlas) runtime.KeepAlive(catlasAllocMap) } -// NkFontAtlasClear function as declared in nk/nuklear.h:4111 +// NkFontAtlasClear function as declared in nk/nuklear.h:4346 func NkFontAtlasClear(arg0 *FontAtlas) { carg0, carg0AllocMap := (*C.struct_nk_font_atlas)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_font_atlas_clear(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkBufferInitDefault function as declared in nk/nuklear.h:4197 +// NkBufferInitDefault function as declared in nk/nuklear.h:4425 func NkBufferInitDefault(arg0 *Buffer) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_buffer_init_default(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkBufferInit function as declared in nk/nuklear.h:4199 +// NkBufferInit function as declared in nk/nuklear.h:4427 func NkBufferInit(arg0 *Buffer, arg1 *Allocator, size Size) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_allocator)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4878,7 +5098,7 @@ func NkBufferInit(arg0 *Buffer, arg1 *Allocator, size Size) { runtime.KeepAlive(carg0AllocMap) } -// NkBufferInitFixed function as declared in nk/nuklear.h:4200 +// NkBufferInitFixed function as declared in nk/nuklear.h:4428 func NkBufferInitFixed(arg0 *Buffer, memory unsafe.Pointer, size Size) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmemory, cmemoryAllocMap := memory, cgoAllocsUnknown @@ -4889,7 +5109,7 @@ func NkBufferInitFixed(arg0 *Buffer, memory unsafe.Pointer, size Size) { runtime.KeepAlive(carg0AllocMap) } -// NkBufferInfo function as declared in nk/nuklear.h:4201 +// NkBufferInfo function as declared in nk/nuklear.h:4429 func NkBufferInfo(arg0 *MemoryStatus, arg1 *Buffer) { carg0, carg0AllocMap := (*C.struct_nk_memory_status)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4898,7 +5118,7 @@ func NkBufferInfo(arg0 *MemoryStatus, arg1 *Buffer) { runtime.KeepAlive(carg0AllocMap) } -// NkBufferPush function as declared in nk/nuklear.h:4202 +// NkBufferPush function as declared in nk/nuklear.h:4430 func NkBufferPush(arg0 *Buffer, kind C.enum_, memory unsafe.Pointer, size Size, align Size) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown ckind, ckindAllocMap := (C.enum_)(kind), cgoAllocsUnknown @@ -4913,7 +5133,7 @@ func NkBufferPush(arg0 *Buffer, kind C.enum_, memory unsafe.Pointer, size Size, runtime.KeepAlive(carg0AllocMap) } -// NkBufferMark function as declared in nk/nuklear.h:4203 +// NkBufferMark function as declared in nk/nuklear.h:4431 func NkBufferMark(arg0 *Buffer, kind C.enum_) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown ckind, ckindAllocMap := (C.enum_)(kind), cgoAllocsUnknown @@ -4922,7 +5142,7 @@ func NkBufferMark(arg0 *Buffer, kind C.enum_) { runtime.KeepAlive(carg0AllocMap) } -// NkBufferReset function as declared in nk/nuklear.h:4204 +// NkBufferReset function as declared in nk/nuklear.h:4432 func NkBufferReset(arg0 *Buffer, kind C.enum_) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown ckind, ckindAllocMap := (C.enum_)(kind), cgoAllocsUnknown @@ -4931,21 +5151,21 @@ func NkBufferReset(arg0 *Buffer, kind C.enum_) { runtime.KeepAlive(carg0AllocMap) } -// NkBufferClear function as declared in nk/nuklear.h:4205 +// NkBufferClear function as declared in nk/nuklear.h:4433 func NkBufferClear(arg0 *Buffer) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_buffer_clear(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkBufferFree function as declared in nk/nuklear.h:4206 +// NkBufferFree function as declared in nk/nuklear.h:4434 func NkBufferFree(arg0 *Buffer) { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_buffer_free(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkBufferMemory function as declared in nk/nuklear.h:4207 +// NkBufferMemory function as declared in nk/nuklear.h:4435 func NkBufferMemory(arg0 *Buffer) unsafe.Pointer { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_buffer_memory(carg0) @@ -4954,7 +5174,7 @@ func NkBufferMemory(arg0 *Buffer) unsafe.Pointer { return __v } -// NkBufferMemoryConst function as declared in nk/nuklear.h:4208 +// NkBufferMemoryConst function as declared in nk/nuklear.h:4436 func NkBufferMemoryConst(arg0 *Buffer) unsafe.Pointer { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_buffer_memory_const(carg0) @@ -4963,7 +5183,7 @@ func NkBufferMemoryConst(arg0 *Buffer) unsafe.Pointer { return __v } -// NkBufferTotal function as declared in nk/nuklear.h:4209 +// NkBufferTotal function as declared in nk/nuklear.h:4437 func NkBufferTotal(arg0 *Buffer) Size { carg0, carg0AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_buffer_total(carg0) @@ -4972,14 +5192,14 @@ func NkBufferTotal(arg0 *Buffer) Size { return __v } -// NkStrInitDefault function as declared in nk/nuklear.h:4227 +// NkStrInitDefault function as declared in nk/nuklear.h:4455 func NkStrInitDefault(arg0 *Str) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_str_init_default(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStrInit function as declared in nk/nuklear.h:4229 +// NkStrInit function as declared in nk/nuklear.h:4457 func NkStrInit(arg0 *Str, arg1 *Allocator, size Size) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_allocator)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -4990,7 +5210,7 @@ func NkStrInit(arg0 *Str, arg1 *Allocator, size Size) { runtime.KeepAlive(carg0AllocMap) } -// NkStrInitFixed function as declared in nk/nuklear.h:4230 +// NkStrInitFixed function as declared in nk/nuklear.h:4458 func NkStrInitFixed(arg0 *Str, memory unsafe.Pointer, size Size) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmemory, cmemoryAllocMap := memory, cgoAllocsUnknown @@ -5001,21 +5221,21 @@ func NkStrInitFixed(arg0 *Str, memory unsafe.Pointer, size Size) { runtime.KeepAlive(carg0AllocMap) } -// NkStrClear function as declared in nk/nuklear.h:4231 +// NkStrClear function as declared in nk/nuklear.h:4459 func NkStrClear(arg0 *Str) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_str_clear(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStrFree function as declared in nk/nuklear.h:4232 +// NkStrFree function as declared in nk/nuklear.h:4460 func NkStrFree(arg0 *Str) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_str_free(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStrAppendTextChar function as declared in nk/nuklear.h:4234 +// NkStrAppendTextChar function as declared in nk/nuklear.h:4462 func NkStrAppendTextChar(arg0 *Str, arg1 *byte, arg2 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5028,7 +5248,7 @@ func NkStrAppendTextChar(arg0 *Str, arg1 *byte, arg2 int32) int32 { return __v } -// NkStrAppendStrChar function as declared in nk/nuklear.h:4235 +// NkStrAppendStrChar function as declared in nk/nuklear.h:4463 func NkStrAppendStrChar(arg0 *Str, arg1 *byte) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5039,7 +5259,7 @@ func NkStrAppendStrChar(arg0 *Str, arg1 *byte) int32 { return __v } -// NkStrAppendTextUtf8 function as declared in nk/nuklear.h:4236 +// NkStrAppendTextUtf8 function as declared in nk/nuklear.h:4464 func NkStrAppendTextUtf8(arg0 *Str, arg1 *byte, arg2 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5052,7 +5272,7 @@ func NkStrAppendTextUtf8(arg0 *Str, arg1 *byte, arg2 int32) int32 { return __v } -// NkStrAppendStrUtf8 function as declared in nk/nuklear.h:4237 +// NkStrAppendStrUtf8 function as declared in nk/nuklear.h:4465 func NkStrAppendStrUtf8(arg0 *Str, arg1 *byte) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5063,7 +5283,7 @@ func NkStrAppendStrUtf8(arg0 *Str, arg1 *byte) int32 { return __v } -// NkStrAppendTextRunes function as declared in nk/nuklear.h:4238 +// NkStrAppendTextRunes function as declared in nk/nuklear.h:4466 func NkStrAppendTextRunes(arg0 *Str, arg1 *Rune, arg2 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.nk_rune)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5076,7 +5296,7 @@ func NkStrAppendTextRunes(arg0 *Str, arg1 *Rune, arg2 int32) int32 { return __v } -// NkStrAppendStrRunes function as declared in nk/nuklear.h:4239 +// NkStrAppendStrRunes function as declared in nk/nuklear.h:4467 func NkStrAppendStrRunes(arg0 *Str, arg1 *Rune) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.nk_rune)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5087,7 +5307,7 @@ func NkStrAppendStrRunes(arg0 *Str, arg1 *Rune) int32 { return __v } -// NkStrInsertAtChar function as declared in nk/nuklear.h:4241 +// NkStrInsertAtChar function as declared in nk/nuklear.h:4469 func NkStrInsertAtChar(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5102,7 +5322,7 @@ func NkStrInsertAtChar(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { return __v } -// NkStrInsertAtRune function as declared in nk/nuklear.h:4242 +// NkStrInsertAtRune function as declared in nk/nuklear.h:4470 func NkStrInsertAtRune(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5117,7 +5337,7 @@ func NkStrInsertAtRune(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { return __v } -// NkStrInsertTextChar function as declared in nk/nuklear.h:4244 +// NkStrInsertTextChar function as declared in nk/nuklear.h:4472 func NkStrInsertTextChar(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5132,7 +5352,7 @@ func NkStrInsertTextChar(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { return __v } -// NkStrInsertStrChar function as declared in nk/nuklear.h:4245 +// NkStrInsertStrChar function as declared in nk/nuklear.h:4473 func NkStrInsertStrChar(arg0 *Str, pos int32, arg2 *byte) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5145,7 +5365,7 @@ func NkStrInsertStrChar(arg0 *Str, pos int32, arg2 *byte) int32 { return __v } -// NkStrInsertTextUtf8 function as declared in nk/nuklear.h:4246 +// NkStrInsertTextUtf8 function as declared in nk/nuklear.h:4474 func NkStrInsertTextUtf8(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5160,7 +5380,7 @@ func NkStrInsertTextUtf8(arg0 *Str, pos int32, arg2 *byte, arg3 int32) int32 { return __v } -// NkStrInsertStrUtf8 function as declared in nk/nuklear.h:4247 +// NkStrInsertStrUtf8 function as declared in nk/nuklear.h:4475 func NkStrInsertStrUtf8(arg0 *Str, pos int32, arg2 *byte) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5173,7 +5393,7 @@ func NkStrInsertStrUtf8(arg0 *Str, pos int32, arg2 *byte) int32 { return __v } -// NkStrInsertTextRunes function as declared in nk/nuklear.h:4248 +// NkStrInsertTextRunes function as declared in nk/nuklear.h:4476 func NkStrInsertTextRunes(arg0 *Str, pos int32, arg2 *Rune, arg3 int32) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5188,7 +5408,7 @@ func NkStrInsertTextRunes(arg0 *Str, pos int32, arg2 *Rune, arg3 int32) int32 { return __v } -// NkStrInsertStrRunes function as declared in nk/nuklear.h:4249 +// NkStrInsertStrRunes function as declared in nk/nuklear.h:4477 func NkStrInsertStrRunes(arg0 *Str, pos int32, arg2 *Rune) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5201,7 +5421,7 @@ func NkStrInsertStrRunes(arg0 *Str, pos int32, arg2 *Rune) int32 { return __v } -// NkStrRemoveChars function as declared in nk/nuklear.h:4251 +// NkStrRemoveChars function as declared in nk/nuklear.h:4479 func NkStrRemoveChars(arg0 *Str, len int32) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown @@ -5210,7 +5430,7 @@ func NkStrRemoveChars(arg0 *Str, len int32) { runtime.KeepAlive(carg0AllocMap) } -// NkStrRemoveRunes function as declared in nk/nuklear.h:4252 +// NkStrRemoveRunes function as declared in nk/nuklear.h:4480 func NkStrRemoveRunes(str *Str, len int32) { cstr, cstrAllocMap := (*C.struct_nk_str)(unsafe.Pointer(str)), cgoAllocsUnknown clen, clenAllocMap := (C.int)(len), cgoAllocsUnknown @@ -5219,7 +5439,7 @@ func NkStrRemoveRunes(str *Str, len int32) { runtime.KeepAlive(cstrAllocMap) } -// NkStrDeleteChars function as declared in nk/nuklear.h:4253 +// NkStrDeleteChars function as declared in nk/nuklear.h:4481 func NkStrDeleteChars(arg0 *Str, pos int32, len int32) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5230,7 +5450,7 @@ func NkStrDeleteChars(arg0 *Str, pos int32, len int32) { runtime.KeepAlive(carg0AllocMap) } -// NkStrDeleteRunes function as declared in nk/nuklear.h:4254 +// NkStrDeleteRunes function as declared in nk/nuklear.h:4482 func NkStrDeleteRunes(arg0 *Str, pos int32, len int32) { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5241,7 +5461,7 @@ func NkStrDeleteRunes(arg0 *Str, pos int32, len int32) { runtime.KeepAlive(carg0AllocMap) } -// NkStrAtChar function as declared in nk/nuklear.h:4256 +// NkStrAtChar function as declared in nk/nuklear.h:4484 func NkStrAtChar(arg0 *Str, pos int32) *byte { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5252,7 +5472,7 @@ func NkStrAtChar(arg0 *Str, pos int32) *byte { return __v } -// NkStrAtRune function as declared in nk/nuklear.h:4257 +// NkStrAtRune function as declared in nk/nuklear.h:4485 func NkStrAtRune(arg0 *Str, pos int32, unicode *Rune, len *int32) *byte { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5267,7 +5487,7 @@ func NkStrAtRune(arg0 *Str, pos int32, unicode *Rune, len *int32) *byte { return __v } -// NkStrRuneAt function as declared in nk/nuklear.h:4258 +// NkStrRuneAt function as declared in nk/nuklear.h:4486 func NkStrRuneAt(arg0 *Str, pos int32) Rune { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown @@ -5278,19 +5498,19 @@ func NkStrRuneAt(arg0 *Str, pos int32) Rune { return __v } -// NkStrAtCharConst function as declared in nk/nuklear.h:4259 -func NkStrAtCharConst(arg0 *Str, pos int32) string { +// NkStrAtCharConst function as declared in nk/nuklear.h:4487 +func NkStrAtCharConst(arg0 *Str, pos int32) *byte { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown __ret := C.nk_str_at_char_const(carg0, cpos) runtime.KeepAlive(cposAllocMap) runtime.KeepAlive(carg0AllocMap) - __v := packPCharString(__ret) + __v := *(**byte)(unsafe.Pointer(&__ret)) return __v } -// NkStrAtConst function as declared in nk/nuklear.h:4260 -func NkStrAtConst(arg0 *Str, pos int32, unicode *Rune, len *int32) string { +// NkStrAtConst function as declared in nk/nuklear.h:4488 +func NkStrAtConst(arg0 *Str, pos int32, unicode *Rune, len *int32) *byte { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := (C.int)(pos), cgoAllocsUnknown cunicode, cunicodeAllocMap := (*C.nk_rune)(unsafe.Pointer(unicode)), cgoAllocsUnknown @@ -5300,11 +5520,11 @@ func NkStrAtConst(arg0 *Str, pos int32, unicode *Rune, len *int32) string { runtime.KeepAlive(cunicodeAllocMap) runtime.KeepAlive(cposAllocMap) runtime.KeepAlive(carg0AllocMap) - __v := packPCharString(__ret) + __v := *(**byte)(unsafe.Pointer(&__ret)) return __v } -// NkStrGet function as declared in nk/nuklear.h:4262 +// NkStrGet function as declared in nk/nuklear.h:4490 func NkStrGet(arg0 *Str) *byte { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_str_get(carg0) @@ -5313,16 +5533,16 @@ func NkStrGet(arg0 *Str) *byte { return __v } -// NkStrGetConst function as declared in nk/nuklear.h:4263 -func NkStrGetConst(arg0 *Str) string { +// NkStrGetConst function as declared in nk/nuklear.h:4491 +func NkStrGetConst(arg0 *Str) *byte { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_str_get_const(carg0) runtime.KeepAlive(carg0AllocMap) - __v := packPCharString(__ret) + __v := *(**byte)(unsafe.Pointer(&__ret)) return __v } -// NkStrLen function as declared in nk/nuklear.h:4264 +// NkStrLen function as declared in nk/nuklear.h:4492 func NkStrLen(arg0 *Str) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_str_len(carg0) @@ -5331,7 +5551,7 @@ func NkStrLen(arg0 *Str) int32 { return __v } -// NkStrLenChar function as declared in nk/nuklear.h:4265 +// NkStrLenChar function as declared in nk/nuklear.h:4493 func NkStrLenChar(arg0 *Str) int32 { carg0, carg0AllocMap := (*C.struct_nk_str)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_str_len_char(carg0) @@ -5340,7 +5560,7 @@ func NkStrLenChar(arg0 *Str) int32 { return __v } -// NkFilterDefault function as declared in nk/nuklear.h:4359 +// NkFilterDefault function as declared in nk/nuklear.h:4589 func NkFilterDefault(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5351,7 +5571,7 @@ func NkFilterDefault(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkFilterAscii function as declared in nk/nuklear.h:4360 +// NkFilterAscii function as declared in nk/nuklear.h:4590 func NkFilterAscii(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5362,7 +5582,7 @@ func NkFilterAscii(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkFilterFloat function as declared in nk/nuklear.h:4361 +// NkFilterFloat function as declared in nk/nuklear.h:4591 func NkFilterFloat(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5373,7 +5593,7 @@ func NkFilterFloat(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkFilterDecimal function as declared in nk/nuklear.h:4362 +// NkFilterDecimal function as declared in nk/nuklear.h:4592 func NkFilterDecimal(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5384,7 +5604,7 @@ func NkFilterDecimal(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkFilterHex function as declared in nk/nuklear.h:4363 +// NkFilterHex function as declared in nk/nuklear.h:4593 func NkFilterHex(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5395,7 +5615,7 @@ func NkFilterHex(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkFilterOct function as declared in nk/nuklear.h:4364 +// NkFilterOct function as declared in nk/nuklear.h:4594 func NkFilterOct(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5406,7 +5626,7 @@ func NkFilterOct(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkFilterBinary function as declared in nk/nuklear.h:4365 +// NkFilterBinary function as declared in nk/nuklear.h:4595 func NkFilterBinary(arg0 *TextEdit, unicode Rune) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cunicode, cunicodeAllocMap := (C.nk_rune)(unicode), cgoAllocsUnknown @@ -5417,14 +5637,14 @@ func NkFilterBinary(arg0 *TextEdit, unicode Rune) Bool { return __v } -// NkTexteditInitDefault function as declared in nk/nuklear.h:4369 +// NkTexteditInitDefault function as declared in nk/nuklear.h:4599 func NkTexteditInitDefault(arg0 *TextEdit) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_textedit_init_default(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTexteditInit function as declared in nk/nuklear.h:4371 +// NkTexteditInit function as declared in nk/nuklear.h:4601 func NkTexteditInit(arg0 *TextEdit, arg1 *Allocator, size Size) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_allocator)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5435,7 +5655,7 @@ func NkTexteditInit(arg0 *TextEdit, arg1 *Allocator, size Size) { runtime.KeepAlive(carg0AllocMap) } -// NkTexteditInitFixed function as declared in nk/nuklear.h:4372 +// NkTexteditInitFixed function as declared in nk/nuklear.h:4602 func NkTexteditInitFixed(arg0 *TextEdit, memory unsafe.Pointer, size Size) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cmemory, cmemoryAllocMap := memory, cgoAllocsUnknown @@ -5446,14 +5666,14 @@ func NkTexteditInitFixed(arg0 *TextEdit, memory unsafe.Pointer, size Size) { runtime.KeepAlive(carg0AllocMap) } -// NkTexteditFree function as declared in nk/nuklear.h:4373 +// NkTexteditFree function as declared in nk/nuklear.h:4603 func NkTexteditFree(arg0 *TextEdit) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_textedit_free(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTexteditText function as declared in nk/nuklear.h:4374 +// NkTexteditText function as declared in nk/nuklear.h:4604 func NkTexteditText(arg0 *TextEdit, arg1 *byte, totalLen int32) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5464,7 +5684,7 @@ func NkTexteditText(arg0 *TextEdit, arg1 *byte, totalLen int32) { runtime.KeepAlive(carg0AllocMap) } -// NkTexteditDelete function as declared in nk/nuklear.h:4375 +// NkTexteditDelete function as declared in nk/nuklear.h:4605 func NkTexteditDelete(arg0 *TextEdit, where int32, len int32) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown cwhere, cwhereAllocMap := (C.int)(where), cgoAllocsUnknown @@ -5475,21 +5695,21 @@ func NkTexteditDelete(arg0 *TextEdit, where int32, len int32) { runtime.KeepAlive(carg0AllocMap) } -// NkTexteditDeleteSelection function as declared in nk/nuklear.h:4376 +// NkTexteditDeleteSelection function as declared in nk/nuklear.h:4606 func NkTexteditDeleteSelection(arg0 *TextEdit) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_textedit_delete_selection(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTexteditSelectAll function as declared in nk/nuklear.h:4377 +// NkTexteditSelectAll function as declared in nk/nuklear.h:4607 func NkTexteditSelectAll(arg0 *TextEdit) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_textedit_select_all(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTexteditCut function as declared in nk/nuklear.h:4378 +// NkTexteditCut function as declared in nk/nuklear.h:4608 func NkTexteditCut(arg0 *TextEdit) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown __ret := C.nk_textedit_cut(carg0) @@ -5498,7 +5718,7 @@ func NkTexteditCut(arg0 *TextEdit) Bool { return __v } -// NkTexteditPaste function as declared in nk/nuklear.h:4379 +// NkTexteditPaste function as declared in nk/nuklear.h:4609 func NkTexteditPaste(arg0 *TextEdit, arg1 *byte, len int32) Bool { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.char)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -5511,21 +5731,21 @@ func NkTexteditPaste(arg0 *TextEdit, arg1 *byte, len int32) Bool { return __v } -// NkTexteditUndo function as declared in nk/nuklear.h:4380 +// NkTexteditUndo function as declared in nk/nuklear.h:4610 func NkTexteditUndo(arg0 *TextEdit) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_textedit_undo(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkTexteditRedo function as declared in nk/nuklear.h:4381 +// NkTexteditRedo function as declared in nk/nuklear.h:4611 func NkTexteditRedo(arg0 *TextEdit) { carg0, carg0AllocMap := (*C.struct_nk_text_edit)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_textedit_redo(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkStrokeLine function as declared in nk/nuklear.h:4632 +// NkStrokeLine function as declared in nk/nuklear.h:4864 func NkStrokeLine(b *CommandBuffer, x0 float32, y0 float32, x1 float32, y1 float32, lineThickness float32, arg6 Color) { cb, cbAllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(b)), cgoAllocsUnknown cx0, cx0AllocMap := (C.float)(x0), cgoAllocsUnknown @@ -5544,7 +5764,7 @@ func NkStrokeLine(b *CommandBuffer, x0 float32, y0 float32, x1 float32, y1 float runtime.KeepAlive(cbAllocMap) } -// NkStrokeCurve function as declared in nk/nuklear.h:4633 +// NkStrokeCurve function as declared in nk/nuklear.h:4865 func NkStrokeCurve(arg0 *CommandBuffer, arg1 float32, arg2 float32, arg3 float32, arg4 float32, arg5 float32, arg6 float32, arg7 float32, arg8 float32, lineThickness float32, arg10 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.float)(arg1), cgoAllocsUnknown @@ -5571,7 +5791,7 @@ func NkStrokeCurve(arg0 *CommandBuffer, arg1 float32, arg2 float32, arg3 float32 runtime.KeepAlive(carg0AllocMap) } -// NkStrokeRect function as declared in nk/nuklear.h:4634 +// NkStrokeRect function as declared in nk/nuklear.h:4866 func NkStrokeRect(arg0 *CommandBuffer, arg1 Rect, rounding float32, lineThickness float32, arg4 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5586,7 +5806,7 @@ func NkStrokeRect(arg0 *CommandBuffer, arg1 Rect, rounding float32, lineThicknes runtime.KeepAlive(carg0AllocMap) } -// NkStrokeCircle function as declared in nk/nuklear.h:4635 +// NkStrokeCircle function as declared in nk/nuklear.h:4867 func NkStrokeCircle(arg0 *CommandBuffer, arg1 Rect, lineThickness float32, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5599,7 +5819,7 @@ func NkStrokeCircle(arg0 *CommandBuffer, arg1 Rect, lineThickness float32, arg3 runtime.KeepAlive(carg0AllocMap) } -// NkStrokeArc function as declared in nk/nuklear.h:4636 +// NkStrokeArc function as declared in nk/nuklear.h:4868 func NkStrokeArc(arg0 *CommandBuffer, cx float32, cy float32, radius float32, aMin float32, aMax float32, lineThickness float32, arg7 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccx, ccxAllocMap := (C.float)(cx), cgoAllocsUnknown @@ -5620,7 +5840,7 @@ func NkStrokeArc(arg0 *CommandBuffer, cx float32, cy float32, radius float32, aM runtime.KeepAlive(carg0AllocMap) } -// NkStrokeTriangle function as declared in nk/nuklear.h:4637 +// NkStrokeTriangle function as declared in nk/nuklear.h:4869 func NkStrokeTriangle(arg0 *CommandBuffer, arg1 float32, arg2 float32, arg3 float32, arg4 float32, arg5 float32, arg6 float32, lineThichness float32, arg8 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.float)(arg1), cgoAllocsUnknown @@ -5643,10 +5863,10 @@ func NkStrokeTriangle(arg0 *CommandBuffer, arg1 float32, arg2 float32, arg3 floa runtime.KeepAlive(carg0AllocMap) } -// NkStrokePolyline function as declared in nk/nuklear.h:4638 +// NkStrokePolyline function as declared in nk/nuklear.h:4870 func NkStrokePolyline(arg0 *CommandBuffer, points []float32, pointCount int32, lineThickness float32, col Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown - cpoints, cpointsAllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&points))) + cpoints, cpointsAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&points)).Data)), cgoAllocsUnknown cpointCount, cpointCountAllocMap := (C.int)(pointCount), cgoAllocsUnknown clineThickness, clineThicknessAllocMap := (C.float)(lineThickness), cgoAllocsUnknown ccol, ccolAllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&col)), cgoAllocsUnknown @@ -5658,22 +5878,22 @@ func NkStrokePolyline(arg0 *CommandBuffer, points []float32, pointCount int32, l runtime.KeepAlive(carg0AllocMap) } -// NkStrokePolygon function as declared in nk/nuklear.h:4639 -func NkStrokePolygon(arg0 *CommandBuffer, arg1 []float32, pointCount int32, lineThickness float32, arg4 Color) { +// NkStrokePolygon function as declared in nk/nuklear.h:4871 +func NkStrokePolygon(arg0 *CommandBuffer, points []float32, pointCount int32, lineThickness float32, arg4 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&arg1))) + cpoints, cpointsAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&points)).Data)), cgoAllocsUnknown cpointCount, cpointCountAllocMap := (C.int)(pointCount), cgoAllocsUnknown clineThickness, clineThicknessAllocMap := (C.float)(lineThickness), cgoAllocsUnknown carg4, carg4AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg4)), cgoAllocsUnknown - C.nk_stroke_polygon(carg0, carg1, cpointCount, clineThickness, carg4) + C.nk_stroke_polygon(carg0, cpoints, cpointCount, clineThickness, carg4) runtime.KeepAlive(carg4AllocMap) runtime.KeepAlive(clineThicknessAllocMap) runtime.KeepAlive(cpointCountAllocMap) - runtime.KeepAlive(carg1AllocMap) + runtime.KeepAlive(cpointsAllocMap) runtime.KeepAlive(carg0AllocMap) } -// NkFillRect function as declared in nk/nuklear.h:4642 +// NkFillRect function as declared in nk/nuklear.h:4874 func NkFillRect(arg0 *CommandBuffer, arg1 Rect, rounding float32, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5686,7 +5906,7 @@ func NkFillRect(arg0 *CommandBuffer, arg1 Rect, rounding float32, arg3 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkFillRectMultiColor function as declared in nk/nuklear.h:4643 +// NkFillRectMultiColor function as declared in nk/nuklear.h:4875 func NkFillRectMultiColor(arg0 *CommandBuffer, arg1 Rect, left Color, top Color, right Color, bottom Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5703,7 +5923,7 @@ func NkFillRectMultiColor(arg0 *CommandBuffer, arg1 Rect, left Color, top Color, runtime.KeepAlive(carg0AllocMap) } -// NkFillCircle function as declared in nk/nuklear.h:4644 +// NkFillCircle function as declared in nk/nuklear.h:4876 func NkFillCircle(arg0 *CommandBuffer, arg1 Rect, arg2 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5714,7 +5934,7 @@ func NkFillCircle(arg0 *CommandBuffer, arg1 Rect, arg2 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkFillArc function as declared in nk/nuklear.h:4645 +// NkFillArc function as declared in nk/nuklear.h:4877 func NkFillArc(arg0 *CommandBuffer, cx float32, cy float32, radius float32, aMin float32, aMax float32, arg6 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccx, ccxAllocMap := (C.float)(cx), cgoAllocsUnknown @@ -5733,7 +5953,7 @@ func NkFillArc(arg0 *CommandBuffer, cx float32, cy float32, radius float32, aMin runtime.KeepAlive(carg0AllocMap) } -// NkFillTriangle function as declared in nk/nuklear.h:4646 +// NkFillTriangle function as declared in nk/nuklear.h:4878 func NkFillTriangle(arg0 *CommandBuffer, x0 float32, y0 float32, x1 float32, y1 float32, x2 float32, y2 float32, arg7 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown cx0, cx0AllocMap := (C.float)(x0), cgoAllocsUnknown @@ -5754,20 +5974,20 @@ func NkFillTriangle(arg0 *CommandBuffer, x0 float32, y0 float32, x1 float32, y1 runtime.KeepAlive(carg0AllocMap) } -// NkFillPolygon function as declared in nk/nuklear.h:4647 -func NkFillPolygon(arg0 *CommandBuffer, arg1 []float32, pointCount int32, arg3 Color) { +// NkFillPolygon function as declared in nk/nuklear.h:4879 +func NkFillPolygon(arg0 *CommandBuffer, points []float32, pointCount int32, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown - carg1, carg1AllocMap := copyPFloatBytes((*sliceHeader)(unsafe.Pointer(&arg1))) + cpoints, cpointsAllocMap := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&points)).Data)), cgoAllocsUnknown cpointCount, cpointCountAllocMap := (C.int)(pointCount), cgoAllocsUnknown carg3, carg3AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg3)), cgoAllocsUnknown - C.nk_fill_polygon(carg0, carg1, cpointCount, carg3) + C.nk_fill_polygon(carg0, cpoints, cpointCount, carg3) runtime.KeepAlive(carg3AllocMap) runtime.KeepAlive(cpointCountAllocMap) - runtime.KeepAlive(carg1AllocMap) + runtime.KeepAlive(cpointsAllocMap) runtime.KeepAlive(carg0AllocMap) } -// NkDrawImage function as declared in nk/nuklear.h:4650 +// NkDrawImage function as declared in nk/nuklear.h:4882 func NkDrawImage(arg0 *CommandBuffer, arg1 Rect, arg2 *Image, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5780,7 +6000,7 @@ func NkDrawImage(arg0 *CommandBuffer, arg1 Rect, arg2 *Image, arg3 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkDrawNineSlice function as declared in nk/nuklear.h:4651 +// NkDrawNineSlice function as declared in nk/nuklear.h:4883 func NkDrawNineSlice(arg0 *CommandBuffer, arg1 Rect, arg2 *NineSlice, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5793,7 +6013,7 @@ func NkDrawNineSlice(arg0 *CommandBuffer, arg1 Rect, arg2 *NineSlice, arg3 Color runtime.KeepAlive(carg0AllocMap) } -// NkDrawText function as declared in nk/nuklear.h:4652 +// NkDrawText function as declared in nk/nuklear.h:4884 func NkDrawText(arg0 *CommandBuffer, arg1 Rect, text string, len int32, arg4 *UserFont, arg5 Color, arg6 Color) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5814,7 +6034,7 @@ func NkDrawText(arg0 *CommandBuffer, arg1 Rect, text string, len int32, arg4 *Us runtime.KeepAlive(carg0AllocMap) } -// NkPushScissor function as declared in nk/nuklear.h:4653 +// NkPushScissor function as declared in nk/nuklear.h:4885 func NkPushScissor(arg0 *CommandBuffer, arg1 Rect) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5823,7 +6043,7 @@ func NkPushScissor(arg0 *CommandBuffer, arg1 Rect) { runtime.KeepAlive(carg0AllocMap) } -// NkPushCustom function as declared in nk/nuklear.h:4654 +// NkPushCustom function as declared in nk/nuklear.h:4886 func NkPushCustom(arg0 *CommandBuffer, arg1 Rect, arg2 CommandCustomCallback, usr Handle) { carg0, carg0AllocMap := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5836,7 +6056,7 @@ func NkPushCustom(arg0 *CommandBuffer, arg1 Rect, arg2 CommandCustomCallback, us runtime.KeepAlive(carg0AllocMap) } -// NkInputHasMouseClick function as declared in nk/nuklear.h:4695 +// NkInputHasMouseClick function as declared in nk/nuklear.h:4927 func NkInputHasMouseClick(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5847,7 +6067,7 @@ func NkInputHasMouseClick(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkInputHasMouseClickInRect function as declared in nk/nuklear.h:4696 +// NkInputHasMouseClickInRect function as declared in nk/nuklear.h:4928 func NkInputHasMouseClickInRect(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5860,7 +6080,7 @@ func NkInputHasMouseClickInRect(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { return __v } -// NkInputHasMouseClickInButtonRect function as declared in nk/nuklear.h:4697 +// NkInputHasMouseClickInButtonRect function as declared in nk/nuklear.h:4929 func NkInputHasMouseClickInButtonRect(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5873,7 +6093,7 @@ func NkInputHasMouseClickInButtonRect(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool return __v } -// NkInputHasMouseClickDownInRect function as declared in nk/nuklear.h:4698 +// NkInputHasMouseClickDownInRect function as declared in nk/nuklear.h:4930 func NkInputHasMouseClickDownInRect(arg0 *Input, arg1 C.enum_, arg2 Rect, down Bool) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5888,7 +6108,7 @@ func NkInputHasMouseClickDownInRect(arg0 *Input, arg1 C.enum_, arg2 Rect, down B return __v } -// NkInputIsMouseClickInRect function as declared in nk/nuklear.h:4699 +// NkInputIsMouseClickInRect function as declared in nk/nuklear.h:4931 func NkInputIsMouseClickInRect(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5901,7 +6121,7 @@ func NkInputIsMouseClickInRect(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { return __v } -// NkInputIsMouseClickDownInRect function as declared in nk/nuklear.h:4700 +// NkInputIsMouseClickDownInRect function as declared in nk/nuklear.h:4932 func NkInputIsMouseClickDownInRect(i *Input, id C.enum_, b Rect, down Bool) Bool { ci, ciAllocMap := (*C.struct_nk_input)(unsafe.Pointer(i)), cgoAllocsUnknown cid, cidAllocMap := (C.enum_)(id), cgoAllocsUnknown @@ -5916,7 +6136,7 @@ func NkInputIsMouseClickDownInRect(i *Input, id C.enum_, b Rect, down Bool) Bool return __v } -// NkInputAnyMouseClickInRect function as declared in nk/nuklear.h:4701 +// NkInputAnyMouseClickInRect function as declared in nk/nuklear.h:4933 func NkInputAnyMouseClickInRect(arg0 *Input, arg1 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5927,7 +6147,7 @@ func NkInputAnyMouseClickInRect(arg0 *Input, arg1 Rect) Bool { return __v } -// NkInputIsMousePrevHoveringRect function as declared in nk/nuklear.h:4702 +// NkInputIsMousePrevHoveringRect function as declared in nk/nuklear.h:4934 func NkInputIsMousePrevHoveringRect(arg0 *Input, arg1 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5938,7 +6158,7 @@ func NkInputIsMousePrevHoveringRect(arg0 *Input, arg1 Rect) Bool { return __v } -// NkInputIsMouseHoveringRect function as declared in nk/nuklear.h:4703 +// NkInputIsMouseHoveringRect function as declared in nk/nuklear.h:4935 func NkInputIsMouseHoveringRect(arg0 *Input, arg1 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -5949,7 +6169,7 @@ func NkInputIsMouseHoveringRect(arg0 *Input, arg1 Rect) Bool { return __v } -// NkInputMouseClicked function as declared in nk/nuklear.h:4704 +// NkInputMouseClicked function as declared in nk/nuklear.h:4936 func NkInputMouseClicked(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5962,7 +6182,7 @@ func NkInputMouseClicked(arg0 *Input, arg1 C.enum_, arg2 Rect) Bool { return __v } -// NkInputIsMouseDown function as declared in nk/nuklear.h:4705 +// NkInputIsMouseDown function as declared in nk/nuklear.h:4937 func NkInputIsMouseDown(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5973,7 +6193,7 @@ func NkInputIsMouseDown(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkInputIsMousePressed function as declared in nk/nuklear.h:4706 +// NkInputIsMousePressed function as declared in nk/nuklear.h:4938 func NkInputIsMousePressed(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5984,7 +6204,7 @@ func NkInputIsMousePressed(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkInputIsMouseReleased function as declared in nk/nuklear.h:4707 +// NkInputIsMouseReleased function as declared in nk/nuklear.h:4939 func NkInputIsMouseReleased(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -5995,7 +6215,7 @@ func NkInputIsMouseReleased(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkInputIsKeyPressed function as declared in nk/nuklear.h:4708 +// NkInputIsKeyPressed function as declared in nk/nuklear.h:4940 func NkInputIsKeyPressed(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -6006,7 +6226,7 @@ func NkInputIsKeyPressed(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkInputIsKeyReleased function as declared in nk/nuklear.h:4709 +// NkInputIsKeyReleased function as declared in nk/nuklear.h:4941 func NkInputIsKeyReleased(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -6017,7 +6237,7 @@ func NkInputIsKeyReleased(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkInputIsKeyDown function as declared in nk/nuklear.h:4710 +// NkInputIsKeyDown function as declared in nk/nuklear.h:4942 func NkInputIsKeyDown(arg0 *Input, arg1 C.enum_) Bool { carg0, carg0AllocMap := (*C.struct_nk_input)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown @@ -6028,20 +6248,20 @@ func NkInputIsKeyDown(arg0 *Input, arg1 C.enum_) Bool { return __v } -// NkDrawListInit function as declared in nk/nuklear.h:4824 +// NkDrawListInit function as declared in nk/nuklear.h:5053 func NkDrawListInit(arg0 *DrawList) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_draw_list_init(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkDrawListSetup function as declared in nk/nuklear.h:4825 +// NkDrawListSetup function as declared in nk/nuklear.h:5054 func NkDrawListSetup(arg0 *DrawList, arg1 *ConvertConfig, cmds *Buffer, vertices *Buffer, elements []Buffer, lineAa C.enum_, shapeAa C.enum_) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := arg1.PassRef() ccmds, ccmdsAllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(cmds)), cgoAllocsUnknown cvertices, cverticesAllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(vertices)), cgoAllocsUnknown - celements, celementsAllocMap := copyPStructNkBufferBytes((*sliceHeader)(unsafe.Pointer(&elements))) + celements, celementsAllocMap := (*C.struct_nk_buffer)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&elements)).Data)), cgoAllocsUnknown clineAa, clineAaAllocMap := (C.enum_)(lineAa), cgoAllocsUnknown cshapeAa, cshapeAaAllocMap := (C.enum_)(shapeAa), cgoAllocsUnknown C.nk_draw_list_setup(carg0, carg1, ccmds, cvertices, celements, clineAa, cshapeAa) @@ -6054,7 +6274,7 @@ func NkDrawListSetup(arg0 *DrawList, arg1 *ConvertConfig, cmds *Buffer, vertices runtime.KeepAlive(carg0AllocMap) } -// Nk_DrawListBegin function as declared in nk/nuklear.h:4829 +// Nk_DrawListBegin function as declared in nk/nuklear.h:5058 func Nk_DrawListBegin(arg0 *DrawList, arg1 *Buffer) *DrawCommand { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -6065,7 +6285,7 @@ func Nk_DrawListBegin(arg0 *DrawList, arg1 *Buffer) *DrawCommand { return __v } -// Nk_DrawListNext function as declared in nk/nuklear.h:4830 +// Nk_DrawListNext function as declared in nk/nuklear.h:5059 func Nk_DrawListNext(arg0 *DrawCommand, arg1 *Buffer, arg2 *DrawList) *DrawCommand { carg0, carg0AllocMap := (*C.struct_nk_draw_command)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -6078,7 +6298,7 @@ func Nk_DrawListNext(arg0 *DrawCommand, arg1 *Buffer, arg2 *DrawList) *DrawComma return __v } -// Nk_DrawListEnd function as declared in nk/nuklear.h:4831 +// Nk_DrawListEnd function as declared in nk/nuklear.h:5060 func Nk_DrawListEnd(arg0 *DrawList, arg1 *Buffer) *DrawCommand { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := (*C.struct_nk_buffer)(unsafe.Pointer(arg1)), cgoAllocsUnknown @@ -6089,14 +6309,14 @@ func Nk_DrawListEnd(arg0 *DrawList, arg1 *Buffer) *DrawCommand { return __v } -// NkDrawListPathClear function as declared in nk/nuklear.h:4834 +// NkDrawListPathClear function as declared in nk/nuklear.h:5063 func NkDrawListPathClear(arg0 *DrawList) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown C.nk_draw_list_path_clear(carg0) runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathLineTo function as declared in nk/nuklear.h:4835 +// NkDrawListPathLineTo function as declared in nk/nuklear.h:5064 func NkDrawListPathLineTo(arg0 *DrawList, pos Vec2) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpos, cposAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&pos)), cgoAllocsUnknown @@ -6105,7 +6325,7 @@ func NkDrawListPathLineTo(arg0 *DrawList, pos Vec2) { runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathArcToFast function as declared in nk/nuklear.h:4836 +// NkDrawListPathArcToFast function as declared in nk/nuklear.h:5065 func NkDrawListPathArcToFast(arg0 *DrawList, center Vec2, radius float32, aMin int32, aMax int32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccenter, ccenterAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(¢er)), cgoAllocsUnknown @@ -6120,7 +6340,7 @@ func NkDrawListPathArcToFast(arg0 *DrawList, center Vec2, radius float32, aMin i runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathArcTo function as declared in nk/nuklear.h:4837 +// NkDrawListPathArcTo function as declared in nk/nuklear.h:5066 func NkDrawListPathArcTo(arg0 *DrawList, center Vec2, radius float32, aMin float32, aMax float32, segments uint32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccenter, ccenterAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(¢er)), cgoAllocsUnknown @@ -6137,7 +6357,7 @@ func NkDrawListPathArcTo(arg0 *DrawList, center Vec2, radius float32, aMin float runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathRectTo function as declared in nk/nuklear.h:4838 +// NkDrawListPathRectTo function as declared in nk/nuklear.h:5067 func NkDrawListPathRectTo(arg0 *DrawList, a Vec2, b Vec2, rounding float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ca, caAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&a)), cgoAllocsUnknown @@ -6150,7 +6370,7 @@ func NkDrawListPathRectTo(arg0 *DrawList, a Vec2, b Vec2, rounding float32) { runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathCurveTo function as declared in nk/nuklear.h:4839 +// NkDrawListPathCurveTo function as declared in nk/nuklear.h:5068 func NkDrawListPathCurveTo(arg0 *DrawList, p2 Vec2, p3 Vec2, p4 Vec2, numSegments uint32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown cp2, cp2AllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&p2)), cgoAllocsUnknown @@ -6165,7 +6385,7 @@ func NkDrawListPathCurveTo(arg0 *DrawList, p2 Vec2, p3 Vec2, p4 Vec2, numSegment runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathFill function as declared in nk/nuklear.h:4840 +// NkDrawListPathFill function as declared in nk/nuklear.h:5069 func NkDrawListPathFill(arg0 *DrawList, arg1 Color) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -6174,7 +6394,7 @@ func NkDrawListPathFill(arg0 *DrawList, arg1 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkDrawListPathStroke function as declared in nk/nuklear.h:4841 +// NkDrawListPathStroke function as declared in nk/nuklear.h:5070 func NkDrawListPathStroke(arg0 *DrawList, arg1 Color, closed C.enum_, thickness float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg1)), cgoAllocsUnknown @@ -6187,7 +6407,7 @@ func NkDrawListPathStroke(arg0 *DrawList, arg1 Color, closed C.enum_, thickness runtime.KeepAlive(carg0AllocMap) } -// NkDrawListStrokeLine function as declared in nk/nuklear.h:4844 +// NkDrawListStrokeLine function as declared in nk/nuklear.h:5073 func NkDrawListStrokeLine(arg0 *DrawList, a Vec2, b Vec2, arg3 Color, thickness float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ca, caAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&a)), cgoAllocsUnknown @@ -6202,7 +6422,7 @@ func NkDrawListStrokeLine(arg0 *DrawList, a Vec2, b Vec2, arg3 Color, thickness runtime.KeepAlive(carg0AllocMap) } -// NkDrawListStrokeRect function as declared in nk/nuklear.h:4845 +// NkDrawListStrokeRect function as declared in nk/nuklear.h:5074 func NkDrawListStrokeRect(arg0 *DrawList, rect Rect, arg2 Color, rounding float32, thickness float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown crect, crectAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&rect)), cgoAllocsUnknown @@ -6217,7 +6437,7 @@ func NkDrawListStrokeRect(arg0 *DrawList, rect Rect, arg2 Color, rounding float3 runtime.KeepAlive(carg0AllocMap) } -// NkDrawListStrokeTriangle function as declared in nk/nuklear.h:4846 +// NkDrawListStrokeTriangle function as declared in nk/nuklear.h:5075 func NkDrawListStrokeTriangle(arg0 *DrawList, a Vec2, b Vec2, c Vec2, arg4 Color, thickness float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ca, caAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&a)), cgoAllocsUnknown @@ -6234,7 +6454,7 @@ func NkDrawListStrokeTriangle(arg0 *DrawList, a Vec2, b Vec2, c Vec2, arg4 Color runtime.KeepAlive(carg0AllocMap) } -// NkDrawListStrokeCircle function as declared in nk/nuklear.h:4847 +// NkDrawListStrokeCircle function as declared in nk/nuklear.h:5076 func NkDrawListStrokeCircle(arg0 *DrawList, center Vec2, radius float32, arg3 Color, segs uint32, thickness float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccenter, ccenterAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(¢er)), cgoAllocsUnknown @@ -6251,7 +6471,7 @@ func NkDrawListStrokeCircle(arg0 *DrawList, center Vec2, radius float32, arg3 Co runtime.KeepAlive(carg0AllocMap) } -// NkDrawListStrokeCurve function as declared in nk/nuklear.h:4848 +// NkDrawListStrokeCurve function as declared in nk/nuklear.h:5077 func NkDrawListStrokeCurve(arg0 *DrawList, p0 Vec2, cp0 Vec2, cp1 Vec2, p1 Vec2, arg5 Color, segments uint32, thickness float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccp0, ccp0AllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&p0)), cgoAllocsUnknown @@ -6272,7 +6492,7 @@ func NkDrawListStrokeCurve(arg0 *DrawList, p0 Vec2, cp0 Vec2, cp1 Vec2, p1 Vec2, runtime.KeepAlive(carg0AllocMap) } -// NkDrawListStrokePolyLine function as declared in nk/nuklear.h:4849 +// NkDrawListStrokePolyLine function as declared in nk/nuklear.h:5078 func NkDrawListStrokePolyLine(arg0 *DrawList, pnts *Vec2, cnt uint32, arg3 Color, arg4 C.enum_, thickness float32, arg6 C.enum_) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpnts, cpntsAllocMap := (*C.struct_nk_vec2)(unsafe.Pointer(pnts)), cgoAllocsUnknown @@ -6291,7 +6511,7 @@ func NkDrawListStrokePolyLine(arg0 *DrawList, pnts *Vec2, cnt uint32, arg3 Color runtime.KeepAlive(carg0AllocMap) } -// NkDrawListFillRect function as declared in nk/nuklear.h:4852 +// NkDrawListFillRect function as declared in nk/nuklear.h:5081 func NkDrawListFillRect(arg0 *DrawList, rect Rect, arg2 Color, rounding float32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown crect, crectAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&rect)), cgoAllocsUnknown @@ -6304,7 +6524,7 @@ func NkDrawListFillRect(arg0 *DrawList, rect Rect, arg2 Color, rounding float32) runtime.KeepAlive(carg0AllocMap) } -// NkDrawListFillRectMultiColor function as declared in nk/nuklear.h:4853 +// NkDrawListFillRectMultiColor function as declared in nk/nuklear.h:5082 func NkDrawListFillRectMultiColor(arg0 *DrawList, rect Rect, left Color, top Color, right Color, bottom Color) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown crect, crectAllocMap := *(*C.struct_nk_rect)(unsafe.Pointer(&rect)), cgoAllocsUnknown @@ -6321,7 +6541,7 @@ func NkDrawListFillRectMultiColor(arg0 *DrawList, rect Rect, left Color, top Col runtime.KeepAlive(carg0AllocMap) } -// NkDrawListFillTriangle function as declared in nk/nuklear.h:4854 +// NkDrawListFillTriangle function as declared in nk/nuklear.h:5083 func NkDrawListFillTriangle(arg0 *DrawList, a Vec2, b Vec2, c Vec2, arg4 Color) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ca, caAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(&a)), cgoAllocsUnknown @@ -6336,7 +6556,7 @@ func NkDrawListFillTriangle(arg0 *DrawList, a Vec2, b Vec2, c Vec2, arg4 Color) runtime.KeepAlive(carg0AllocMap) } -// NkDrawListFillCircle function as declared in nk/nuklear.h:4855 +// NkDrawListFillCircle function as declared in nk/nuklear.h:5084 func NkDrawListFillCircle(arg0 *DrawList, center Vec2, radius float32, col Color, segs uint32) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ccenter, ccenterAllocMap := *(*C.struct_nk_vec2)(unsafe.Pointer(¢er)), cgoAllocsUnknown @@ -6351,7 +6571,7 @@ func NkDrawListFillCircle(arg0 *DrawList, center Vec2, radius float32, col Color runtime.KeepAlive(carg0AllocMap) } -// NkDrawListFillPolyConvex function as declared in nk/nuklear.h:4856 +// NkDrawListFillPolyConvex function as declared in nk/nuklear.h:5085 func NkDrawListFillPolyConvex(arg0 *DrawList, points *Vec2, count uint32, arg3 Color, arg4 C.enum_) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown cpoints, cpointsAllocMap := (*C.struct_nk_vec2)(unsafe.Pointer(points)), cgoAllocsUnknown @@ -6366,7 +6586,7 @@ func NkDrawListFillPolyConvex(arg0 *DrawList, points *Vec2, count uint32, arg3 C runtime.KeepAlive(carg0AllocMap) } -// NkDrawListAddImage function as declared in nk/nuklear.h:4859 +// NkDrawListAddImage function as declared in nk/nuklear.h:5088 func NkDrawListAddImage(arg0 *DrawList, texture Image, rect Rect, arg3 Color) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown ctexture, ctextureAllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&texture)), cgoAllocsUnknown @@ -6379,7 +6599,7 @@ func NkDrawListAddImage(arg0 *DrawList, texture Image, rect Rect, arg3 Color) { runtime.KeepAlive(carg0AllocMap) } -// NkDrawListAddText function as declared in nk/nuklear.h:4860 +// NkDrawListAddText function as declared in nk/nuklear.h:5089 func NkDrawListAddText(arg0 *DrawList, arg1 *UserFont, arg2 Rect, text string, len int32, fontHeight float32, arg6 Color) { carg0, carg0AllocMap := (*C.struct_nk_draw_list)(unsafe.Pointer(arg0)), cgoAllocsUnknown carg1, carg1AllocMap := arg1.PassRef() @@ -6400,7 +6620,7 @@ func NkDrawListAddText(arg0 *DrawList, arg1 *UserFont, arg2 Rect, text string, l runtime.KeepAlive(carg0AllocMap) } -// NkStyleItemColor function as declared in nk/nuklear.h:5307 +// NkStyleItemColor function as declared in nk/nuklear.h:5596 func NkStyleItemColor(arg0 Color) StyleItem { carg0, carg0AllocMap := *(*C.struct_nk_color)(unsafe.Pointer(&arg0)), cgoAllocsUnknown __ret := C.nk_style_item_color(carg0) @@ -6409,7 +6629,7 @@ func NkStyleItemColor(arg0 Color) StyleItem { return __v } -// NkStyleItemImage function as declared in nk/nuklear.h:5308 +// NkStyleItemImage function as declared in nk/nuklear.h:5597 func NkStyleItemImage(img Image) StyleItem { cimg, cimgAllocMap := *(*C.struct_nk_image)(unsafe.Pointer(&img)), cgoAllocsUnknown __ret := C.nk_style_item_image(cimg) @@ -6418,7 +6638,7 @@ func NkStyleItemImage(img Image) StyleItem { return __v } -// NkStyleItemNineSlice function as declared in nk/nuklear.h:5309 +// NkStyleItemNineSlice function as declared in nk/nuklear.h:5598 func NkStyleItemNineSlice(slice NineSlice) StyleItem { cslice, csliceAllocMap := *(*C.struct_nk_nine_slice)(unsafe.Pointer(&slice)), cgoAllocsUnknown __ret := C.nk_style_item_nine_slice(cslice) @@ -6427,7 +6647,7 @@ func NkStyleItemNineSlice(slice NineSlice) StyleItem { return __v } -// NkStyleItemHide function as declared in nk/nuklear.h:5310 +// NkStyleItemHide function as declared in nk/nuklear.h:5599 func NkStyleItemHide() StyleItem { __ret := C.nk_style_item_hide() __v := *(*StyleItem)(unsafe.Pointer(&__ret)) diff --git a/nk/nuklear.h b/nk/nuklear.h index 89e0eb4..71b55a2 100644 --- a/nk/nuklear.h +++ b/nk/nuklear.h @@ -1,225 +1,231 @@ /* -/// # Nuklear -/// ![](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif) -/// -/// ## Contents -/// 1. About section -/// 2. Highlights section -/// 3. Features section -/// 4. Usage section -/// 1. Flags section -/// 2. Constants section -/// 3. Dependencies section -/// 5. Example section -/// 6. API section -/// 1. Context section -/// 2. Input section -/// 3. Drawing section -/// 4. Window section -/// 5. Layouting section -/// 6. Groups section -/// 7. Tree section -/// 8. Properties section -/// 7. License section -/// 8. Changelog section -/// 9. Gallery section -/// 10. Credits section -/// -/// ## About -/// This is a minimal state immediate mode graphical user interface toolkit -/// written in ANSI C and licensed under public domain. It was designed as a simple -/// embeddable user interface for application and does not have any dependencies, -/// a default renderbackend or OS window and input handling but instead provides a very modular -/// library approach by using simple input state for input and draw -/// commands describing primitive shapes as output. So instead of providing a -/// layered library that tries to abstract over a number of platform and -/// render backends it only focuses on the actual UI. -/// -/// ## Highlights -/// - Graphical user interface toolkit -/// - Single header library -/// - Written in C89 (a.k.a. ANSI C or ISO C90) -/// - Small codebase (~18kLOC) -/// - Focus on portability, efficiency and simplicity -/// - No dependencies (not even the standard library if not wanted) -/// - Fully skinnable and customizable -/// - Low memory footprint with total memory control if needed or wanted -/// - UTF-8 support -/// - No global or hidden state -/// - Customizable library modules (you can compile and use only what you need) -/// - Optional font baker and vertex buffer output -/// - [Code available on github](https://github.com/Immediate-Mode-UI/Nuklear/) -/// -/// ## Features -/// - Absolutely no platform dependent code -/// - Memory management control ranging from/to -/// - Ease of use by allocating everything from standard library -/// - Control every byte of memory inside the library -/// - Font handling control ranging from/to -/// - Use your own font implementation for everything -/// - Use this libraries internal font baking and handling API -/// - Drawing output control ranging from/to -/// - Simple shapes for more high level APIs which already have drawing capabilities -/// - Hardware accessible anti-aliased vertex buffer output -/// - Customizable colors and properties ranging from/to -/// - Simple changes to color by filling a simple color table -/// - Complete control with ability to use skinning to decorate widgets -/// - Bendable UI library with widget ranging from/to -/// - Basic widgets like buttons, checkboxes, slider, ... -/// - Advanced widget like abstract comboboxes, contextual menus,... -/// - Compile time configuration to only compile what you need -/// - Subset which can be used if you do not want to link or use the standard library -/// - Can be easily modified to only update on user input instead of frame updates -/// -/// ## Usage -/// This library is self contained in one single header file and can be used either -/// in header only mode or in implementation mode. The header only mode is used -/// by default when included and allows including this header in other headers -/// and does not contain the actual implementation.

-/// -/// The implementation mode requires to define the preprocessor macro -/// NK_IMPLEMENTATION in *one* .c/.cpp file before #including this file, e.g.: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~C -/// #define NK_IMPLEMENTATION -/// #include "nuklear.h" -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Also optionally define the symbols listed in the section "OPTIONAL DEFINES" -/// below in header and implementation mode if you want to use additional functionality -/// or need more control over the library. -/// -/// !!! WARNING -/// Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions. -/// -/// ### Flags -/// Flag | Description -/// --------------------------------|------------------------------------------ -/// NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation -/// NK_INCLUDE_FIXED_TYPES | If defined it will include header `` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself. -/// NK_INCLUDE_DEFAULT_ALLOCATOR | If defined it will include header `` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management. -/// NK_INCLUDE_STANDARD_IO | If defined it will include header `` and provide additional functions depending on file loading. -/// NK_INCLUDE_STANDARD_VARARGS | If defined it will include header and provide additional functions depending on file loading. -/// NK_INCLUDE_STANDARD_BOOL | If defined it will include header `` for nk_bool otherwise nuklear defines nk_bool as int. -/// NK_INCLUDE_VERTEX_BUFFER_OUTPUT | Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,... -/// NK_INCLUDE_FONT_BAKING | Defining this adds `stb_truetype` and `stb_rect_pack` implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it. -/// NK_INCLUDE_DEFAULT_FONT | Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font -/// NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures. -/// NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released. -/// NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame. -/// NK_UINT_DRAW_INDEX | Defining this will set the size of vertex index elements when using NK_VERTEX_BUFFER_OUTPUT to 32bit instead of the default of 16bit -/// NK_KEYSTATE_BASED_INPUT | Define this if your backend uses key state for each frame rather than key press/release events -/// -/// !!! WARNING -/// The following flags will pull in the standard C library: -/// - NK_INCLUDE_DEFAULT_ALLOCATOR -/// - NK_INCLUDE_STANDARD_IO -/// - NK_INCLUDE_STANDARD_VARARGS -/// -/// !!! WARNING -/// The following flags if defined need to be defined for both header and implementation: -/// - NK_INCLUDE_FIXED_TYPES -/// - NK_INCLUDE_DEFAULT_ALLOCATOR -/// - NK_INCLUDE_STANDARD_VARARGS -/// - NK_INCLUDE_STANDARD_BOOL -/// - NK_INCLUDE_VERTEX_BUFFER_OUTPUT -/// - NK_INCLUDE_FONT_BAKING -/// - NK_INCLUDE_DEFAULT_FONT -/// - NK_INCLUDE_STANDARD_VARARGS -/// - NK_INCLUDE_COMMAND_USERDATA -/// - NK_UINT_DRAW_INDEX -/// -/// ### Constants -/// Define | Description -/// --------------------------------|--------------------------------------- -/// NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it. -/// NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient. -/// NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient. -/// -/// !!! WARNING -/// The following constants if defined need to be defined for both header and implementation: -/// - NK_MAX_NUMBER_BUFFER -/// - NK_BUFFER_DEFAULT_INITIAL_SIZE -/// - NK_INPUT_MAX -/// -/// ### Dependencies -/// Function | Description -/// ------------|--------------------------------------------------------------- -/// NK_ASSERT | If you don't define this, nuklear will use with assert(). -/// NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version. -/// NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version. -/// NK_INV_SQRT | You can define this to your own inverse sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version. -/// NK_SIN | You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation. -/// NK_COS | You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation. -/// NK_STRTOD | You can define this to `strtod` or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!). -/// NK_DTOA | You can define this to `dtoa` or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!). -/// NK_VSNPRINTF| If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO` and want to be safe define this to `vsnprintf` on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if `vsnprintf` is available it will define it to `vsnprintf` directly. If not defined and if you have older versions of C or C++ it will be defined to `vsprintf` which is unsafe. -/// -/// !!! WARNING -/// The following dependencies will pull in the standard C library if not redefined: -/// - NK_ASSERT -/// -/// !!! WARNING -/// The following dependencies if defined need to be defined for both header and implementation: -/// - NK_ASSERT -/// -/// !!! WARNING -/// The following dependencies if defined need to be defined only for the implementation part: -/// - NK_MEMSET -/// - NK_MEMCPY -/// - NK_SQRT -/// - NK_SIN -/// - NK_COS -/// - NK_STRTOD -/// - NK_DTOA -/// - NK_VSNPRINTF -/// -/// ## Example -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// // init gui state -/// enum {EASY, HARD}; -/// static int op = EASY; -/// static float value = 0.6f; -/// static int i = 20; -/// struct nk_context ctx; -/// -/// nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font); -/// if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220), -/// NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) { -/// // fixed widget pixel width -/// nk_layout_row_static(&ctx, 30, 80, 1); -/// if (nk_button_label(&ctx, "button")) { -/// // event handling -/// } -/// -/// // fixed widget window ratio width -/// nk_layout_row_dynamic(&ctx, 30, 2); -/// if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY; -/// if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD; -/// -/// // custom widget pixel width -/// nk_layout_row_begin(&ctx, NK_STATIC, 30, 2); -/// { -/// nk_layout_row_push(&ctx, 50); -/// nk_label(&ctx, "Volume:", NK_TEXT_LEFT); -/// nk_layout_row_push(&ctx, 110); -/// nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f); -/// } -/// nk_layout_row_end(&ctx); -/// } -/// nk_end(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// ![](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png) -/// -/// ## API -/// +# Nuklear +![](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif) + +## Contents +1. About section +2. Highlights section +3. Features section +4. Usage section + 1. Flags section + 2. Constants section + 3. Dependencies section +5. Example section +6. API section + 1. Context section + 2. Input section + 3. Drawing section + 4. Window section + 5. Layouting section + 6. Groups section + 7. Tree section + 8. Properties section +7. License section +8. Changelog section +9. Gallery section +10. Credits section + +## About +This is a minimal state immediate mode graphical user interface toolkit +written in ANSI C and licensed under public domain. It was designed as a simple +embeddable user interface for application and does not have any dependencies, +a default renderbackend or OS window and input handling but instead provides a very modular +library approach by using simple input state for input and draw +commands describing primitive shapes as output. So instead of providing a +layered library that tries to abstract over a number of platform and +render backends it only focuses on the actual UI. + +## Highlights +- Graphical user interface toolkit +- Single header library +- Written in C89 (a.k.a. ANSI C or ISO C90) +- Small codebase (~18kLOC) +- Focus on portability, efficiency and simplicity +- No dependencies (not even the standard library if not wanted) +- Fully skinnable and customizable +- Low memory footprint with total memory control if needed or wanted +- UTF-8 support +- No global or hidden state +- Customizable library modules (you can compile and use only what you need) +- Optional font baker and vertex buffer output +- [Code available on github](https://github.com/Immediate-Mode-UI/Nuklear/) + +## Features +- Absolutely no platform dependent code +- Memory management control ranging from/to + - Ease of use by allocating everything from standard library + - Control every byte of memory inside the library +- Font handling control ranging from/to + - Use your own font implementation for everything + - Use this libraries internal font baking and handling API +- Drawing output control ranging from/to + - Simple shapes for more high level APIs which already have drawing capabilities + - Hardware accessible anti-aliased vertex buffer output +- Customizable colors and properties ranging from/to + - Simple changes to color by filling a simple color table + - Complete control with ability to use skinning to decorate widgets +- Bendable UI library with widget ranging from/to + - Basic widgets like buttons, checkboxes, slider, ... + - Advanced widget like abstract comboboxes, contextual menus,... +- Compile time configuration to only compile what you need + - Subset which can be used if you do not want to link or use the standard library +- Can be easily modified to only update on user input instead of frame updates + +## Usage +This library is self contained in one single header file and can be used either +in header only mode or in implementation mode. The header only mode is used +by default when included and allows including this header in other headers +and does not contain the actual implementation.

+ +The implementation mode requires to define the preprocessor macro +NK_IMPLEMENTATION in *one* .c/.cpp file before #including this file, e.g.: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~C + #define NK_IMPLEMENTATION + #include "nuklear.h" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Also optionally define the symbols listed in the section "OPTIONAL DEFINES" +below in header and implementation mode if you want to use additional functionality +or need more control over the library. + +!!! WARNING + Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions. + +### Flags +Flag | Description +--------------------------------|------------------------------------------ +NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation +NK_INCLUDE_FIXED_TYPES | If defined it will include header `` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself. +NK_INCLUDE_DEFAULT_ALLOCATOR | If defined it will include header `` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management. +NK_INCLUDE_STANDARD_IO | If defined it will include header `` and provide additional functions depending on file loading. +NK_INCLUDE_STANDARD_VARARGS | If defined it will include header and provide additional functions depending on file loading. +NK_INCLUDE_STANDARD_BOOL | If defined it will include header `` for nk_bool otherwise nuklear defines nk_bool as int. +NK_INCLUDE_VERTEX_BUFFER_OUTPUT | Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,... +NK_INCLUDE_FONT_BAKING | Defining this adds `stb_truetype` and `stb_rect_pack` implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it. +NK_INCLUDE_DEFAULT_FONT | Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font +NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures. +NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released. +NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame. +NK_UINT_DRAW_INDEX | Defining this will set the size of vertex index elements when using NK_VERTEX_BUFFER_OUTPUT to 32bit instead of the default of 16bit +NK_KEYSTATE_BASED_INPUT | Define this if your backend uses key state for each frame rather than key press/release events +NK_IS_WORD_BOUNDARY(c) | Define this to a function macro that takes a single nk_rune (nk_uint) and returns true if it's a word separator. If not defined, uses the default definition (see nk_is_word_boundary()) + +!!! WARNING + The following flags will pull in the standard C library: + - NK_INCLUDE_DEFAULT_ALLOCATOR + - NK_INCLUDE_STANDARD_IO + - NK_INCLUDE_STANDARD_VARARGS + +!!! WARNING + The following flags if defined need to be defined for both header and implementation: + - NK_INCLUDE_FIXED_TYPES + - NK_INCLUDE_DEFAULT_ALLOCATOR + - NK_INCLUDE_STANDARD_VARARGS + - NK_INCLUDE_STANDARD_BOOL + - NK_INCLUDE_VERTEX_BUFFER_OUTPUT + - NK_INCLUDE_FONT_BAKING + - NK_INCLUDE_DEFAULT_FONT + - NK_INCLUDE_STANDARD_VARARGS + - NK_INCLUDE_COMMAND_USERDATA + - NK_UINT_DRAW_INDEX + +### Constants +Define | Description +--------------------------------|--------------------------------------- +NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it. +NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient. +NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient. + +!!! WARNING + The following constants if defined need to be defined for both header and implementation: + - NK_MAX_NUMBER_BUFFER + - NK_BUFFER_DEFAULT_INITIAL_SIZE + - NK_INPUT_MAX + +### Dependencies +Function | Description +------------|--------------------------------------------------------------- +NK_ASSERT | If you don't define this, nuklear will use with assert(). +NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version. +NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version. +NK_INV_SQRT | You can define this to your own inverse sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version. +NK_SIN | You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation. +NK_COS | You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation. +NK_STRTOD | You can define this to `strtod` or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!). +NK_DTOA | You can define this to `dtoa` or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!). +NK_VSNPRINTF| If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO` and want to be safe define this to `vsnprintf` on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if `vsnprintf` is available it will define it to `vsnprintf` directly. If not defined and if you have older versions of C or C++ it will be defined to `vsprintf` which is unsafe. + +!!! WARNING + The following dependencies will pull in the standard C library if not redefined: + - NK_ASSERT + +!!! WARNING + The following dependencies if defined need to be defined for both header and implementation: + - NK_ASSERT + +!!! WARNING + The following dependencies if defined need to be defined only for the implementation part: + - NK_MEMSET + - NK_MEMCPY + - NK_SQRT + - NK_SIN + - NK_COS + - NK_STRTOD + - NK_DTOA + - NK_VSNPRINTF + +## Example + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c +// init gui state +enum {EASY, HARD}; +static int op = EASY; +static float value = 0.6f; +static int i = 20; +struct nk_context ctx; + +nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font); +if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220), + NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) { + // fixed widget pixel width + nk_layout_row_static(&ctx, 30, 80, 1); + if (nk_button_label(&ctx, "button")) { + // event handling + } + + // fixed widget window ratio width + nk_layout_row_dynamic(&ctx, 30, 2); + if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY; + if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD; + + // custom widget pixel width + nk_layout_row_begin(&ctx, NK_STATIC, 30, 2); + { + nk_layout_row_push(&ctx, 50); + nk_label(&ctx, "Volume:", NK_TEXT_LEFT); + nk_layout_row_push(&ctx, 110); + nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f); + } + nk_layout_row_end(&ctx); +} +nk_end(&ctx); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +![](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png) + +## API + */ #ifndef NK_SINGLE_FILE #define NK_SINGLE_FILE #endif +/** \file nuklear.h + * \brief main API and documentation file + * + * \details + */ #ifndef NK_NUKLEAR_H_ #define NK_NUKLEAR_H_ @@ -233,9 +239,10 @@ extern "C" { * * =============================================================== */ + #define NK_UNDEFINED (-1.0f) -#define NK_UTF_INVALID 0xFFFD /* internal invalid utf8 rune */ -#define NK_UTF_SIZE 4 /* describes the number of bytes a glyph consists of*/ +#define NK_UTF_INVALID 0xFFFD /**< internal invalid utf8 rune */ +#define NK_UTF_SIZE 4 /**< describes the number of bytes a glyph consists of*/ #ifndef NK_INPUT_MAX #define NK_INPUT_MAX 16 #endif @@ -252,6 +259,7 @@ extern "C" { * * =============================================================== */ + #ifndef NK_API #ifdef NK_PRIVATE #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L)) @@ -330,7 +338,7 @@ extern "C" { * * =============================================================== */ -#ifdef NK_INCLUDE_FIXED_TYPES + #ifdef NK_INCLUDE_FIXED_TYPES #include #define NK_INT8 int8_t #define NK_UINT8 uint8_t @@ -373,7 +381,7 @@ extern "C" { #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) #define NK_SIZE_TYPE unsigned __int32 #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__) + #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) #define NK_SIZE_TYPE unsigned long #else #define NK_SIZE_TYPE unsigned int @@ -388,7 +396,7 @@ extern "C" { #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) #define NK_POINTER_TYPE unsigned __int32 #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__) + #if defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__aarch64__) #define NK_POINTER_TYPE unsigned long #else #define NK_POINTER_TYPE unsigned int @@ -404,7 +412,7 @@ extern "C" { #include #define NK_BOOL bool #else - #define NK_BOOL int /* could be char, use int for drop-in replacement backwards compatibility */ + #define NK_BOOL int /**< could be char, use int for drop-in replacement backwards compatibility */ #endif #endif @@ -524,6 +532,10 @@ enum nk_symbol_type { NK_SYMBOL_TRIANGLE_RIGHT, NK_SYMBOL_PLUS, NK_SYMBOL_MINUS, + NK_SYMBOL_TRIANGLE_UP_OUTLINE, + NK_SYMBOL_TRIANGLE_DOWN_OUTLINE, + NK_SYMBOL_TRIANGLE_LEFT_OUTLINE, + NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE, NK_SYMBOL_MAX }; /* ============================================================================= @@ -531,159 +543,166 @@ enum nk_symbol_type { * CONTEXT * * =============================================================================*/ -/*/// ### Context -/// Contexts are the main entry point and the majestro of nuklear and contain all required state. -/// They are used for window, memory, input, style, stack, commands and time management and need -/// to be passed into all nuklear GUI specific functions. -/// -/// #### Usage -/// To use a context it first has to be initialized which can be achieved by calling -/// one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`. -/// Each takes in a font handle and a specific way of handling memory. Memory control -/// hereby ranges from standard library to just specifying a fixed sized block of memory -/// which nuklear has to manage itself from. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // [...] -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------------------- -/// __nk_init_default__ | Initializes context with standard library memory allocation (malloc,free) -/// __nk_init_fixed__ | Initializes context from single fixed size memory block -/// __nk_init__ | Initializes context with memory allocator callbacks for alloc and free -/// __nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations -/// __nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame -/// __nk_free__ | Shutdown and free all memory allocated inside the context -/// __nk_set_user_data__| Utility function to pass user data to draw command +/** + * \page Context + * Contexts are the main entry point and the majestro of nuklear and contain all required state. + * They are used for window, memory, input, style, stack, commands and time management and need + * to be passed into all nuklear GUI specific functions. + * + * # Usage + * To use a context it first has to be initialized which can be achieved by calling + * one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`. + * Each takes in a font handle and a specific way of handling memory. Memory control + * hereby ranges from standard library to just specifying a fixed sized block of memory + * which nuklear has to manage itself from. + * + * ```c + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * // [...] + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * + * # Reference + * Function | Description + * --------------------|------------------------------------------------------- + * \ref nk_init_default | Initializes context with standard library memory allocation (malloc,free) + * \ref nk_init_fixed | Initializes context from single fixed size memory block + * \ref nk_init | Initializes context with memory allocator callbacks for alloc and free + * \ref nk_init_custom | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations + * \ref nk_clear | Called at the end of the frame to reset and prepare the context for the next frame + * \ref nk_free | Shutdown and free all memory allocated inside the context + * \ref nk_set_user_data| Utility function to pass user data to draw command */ + #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -/*/// #### nk_init_default -/// Initializes a `nk_context` struct with a default standard library allocator. -/// Should be used if you don't want to be bothered with memory management in nuklear. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_init_default(struct nk_context *ctx, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|--------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -/// -*/ + +/** + * # nk_init_default + * Initializes a `nk_context` struct with a default standard library allocator. + * Should be used if you don't want to be bothered with memory management in nuklear. + * + * ```c + * nk_bool nk_init_default(struct nk_context *ctx, const struct nk_user_font *font); + * ``` + * + * Parameter | Description + * ------------|--------------------------------------------------------------- + * \param[in] ctx | Must point to an either stack or heap allocated `nk_context` struct + * \param[in] font | Must point to a previously initialized font handle for more info look at font documentation + * + * \returns either `false(0)` on failure or `true(1)` on success. + */ NK_API nk_bool nk_init_default(struct nk_context*, const struct nk_user_font*); #endif -/*/// #### nk_init_fixed -/// Initializes a `nk_context` struct from single fixed size memory block -/// Should be used if you want complete control over nuklear's memory management. -/// Especially recommended for system with little memory or systems with virtual memory. -/// For the later case you can just allocate for example 16MB of virtual memory -/// and only the required amount of memory will actually be committed. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// !!! Warning -/// make sure the passed memory block is aligned correctly for `nk_draw_commands`. -/// -/// Parameter | Description -/// ------------|-------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __memory__ | Must point to a previously allocated memory block -/// __size__ | Must contain the total size of __memory__ -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -*/ +/** + * # nk_init_fixed + * Initializes a `nk_context` struct from single fixed size memory block + * Should be used if you want complete control over nuklear's memory management. + * Especially recommended for system with little memory or systems with virtual memory. + * For the later case you can just allocate for example 16MB of virtual memory + * and only the required amount of memory will actually be committed. + * + * ```c + * nk_bool nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font); + * ``` + * + * !!! Warning + * make sure the passed memory block is aligned correctly for `nk_draw_commands`. + * + * Parameter | Description + * ------------|-------------------------------------------------------------- + * \param[in] ctx | Must point to an either stack or heap allocated `nk_context` struct + * \param[in] memory | Must point to a previously allocated memory block + * \param[in] size | Must contain the total size of memory + * \param[in] font | Must point to a previously initialized font handle for more info look at font documentation + * + * \returns either `false(0)` on failure or `true(1)` on success. + */ NK_API nk_bool nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*); -/*/// #### nk_init -/// Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate -/// memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation -/// interface to nuklear. Can be useful for cases like monitoring memory consumption. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|--------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __alloc__ | Must point to a previously allocated memory allocator -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -*/ -NK_API nk_bool nk_init(struct nk_context*, struct nk_allocator*, const struct nk_user_font*); -/*/// #### nk_init_custom -/// Initializes a `nk_context` struct from two different either fixed or growing -/// buffers. The first buffer is for allocating draw commands while the second buffer is -/// used for allocating windows, panels and state tables. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|--------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into -/// __pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -*/ + +/** + * # nk_init + * Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate + * memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation + * interface to nuklear. Can be useful for cases like monitoring memory consumption. + * + * ```c + * nk_bool nk_init(struct nk_context *ctx, const struct nk_allocator *alloc, const struct nk_user_font *font); + * ``` + * + * Parameter | Description + * ------------|--------------------------------------------------------------- + * \param[in] ctx | Must point to an either stack or heap allocated `nk_context` struct + * \param[in] alloc | Must point to a previously allocated memory allocator + * \param[in] font | Must point to a previously initialized font handle for more info look at font documentation + * + * \returns either `false(0)` on failure or `true(1)` on success. + */ +NK_API nk_bool nk_init(struct nk_context*, const struct nk_allocator*, const struct nk_user_font*); + +/** + * \brief Initializes a `nk_context` struct from two different either fixed or growing buffers. + * + * \details + * The first buffer is for allocating draw commands while the second buffer is + * used for allocating windows, panels and state tables. + * + * ```c + * nk_bool nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font); + * ``` + * + * \param[in] ctx Must point to an either stack or heap allocated `nk_context` struct + * \param[in] cmds Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into + * \param[in] pool Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables + * \param[in] font Must point to a previously initialized font handle for more info look at font documentation + * + * \returns either `false(0)` on failure or `true(1)` on success. + */ NK_API nk_bool nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*); -/*/// #### nk_clear -/// Resets the context state at the end of the frame. This includes mostly -/// garbage collector tasks like removing windows or table not called and therefore -/// used anymore. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_clear(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ + +/** + * \brief Resets the context state at the end of the frame. + * + * \details + * This includes mostly garbage collector tasks like removing windows or table + * not called and therefore used anymore. + * + * ```c + * void nk_clear(struct nk_context *ctx); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + */ NK_API void nk_clear(struct nk_context*); -/*/// #### nk_free -/// Frees all memory allocated by nuklear. Not needed if context was -/// initialized with `nk_init_fixed`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_free(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ + +/** + * \brief Frees all memory allocated by nuklear; Not needed if context was initialized with `nk_init_fixed`. + * + * \details + * ```c + * void nk_free(struct nk_context *ctx); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + */ NK_API void nk_free(struct nk_context*); + #ifdef NK_INCLUDE_COMMAND_USERDATA -/*/// #### nk_set_user_data -/// Sets the currently passed userdata passed down into each draw command. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_set_user_data(struct nk_context *ctx, nk_handle data); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|-------------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __data__ | Handle with either pointer or index to be passed into every draw commands -*/ +/** + * \brief Sets the currently passed userdata passed down into each draw command. + * + * \details + * ```c + * void nk_set_user_data(struct nk_context *ctx, nk_handle data); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + * \param[in] data Handle with either pointer or index to be passed into every draw commands + */ NK_API void nk_set_user_data(struct nk_context*, nk_handle handle); #endif /* ============================================================================= @@ -691,67 +710,70 @@ NK_API void nk_set_user_data(struct nk_context*, nk_handle handle); * INPUT * * =============================================================================*/ -/*/// ### Input -/// The input API is responsible for holding the current input state composed of -/// mouse, key and text input states. -/// It is worth noting that no direct OS or window handling is done in nuklear. -/// Instead all input state has to be provided by platform specific code. This on one hand -/// expects more work from the user and complicates usage but on the other hand -/// provides simple abstraction over a big number of platforms, libraries and other -/// already provided functionality. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// // [...] -/// } -/// } nk_input_end(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Usage -/// Input state needs to be provided to nuklear by first calling `nk_input_begin` -/// which resets internal state like delta mouse position and button transitions. -/// After `nk_input_begin` all current input state needs to be provided. This includes -/// mouse motion, button and key pressed and released, text input and scrolling. -/// Both event- or state-based input handling are supported by this API -/// and should work without problems. Finally after all input state has been -/// mirrored `nk_input_end` needs to be called to finish input process. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// // [...] -/// } -/// } -/// nk_input_end(&ctx); -/// // [...] -/// nk_clear(&ctx); -/// } nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------------------- -/// __nk_input_begin__ | Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls -/// __nk_input_motion__ | Mirrors mouse cursor position -/// __nk_input_key__ | Mirrors key state with either pressed or released -/// __nk_input_button__ | Mirrors mouse button state with either pressed or released -/// __nk_input_scroll__ | Mirrors mouse scroll values -/// __nk_input_char__ | Adds a single ASCII text character into an internal text buffer -/// __nk_input_glyph__ | Adds a single multi-byte UTF-8 character into an internal text buffer -/// __nk_input_unicode__| Adds a single unicode rune into an internal text buffer -/// __nk_input_end__ | Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call -*/ +/** + * \page Input + * + * The input API is responsible for holding the current input state composed of + * mouse, key and text input states. + * It is worth noting that no direct OS or window handling is done in nuklear. + * Instead all input state has to be provided by platform specific code. This on one hand + * expects more work from the user and complicates usage but on the other hand + * provides simple abstraction over a big number of platforms, libraries and other + * already provided functionality. + * + * ```c + * nk_input_begin(&ctx); + * while (GetEvent(&evt)) { + * if (evt.type == MOUSE_MOVE) + * nk_input_motion(&ctx, evt.motion.x, evt.motion.y); + * else if (evt.type == [...]) { + * // [...] + * } + * } nk_input_end(&ctx); + * ``` + * + * # Usage + * Input state needs to be provided to nuklear by first calling `nk_input_begin` + * which resets internal state like delta mouse position and button transitions. + * After `nk_input_begin` all current input state needs to be provided. This includes + * mouse motion, button and key pressed and released, text input and scrolling. + * Both event- or state-based input handling are supported by this API + * and should work without problems. Finally after all input state has been + * mirrored `nk_input_end` needs to be called to finish input process. + * + * ```c + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * Event evt; + * nk_input_begin(&ctx); + * while (GetEvent(&evt)) { + * if (evt.type == MOUSE_MOVE) + * nk_input_motion(&ctx, evt.motion.x, evt.motion.y); + * else if (evt.type == [...]) { + * // [...] + * } + * } + * nk_input_end(&ctx); + * // [...] + * nk_clear(&ctx); + * } nk_free(&ctx); + * ``` + * + * # Reference + * Function | Description + * --------------------|------------------------------------------------------- + * \ref nk_input_begin | Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls + * \ref nk_input_motion | Mirrors mouse cursor position + * \ref nk_input_key | Mirrors key state with either pressed or released + * \ref nk_input_button | Mirrors mouse button state with either pressed or released + * \ref nk_input_scroll | Mirrors mouse scroll values + * \ref nk_input_char | Adds a single ASCII text character into an internal text buffer + * \ref nk_input_glyph | Adds a single multi-byte UTF-8 character into an internal text buffer + * \ref nk_input_unicode| Adds a single unicode rune into an internal text buffer + * \ref nk_input_end | Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call + */ + enum nk_keys { NK_KEY_NONE, NK_KEY_SHIFT, @@ -794,371 +816,376 @@ enum nk_buttons { NK_BUTTON_DOUBLE, NK_BUTTON_MAX }; -/*/// #### nk_input_begin -/// Begins the input mirroring process by resetting text, scroll -/// mouse, previous mouse position and movement as well as key state transitions, -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_begin(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ + +/** + * \brief Begins the input mirroring process by resetting text, scroll + * mouse, previous mouse position and movement as well as key state transitions. + * + * \details + * ```c + * void nk_input_begin(struct nk_context*); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + */ NK_API void nk_input_begin(struct nk_context*); -/*/// #### nk_input_motion -/// Mirrors current mouse position to nuklear -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_motion(struct nk_context *ctx, int x, int y); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __x__ | Must hold an integer describing the current mouse cursor x-position -/// __y__ | Must hold an integer describing the current mouse cursor y-position -*/ + +/** + * \brief Mirrors current mouse position to nuklear + * + * \details + * ```c + * void nk_input_motion(struct nk_context *ctx, int x, int y); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + * \param[in] x Must hold an integer describing the current mouse cursor x-position + * \param[in] y Must hold an integer describing the current mouse cursor y-position + */ NK_API void nk_input_motion(struct nk_context*, int x, int y); -/*/// #### nk_input_key -/// Mirrors the state of a specific key to nuklear -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_key(struct nk_context*, enum nk_keys key, nk_bool down); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __key__ | Must be any value specified in enum `nk_keys` that needs to be mirrored -/// __down__ | Must be 0 for key is up and 1 for key is down -*/ + +/** + * \brief Mirrors the state of a specific key to nuklear + * + * \details + * ```c + * void nk_input_key(struct nk_context*, enum nk_keys key, nk_bool down); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + * \param[in] key Must be any value specified in enum `nk_keys` that needs to be mirrored + * \param[in] down Must be 0 for key is up and 1 for key is down + */ NK_API void nk_input_key(struct nk_context*, enum nk_keys, nk_bool down); -/*/// #### nk_input_button -/// Mirrors the state of a specific mouse button to nuklear -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, nk_bool down); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __btn__ | Must be any value specified in enum `nk_buttons` that needs to be mirrored -/// __x__ | Must contain an integer describing mouse cursor x-position on click up/down -/// __y__ | Must contain an integer describing mouse cursor y-position on click up/down -/// __down__ | Must be 0 for key is up and 1 for key is down -*/ + +/** + * \brief Mirrors the state of a specific mouse button to nuklear + * + * \details + * ```c + * void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, nk_bool down); + * ``` + * + * \param[in] ctx Must point to a previously initialized `nk_context` struct + * \param[in] btn Must be any value specified in enum `nk_buttons` that needs to be mirrored + * \param[in] x Must contain an integer describing mouse cursor x-position on click up/down + * \param[in] y Must contain an integer describing mouse cursor y-position on click up/down + * \param[in] down Must be 0 for key is up and 1 for key is down + */ NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, nk_bool down); -/*/// #### nk_input_scroll -/// Copies the last mouse scroll value to nuklear. Is generally -/// a scroll value. So does not have to come from mouse and could also originate -/// TODO finish this sentence -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __val__ | vector with both X- as well as Y-scroll value -*/ + +/** + * \brief Copies the last mouse scroll value to nuklear. + * + * \details + * Is generally a scroll value. So does not have to come from mouse and could + * also originate from balls, tracks, linear guide rails, or other programs. + * + * ```c + * void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val); + * ``` + * + * \param[in] ctx | Must point to a previously initialized `nk_context` struct + * \param[in] val | vector with both X- as well as Y-scroll value + */ NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val); -/*/// #### nk_input_char -/// Copies a single ASCII character into an internal text buffer -/// This is basically a helper function to quickly push ASCII characters into -/// nuklear. -/// -/// !!! Note -/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_char(struct nk_context *ctx, char c); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __c__ | Must be a single ASCII character preferable one that can be printed -*/ + +/** + * \brief Copies a single ASCII character into an internal text buffer + * + * \details + * This is basically a helper function to quickly push ASCII characters into + * nuklear. + * + * \note + * Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. + * + * ```c + * void nk_input_char(struct nk_context *ctx, char c); + * ``` + * + * \param[in] ctx | Must point to a previously initialized `nk_context` struct + * \param[in] c | Must be a single ASCII character preferable one that can be printed + */ NK_API void nk_input_char(struct nk_context*, char); -/*/// #### nk_input_glyph -/// Converts an encoded unicode rune into UTF-8 and copies the result into an -/// internal text buffer. -/// -/// !!! Note -/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_glyph(struct nk_context *ctx, const nk_glyph g); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __g__ | UTF-32 unicode codepoint -*/ + +/** + * \brief Converts an encoded unicode rune into UTF-8 and copies the result into an + * internal text buffer. + * + * \note + * Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. + * + * ```c + * void nk_input_glyph(struct nk_context *ctx, const nk_glyph g); + * ``` + * + * \param[in] ctx | Must point to a previously initialized `nk_context` struct + * \param[in] g | UTF-32 unicode codepoint + */ NK_API void nk_input_glyph(struct nk_context*, const nk_glyph); -/*/// #### nk_input_unicode -/// Converts a unicode rune into UTF-8 and copies the result -/// into an internal text buffer. -/// !!! Note -/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_unicode(struct nk_context*, nk_rune rune); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __rune__ | UTF-32 unicode codepoint -*/ + +/** + * \brief Converts a unicode rune into UTF-8 and copies the result + * into an internal text buffer. + * + * \details + * \note + * Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. + * + * ```c + * void nk_input_unicode(struct nk_context*, nk_rune rune); + * ``` + * + * \param[in] ctx | Must point to a previously initialized `nk_context` struct + * \param[in] rune | UTF-32 unicode codepoint + */ NK_API void nk_input_unicode(struct nk_context*, nk_rune); -/*/// #### nk_input_end -/// End the input mirroring process by resetting mouse grabbing -/// state to ensure the mouse cursor is not grabbed indefinitely. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_end(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ + +/** + * \brief End the input mirroring process by resetting mouse grabbing + * state to ensure the mouse cursor is not grabbed indefinitely. + * + * \details + * ```c + * void nk_input_end(struct nk_context *ctx); + * ``` + * + * \param[in] ctx | Must point to a previously initialized `nk_context` struct + */ NK_API void nk_input_end(struct nk_context*); -/* ============================================================================= + +/** ============================================================================= * * DRAWING * * =============================================================================*/ -/*/// ### Drawing -/// This library was designed to be render backend agnostic so it does -/// not draw anything to screen directly. Instead all drawn shapes, widgets -/// are made of, are buffered into memory and make up a command queue. -/// Each frame therefore fills the command buffer with draw commands -/// that then need to be executed by the user and his own render backend. -/// After that the command buffer needs to be cleared and a new frame can be -/// started. It is probably important to note that the command buffer is the main -/// drawing API and the optional vertex buffer API only takes this format and -/// converts it into a hardware accessible format. -/// -/// #### Usage -/// To draw all draw commands accumulated over a frame you need your own render -/// backend able to draw a number of 2D primitives. This includes at least -/// filled and stroked rectangles, circles, text, lines, triangles and scissors. -/// As soon as this criterion is met you can iterate over each draw command -/// and execute each draw command in a interpreter like fashion: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case //...: -/// //[...] -/// } -/// } -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// In program flow context draw commands need to be executed after input has been -/// gathered and the complete UI with windows and their contained widgets have -/// been executed and before calling `nk_clear` which frees all previously -/// allocated draw commands. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// [...] -/// } -/// } -/// nk_input_end(&ctx); -/// // -/// // [...] -/// // -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// You probably noticed that you have to draw all of the UI each frame which is -/// quite wasteful. While the actual UI updating loop is quite fast rendering -/// without actually needing it is not. So there are multiple things you could do. -/// -/// First is only update on input. This of course is only an option if your -/// application only depends on the UI and does not require any outside calculations. -/// If you actually only update on input make sure to update the UI two times each -/// frame and call `nk_clear` directly after the first pass and only draw in -/// the second pass. In addition it is recommended to also add additional timers -/// to make sure the UI is not drawn more than a fixed number of frames per second. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // [...wait for input ] -/// // [...do two UI passes ...] -/// do_ui(...) -/// nk_clear(&ctx); -/// do_ui(...) -/// // -/// // draw -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// //[...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// The second probably more applicable trick is to only draw if anything changed. -/// It is not really useful for applications with continuous draw loop but -/// quite useful for desktop applications. To actually get nuklear to only -/// draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and -/// allocate a memory buffer that will store each unique drawing output. -/// After each frame you compare the draw command memory inside the library -/// with your allocated buffer by memcmp. If memcmp detects differences -/// you have to copy the command buffer into the allocated buffer -/// and then draw like usual (this example uses fixed memory but you could -/// use dynamically allocated memory). -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// //[... other defines ...] -/// #define NK_ZERO_COMMAND_MEMORY -/// #include "nuklear.h" -/// // -/// // setup context -/// struct nk_context ctx; -/// void *last = calloc(1,64*1024); -/// void *buf = calloc(1,64*1024); -/// nk_init_fixed(&ctx, buf, 64*1024); -/// // -/// // loop -/// while (1) { -/// // [...input...] -/// // [...ui...] -/// void *cmds = nk_buffer_memory(&ctx.memory); -/// if (memcmp(cmds, last, ctx.memory.allocated)) { -/// memcpy(last,cmds,ctx.memory.allocated); -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// } -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Finally while using draw commands makes sense for higher abstracted platforms like -/// X11 and Win32 or drawing libraries it is often desirable to use graphics -/// hardware directly. Therefore it is possible to just define -/// `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output. -/// To access the vertex output you first have to convert all draw commands into -/// vertexes by calling `nk_convert` which takes in your preferred vertex format. -/// After successfully converting all draw commands just iterate over and execute all -/// vertex draw commands: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// // fill configuration -/// struct your_vertex -/// { -/// float pos[2]; // important to keep it to 2 floats -/// float uv[2]; -/// unsigned char col[4]; -/// }; -/// struct nk_convert_config cfg = {}; -/// static const struct nk_draw_vertex_layout_element vertex_layout[] = { -/// {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)}, -/// {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)}, -/// {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)}, -/// {NK_VERTEX_LAYOUT_END} -/// }; -/// cfg.shape_AA = NK_ANTI_ALIASING_ON; -/// cfg.line_AA = NK_ANTI_ALIASING_ON; -/// cfg.vertex_layout = vertex_layout; -/// cfg.vertex_size = sizeof(struct your_vertex); -/// cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex); -/// cfg.circle_segment_count = 22; -/// cfg.curve_segment_count = 22; -/// cfg.arc_segment_count = 22; -/// cfg.global_alpha = 1.0f; -/// cfg.tex_null = dev->tex_null; -/// // -/// // setup buffers and convert -/// struct nk_buffer cmds, verts, idx; -/// nk_buffer_init_default(&cmds); -/// nk_buffer_init_default(&verts); -/// nk_buffer_init_default(&idx); -/// nk_convert(&ctx, &cmds, &verts, &idx, &cfg); -/// // -/// // draw -/// nk_draw_foreach(cmd, &ctx, &cmds) { -/// if (!cmd->elem_count) continue; -/// //[...] -/// } -/// nk_buffer_free(&cms); -/// nk_buffer_free(&verts); -/// nk_buffer_free(&idx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------------------- -/// __nk__begin__ | Returns the first draw command in the context draw command list to be drawn -/// __nk__next__ | Increments the draw command iterator to the next command inside the context draw command list -/// __nk_foreach__ | Iterates over each draw command inside the context draw command list -/// __nk_convert__ | Converts from the abstract draw commands list into a hardware accessible vertex format -/// __nk_draw_begin__ | Returns the first vertex command in the context vertex draw list to be executed -/// __nk__draw_next__ | Increments the vertex command iterator to the next command inside the context vertex command list -/// __nk__draw_end__ | Returns the end of the vertex draw list -/// __nk_draw_foreach__ | Iterates over each vertex draw command inside the vertex draw list -*/ +/** + * \page Drawing + * This library was designed to be render backend agnostic so it does + * not draw anything to screen directly. Instead all drawn shapes, widgets + * are made of, are buffered into memory and make up a command queue. + * Each frame therefore fills the command buffer with draw commands + * that then need to be executed by the user and his own render backend. + * After that the command buffer needs to be cleared and a new frame can be + * started. It is probably important to note that the command buffer is the main + * drawing API and the optional vertex buffer API only takes this format and + * converts it into a hardware accessible format. + * + * # Usage + * To draw all draw commands accumulated over a frame you need your own render + * backend able to draw a number of 2D primitives. This includes at least + * filled and stroked rectangles, circles, text, lines, triangles and scissors. + * As soon as this criterion is met you can iterate over each draw command + * and execute each draw command in a interpreter like fashion: + * + * ```c + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * switch (cmd->type) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case //...: + * //[...] + * } + * } + * ``` + * + * In program flow context draw commands need to be executed after input has been + * gathered and the complete UI with windows and their contained widgets have + * been executed and before calling `nk_clear` which frees all previously + * allocated draw commands. + * + * ```c + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * Event evt; + * nk_input_begin(&ctx); + * while (GetEvent(&evt)) { + * if (evt.type == MOUSE_MOVE) + * nk_input_motion(&ctx, evt.motion.x, evt.motion.y); + * else if (evt.type == [...]) { + * [...] + * } + * } + * nk_input_end(&ctx); + * // + * // [...] + * // + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * switch (cmd->type) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case ...: + * // [...] + * } + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * + * You probably noticed that you have to draw all of the UI each frame which is + * quite wasteful. While the actual UI updating loop is quite fast rendering + * without actually needing it is not. So there are multiple things you could do. + * + * First is only update on input. This of course is only an option if your + * application only depends on the UI and does not require any outside calculations. + * If you actually only update on input make sure to update the UI two times each + * frame and call `nk_clear` directly after the first pass and only draw in + * the second pass. In addition it is recommended to also add additional timers + * to make sure the UI is not drawn more than a fixed number of frames per second. + * + * ```c + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * // [...wait for input ] + * // [...do two UI passes ...] + * do_ui(...) + * nk_clear(&ctx); + * do_ui(...) + * // + * // draw + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * switch (cmd->type) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case ...: + * //[...] + * } + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * + * The second probably more applicable trick is to only draw if anything changed. + * It is not really useful for applications with continuous draw loop but + * quite useful for desktop applications. To actually get nuklear to only + * draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and + * allocate a memory buffer that will store each unique drawing output. + * After each frame you compare the draw command memory inside the library + * with your allocated buffer by memcmp. If memcmp detects differences + * you have to copy the command buffer into the allocated buffer + * and then draw like usual (this example uses fixed memory but you could + * use dynamically allocated memory). + * + * ```c + * //[... other defines ...] + * #define NK_ZERO_COMMAND_MEMORY + * #include "nuklear.h" + * // + * // setup context + * struct nk_context ctx; + * void *last = calloc(1,64*1024); + * void *buf = calloc(1,64*1024); + * nk_init_fixed(&ctx, buf, 64*1024); + * // + * // loop + * while (1) { + * // [...input...] + * // [...ui...] + * void *cmds = nk_buffer_memory(&ctx.memory); + * if (memcmp(cmds, last, ctx.memory.allocated)) { + * memcpy(last,cmds,ctx.memory.allocated); + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * switch (cmd->type) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case ...: + * // [...] + * } + * } + * } + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * + * Finally while using draw commands makes sense for higher abstracted platforms like + * X11 and Win32 or drawing libraries it is often desirable to use graphics + * hardware directly. Therefore it is possible to just define + * `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output. + * To access the vertex output you first have to convert all draw commands into + * vertexes by calling `nk_convert` which takes in your preferred vertex format. + * After successfully converting all draw commands just iterate over and execute all + * vertex draw commands: + * + * ```c + * // fill configuration + * struct your_vertex + * { + * float pos[2]; // important to keep it to 2 floats + * float uv[2]; + * unsigned char col[4]; + * }; + * struct nk_convert_config cfg = {}; + * static const struct nk_draw_vertex_layout_element vertex_layout[] = { + * {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)}, + * {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)}, + * {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)}, + * {NK_VERTEX_LAYOUT_END} + * }; + * cfg.shape_AA = NK_ANTI_ALIASING_ON; + * cfg.line_AA = NK_ANTI_ALIASING_ON; + * cfg.vertex_layout = vertex_layout; + * cfg.vertex_size = sizeof(struct your_vertex); + * cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex); + * cfg.circle_segment_count = 22; + * cfg.curve_segment_count = 22; + * cfg.arc_segment_count = 22; + * cfg.global_alpha = 1.0f; + * cfg.tex_null = dev->tex_null; + * // + * // setup buffers and convert + * struct nk_buffer cmds, verts, idx; + * nk_buffer_init_default(&cmds); + * nk_buffer_init_default(&verts); + * nk_buffer_init_default(&idx); + * nk_convert(&ctx, &cmds, &verts, &idx, &cfg); + * // + * // draw + * nk_draw_foreach(cmd, &ctx, &cmds) { + * if (!cmd->elem_count) continue; + * //[...] + * } + * nk_buffer_free(&cms); + * nk_buffer_free(&verts); + * nk_buffer_free(&idx); + * ``` + * + * # Reference + * Function | Description + * --------------------|------------------------------------------------------- + * \ref nk__begin | Returns the first draw command in the context draw command list to be drawn + * \ref nk__next | Increments the draw command iterator to the next command inside the context draw command list + * \ref nk_foreach | Iterates over each draw command inside the context draw command list + * \ref nk_convert | Converts from the abstract draw commands list into a hardware accessible vertex format + * \ref nk_draw_begin | Returns the first vertex command in the context vertex draw list to be executed + * \ref nk__draw_next | Increments the vertex command iterator to the next command inside the context vertex command list + * \ref nk__draw_end | Returns the end of the vertex draw list + * \ref nk_draw_foreach | Iterates over each vertex draw command inside the vertex draw list + */ + enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON}; enum nk_convert_result { NK_CONVERT_SUCCESS = 0, @@ -1168,305 +1195,315 @@ enum nk_convert_result { NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3) }; struct nk_draw_null_texture { - nk_handle texture; /* texture handle to a texture with a white pixel */ - struct nk_vec2 uv; /* coordinates to a white pixel in the texture */ + nk_handle texture; /**!< texture handle to a texture with a white pixel */ + struct nk_vec2 uv; /**!< coordinates to a white pixel in the texture */ }; struct nk_convert_config { - float global_alpha; /* global alpha value */ - enum nk_anti_aliasing line_AA; /* line anti-aliasing flag can be turned off if you are tight on memory */ - enum nk_anti_aliasing shape_AA; /* shape anti-aliasing flag can be turned off if you are tight on memory */ - unsigned circle_segment_count; /* number of segments used for circles: default to 22 */ - unsigned arc_segment_count; /* number of segments used for arcs: default to 22 */ - unsigned curve_segment_count; /* number of segments used for curves: default to 22 */ - struct nk_draw_null_texture tex_null; /* handle to texture with a white pixel for shape drawing */ - const struct nk_draw_vertex_layout_element *vertex_layout; /* describes the vertex output format and packing */ - nk_size vertex_size; /* sizeof one vertex for vertex packing */ - nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */ + float global_alpha; /**!< global alpha value */ + enum nk_anti_aliasing line_AA; /**!< line anti-aliasing flag can be turned off if you are tight on memory */ + enum nk_anti_aliasing shape_AA; /**!< shape anti-aliasing flag can be turned off if you are tight on memory */ + unsigned circle_segment_count; /**!< number of segments used for circles: default to 22 */ + unsigned arc_segment_count; /**!< number of segments used for arcs: default to 22 */ + unsigned curve_segment_count; /**!< number of segments used for curves: default to 22 */ + struct nk_draw_null_texture tex_null; /**!< handle to texture with a white pixel for shape drawing */ + const struct nk_draw_vertex_layout_element *vertex_layout; /**!< describes the vertex output format and packing */ + nk_size vertex_size; /**!< sizeof one vertex for vertex packing */ + nk_size vertex_alignment; /**!< vertex alignment: Can be obtained by NK_ALIGNOF */ }; -/*/// #### nk__begin -/// Returns a draw command list iterator to iterate all draw -/// commands accumulated over one frame. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_command* nk__begin(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | must point to an previously initialized `nk_context` struct at the end of a frame -/// -/// Returns draw command pointer pointing to the first command inside the draw command list -*/ + +/** + * \brief Returns a draw command list iterator to iterate all draw + * commands accumulated over one frame. + * + * \details + * ```c + * const struct nk_command* nk__begin(struct nk_context*); + * ``` + * + * \param[in] ctx | must point to an previously initialized `nk_context` struct at the end of a frame + * + * \returns draw command pointer pointing to the first command inside the draw command list + */ NK_API const struct nk_command* nk__begin(struct nk_context*); -/*/// #### nk__next -/// Returns draw command pointer pointing to the next command inside the draw command list -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_command* nk__next(struct nk_context*, const struct nk_command*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __cmd__ | Must point to an previously a draw command either returned by `nk__begin` or `nk__next` -/// -/// Returns draw command pointer pointing to the next command inside the draw command list -*/ + +/** + * \brief Returns draw command pointer pointing to the next command inside the draw command list + * + * \details + * ```c + * const struct nk_command* nk__next(struct nk_context*, const struct nk_command*); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct at the end of a frame + * \param[in] cmd | Must point to an previously a draw command either returned by `nk__begin` or `nk__next` + * + * \returns draw command pointer pointing to the next command inside the draw command list + */ NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*); -/*/// #### nk_foreach -/// Iterates over each draw command inside the context draw command list -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_foreach(c, ctx) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __cmd__ | Command pointer initialized to NULL -/// -/// Iterates over each draw command inside the context draw command list -*/ + +/** + * \brief Iterates over each draw command inside the context draw command list + * + * ```c + * #define nk_foreach(c, ctx) + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct at the end of a frame + * \param[in] cmd | Command pointer initialized to NULL + */ #define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c)) + #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT -/*/// #### nk_convert -/// Converts all internal draw commands into vertex draw commands and fills -/// three buffers with vertexes, vertex draw commands and vertex indices. The vertex format -/// as well as some other configuration values have to be configured by filling out a -/// `nk_convert_config` struct. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_flags nk_convert(struct nk_context *ctx, struct nk_buffer *cmds, -/// struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __cmds__ | Must point to a previously initialized buffer to hold converted vertex draw commands -/// __vertices__| Must point to a previously initialized buffer to hold all produced vertices -/// __elements__| Must point to a previously initialized buffer to hold all produced vertex indices -/// __config__ | Must point to a filled out `nk_config` struct to configure the conversion process -/// -/// Returns one of enum nk_convert_result error codes -/// -/// Parameter | Description -/// --------------------------------|----------------------------------------------------------- -/// NK_CONVERT_SUCCESS | Signals a successful draw command to vertex buffer conversion -/// NK_CONVERT_INVALID_PARAM | An invalid argument was passed in the function call -/// NK_CONVERT_COMMAND_BUFFER_FULL | The provided buffer for storing draw commands is full or failed to allocate more memory -/// NK_CONVERT_VERTEX_BUFFER_FULL | The provided buffer for storing vertices is full or failed to allocate more memory -/// NK_CONVERT_ELEMENT_BUFFER_FULL | The provided buffer for storing indices is full or failed to allocate more memory -*/ + +/** + * \brief Converts all internal draw commands into vertex draw commands and fills + * three buffers with vertexes, vertex draw commands and vertex indices. + * + * \details + * The vertex format as well as some other configuration values have to be + * configured by filling out a `nk_convert_config` struct. + * + * ```c + * nk_flags nk_convert(struct nk_context *ctx, struct nk_buffer *cmds, + * struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*); + * ``` + * + * \param[in] ctx Must point to an previously initialized `nk_context` struct at the end of a frame + * \param[out] cmds Must point to a previously initialized buffer to hold converted vertex draw commands + * \param[out] vertices Must point to a previously initialized buffer to hold all produced vertices + * \param[out] elements Must point to a previously initialized buffer to hold all produced vertex indices + * \param[in] config Must point to a filled out `nk_config` struct to configure the conversion process + * + * \returns one of enum nk_convert_result error codes + * + * Parameter | Description + * --------------------------------|----------------------------------------------------------- + * NK_CONVERT_SUCCESS | Signals a successful draw command to vertex buffer conversion + * NK_CONVERT_INVALID_PARAM | An invalid argument was passed in the function call + * NK_CONVERT_COMMAND_BUFFER_FULL | The provided buffer for storing draw commands is full or failed to allocate more memory + * NK_CONVERT_VERTEX_BUFFER_FULL | The provided buffer for storing vertices is full or failed to allocate more memory + * NK_CONVERT_ELEMENT_BUFFER_FULL | The provided buffer for storing indices is full or failed to allocate more memory + */ NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*); -/*/// #### nk__draw_begin -/// Returns a draw vertex command buffer iterator to iterate over the vertex draw command buffer -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// -/// Returns vertex draw command pointer pointing to the first command inside the vertex draw command buffer -*/ + +/** + * \brief Returns a draw vertex command buffer iterator to iterate over the vertex draw command buffer + * + * \details + * ```c + * const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct at the end of a frame + * \param[in] buf | Must point to an previously by `nk_convert` filled out vertex draw command buffer + * + * \returns vertex draw command pointer pointing to the first command inside the vertex draw command buffer + */ NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*); -/*/// #### nk__draw_end -/// Returns the vertex draw command at the end of the vertex draw command buffer -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_draw_command* nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buf); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// -/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer -*/ + +/** + + * # # nk__draw_end + * \returns the vertex draw command at the end of the vertex draw command buffer + * + * ```c + * const struct nk_draw_command* nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buf); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct at the end of a frame + * \param[in] buf | Must point to an previously by `nk_convert` filled out vertex draw command buffer + * + * \returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer + + */ NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*); -/*/// #### nk__draw_next -/// Increments the vertex draw command buffer iterator -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __cmd__ | Must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// -/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer -*/ + +/** + * # # nk__draw_next + * Increments the vertex draw command buffer iterator + * + * ```c + * const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] cmd | Must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command + * \param[in] buf | Must point to an previously by `nk_convert` filled out vertex draw command buffer + * \param[in] ctx | Must point to an previously initialized `nk_context` struct at the end of a frame + * + * \returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer + + */ NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*); -/*/// #### nk_draw_foreach -/// Iterates over each vertex draw command inside a vertex draw command buffer -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_draw_foreach(cmd,ctx, b) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __cmd__ | `nk_draw_command`iterator set to NULL -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -*/ + +/** + * # # nk_draw_foreach + * Iterates over each vertex draw command inside a vertex draw command buffer + * + * ```c + * #define nk_draw_foreach(cmd,ctx, b) + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] cmd | `nk_draw_command`iterator set to NULL + * \param[in] buf | Must point to an previously by `nk_convert` filled out vertex draw command buffer + * \param[in] ctx | Must point to an previously initialized `nk_context` struct at the end of a frame + */ + #define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx)) #endif -/* ============================================================================= + +/** ============================================================================= * * WINDOW * - * ============================================================================= -/// ### Window -/// Windows are the main persistent state used inside nuklear and are life time -/// controlled by simply "retouching" (i.e. calling) each window each frame. -/// All widgets inside nuklear can only be added inside the function pair `nk_begin_xxx` -/// and `nk_end`. Calling any widgets outside these two functions will result in an -/// assert in debug or no state change in release mode.

-/// -/// Each window holds frame persistent state like position, size, flags, state tables, -/// and some garbage collected internal persistent widget state. Each window -/// is linked into a window stack list which determines the drawing and overlapping -/// order. The topmost window thereby is the currently active window.

-/// -/// To change window position inside the stack occurs either automatically by -/// user input by being clicked on or programmatically by calling `nk_window_focus`. -/// Windows by default are visible unless explicitly being defined with flag -/// `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag -/// `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling -/// `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.

-/// -/// #### Usage -/// To create and keep a window you have to call one of the two `nk_begin_xxx` -/// functions to start window declarations and `nk_end` at the end. Furthermore it -/// is recommended to check the return value of `nk_begin_xxx` and only process -/// widgets inside the window if the value is not 0. Either way you have to call -/// `nk_end` at the end of window declarations. Furthermore, do not attempt to -/// nest `nk_begin_xxx` calls which will hopefully result in an assert or if not -/// in a segmentation fault. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // [... widgets ...] -/// } -/// nk_end(ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// In the grand concept window and widget declarations need to occur after input -/// handling and before drawing to screen. Not doing so can result in higher -/// latency or at worst invalid behavior. Furthermore make sure that `nk_clear` -/// is called at the end of the frame. While nuklear's default platform backends -/// already call `nk_clear` for you if you write your own backend not calling -/// `nk_clear` can cause asserts or even worse undefined behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// nk_input_xxx(...); -/// } -/// } -/// nk_input_end(&ctx); -/// -/// if (nk_begin_xxx(...) { -/// //[...] -/// } -/// nk_end(ctx); -/// -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case //...: -/// //[...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// ------------------------------------|---------------------------------------- -/// nk_begin | Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed -/// nk_begin_titled | Extended window start with separated title and identifier to allow multiple windows with same name but not title -/// nk_end | Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup -// -/// nk_window_find | Finds and returns the window with give name -/// nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window. -/// nk_window_get_position | Returns the position of the currently processed window -/// nk_window_get_size | Returns the size with width and height of the currently processed window -/// nk_window_get_width | Returns the width of the currently processed window -/// nk_window_get_height | Returns the height of the currently processed window -/// nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window -/// nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets -/// nk_window_get_scroll | Gets the scroll offset of the current window -/// nk_window_has_focus | Returns if the currently processed window is currently active -/// nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed -/// nk_window_is_closed | Returns if the currently processed window was closed -/// nk_window_is_hidden | Returns if the currently processed window was hidden -/// nk_window_is_active | Same as nk_window_has_focus for some reason -/// nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse -/// nk_window_is_any_hovered | Return if any window currently hovered -/// nk_item_is_any_active | Returns if any window or widgets is currently hovered or active + * =============================================================================*/ +/** + * \page Window + * Windows are the main persistent state used inside nuklear and are life time + * controlled by simply "retouching" (i.e. calling) each window each frame. + * All widgets inside nuklear can only be added inside the function pair `nk_begin_xxx` + * and `nk_end`. Calling any widgets outside these two functions will result in an + * assert in debug or no state change in release mode.

+ * + * Each window holds frame persistent state like position, size, flags, state tables, + * and some garbage collected internal persistent widget state. Each window + * is linked into a window stack list which determines the drawing and overlapping + * order. The topmost window thereby is the currently active window.

+ * + * To change window position inside the stack occurs either automatically by + * user input by being clicked on or programmatically by calling `nk_window_focus`. + * Windows by default are visible unless explicitly being defined with flag + * `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag + * `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling + * `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.

+ * + * # Usage + * To create and keep a window you have to call one of the two `nk_begin_xxx` + * functions to start window declarations and `nk_end` at the end. Furthermore it + * is recommended to check the return value of `nk_begin_xxx` and only process + * widgets inside the window if the value is not 0. Either way you have to call + * `nk_end` at the end of window declarations. Furthermore, do not attempt to + * nest `nk_begin_xxx` calls which will hopefully result in an assert or if not + * in a segmentation fault. + * + * ```c + * if (nk_begin_xxx(...) { + * // [... widgets ...] + * } + * nk_end(ctx); + * ``` + * + * In the grand concept window and widget declarations need to occur after input + * handling and before drawing to screen. Not doing so can result in higher + * latency or at worst invalid behavior. Furthermore make sure that `nk_clear` + * is called at the end of the frame. While nuklear's default platform backends + * already call `nk_clear` for you if you write your own backend not calling + * `nk_clear` can cause asserts or even worse undefined behavior. + * + * ```c + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * Event evt; + * nk_input_begin(&ctx); + * while (GetEvent(&evt)) { + * if (evt.type == MOUSE_MOVE) + * nk_input_motion(&ctx, evt.motion.x, evt.motion.y); + * else if (evt.type == [...]) { + * nk_input_xxx(...); + * } + * } + * nk_input_end(&ctx); + * + * if (nk_begin_xxx(...) { + * //[...] + * } + * nk_end(ctx); + * + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case //...: + * //[...] + * } + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * + * # Reference + * Function | Description + * ------------------------------------|---------------------------------------- + * \ref nk_begin | Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed + * \ref nk_begin_titled | Extended window start with separated title and identifier to allow multiple windows with same name but not title + * \ref nk_end | Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup + * + * \ref nk_window_find | Finds and returns the window with give name + * \ref nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window. + * \ref nk_window_get_position | Returns the position of the currently processed window + * \ref nk_window_get_size | Returns the size with width and height of the currently processed window + * \ref nk_window_get_width | Returns the width of the currently processed window + * \ref nk_window_get_height | Returns the height of the currently processed window + * \ref nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window + * \ref nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window + * \ref nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window + * \ref nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window + * \ref nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window + * \ref nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets + * \ref nk_window_get_scroll | Gets the scroll offset of the current window + * \ref nk_window_has_focus | Returns if the currently processed window is currently active + * \ref nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed + * \ref nk_window_is_closed | Returns if the currently processed window was closed + * \ref nk_window_is_hidden | Returns if the currently processed window was hidden + * \ref nk_window_is_active | Same as nk_window_has_focus for some reason + * \ref nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse + * \ref nk_window_is_any_hovered | Return if any window currently hovered + * \ref nk_item_is_any_active | Returns if any window or widgets is currently hovered or active // -/// nk_window_set_bounds | Updates position and size of the currently processed window -/// nk_window_set_position | Updates position of the currently process window -/// nk_window_set_size | Updates the size of the currently processed window -/// nk_window_set_focus | Set the currently processed window as active window -/// nk_window_set_scroll | Sets the scroll offset of the current window + * \ref nk_window_set_bounds | Updates position and size of the currently processed window + * \ref nk_window_set_position | Updates position of the currently process window + * \ref nk_window_set_size | Updates the size of the currently processed window + * \ref nk_window_set_focus | Set the currently processed window as active window + * \ref nk_window_set_scroll | Sets the scroll offset of the current window // -/// nk_window_close | Closes the window with given window name which deletes the window at the end of the frame -/// nk_window_collapse | Collapses the window with given window name -/// nk_window_collapse_if | Collapses the window with given window name if the given condition was met -/// nk_window_show | Hides a visible or reshows a hidden window -/// nk_window_show_if | Hides/shows a window depending on condition -*/ -/* -/// #### nk_panel_flags -/// Flag | Description -/// ----------------------------|---------------------------------------- -/// NK_WINDOW_BORDER | Draws a border around the window to visually separate window from the background -/// NK_WINDOW_MOVABLE | The movable flag indicates that a window can be moved by user input or by dragging the window header -/// NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window -/// NK_WINDOW_CLOSABLE | Adds a closable icon into the header -/// NK_WINDOW_MINIMIZABLE | Adds a minimize icon into the header -/// NK_WINDOW_NO_SCROLLBAR | Removes the scrollbar from the window -/// NK_WINDOW_TITLE | Forces a header at the top at the window showing the title -/// NK_WINDOW_SCROLL_AUTO_HIDE | Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame -/// NK_WINDOW_BACKGROUND | Always keep window in the background -/// NK_WINDOW_SCALE_LEFT | Puts window scaler in the left-bottom corner instead right-bottom -/// NK_WINDOW_NO_INPUT | Prevents window of scaling, moving or getting focus -/// -/// #### nk_collapse_states -/// State | Description -/// ----------------|----------------------------------------------------------- -/// __NK_MINIMIZED__| UI section is collased and not visible until maximized -/// __NK_MAXIMIZED__| UI section is extended and visible until minimized -///

-*/ + * \ref nk_window_close | Closes the window with given window name which deletes the window at the end of the frame + * \ref nk_window_collapse | Collapses the window with given window name + * \ref nk_window_collapse_if | Collapses the window with given window name if the given condition was met + * \ref nk_window_show | Hides a visible or reshows a hidden window + * \ref nk_window_show_if | Hides/shows a window depending on condition + + * # nk_panel_flags + * Flag | Description + * ----------------------------|---------------------------------------- + * NK_WINDOW_BORDER | Draws a border around the window to visually separate window from the background + * NK_WINDOW_MOVABLE | The movable flag indicates that a window can be moved by user input or by dragging the window header + * NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window + * NK_WINDOW_CLOSABLE | Adds a closable icon into the header + * NK_WINDOW_MINIMIZABLE | Adds a minimize icon into the header + * NK_WINDOW_NO_SCROLLBAR | Removes the scrollbar from the window + * NK_WINDOW_TITLE | Forces a header at the top at the window showing the title + * NK_WINDOW_SCROLL_AUTO_HIDE | Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame + * NK_WINDOW_BACKGROUND | Always keep window in the background + * NK_WINDOW_SCALE_LEFT | Puts window scaler in the left-bottom corner instead right-bottom + * NK_WINDOW_NO_INPUT | Prevents window of scaling, moving or getting focus + * + * # nk_collapse_states + * State | Description + * ----------------|----------------------------------------------------------- + * NK_MINIMIZED| UI section is collapsed and not visible until maximized + * NK_MAXIMIZED| UI section is extended and visible until minimized + */ + enum nk_panel_flags { NK_WINDOW_BORDER = NK_FLAG(0), NK_WINDOW_MOVABLE = NK_FLAG(1), @@ -1480,1570 +1517,1761 @@ enum nk_panel_flags { NK_WINDOW_SCALE_LEFT = NK_FLAG(9), NK_WINDOW_NO_INPUT = NK_FLAG(10) }; -/*/// #### nk_begin -/// Starts a new window; needs to be called every frame for every -/// window (unless hidden) or otherwise the window gets removed -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __title__ | Window title and identifier. Needs to be persistent over frames to identify the window -/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors -/// -/// Returns `true(1)` if the window can be filled up with widgets from this point -/// until `nk_end` or `false(0)` otherwise for example if minimized -*/ + +/** + * # # nk_begin + * Starts a new window; needs to be called every frame for every + * window (unless hidden) or otherwise the window gets removed + * + * ```c + * nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] title | Window title and identifier. Needs to be persistent over frames to identify the window + * \param[in] bounds | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame + * \param[in] flags | Window flags defined in the nk_panel_flags section with a number of different window behaviors + * + * \returns `true(1)` if the window can be filled up with widgets from this point + * until `nk_end` or `false(0)` otherwise for example if minimized + + */ NK_API nk_bool nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags); -/*/// #### nk_begin_titled -/// Extended window start with separated title and identifier to allow multiple -/// windows with same title but not name -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Window identifier. Needs to be persistent over frames to identify the window -/// __title__ | Window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set -/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors -/// -/// Returns `true(1)` if the window can be filled up with widgets from this point -/// until `nk_end` or `false(0)` otherwise for example if minimized -*/ + +/** + * # # nk_begin_titled + * Extended window start with separated title and identifier to allow multiple + * windows with same title but not name + * + * ```c + * nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Window identifier. Needs to be persistent over frames to identify the window + * \param[in] title | Window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set + * \param[in] bounds | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame + * \param[in] flags | Window flags defined in the nk_panel_flags section with a number of different window behaviors + * + * \returns `true(1)` if the window can be filled up with widgets from this point + * until `nk_end` or `false(0)` otherwise for example if minimized + + */ NK_API nk_bool nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags); -/*/// #### nk_end -/// Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup. -/// All widget calls after this functions will result in asserts or no state changes -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_end(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -*/ + +/** + * # # nk_end + * Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup. + * All widget calls after this functions will result in asserts or no state changes + * + * ```c + * void nk_end(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + + */ NK_API void nk_end(struct nk_context *ctx); -/*/// #### nk_window_find -/// Finds and returns a window from passed name -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_window *nk_window_find(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Window identifier -/// -/// Returns a `nk_window` struct pointing to the identified window or NULL if -/// no window with the given name was found -*/ -NK_API struct nk_window *nk_window_find(struct nk_context *ctx, const char *name); -/*/// #### nk_window_get_bounds -/// Returns a rectangle with screen position and size of the currently processed window -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_window_get_bounds(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a `nk_rect` struct with window upper left window position and size -*/ + +/** + * # # nk_window_find + * Finds and returns a window from passed name + * + * ```c + * struct nk_window *nk_window_find(struct nk_context *ctx, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Window identifier + * + * \returns a `nk_window` struct pointing to the identified window or NULL if + * no window with the given name was found + */ +NK_API struct nk_window *nk_window_find(const struct nk_context *ctx, const char *name); + +/** + * # # nk_window_get_bounds + * \returns a rectangle with screen position and size of the currently processed window + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * struct nk_rect nk_window_get_bounds(const struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns a `nk_rect` struct with window upper left window position and size + + */ NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx); -/*/// #### nk_window_get_position -/// Returns the position of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_position(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a `nk_vec2` struct with window upper left position -*/ + +/** + * # # nk_window_get_position + * \returns the position of the currently processed window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * struct nk_vec2 nk_window_get_position(const struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns a `nk_vec2` struct with window upper left position + + */ NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx); -/*/// #### nk_window_get_size -/// Returns the size with width and height of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_size(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a `nk_vec2` struct with window width and height -*/ -NK_API struct nk_vec2 nk_window_get_size(const struct nk_context*); -/*/// #### nk_window_get_width -/// Returns the width of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_window_get_width(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns the current window width -*/ -NK_API float nk_window_get_width(const struct nk_context*); -/*/// #### nk_window_get_height -/// Returns the height of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_window_get_height(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns the current window height -*/ -NK_API float nk_window_get_height(const struct nk_context*); -/*/// #### nk_window_get_panel -/// Returns the underlying panel which contains all processing state of the current window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// !!! WARNING -/// Do not keep the returned panel pointer around, it is only valid until `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_panel* nk_window_get_panel(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a pointer to window internal `nk_panel` state. -*/ -NK_API struct nk_panel* nk_window_get_panel(struct nk_context*); -/*/// #### nk_window_get_content_region -/// Returns the position and size of the currently visible and non-clipped space -/// inside the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_window_get_content_region(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `nk_rect` struct with screen position and size (no scrollbar offset) -/// of the visible space inside the current window -*/ -NK_API struct nk_rect nk_window_get_content_region(struct nk_context*); -/*/// #### nk_window_get_content_region_min -/// Returns the upper left position of the currently visible and non-clipped -/// space inside the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_content_region_min(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// returns `nk_vec2` struct with upper left screen position (no scrollbar offset) -/// of the visible space inside the current window -*/ -NK_API struct nk_vec2 nk_window_get_content_region_min(struct nk_context*); -/*/// #### nk_window_get_content_region_max -/// Returns the lower right screen position of the currently visible and -/// non-clipped space inside the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_content_region_max(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `nk_vec2` struct with lower right screen position (no scrollbar offset) -/// of the visible space inside the current window -*/ -NK_API struct nk_vec2 nk_window_get_content_region_max(struct nk_context*); -/*/// #### nk_window_get_content_region_size -/// Returns the size of the currently visible and non-clipped space inside the -/// currently processed window -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_content_region_size(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `nk_vec2` struct with size the visible space inside the current window -*/ -NK_API struct nk_vec2 nk_window_get_content_region_size(struct nk_context*); -/*/// #### nk_window_get_canvas -/// Returns the draw command buffer. Can be used to draw custom widgets -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// !!! WARNING -/// Do not keep the returned command buffer pointer around it is only valid until `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_command_buffer* nk_window_get_canvas(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a pointer to window internal `nk_command_buffer` struct used as -/// drawing canvas. Can be used to do custom drawing. -*/ -NK_API struct nk_command_buffer* nk_window_get_canvas(struct nk_context*); -/*/// #### nk_window_get_scroll -/// Gets the scroll offset for the current window -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __offset_x__ | A pointer to the x offset output (or NULL to ignore) -/// __offset_y__ | A pointer to the y offset output (or NULL to ignore) -*/ -NK_API void nk_window_get_scroll(struct nk_context*, nk_uint *offset_x, nk_uint *offset_y); -/*/// #### nk_window_has_focus -/// Returns if the currently processed window is currently active -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_has_focus(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `false(0)` if current window is not active or `true(1)` if it is -*/ -NK_API nk_bool nk_window_has_focus(const struct nk_context*); -/*/// #### nk_window_is_hovered -/// Return if the current window is being hovered -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_is_hovered(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `true(1)` if current window is hovered or `false(0)` otherwise -*/ -NK_API nk_bool nk_window_is_hovered(struct nk_context*); -/*/// #### nk_window_is_collapsed -/// Returns if the window with given name is currently minimized/collapsed -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_is_collapsed(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is collapsed -/// -/// Returns `true(1)` if current window is minimized and `false(0)` if window not -/// found or is not minimized -*/ -NK_API nk_bool nk_window_is_collapsed(struct nk_context *ctx, const char *name); -/*/// #### nk_window_is_closed -/// Returns if the window with given name was closed by calling `nk_close` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_is_closed(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is closed -/// -/// Returns `true(1)` if current window was closed or `false(0)` window not found or not closed -*/ -NK_API nk_bool nk_window_is_closed(struct nk_context*, const char*); -/*/// #### nk_window_is_hidden -/// Returns if the window with given name is hidden -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_is_hidden(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is hidden -/// -/// Returns `true(1)` if current window is hidden or `false(0)` window not found or visible -*/ -NK_API nk_bool nk_window_is_hidden(struct nk_context*, const char*); -/*/// #### nk_window_is_active -/// Same as nk_window_has_focus for some reason -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_is_active(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is active -/// -/// Returns `true(1)` if current window is active or `false(0)` window not found or not active -*/ -NK_API nk_bool nk_window_is_active(struct nk_context*, const char*); -/*/// #### nk_window_is_any_hovered -/// Returns if the any window is being hovered -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_window_is_any_hovered(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `true(1)` if any window is hovered or `false(0)` otherwise -*/ -NK_API nk_bool nk_window_is_any_hovered(struct nk_context*); -/*/// #### nk_item_is_any_active -/// Returns if the any window is being hovered or any widget is currently active. -/// Can be used to decide if input should be processed by UI or your specific input handling. -/// Example could be UI and 3D camera to move inside a 3D space. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_item_is_any_active(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `true(1)` if any window is hovered or any item is active or `false(0)` otherwise -*/ -NK_API nk_bool nk_item_is_any_active(struct nk_context*); -/*/// #### nk_window_set_bounds -/// Updates position and size of window with passed in name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to modify both position and size -/// __bounds__ | Must point to a `nk_rect` struct with the new position and size -*/ -NK_API void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds); -/*/// #### nk_window_set_position -/// Updates position of window with passed name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to modify both position -/// __pos__ | Must point to a `nk_vec2` struct with the new position -*/ -NK_API void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos); -/*/// #### nk_window_set_size -/// Updates size of window with passed in name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to modify both window size -/// __size__ | Must point to a `nk_vec2` struct with new window size -*/ -NK_API void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2); -/*/// #### nk_window_set_focus -/// Sets the window with given name as active -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_focus(struct nk_context*, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to set focus on -*/ -NK_API void nk_window_set_focus(struct nk_context*, const char *name); -/*/// #### nk_window_set_scroll -/// Sets the scroll offset for the current window -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __offset_x__ | The x offset to scroll to -/// __offset_y__ | The y offset to scroll to -*/ -NK_API void nk_window_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y); -/*/// #### nk_window_close -/// Closes a window and marks it for being freed at the end of the frame -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_close(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to close -*/ -NK_API void nk_window_close(struct nk_context *ctx, const char *name); -/*/// #### nk_window_collapse -/// Updates collapse state of a window with given name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to close -/// __state__ | value out of nk_collapse_states section -*/ -NK_API void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state); -/*/// #### nk_window_collapse_if -/// Updates collapse state of a window with given name if given condition is met -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to either collapse or maximize -/// __state__ | value out of nk_collapse_states section the window should be put into -/// __cond__ | condition that has to be met to actually commit the collapse state change -*/ -NK_API void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond); -/*/// #### nk_window_show -/// updates visibility state of a window with given name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_show(struct nk_context*, const char *name, enum nk_show_states); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to either collapse or maximize -/// __state__ | state with either visible or hidden to modify the window with -*/ -NK_API void nk_window_show(struct nk_context*, const char *name, enum nk_show_states); -/*/// #### nk_window_show_if -/// Updates visibility state of a window with given name if a given condition is met -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to either hide or show -/// __state__ | state with either visible or hidden to modify the window with -/// __cond__ | condition that has to be met to actually commit the visbility state change -*/ -NK_API void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond); -/* ============================================================================= + +/** + * # # nk_window_get_size + * \returns the size with width and height of the currently processed window. * - * LAYOUT + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * struct nk_vec2 nk_window_get_size(const struct nk_context *ctx); + * ``` * - * ============================================================================= -/// ### Layouting -/// Layouting in general describes placing widget inside a window with position and size. -/// While in this particular implementation there are five different APIs for layouting -/// each with different trade offs between control and ease of use.

-/// -/// All layouting methods in this library are based around the concept of a row. -/// A row has a height the window content grows by and a number of columns and each -/// layouting method specifies how each widget is placed inside the row. -/// After a row has been allocated by calling a layouting functions and then -/// filled with widgets will advance an internal pointer over the allocated row.

-/// -/// To actually define a layout you just call the appropriate layouting function -/// and each subsequent widget call will place the widget as specified. Important -/// here is that if you define more widgets then columns defined inside the layout -/// functions it will allocate the next row without you having to make another layouting

-/// call. -/// -/// Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API -/// is that you have to define the row height for each. However the row height -/// often depends on the height of the font.

-/// -/// To fix that internally nuklear uses a minimum row height that is set to the -/// height plus padding of currently active font and overwrites the row height -/// value if zero.

-/// -/// If you manually want to change the minimum row height then -/// use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to -/// reset it back to be derived from font height.

-/// -/// Also if you change the font in nuklear it will automatically change the minimum -/// row height for you and. This means if you change the font but still want -/// a minimum row height smaller than the font you have to repush your value.

-/// -/// For actually more advanced UI I would even recommend using the `nk_layout_space_xxx` -/// layouting method in combination with a cassowary constraint solver (there are -/// some versions on github with permissive license model) to take over all control over widget -/// layouting yourself. However for quick and dirty layouting using all the other layouting -/// functions should be fine. -/// -/// #### Usage -/// 1. __nk_layout_row_dynamic__

-/// The easiest layouting function is `nk_layout_row_dynamic`. It provides each -/// widgets with same horizontal space inside the row and dynamically grows -/// if the owning window grows in width. So the number of columns dictates -/// the size of each widget dynamically by formula: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// widget_width = (window_width - padding - spacing) * (1/colum_count) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Just like all other layouting APIs if you define more widget than columns this -/// library will allocate a new row and keep all layouting parameters previously -/// defined. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // first row with height: 30 composed of two widgets -/// nk_layout_row_dynamic(&ctx, 30, 2); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // second row with same parameter as defined above -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // third row uses 0 for height which will use auto layouting -/// nk_layout_row_dynamic(&ctx, 0, 2); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 2. __nk_layout_row_static__

-/// Another easy layouting function is `nk_layout_row_static`. It provides each -/// widget with same horizontal pixel width inside the row and does not grow -/// if the owning window scales smaller or bigger. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // first row with height: 30 composed of two widgets with width: 80 -/// nk_layout_row_static(&ctx, 30, 80, 2); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // second row with same parameter as defined above -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // third row uses 0 for height which will use auto layouting -/// nk_layout_row_static(&ctx, 0, 80, 2); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 3. __nk_layout_row_xxx__

-/// A little bit more advanced layouting API are functions `nk_layout_row_begin`, -/// `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly -/// specify each column pixel or window ratio in a row. It supports either -/// directly setting per column pixel width or widget window ratio but not -/// both. Furthermore it is a immediate mode API so each value is directly -/// pushed before calling a widget. Therefore the layout is not automatically -/// repeating like the last two layouting functions. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // first row with height: 25 composed of two widgets with width 60 and 40 -/// nk_layout_row_begin(ctx, NK_STATIC, 25, 2); -/// nk_layout_row_push(ctx, 60); -/// nk_widget(...); -/// nk_layout_row_push(ctx, 40); -/// nk_widget(...); -/// nk_layout_row_end(ctx); -/// // -/// // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75 -/// nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2); -/// nk_layout_row_push(ctx, 0.25f); -/// nk_widget(...); -/// nk_layout_row_push(ctx, 0.75f); -/// nk_widget(...); -/// nk_layout_row_end(ctx); -/// // -/// // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75 -/// nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2); -/// nk_layout_row_push(ctx, 0.25f); -/// nk_widget(...); -/// nk_layout_row_push(ctx, 0.75f); -/// nk_widget(...); -/// nk_layout_row_end(ctx); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 4. __nk_layout_row__

-/// The array counterpart to API nk_layout_row_xxx is the single nk_layout_row -/// functions. Instead of pushing either pixel or window ratio for every widget -/// it allows to define it by array. The trade of for less control is that -/// `nk_layout_row` is automatically repeating. Otherwise the behavior is the -/// same. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // two rows with height: 30 composed of two widgets with width 60 and 40 -/// const float size[] = {60,40}; -/// nk_layout_row(ctx, NK_STATIC, 30, 2, ratio); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75 -/// const float ratio[] = {0.25, 0.75}; -/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75 -/// const float ratio[] = {0.25, 0.75}; -/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 5. __nk_layout_row_template_xxx__

-/// The most complex and second most flexible API is a simplified flexbox version without -/// line wrapping and weights for dynamic widgets. It is an immediate mode API but -/// unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called -/// before calling the templated widgets. -/// The row template layout has three different per widget size specifier. The first -/// one is the `nk_layout_row_template_push_static` with fixed widget pixel width. -/// They do not grow if the row grows and will always stay the same. -/// The second size specifier is `nk_layout_row_template_push_variable` -/// which defines a minimum widget size but it also can grow if more space is available -/// not taken by other widgets. -/// Finally there are dynamic widgets with `nk_layout_row_template_push_dynamic` -/// which are completely flexible and unlike variable widgets can even shrink -/// to zero if not enough space is provided. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // two rows with height: 30 composed of three widgets -/// nk_layout_row_template_begin(ctx, 30); -/// nk_layout_row_template_push_dynamic(ctx); -/// nk_layout_row_template_push_variable(ctx, 80); -/// nk_layout_row_template_push_static(ctx, 80); -/// nk_layout_row_template_end(ctx); -/// // -/// // first row -/// nk_widget(...); // dynamic widget can go to zero if not enough space -/// nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space -/// nk_widget(...); // static widget with fixed 80 pixel width -/// // -/// // second row same layout -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 6. __nk_layout_space_xxx__

-/// Finally the most flexible API directly allows you to place widgets inside the -/// window. The space layout API is an immediate mode API which does not support -/// row auto repeat and directly sets position and size of a widget. Position -/// and size hereby can be either specified as ratio of allocated space or -/// allocated space local position and pixel size. Since this API is quite -/// powerful there are a number of utility functions to get the available space -/// and convert between local allocated space and screen space. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) -/// nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX); -/// nk_layout_space_push(ctx, nk_rect(0,0,150,200)); -/// nk_widget(...); -/// nk_layout_space_push(ctx, nk_rect(200,200,100,200)); -/// nk_widget(...); -/// nk_layout_space_end(ctx); -/// // -/// // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) -/// nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX); -/// nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1)); -/// nk_widget(...); -/// nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1)); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// ----------------------------------------|------------------------------------ -/// nk_layout_set_min_row_height | Set the currently used minimum row height to a specified value -/// nk_layout_reset_min_row_height | Resets the currently used minimum row height to font height -/// nk_layout_widget_bounds | Calculates current width a static layout row can fit inside a window -/// nk_layout_ratio_from_pixel | Utility functions to calculate window ratio from pixel size -// -/// nk_layout_row_dynamic | Current layout is divided into n same sized growing columns -/// nk_layout_row_static | Current layout is divided into n same fixed sized columns -/// nk_layout_row_begin | Starts a new row with given height and number of columns -/// nk_layout_row_push | Pushes another column with given size or window ratio -/// nk_layout_row_end | Finished previously started row -/// nk_layout_row | Specifies row columns in array as either window ratio or size -// -/// nk_layout_row_template_begin | Begins the row template declaration -/// nk_layout_row_template_push_dynamic | Adds a dynamic column that dynamically grows and can go to zero if not enough space -/// nk_layout_row_template_push_variable | Adds a variable column that dynamically grows but does not shrink below specified pixel width -/// nk_layout_row_template_push_static | Adds a static column that does not grow and will always have the same size -/// nk_layout_row_template_end | Marks the end of the row template -// -/// nk_layout_space_begin | Begins a new layouting space that allows to specify each widgets position and size -/// nk_layout_space_push | Pushes position and size of the next widget in own coordinate space either as pixel or ratio -/// nk_layout_space_end | Marks the end of the layouting space -// -/// nk_layout_space_bounds | Callable after nk_layout_space_begin and returns total space allocated -/// nk_layout_space_to_screen | Converts vector from nk_layout_space coordinate space into screen space -/// nk_layout_space_to_local | Converts vector from screen space into nk_layout_space coordinates -/// nk_layout_space_rect_to_screen | Converts rectangle from nk_layout_space coordinate space into screen space -/// nk_layout_space_rect_to_local | Converts rectangle from screen space into nk_layout_space coordinates -*/ -/*/// #### nk_layout_set_min_row_height -/// Sets the currently used minimum row height. -/// !!! WARNING -/// The passed height needs to include both your preferred row height -/// as well as padding. No internal padding is added. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_set_min_row_height(struct nk_context*, float height); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | New minimum row height to be used for auto generating the row height -*/ + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns a `nk_vec2` struct with window width and height + + */ +NK_API struct nk_vec2 nk_window_get_size(const struct nk_context *ctx); + +/** + * nk_window_get_width + * \returns the width of the currently processed window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * float nk_window_get_width(const struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns the current window width + */ +NK_API float nk_window_get_width(const struct nk_context *ctx); + +/** + * # # nk_window_get_height + * \returns the height of the currently processed window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * float nk_window_get_height(const struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns the current window height + + */ +NK_API float nk_window_get_height(const struct nk_context* ctx); + +/** + * # # nk_window_get_panel + * \returns the underlying panel which contains all processing state of the current window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * !!! \warning + * Do not keep the returned panel pointer around, it is only valid until `nk_end` + * ```c + * struct nk_panel* nk_window_get_panel(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns a pointer to window internal `nk_panel` state. + + */ +NK_API struct nk_panel* nk_window_get_panel(const struct nk_context* ctx); + +/** + * # # nk_window_get_content_region + * \returns the position and size of the currently visible and non-clipped space + * inside the currently processed window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * + * ```c + * struct nk_rect nk_window_get_content_region(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `nk_rect` struct with screen position and size (no scrollbar offset) + * of the visible space inside the current window + + */ +NK_API struct nk_rect nk_window_get_content_region(const struct nk_context* ctx); + +/** + * # # nk_window_get_content_region_min + * \returns the upper left position of the currently visible and non-clipped + * space inside the currently processed window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * + * ```c + * struct nk_vec2 nk_window_get_content_region_min(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * returns `nk_vec2` struct with upper left screen position (no scrollbar offset) + * of the visible space inside the current window + + */ +NK_API struct nk_vec2 nk_window_get_content_region_min(const struct nk_context *ctx); + +/** + * # # nk_window_get_content_region_max + * \returns the lower right screen position of the currently visible and + * non-clipped space inside the currently processed window. + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * + * ```c + * struct nk_vec2 nk_window_get_content_region_max(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `nk_vec2` struct with lower right screen position (no scrollbar offset) + * of the visible space inside the current window + + */ +NK_API struct nk_vec2 nk_window_get_content_region_max(const struct nk_context *ctx); + +/** + * # # nk_window_get_content_region_size + * \returns the size of the currently visible and non-clipped space inside the + * currently processed window + * + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * + * ```c + * struct nk_vec2 nk_window_get_content_region_size(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `nk_vec2` struct with size the visible space inside the current window + + */ +NK_API struct nk_vec2 nk_window_get_content_region_size(const struct nk_context *ctx); + +/** + * # # nk_window_get_canvas + * \returns the draw command buffer. Can be used to draw custom widgets + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * !!! \warning + * Do not keep the returned command buffer pointer around it is only valid until `nk_end` + * + * ```c + * struct nk_command_buffer* nk_window_get_canvas(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns a pointer to window internal `nk_command_buffer` struct used as + * drawing canvas. Can be used to do custom drawing. + */ +NK_API struct nk_command_buffer* nk_window_get_canvas(const struct nk_context* ctx); + +/** + * # # nk_window_get_scroll + * Gets the scroll offset for the current window + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * + * ```c + * void nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y); + * ``` + * + * Parameter | Description + * -------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] offset_x | A pointer to the x offset output (or NULL to ignore) + * \param[in] offset_y | A pointer to the y offset output (or NULL to ignore) + + */ +NK_API void nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y); + +/** + * # # nk_window_has_focus + * \returns if the currently processed window is currently active + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * nk_bool nk_window_has_focus(const struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `false(0)` if current window is not active or `true(1)` if it is + + */ +NK_API nk_bool nk_window_has_focus(const struct nk_context *ctx); + +/** + * # # nk_window_is_hovered + * Return if the current window is being hovered + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * ```c + * nk_bool nk_window_is_hovered(struct nk_context *ctx); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `true(1)` if current window is hovered or `false(0)` otherwise + + */ +NK_API nk_bool nk_window_is_hovered(const struct nk_context *ctx); + +/** + * # # nk_window_is_collapsed + * \returns if the window with given name is currently minimized/collapsed + * ```c + * nk_bool nk_window_is_collapsed(struct nk_context *ctx, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of window you want to check if it is collapsed + * + * \returns `true(1)` if current window is minimized and `false(0)` if window not + * found or is not minimized + + */ +NK_API nk_bool nk_window_is_collapsed(const struct nk_context *ctx, const char *name); + +/** + * # # nk_window_is_closed + * \returns if the window with given name was closed by calling `nk_close` + * ```c + * nk_bool nk_window_is_closed(struct nk_context *ctx, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of window you want to check if it is closed + * + * \returns `true(1)` if current window was closed or `false(0)` window not found or not closed + + */ +NK_API nk_bool nk_window_is_closed(const struct nk_context *ctx, const char* name); + +/** + * # # nk_window_is_hidden + * \returns if the window with given name is hidden + * ```c + * nk_bool nk_window_is_hidden(struct nk_context *ctx, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of window you want to check if it is hidden + * + * \returns `true(1)` if current window is hidden or `false(0)` window not found or visible + + */ +NK_API nk_bool nk_window_is_hidden(const struct nk_context *ctx, const char* name); + +/** + * # # nk_window_is_active + * Same as nk_window_has_focus for some reason + * ```c + * nk_bool nk_window_is_active(struct nk_context *ctx, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of window you want to check if it is active + * + * \returns `true(1)` if current window is active or `false(0)` window not found or not active + */ +NK_API nk_bool nk_window_is_active(const struct nk_context *ctx, const char* name); + +/** + * # # nk_window_is_any_hovered + * \returns if the any window is being hovered + * ```c + * nk_bool nk_window_is_any_hovered(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `true(1)` if any window is hovered or `false(0)` otherwise + */ +NK_API nk_bool nk_window_is_any_hovered(const struct nk_context *ctx); + +/** + * # # nk_item_is_any_active + * \returns if the any window is being hovered or any widget is currently active. + * Can be used to decide if input should be processed by UI or your specific input handling. + * Example could be UI and 3D camera to move inside a 3D space. + * ```c + * nk_bool nk_item_is_any_active(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * + * \returns `true(1)` if any window is hovered or any item is active or `false(0)` otherwise + + */ +NK_API nk_bool nk_item_is_any_active(const struct nk_context *ctx); + +/** + * # # nk_window_set_bounds + * Updates position and size of window with passed in name + * ```c + * void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to modify both position and size + * \param[in] bounds | Must point to a `nk_rect` struct with the new position and size + + */ +NK_API void nk_window_set_bounds(struct nk_context *ctx, const char *name, struct nk_rect bounds); + +/** + * # # nk_window_set_position + * Updates position of window with passed name + * ```c + * void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to modify both position + * \param[in] pos | Must point to a `nk_vec2` struct with the new position + + */ +NK_API void nk_window_set_position(struct nk_context *ctx, const char *name, struct nk_vec2 pos); + +/** + * # # nk_window_set_size + * Updates size of window with passed in name + * ```c + * void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to modify both window size + * \param[in] size | Must point to a `nk_vec2` struct with new window size + + */ +NK_API void nk_window_set_size(struct nk_context *ctx, const char *name, struct nk_vec2 size); + +/** + * # # nk_window_set_focus + * Sets the window with given name as active + * ```c + * void nk_window_set_focus(struct nk_context*, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to set focus on + + */ +NK_API void nk_window_set_focus(struct nk_context *ctx, const char *name); + +/** + * # # nk_window_set_scroll + * Sets the scroll offset for the current window + * !!! \warning + * Only call this function between calls `nk_begin_xxx` and `nk_end` + * + * ```c + * void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y); + * ``` + * + * Parameter | Description + * -------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] offset_x | The x offset to scroll to + * \param[in] offset_y | The y offset to scroll to + + */ +NK_API void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y); + +/** + * # # nk_window_close + * Closes a window and marks it for being freed at the end of the frame + * ```c + * void nk_window_close(struct nk_context *ctx, const char *name); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to close + + */ +NK_API void nk_window_close(struct nk_context *ctx, const char *name); + +/** + * # # nk_window_collapse + * Updates collapse state of a window with given name + * ```c + * void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to close + * \param[in] state | value out of nk_collapse_states section + + */ +NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states state); + +/** + * # # nk_window_collapse_if + * Updates collapse state of a window with given name if given condition is met + * ```c + * void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to either collapse or maximize + * \param[in] state | value out of nk_collapse_states section the window should be put into + * \param[in] cond | condition that has to be met to actually commit the collapse state change + + */ +NK_API void nk_window_collapse_if(struct nk_context *ctx, const char *name, enum nk_collapse_states state, int cond); + +/** + * # # nk_window_show + * updates visibility state of a window with given name + * ```c + * void nk_window_show(struct nk_context*, const char *name, enum nk_show_states); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to either collapse or maximize + * \param[in] state | state with either visible or hidden to modify the window with + */ +NK_API void nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states state); + +/** + * # # nk_window_show_if + * Updates visibility state of a window with given name if a given condition is met + * ```c + * void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] name | Identifier of the window to either hide or show + * \param[in] state | state with either visible or hidden to modify the window with + * \param[in] cond | condition that has to be met to actually commit the visibility state change + + */ +NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_show_states state, int cond); + +/** + * # # nk_window_show_if + * Line for visual separation. Draws a line with thickness determined by the current row height. + * ```c + * void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, NK_BOOL rounding) + * ``` + * + * Parameter | Description + * ----------------|------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] color | Color of the horizontal line + * \param[in] rounding | Whether or not to make the line round + */ +NK_API void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding); + +/* ============================================================================= + * + * LAYOUT + * + * =============================================================================*/ +/** + * \page Layouting + * Layouting in general describes placing widget inside a window with position and size. + * While in this particular implementation there are five different APIs for layouting + * each with different trade offs between control and ease of use.

+ * + * All layouting methods in this library are based around the concept of a row. + * A row has a height the window content grows by and a number of columns and each + * layouting method specifies how each widget is placed inside the row. + * After a row has been allocated by calling a layouting functions and then + * filled with widgets will advance an internal pointer over the allocated row.

+ * + * To actually define a layout you just call the appropriate layouting function + * and each subsequent widget call will place the widget as specified. Important + * here is that if you define more widgets then columns defined inside the layout + * functions it will allocate the next row without you having to make another layouting

+ * call. + * + * Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API + * is that you have to define the row height for each. However the row height + * often depends on the height of the font.

+ * + * To fix that internally nuklear uses a minimum row height that is set to the + * height plus padding of currently active font and overwrites the row height + * value if zero.

+ * + * If you manually want to change the minimum row height then + * use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to + * reset it back to be derived from font height.

+ * + * Also if you change the font in nuklear it will automatically change the minimum + * row height for you and. This means if you change the font but still want + * a minimum row height smaller than the font you have to repush your value.

+ * + * For actually more advanced UI I would even recommend using the `nk_layout_space_xxx` + * layouting method in combination with a cassowary constraint solver (there are + * some versions on github with permissive license model) to take over all control over widget + * layouting yourself. However for quick and dirty layouting using all the other layouting + * functions should be fine. + * + * # Usage + * 1. __nk_layout_row_dynamic__

+ * The easiest layouting function is `nk_layout_row_dynamic`. It provides each + * widgets with same horizontal space inside the row and dynamically grows + * if the owning window grows in width. So the number of columns dictates + * the size of each widget dynamically by formula: + * + * ```c + * widget_width = (window_width - padding - spacing) * (1/column_count) + * ``` + * + * Just like all other layouting APIs if you define more widget than columns this + * library will allocate a new row and keep all layouting parameters previously + * defined. + * + * ```c + * if (nk_begin_xxx(...) { + * // first row with height: 30 composed of two widgets + * nk_layout_row_dynamic(&ctx, 30, 2); + * nk_widget(...); + * nk_widget(...); + * // + * // second row with same parameter as defined above + * nk_widget(...); + * nk_widget(...); + * // + * // third row uses 0 for height which will use auto layouting + * nk_layout_row_dynamic(&ctx, 0, 2); + * nk_widget(...); + * nk_widget(...); + * } + * nk_end(...); + * ``` + * + * 2. __nk_layout_row_static__

+ * Another easy layouting function is `nk_layout_row_static`. It provides each + * widget with same horizontal pixel width inside the row and does not grow + * if the owning window scales smaller or bigger. + * + * ```c + * if (nk_begin_xxx(...) { + * // first row with height: 30 composed of two widgets with width: 80 + * nk_layout_row_static(&ctx, 30, 80, 2); + * nk_widget(...); + * nk_widget(...); + * // + * // second row with same parameter as defined above + * nk_widget(...); + * nk_widget(...); + * // + * // third row uses 0 for height which will use auto layouting + * nk_layout_row_static(&ctx, 0, 80, 2); + * nk_widget(...); + * nk_widget(...); + * } + * nk_end(...); + * ``` + * + * 3. __nk_layout_row_xxx__

+ * A little bit more advanced layouting API are functions `nk_layout_row_begin`, + * `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly + * specify each column pixel or window ratio in a row. It supports either + * directly setting per column pixel width or widget window ratio but not + * both. Furthermore it is a immediate mode API so each value is directly + * pushed before calling a widget. Therefore the layout is not automatically + * repeating like the last two layouting functions. + * + * ```c + * if (nk_begin_xxx(...) { + * // first row with height: 25 composed of two widgets with width 60 and 40 + * nk_layout_row_begin(ctx, NK_STATIC, 25, 2); + * nk_layout_row_push(ctx, 60); + * nk_widget(...); + * nk_layout_row_push(ctx, 40); + * nk_widget(...); + * nk_layout_row_end(ctx); + * // + * // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75 + * nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2); + * nk_layout_row_push(ctx, 0.25f); + * nk_widget(...); + * nk_layout_row_push(ctx, 0.75f); + * nk_widget(...); + * nk_layout_row_end(ctx); + * // + * // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75 + * nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2); + * nk_layout_row_push(ctx, 0.25f); + * nk_widget(...); + * nk_layout_row_push(ctx, 0.75f); + * nk_widget(...); + * nk_layout_row_end(ctx); + * } + * nk_end(...); + * ``` + * + * 4. __nk_layout_row__

+ * The array counterpart to API nk_layout_row_xxx is the single nk_layout_row + * functions. Instead of pushing either pixel or window ratio for every widget + * it allows to define it by array. The trade of for less control is that + * `nk_layout_row` is automatically repeating. Otherwise the behavior is the + * same. + * + * ```c + * if (nk_begin_xxx(...) { + * // two rows with height: 30 composed of two widgets with width 60 and 40 + * const float ratio[] = {60,40}; + * nk_layout_row(ctx, NK_STATIC, 30, 2, ratio); + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * // + * // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75 + * const float ratio[] = {0.25, 0.75}; + * nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * // + * // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75 + * const float ratio[] = {0.25, 0.75}; + * nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * } + * nk_end(...); + * ``` + * + * 5. __nk_layout_row_template_xxx__

+ * The most complex and second most flexible API is a simplified flexbox version without + * line wrapping and weights for dynamic widgets. It is an immediate mode API but + * unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called + * before calling the templated widgets. + * The row template layout has three different per widget size specifier. The first + * one is the `nk_layout_row_template_push_static` with fixed widget pixel width. + * They do not grow if the row grows and will always stay the same. + * The second size specifier is `nk_layout_row_template_push_variable` + * which defines a minimum widget size but it also can grow if more space is available + * not taken by other widgets. + * Finally there are dynamic widgets with `nk_layout_row_template_push_dynamic` + * which are completely flexible and unlike variable widgets can even shrink + * to zero if not enough space is provided. + * + * ```c + * if (nk_begin_xxx(...) { + * // two rows with height: 30 composed of three widgets + * nk_layout_row_template_begin(ctx, 30); + * nk_layout_row_template_push_dynamic(ctx); + * nk_layout_row_template_push_variable(ctx, 80); + * nk_layout_row_template_push_static(ctx, 80); + * nk_layout_row_template_end(ctx); + * // + * // first row + * nk_widget(...); // dynamic widget can go to zero if not enough space + * nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space + * nk_widget(...); // static widget with fixed 80 pixel width + * // + * // second row same layout + * nk_widget(...); + * nk_widget(...); + * nk_widget(...); + * } + * nk_end(...); + * ``` + * + * 6. __nk_layout_space_xxx__

+ * Finally the most flexible API directly allows you to place widgets inside the + * window. The space layout API is an immediate mode API which does not support + * row auto repeat and directly sets position and size of a widget. Position + * and size hereby can be either specified as ratio of allocated space or + * allocated space local position and pixel size. Since this API is quite + * powerful there are a number of utility functions to get the available space + * and convert between local allocated space and screen space. + * + * ```c + * if (nk_begin_xxx(...) { + * // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) + * nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX); + * nk_layout_space_push(ctx, nk_rect(0,0,150,200)); + * nk_widget(...); + * nk_layout_space_push(ctx, nk_rect(200,200,100,200)); + * nk_widget(...); + * nk_layout_space_end(ctx); + * // + * // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) + * nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX); + * nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1)); + * nk_widget(...); + * nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1)); + * nk_widget(...); + * } + * nk_end(...); + * ``` + * + * # Reference + * Function | Description + * ---------------------------------------------|------------------------------------ + * \ref nk_layout_set_min_row_height | Set the currently used minimum row height to a specified value + * \ref nk_layout_reset_min_row_height | Resets the currently used minimum row height to font height + * \ref nk_layout_widget_bounds | Calculates current width a static layout row can fit inside a window + * \ref nk_layout_ratio_from_pixel | Utility functions to calculate window ratio from pixel size + * \ref nk_layout_row_dynamic | Current layout is divided into n same sized growing columns + * \ref nk_layout_row_static | Current layout is divided into n same fixed sized columns + * \ref nk_layout_row_begin | Starts a new row with given height and number of columns + * \ref nk_layout_row_push | Pushes another column with given size or window ratio + * \ref nk_layout_row_end | Finished previously started row + * \ref nk_layout_row | Specifies row columns in array as either window ratio or size + * \ref nk_layout_row_template_begin | Begins the row template declaration + * \ref nk_layout_row_template_push_dynamic | Adds a dynamic column that dynamically grows and can go to zero if not enough space + * \ref nk_layout_row_template_push_variable | Adds a variable column that dynamically grows but does not shrink below specified pixel width + * \ref nk_layout_row_template_push_static | Adds a static column that does not grow and will always have the same size + * \ref nk_layout_row_template_end | Marks the end of the row template + * \ref nk_layout_space_begin | Begins a new layouting space that allows to specify each widgets position and size + * \ref nk_layout_space_push | Pushes position and size of the next widget in own coordinate space either as pixel or ratio + * \ref nk_layout_space_end | Marks the end of the layouting space + * \ref nk_layout_space_bounds | Callable after nk_layout_space_begin and returns total space allocated + * \ref nk_layout_space_to_screen | Converts vector from nk_layout_space coordinate space into screen space + * \ref nk_layout_space_to_local | Converts vector from screen space into nk_layout_space coordinates + * \ref nk_layout_space_rect_to_screen | Converts rectangle from nk_layout_space coordinate space into screen space + * \ref nk_layout_space_rect_to_local | Converts rectangle from screen space into nk_layout_space coordinates + */ + + + +enum nk_widget_align { + NK_WIDGET_ALIGN_LEFT = 0x01, + NK_WIDGET_ALIGN_CENTERED = 0x02, + NK_WIDGET_ALIGN_RIGHT = 0x04, + NK_WIDGET_ALIGN_TOP = 0x08, + NK_WIDGET_ALIGN_MIDDLE = 0x10, + NK_WIDGET_ALIGN_BOTTOM = 0x20 +}; +enum nk_widget_alignment { + NK_WIDGET_LEFT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_LEFT, + NK_WIDGET_CENTERED = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_CENTERED, + NK_WIDGET_RIGHT = NK_WIDGET_ALIGN_MIDDLE|NK_WIDGET_ALIGN_RIGHT +}; + +/** + * Sets the currently used minimum row height. + * !!! \warning + * The passed height needs to include both your preferred row height + * as well as padding. No internal padding is added. + * + * ```c + * void nk_layout_set_min_row_height(struct nk_context*, float height); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] height | New minimum row height to be used for auto generating the row height + */ NK_API void nk_layout_set_min_row_height(struct nk_context*, float height); -/*/// #### nk_layout_reset_min_row_height -/// Reset the currently used minimum row height back to `font_height + text_padding + padding` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_reset_min_row_height(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -*/ + +/** + * Reset the currently used minimum row height back to `font_height + text_padding + padding` + * ```c + * void nk_layout_reset_min_row_height(struct nk_context*); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + */ NK_API void nk_layout_reset_min_row_height(struct nk_context*); -/*/// #### nk_layout_widget_bounds -/// Returns the width of the next row allocate by one of the layouting functions -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_widget_bounds(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// -/// Return `nk_rect` with both position and size of the next row -*/ -NK_API struct nk_rect nk_layout_widget_bounds(struct nk_context*); -/*/// #### nk_layout_ratio_from_pixel -/// Utility functions to calculate window ratio from pixel size -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __pixel__ | Pixel_width to convert to window ratio -/// -/// Returns `nk_rect` with both position and size of the next row -*/ -NK_API float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width); -/*/// #### nk_layout_row_dynamic -/// Sets current row layout to share horizontal space -/// between @cols number of widgets evenly. Once called all subsequent widget -/// calls greater than @cols will allocate a new row with same layout. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widget inside row -*/ + +/** + * \brief Returns the width of the next row allocate by one of the layouting functions + * + * \details + * ```c + * struct nk_rect nk_layout_widget_bounds(struct nk_context*); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * + * \return `nk_rect` with both position and size of the next row + */ +NK_API struct nk_rect nk_layout_widget_bounds(const struct nk_context *ctx); + +/** + * \brief Utility functions to calculate window ratio from pixel size + * + * \details + * ```c + * float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] pixel | Pixel_width to convert to window ratio + * + * \returns `nk_rect` with both position and size of the next row + */ +NK_API float nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width); + +/** + * \brief Sets current row layout to share horizontal space + * between @cols number of widgets evenly. Once called all subsequent widget + * calls greater than @cols will allocate a new row with same layout. + * + * \details + * ```c + * void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] height | Holds height of each widget in row or zero for auto layouting + * \param[in] columns | Number of widget inside row + */ NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols); -/*/// #### nk_layout_row_static -/// Sets current row layout to fill @cols number of widgets -/// in row with same @item_width horizontal size. Once called all subsequent widget -/// calls greater than @cols will allocate a new row with same layout. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __width__ | Holds pixel width of each widget in the row -/// __columns__ | Number of widget inside row -*/ + +/** + * \brief Sets current row layout to fill @cols number of widgets + * in row with same @item_width horizontal size. Once called all subsequent widget + * calls greater than @cols will allocate a new row with same layout. + * + * \details + * ```c + * void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] height | Holds height of each widget in row or zero for auto layouting + * \param[in] width | Holds pixel width of each widget in the row + * \param[in] columns | Number of widget inside row + */ NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols); -/*/// #### nk_layout_row_begin -/// Starts a new dynamic or fixed row with given height and columns. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __fmt__ | either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns -/// __height__ | holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widget inside row -*/ + +/** + * \brief Starts a new dynamic or fixed row with given height and columns. + * + * \details + * ```c + * void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] fmt | either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns + * \param[in] height | holds height of each widget in row or zero for auto layouting + * \param[in] columns | Number of widget inside row + */ NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols); -/*/// #### nk_layout_row_push -/// Specifies either window ratio or width of a single column -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_push(struct nk_context*, float value); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __value__ | either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call -*/ + +/** + * \breif Specifies either window ratio or width of a single column + * + * \details + * ```c + * void nk_layout_row_push(struct nk_context*, float value); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] value | either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call + */ NK_API void nk_layout_row_push(struct nk_context*, float value); -/*/// #### nk_layout_row_end -/// Finished previously started row -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -*/ + +/** + * \brief Finished previously started row + * + * \details + * ```c + * void nk_layout_row_end(struct nk_context*); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + */ NK_API void nk_layout_row_end(struct nk_context*); -/*/// #### nk_layout_row -/// Specifies row columns in array as either window ratio or size -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widget inside row -*/ + +/** + * \brief Specifies row columns in array as either window ratio or size + * + * \details + * ```c + * void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] fmt | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns + * \param[in] height | Holds height of each widget in row or zero for auto layouting + * \param[in] columns | Number of widget inside row + */ NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio); -/*/// #### nk_layout_row_template_begin -/// Begins the row template declaration -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_begin(struct nk_context*, float row_height); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -*/ + +/** + * # # nk_layout_row_template_begin + * Begins the row template declaration + * ```c + * void nk_layout_row_template_begin(struct nk_context*, float row_height); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] height | Holds height of each widget in row or zero for auto layouting + */ NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height); -/*/// #### nk_layout_row_template_push_dynamic -/// Adds a dynamic column that dynamically grows and can go to zero if not enough space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_push_dynamic(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -*/ + +/** + * # # nk_layout_row_template_push_dynamic + * Adds a dynamic column that dynamically grows and can go to zero if not enough space + * ```c + * void nk_layout_row_template_push_dynamic(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] height | Holds height of each widget in row or zero for auto layouting + */ NK_API void nk_layout_row_template_push_dynamic(struct nk_context*); -/*/// #### nk_layout_row_template_push_variable -/// Adds a variable column that dynamically grows but does not shrink below specified pixel width -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_push_variable(struct nk_context*, float min_width); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __width__ | Holds the minimum pixel width the next column must always be -*/ + +/** + * # # nk_layout_row_template_push_variable + * Adds a variable column that dynamically grows but does not shrink below specified pixel width + * ```c + * void nk_layout_row_template_push_variable(struct nk_context*, float min_width); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] width | Holds the minimum pixel width the next column must always be + */ NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width); -/*/// #### nk_layout_row_template_push_static -/// Adds a static column that does not grow and will always have the same size -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_push_static(struct nk_context*, float width); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __width__ | Holds the absolute pixel width value the next column must be -*/ + +/** + * # # nk_layout_row_template_push_static + * Adds a static column that does not grow and will always have the same size + * ```c + * void nk_layout_row_template_push_static(struct nk_context*, float width); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] width | Holds the absolute pixel width value the next column must be + */ NK_API void nk_layout_row_template_push_static(struct nk_context*, float width); -/*/// #### nk_layout_row_template_end -/// Marks the end of the row template -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -*/ + +/** + * # # nk_layout_row_template_end + * Marks the end of the row template + * ```c + * void nk_layout_row_template_end(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + */ NK_API void nk_layout_row_template_end(struct nk_context*); -/*/// #### nk_layout_space_begin -/// Begins a new layouting space that allows to specify each widgets position and size. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widgets inside row -*/ + +/** + * # # nk_layout_space_begin + * Begins a new layouting space that allows to specify each widgets position and size. + * ```c + * void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` + * \param[in] fmt | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns + * \param[in] height | Holds height of each widget in row or zero for auto layouting + * \param[in] columns | Number of widgets inside row + */ NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count); -/*/// #### nk_layout_space_push -/// Pushes position and size of the next widget in own coordinate space either as pixel or ratio -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __bounds__ | Position and size in laoyut space local coordinates -*/ + +/** + * # # nk_layout_space_push + * Pushes position and size of the next widget in own coordinate space either as pixel or ratio + * ```c + * void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * \param[in] bounds | Position and size in laoyut space local coordinates + */ NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds); -/*/// #### nk_layout_space_end -/// Marks the end of the layout space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_space_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -*/ + +/** + * # # nk_layout_space_end + * Marks the end of the layout space + * ```c + * void nk_layout_space_end(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + */ NK_API void nk_layout_space_end(struct nk_context*); -/*/// #### nk_layout_space_bounds -/// Utility function to calculate total space allocated for `nk_layout_space` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_space_bounds(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// -/// Returns `nk_rect` holding the total space allocated -*/ -NK_API struct nk_rect nk_layout_space_bounds(struct nk_context*); -/*/// #### nk_layout_space_to_screen -/// Converts vector from nk_layout_space coordinate space into screen space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __vec__ | Position to convert from layout space into screen coordinate space -/// -/// Returns transformed `nk_vec2` in screen space coordinates -*/ -NK_API struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2); -/*/// #### nk_layout_space_to_local -/// Converts vector from layout space into screen space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __vec__ | Position to convert from screen space into layout coordinate space -/// -/// Returns transformed `nk_vec2` in layout space coordinates -*/ -NK_API struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2); -/*/// #### nk_layout_space_rect_to_screen -/// Converts rectangle from screen space into layout space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __bounds__ | Rectangle to convert from layout space into screen space -/// -/// Returns transformed `nk_rect` in screen space coordinates -*/ -NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect); -/*/// #### nk_layout_space_rect_to_local -/// Converts rectangle from layout space into screen space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __bounds__ | Rectangle to convert from layout space into screen space -/// -/// Returns transformed `nk_rect` in layout space coordinates -*/ -NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); -/*/// #### nk_spacer -/// Spacer is a dummy widget that consumes space as usual but doesn't draw anything -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_spacer(struct nk_context* ); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// -*/ -NK_API void nk_spacer(struct nk_context* ); +/** + * # # nk_layout_space_bounds + * Utility function to calculate total space allocated for `nk_layout_space` + * ```c + * struct nk_rect nk_layout_space_bounds(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * + * \returns `nk_rect` holding the total space allocated + */ +NK_API struct nk_rect nk_layout_space_bounds(const struct nk_context *ctx); + +/** + * # # nk_layout_space_to_screen + * Converts vector from nk_layout_space coordinate space into screen space + * ```c + * struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * \param[in] vec | Position to convert from layout space into screen coordinate space + * + * \returns transformed `nk_vec2` in screen space coordinates + */ +NK_API struct nk_vec2 nk_layout_space_to_screen(const struct nk_context* ctx, struct nk_vec2 vec); + +/** + * # # nk_layout_space_to_local + * Converts vector from layout space into screen space + * ```c + * struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * \param[in] vec | Position to convert from screen space into layout coordinate space + * + * \returns transformed `nk_vec2` in layout space coordinates + */ +NK_API struct nk_vec2 nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 vec); + +/** + * # # nk_layout_space_rect_to_screen + * Converts rectangle from screen space into layout space + * ```c + * struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * \param[in] bounds | Rectangle to convert from layout space into screen space + * + * \returns transformed `nk_rect` in screen space coordinates + */ +NK_API struct nk_rect nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect bounds); + +/** + * # # nk_layout_space_rect_to_local + * Converts rectangle from layout space into screen space + * ```c + * struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * \param[in] bounds | Rectangle to convert from layout space into screen space + * + * \returns transformed `nk_rect` in layout space coordinates + */ +NK_API struct nk_rect nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect bounds); + +/** + * # # nk_spacer + * Spacer is a dummy widget that consumes space as usual but doesn't draw anything + * ```c + * void nk_spacer(struct nk_context* ); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` + * + */ +NK_API void nk_spacer(struct nk_context *ctx); -/* ============================================================================= +/** ============================================================================= * * GROUP * - * ============================================================================= -/// ### Groups -/// Groups are basically windows inside windows. They allow to subdivide space -/// in a window to layout widgets as a group. Almost all more complex widget -/// layouting requirements can be solved using groups and basic layouting -/// fuctionality. Groups just like windows are identified by an unique name and -/// internally keep track of scrollbar offsets by default. However additional -/// versions are provided to directly manage the scrollbar. -/// -/// #### Usage -/// To create a group you have to call one of the three `nk_group_begin_xxx` -/// functions to start group declarations and `nk_group_end` at the end. Furthermore it -/// is required to check the return value of `nk_group_begin_xxx` and only process -/// widgets inside the window if the value is not 0. -/// Nesting groups is possible and even encouraged since many layouting schemes -/// can only be achieved by nesting. Groups, unlike windows, need `nk_group_end` -/// to be only called if the corresponding `nk_group_begin_xxx` call does not return 0: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_group_begin_xxx(ctx, ...) { -/// // [... widgets ...] -/// nk_group_end(ctx); -/// } -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// In the grand concept groups can be called after starting a window -/// with `nk_begin_xxx` and before calling `nk_end`: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // Input -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// nk_input_xxx(...); -/// } -/// } -/// nk_input_end(&ctx); -/// // -/// // Window -/// if (nk_begin_xxx(...) { -/// // [...widgets...] -/// nk_layout_row_dynamic(...); -/// if (nk_group_begin_xxx(ctx, ...) { -/// //[... widgets ...] -/// nk_group_end(ctx); -/// } -/// } -/// nk_end(ctx); -/// // -/// // Draw -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// #### Reference -/// Function | Description -/// --------------------------------|------------------------------------------- -/// nk_group_begin | Start a new group with internal scrollbar handling -/// nk_group_begin_titled | Start a new group with separated name and title and internal scrollbar handling -/// nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero -/// nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset -/// nk_group_scrolled_begin | Start a new group with manual scrollbar handling -/// nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero -/// nk_group_get_scroll | Gets the scroll offset for the given group -/// nk_group_set_scroll | Sets the scroll offset for the given group -*/ -/*/// #### nk_group_begin -/// Starts a new widget group. Requires a previous layouting function to specify a pos/size. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_group_begin(struct nk_context*, const char *title, nk_flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __title__ | Must be an unique identifier for this group that is also used for the group header -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + * =============================================================================*/ +/** + * \page Groups + * Groups are basically windows inside windows. They allow to subdivide space + * in a window to layout widgets as a group. Almost all more complex widget + * layouting requirements can be solved using groups and basic layouting + * fuctionality. Groups just like windows are identified by an unique name and + * internally keep track of scrollbar offsets by default. However additional + * versions are provided to directly manage the scrollbar. + * + * # Usage + * To create a group you have to call one of the three `nk_group_begin_xxx` + * functions to start group declarations and `nk_group_end` at the end. Furthermore it + * is required to check the return value of `nk_group_begin_xxx` and only process + * widgets inside the window if the value is not 0. + * Nesting groups is possible and even encouraged since many layouting schemes + * can only be achieved by nesting. Groups, unlike windows, need `nk_group_end` + * to be only called if the corresponding `nk_group_begin_xxx` call does not return 0: + * + * ```c + * if (nk_group_begin_xxx(ctx, ...) { + * // [... widgets ...] + * nk_group_end(ctx); + * } + * ``` + * + * In the grand concept groups can be called after starting a window + * with `nk_begin_xxx` and before calling `nk_end`: + * + * ```c + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * // Input + * Event evt; + * nk_input_begin(&ctx); + * while (GetEvent(&evt)) { + * if (evt.type == MOUSE_MOVE) + * nk_input_motion(&ctx, evt.motion.x, evt.motion.y); + * else if (evt.type == [...]) { + * nk_input_xxx(...); + * } + * } + * nk_input_end(&ctx); + * // + * // Window + * if (nk_begin_xxx(...) { + * // [...widgets...] + * nk_layout_row_dynamic(...); + * if (nk_group_begin_xxx(ctx, ...) { + * //[... widgets ...] + * nk_group_end(ctx); + * } + * } + * nk_end(ctx); + * // + * // Draw + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * switch (cmd->type) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case ...: + * // [...] + * } + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * # Reference + * Function | Description + * --------------------------------|------------------------------------------- + * \ref nk_group_begin | Start a new group with internal scrollbar handling + * \ref nk_group_begin_titled | Start a new group with separated name and title and internal scrollbar handling + * \ref nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero + * \ref nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset + * \ref nk_group_scrolled_begin | Start a new group with manual scrollbar handling + * \ref nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero + * \ref nk_group_get_scroll | Gets the scroll offset for the given group + * \ref nk_group_set_scroll | Sets the scroll offset for the given group + */ + + /** + * \brief Starts a new widget group. Requires a previous layouting function to specify a pos/size. + * ```c + * nk_bool nk_group_begin(struct nk_context*, const char *title, nk_flags); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] title | Must be an unique identifier for this group that is also used for the group header + * \param[in] flags | Window flags defined in the nk_panel_flags section with a number of different group behaviors + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_group_begin(struct nk_context*, const char *title, nk_flags); -/*/// #### nk_group_begin_titled -/// Starts a new widget group. Requires a previous layouting function to specify a pos/size. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __id__ | Must be an unique identifier for this group -/// __title__ | Group header title -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + + /** + * \brief Starts a new widget group. Requires a previous layouting function to specify a pos/size. + * ```c + * nk_bool nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags); + * ``` + * + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] id | Must be an unique identifier for this group + * \param[in] title | Group header title + * \param[in] flags | Window flags defined in the nk_panel_flags section with a number of different group behaviors + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags); -/*/// #### nk_group_end -/// Ends a widget group -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -*/ + +/** + * # # nk_group_end + * Ends a widget group + * ```c + * void nk_group_end(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + */ NK_API void nk_group_end(struct nk_context*); -/*/// #### nk_group_scrolled_offset_begin -/// starts a new widget group. requires a previous layouting function to specify -/// a size. Does not keep track of scrollbar. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __x_offset__| Scrollbar x-offset to offset all widgets inside the group horizontally. -/// __y_offset__| Scrollbar y-offset to offset all widgets inside the group vertically -/// __title__ | Window unique group title used to both identify and display in the group header -/// __flags__ | Window flags from the nk_panel_flags section -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_group_scrolled_offset_begin + * starts a new widget group. requires a previous layouting function to specify + * a size. Does not keep track of scrollbar. + * ```c + * nk_bool nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] x_offset| Scrollbar x-offset to offset all widgets inside the group horizontally. + * \param[in] y_offset| Scrollbar y-offset to offset all widgets inside the group vertically + * \param[in] title | Window unique group title used to both identify and display in the group header + * \param[in] flags | Window flags from the nk_panel_flags section + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags); -/*/// #### nk_group_scrolled_begin -/// Starts a new widget group. requires a previous -/// layouting function to specify a size. Does not keep track of scrollbar. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __off__ | Both x- and y- scroll offset. Allows for manual scrollbar control -/// __title__ | Window unique group title used to both identify and display in the group header -/// __flags__ | Window flags from nk_panel_flags section -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_group_scrolled_begin + * Starts a new widget group. requires a previous + * layouting function to specify a size. Does not keep track of scrollbar. + * ```c + * nk_bool nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] off | Both x- and y- scroll offset. Allows for manual scrollbar control + * \param[in] title | Window unique group title used to both identify and display in the group header + * \param[in] flags | Window flags from nk_panel_flags section + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags); -/*/// #### nk_group_scrolled_end -/// Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_scrolled_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -*/ + +/** + * # # nk_group_scrolled_end + * Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin. + * ```c + * void nk_group_scrolled_end(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + */ NK_API void nk_group_scrolled_end(struct nk_context*); -/*/// #### nk_group_get_scroll -/// Gets the scroll position of the given group. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __id__ | The id of the group to get the scroll position of -/// __x_offset__ | A pointer to the x offset output (or NULL to ignore) -/// __y_offset__ | A pointer to the y offset output (or NULL to ignore) -*/ + +/** + * # # nk_group_get_scroll + * Gets the scroll position of the given group. + * ```c + * void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset); + * ``` + * + * Parameter | Description + * -------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] id | The id of the group to get the scroll position of + * \param[in] x_offset | A pointer to the x offset output (or NULL to ignore) + * \param[in] y_offset | A pointer to the y offset output (or NULL to ignore) + */ NK_API void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset); -/*/// #### nk_group_set_scroll -/// Sets the scroll position of the given group. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __id__ | The id of the group to scroll -/// __x_offset__ | The x offset to scroll to -/// __y_offset__ | The y offset to scroll to -*/ + +/** + * # # nk_group_set_scroll + * Sets the scroll position of the given group. + * ```c + * void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset); + * ``` + * + * Parameter | Description + * -------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] id | The id of the group to scroll + * \param[in] x_offset | The x offset to scroll to + * \param[in] y_offset | The y offset to scroll to + */ NK_API void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset); -/* ============================================================================= + +/** ============================================================================= * * TREE * - * ============================================================================= -/// ### Tree -/// Trees represent two different concept. First the concept of a collapsible -/// UI section that can be either in a hidden or visible state. They allow the UI -/// user to selectively minimize the current set of visible UI to comprehend. -/// The second concept are tree widgets for visual UI representation of trees.

-/// -/// Trees thereby can be nested for tree representations and multiple nested -/// collapsible UI sections. All trees are started by calling of the -/// `nk_tree_xxx_push_tree` functions and ended by calling one of the -/// `nk_tree_xxx_pop_xxx()` functions. Each starting functions takes a title label -/// and optionally an image to be displayed and the initial collapse state from -/// the nk_collapse_states section.

-/// -/// The runtime state of the tree is either stored outside the library by the caller -/// or inside which requires a unique ID. The unique ID can either be generated -/// automatically from `__FILE__` and `__LINE__` with function `nk_tree_push`, -/// by `__FILE__` and a user provided ID generated for example by loop index with -/// function `nk_tree_push_id` or completely provided from outside by user with -/// function `nk_tree_push_hashed`. -/// -/// #### Usage -/// To create a tree you have to call one of the seven `nk_tree_xxx_push_xxx` -/// functions to start a collapsible UI section and `nk_tree_xxx_pop` to mark the -/// end. -/// Each starting function will either return `false(0)` if the tree is collapsed -/// or hidden and therefore does not need to be filled with content or `true(1)` -/// if visible and required to be filled. -/// -/// !!! Note -/// The tree header does not require and layouting function and instead -/// calculates a auto height based on the currently used font size -/// -/// The tree ending functions only need to be called if the tree content is -/// actually visible. So make sure the tree push function is guarded by `if` -/// and the pop call is only taken if the tree is visible. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_tree_push(ctx, NK_TREE_TAB, "Tree", NK_MINIMIZED)) { -/// nk_layout_row_dynamic(...); -/// nk_widget(...); -/// nk_tree_pop(ctx); -/// } -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// ----------------------------|------------------------------------------- -/// nk_tree_push | Start a collapsible UI section with internal state management -/// nk_tree_push_id | Start a collapsible UI section with internal state management callable in a look -/// nk_tree_push_hashed | Start a collapsible UI section with internal state management with full control over internal unique ID use to store state -/// nk_tree_image_push | Start a collapsible UI section with image and label header -/// nk_tree_image_push_id | Start a collapsible UI section with image and label header and internal state management callable in a look -/// nk_tree_image_push_hashed | Start a collapsible UI section with image and label header and internal state management with full control over internal unique ID use to store state -/// nk_tree_pop | Ends a collapsible UI section -// -/// nk_tree_state_push | Start a collapsible UI section with external state management -/// nk_tree_state_image_push | Start a collapsible UI section with image and label header and external state management -/// nk_tree_state_pop | Ends a collapsabale UI section -/// -/// #### nk_tree_type -/// Flag | Description -/// ----------------|---------------------------------------- -/// NK_TREE_NODE | Highlighted tree header to mark a collapsible UI section -/// NK_TREE_TAB | Non-highlighted tree header closer to tree representations -*/ -/*/// #### nk_tree_push -/// Starts a collapsible UI section with internal state management -/// !!! WARNING -/// To keep track of the runtime tree collapsible state this function uses -/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want -/// to call this function in a loop please use `nk_tree_push_id` or -/// `nk_tree_push_hashed` instead. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_push(ctx, type, title, state) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + * =============================================================================*/ +/** + * \page Tree + * Trees represent two different concept. First the concept of a collapsible + * UI section that can be either in a hidden or visible state. They allow the UI + * user to selectively minimize the current set of visible UI to comprehend. + * The second concept are tree widgets for visual UI representation of trees.

+ * + * Trees thereby can be nested for tree representations and multiple nested + * collapsible UI sections. All trees are started by calling of the + * `nk_tree_xxx_push_tree` functions and ended by calling one of the + * `nk_tree_xxx_pop_xxx()` functions. Each starting functions takes a title label + * and optionally an image to be displayed and the initial collapse state from + * the nk_collapse_states section.

+ * + * The runtime state of the tree is either stored outside the library by the caller + * or inside which requires a unique ID. The unique ID can either be generated + * automatically from `__FILE__` and `__LINE__` with function `nk_tree_push`, + * by `__FILE__` and a user provided ID generated for example by loop index with + * function `nk_tree_push_id` or completely provided from outside by user with + * function `nk_tree_push_hashed`. + * + * # Usage + * To create a tree you have to call one of the seven `nk_tree_xxx_push_xxx` + * functions to start a collapsible UI section and `nk_tree_xxx_pop` to mark the + * end. + * Each starting function will either return `false(0)` if the tree is collapsed + * or hidden and therefore does not need to be filled with content or `true(1)` + * if visible and required to be filled. + * + * !!! Note + * The tree header does not require and layouting function and instead + * calculates a auto height based on the currently used font size + * + * The tree ending functions only need to be called if the tree content is + * actually visible. So make sure the tree push function is guarded by `if` + * and the pop call is only taken if the tree is visible. + * + * ```c + * if (nk_tree_push(ctx, NK_TREE_TAB, "Tree", NK_MINIMIZED)) { + * nk_layout_row_dynamic(...); + * nk_widget(...); + * nk_tree_pop(ctx); + * } + * ``` + * + * # Reference + * Function | Description + * ----------------------------|------------------------------------------- + * nk_tree_push | Start a collapsible UI section with internal state management + * nk_tree_push_id | Start a collapsible UI section with internal state management callable in a look + * nk_tree_push_hashed | Start a collapsible UI section with internal state management with full control over internal unique ID use to store state + * nk_tree_image_push | Start a collapsible UI section with image and label header + * nk_tree_image_push_id | Start a collapsible UI section with image and label header and internal state management callable in a look + * nk_tree_image_push_hashed | Start a collapsible UI section with image and label header and internal state management with full control over internal unique ID use to store state + * nk_tree_pop | Ends a collapsible UI section + * nk_tree_state_push | Start a collapsible UI section with external state management + * nk_tree_state_image_push | Start a collapsible UI section with image and label header and external state management + * nk_tree_state_pop | Ends a collapsabale UI section + * + * # nk_tree_type + * Flag | Description + * ----------------|---------------------------------------- + * NK_TREE_NODE | Highlighted tree header to mark a collapsible UI section + * NK_TREE_TAB | Non-highlighted tree header closer to tree representations + */ + +/** + * # # nk_tree_push + * Starts a collapsible UI section with internal state management + * !!! \warning + * To keep track of the runtime tree collapsible state this function uses + * defines `__FILE__` and `__LINE__` to generate a unique ID. If you want + * to call this function in a loop please use `nk_tree_push_id` or + * `nk_tree_push_hashed` instead. + * + * ```c + * #define nk_tree_push(ctx, type, title, state) + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] title | Label printed in the tree header + * \param[in] state | Initial tree state value out of nk_collapse_states + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ #define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__) -/*/// #### nk_tree_push_id -/// Starts a collapsible UI section with internal state management callable in a look -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_push_id(ctx, type, title, state, id) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __id__ | Loop counter index if this function is called in a loop -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_push_id + * Starts a collapsible UI section with internal state management callable in a look + * ```c + * #define nk_tree_push_id(ctx, type, title, state, id) + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] title | Label printed in the tree header + * \param[in] state | Initial tree state value out of nk_collapse_states + * \param[in] id | Loop counter index if this function is called in a loop + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ #define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id) -/*/// #### nk_tree_push_hashed -/// Start a collapsible UI section with internal state management with full -/// control over internal unique ID used to store state -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __hash__ | Memory block or string to generate the ID from -/// __len__ | Size of passed memory block or string in __hash__ -/// __seed__ | Seeding value if this function is called in a loop or default to `0` -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_push_hashed + * Start a collapsible UI section with internal state management with full + * control over internal unique ID used to store state + * ```c + * nk_bool nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] title | Label printed in the tree header + * \param[in] state | Initial tree state value out of nk_collapse_states + * \param[in] hash | Memory block or string to generate the ID from + * \param[in] len | Size of passed memory block or string in __hash__ + * \param[in] seed | Seeding value if this function is called in a loop or default to `0` + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/*/// #### nk_tree_image_push -/// Start a collapsible UI section with image and label header -/// !!! WARNING -/// To keep track of the runtime tree collapsible state this function uses -/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want -/// to call this function in a loop please use `nk_tree_image_push_id` or -/// `nk_tree_image_push_hashed` instead. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_image_push(ctx, type, img, title, state) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __img__ | Image to display inside the header on the left of the label -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_image_push + * Start a collapsible UI section with image and label header + * !!! \warning + * To keep track of the runtime tree collapsible state this function uses + * defines `__FILE__` and `__LINE__` to generate a unique ID. If you want + * to call this function in a loop please use `nk_tree_image_push_id` or + * `nk_tree_image_push_hashed` instead. + * + * ```c + * #define nk_tree_image_push(ctx, type, img, title, state) + * ``` + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] img | Image to display inside the header on the left of the label + * \param[in] title | Label printed in the tree header + * \param[in] state | Initial tree state value out of nk_collapse_states + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ #define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__) -/*/// #### nk_tree_image_push_id -/// Start a collapsible UI section with image and label header and internal state -/// management callable in a look -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_image_push_id(ctx, type, img, title, state, id) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __img__ | Image to display inside the header on the left of the label -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __id__ | Loop counter index if this function is called in a loop -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_image_push_id + * Start a collapsible UI section with image and label header and internal state + * management callable in a look + * + * ```c + * #define nk_tree_image_push_id(ctx, type, img, title, state, id) + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] img | Image to display inside the header on the left of the label + * \param[in] title | Label printed in the tree header + * \param[in] state | Initial tree state value out of nk_collapse_states + * \param[in] id | Loop counter index if this function is called in a loop + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ #define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id) -/*/// #### nk_tree_image_push_hashed -/// Start a collapsible UI section with internal state management with full -/// control over internal unique ID used to store state -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __img__ | Image to display inside the header on the left of the label -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __hash__ | Memory block or string to generate the ID from -/// __len__ | Size of passed memory block or string in __hash__ -/// __seed__ | Seeding value if this function is called in a loop or default to `0` -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_image_push_hashed + * Start a collapsible UI section with internal state management with full + * control over internal unique ID used to store state + * ```c + * nk_bool nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] img | Image to display inside the header on the left of the label + * \param[in] title | Label printed in the tree header + * \param[in] state | Initial tree state value out of nk_collapse_states + * \param[in] hash | Memory block or string to generate the ID from + * \param[in] len | Size of passed memory block or string in __hash__ + * \param[in] seed | Seeding value if this function is called in a loop or default to `0` + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/*/// #### nk_tree_pop -/// Ends a collapsabale UI section -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_tree_pop(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -*/ + +/** + * # # nk_tree_pop + * Ends a collapsabale UI section + * ```c + * void nk_tree_pop(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` + */ NK_API void nk_tree_pop(struct nk_context*); -/*/// #### nk_tree_state_push -/// Start a collapsible UI section with external state management -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Persistent state to update -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_state_push + * Start a collapsible UI section with external state management + * ```c + * nk_bool nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] title | Label printed in the tree header + * \param[in] state | Persistent state to update + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state); -/*/// #### nk_tree_state_image_push -/// Start a collapsible UI section with image and label header and external state management -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_bool nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -/// __img__ | Image to display inside the header on the left of the label -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Persistent state to update -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ + +/** + * # # nk_tree_state_image_push + * Start a collapsible UI section with image and label header and external state management + * ```c + * nk_bool nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` + * \param[in] img | Image to display inside the header on the left of the label + * \param[in] type | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node + * \param[in] title | Label printed in the tree header + * \param[in] state | Persistent state to update + * + * \returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise + */ NK_API nk_bool nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state); -/*/// #### nk_tree_state_pop -/// Ends a collapsabale UI section -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_tree_state_pop(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -*/ + +/** + * # # nk_tree_state_pop + * Ends a collapsabale UI section + * ```c + * void nk_tree_state_pop(struct nk_context*); + * ``` + * + * Parameter | Description + * ------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` + */ NK_API void nk_tree_state_pop(struct nk_context*); #define nk_tree_element_push(ctx, type, title, state, sel) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__) @@ -3074,31 +3302,34 @@ NK_API void nk_list_view_end(struct nk_list_view*); * * ============================================================================= */ enum nk_widget_layout_states { - NK_WIDGET_INVALID, /* The widget cannot be seen and is completely out of view */ - NK_WIDGET_VALID, /* The widget is completely inside the window and can be updated and drawn */ - NK_WIDGET_ROM /* The widget is partially visible and cannot be updated */ + NK_WIDGET_INVALID, /**< The widget cannot be seen and is completely out of view */ + NK_WIDGET_VALID, /**< The widget is completely inside the window and can be updated and drawn */ + NK_WIDGET_ROM, /**< The widget is partially visible and cannot be updated */ + NK_WIDGET_DISABLED /**< The widget is manually disabled and acts like NK_WIDGET_ROM */ }; enum nk_widget_states { NK_WIDGET_STATE_MODIFIED = NK_FLAG(1), - NK_WIDGET_STATE_INACTIVE = NK_FLAG(2), /* widget is neither active nor hovered */ - NK_WIDGET_STATE_ENTERED = NK_FLAG(3), /* widget has been hovered on the current frame */ - NK_WIDGET_STATE_HOVER = NK_FLAG(4), /* widget is being hovered */ - NK_WIDGET_STATE_ACTIVED = NK_FLAG(5),/* widget is currently activated */ - NK_WIDGET_STATE_LEFT = NK_FLAG(6), /* widget is from this frame on not hovered anymore */ - NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED, /* widget is being hovered */ - NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED /* widget is currently activated */ + NK_WIDGET_STATE_INACTIVE = NK_FLAG(2), /**!< widget is neither active nor hovered */ + NK_WIDGET_STATE_ENTERED = NK_FLAG(3), /**!< widget has been hovered on the current frame */ + NK_WIDGET_STATE_HOVER = NK_FLAG(4), /**!< widget is being hovered */ + NK_WIDGET_STATE_ACTIVED = NK_FLAG(5),/**!< widget is currently activated */ + NK_WIDGET_STATE_LEFT = NK_FLAG(6), /**!< widget is from this frame on not hovered anymore */ + NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED, /**!< widget is being hovered */ + NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED /**!< widget is currently activated */ }; NK_API enum nk_widget_layout_states nk_widget(struct nk_rect*, const struct nk_context*); -NK_API enum nk_widget_layout_states nk_widget_fitting(struct nk_rect*, struct nk_context*, struct nk_vec2); -NK_API struct nk_rect nk_widget_bounds(struct nk_context*); -NK_API struct nk_vec2 nk_widget_position(struct nk_context*); -NK_API struct nk_vec2 nk_widget_size(struct nk_context*); -NK_API float nk_widget_width(struct nk_context*); -NK_API float nk_widget_height(struct nk_context*); -NK_API nk_bool nk_widget_is_hovered(struct nk_context*); -NK_API nk_bool nk_widget_is_mouse_clicked(struct nk_context*, enum nk_buttons); -NK_API nk_bool nk_widget_has_mouse_click_down(struct nk_context*, enum nk_buttons, nk_bool down); +NK_API enum nk_widget_layout_states nk_widget_fitting(struct nk_rect*, const struct nk_context*, struct nk_vec2); +NK_API struct nk_rect nk_widget_bounds(const struct nk_context*); +NK_API struct nk_vec2 nk_widget_position(const struct nk_context*); +NK_API struct nk_vec2 nk_widget_size(const struct nk_context*); +NK_API float nk_widget_width(const struct nk_context*); +NK_API float nk_widget_height(const struct nk_context*); +NK_API nk_bool nk_widget_is_hovered(const struct nk_context*); +NK_API nk_bool nk_widget_is_mouse_clicked(const struct nk_context*, enum nk_buttons); +NK_API nk_bool nk_widget_has_mouse_click_down(const struct nk_context*, enum nk_buttons, nk_bool down); NK_API void nk_spacing(struct nk_context*, int cols); +NK_API void nk_widget_disable_begin(struct nk_context* ctx); +NK_API void nk_widget_disable_end(struct nk_context* ctx); /* ============================================================================= * * TEXT @@ -3176,10 +3407,13 @@ NK_API nk_bool nk_button_pop_behavior(struct nk_context*); * ============================================================================= */ NK_API nk_bool nk_check_label(struct nk_context*, const char*, nk_bool active); NK_API nk_bool nk_check_text(struct nk_context*, const char*, int, nk_bool active); +NK_API nk_bool nk_check_text_align(struct nk_context*, const char*, int, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment); NK_API unsigned nk_check_flags_label(struct nk_context*, const char*, unsigned int flags, unsigned int value); NK_API unsigned nk_check_flags_text(struct nk_context*, const char*, int, unsigned int flags, unsigned int value); NK_API nk_bool nk_checkbox_label(struct nk_context*, const char*, nk_bool *active); +NK_API nk_bool nk_checkbox_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment); NK_API nk_bool nk_checkbox_text(struct nk_context*, const char*, int, nk_bool *active); +NK_API nk_bool nk_checkbox_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment); NK_API nk_bool nk_checkbox_flags_label(struct nk_context*, const char*, unsigned int *flags, unsigned int value); NK_API nk_bool nk_checkbox_flags_text(struct nk_context*, const char*, int, unsigned int *flags, unsigned int value); /* ============================================================================= @@ -3188,9 +3422,13 @@ NK_API nk_bool nk_checkbox_flags_text(struct nk_context*, const char*, int, unsi * * ============================================================================= */ NK_API nk_bool nk_radio_label(struct nk_context*, const char*, nk_bool *active); +NK_API nk_bool nk_radio_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment); NK_API nk_bool nk_radio_text(struct nk_context*, const char*, int, nk_bool *active); +NK_API nk_bool nk_radio_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment); NK_API nk_bool nk_option_label(struct nk_context*, const char*, nk_bool active); +NK_API nk_bool nk_option_label_align(struct nk_context *ctx, const char *label, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment); NK_API nk_bool nk_option_text(struct nk_context*, const char*, int, nk_bool active); +NK_API nk_bool nk_option_text_align(struct nk_context *ctx, const char *text, int len, nk_bool is_active, nk_flags widget_alignment, nk_flags text_alignment); /* ============================================================================= * * SELECTABLE @@ -3219,6 +3457,15 @@ NK_API float nk_slide_float(struct nk_context*, float min, float val, float max, NK_API int nk_slide_int(struct nk_context*, int min, int val, int max, int step); NK_API nk_bool nk_slider_float(struct nk_context*, float min, float *val, float max, float step); NK_API nk_bool nk_slider_int(struct nk_context*, int min, int *val, int max, int step); + +/* ============================================================================= + * + * KNOB + * + * ============================================================================= */ +NK_API nk_bool nk_knob_float(struct nk_context*, float min, float *val, float max, float step, enum nk_heading zero_direction, float dead_zone_degrees); +NK_API nk_bool nk_knob_int(struct nk_context*, int min, int *val, int max, int step, enum nk_heading zero_direction, float dead_zone_degrees); + /* ============================================================================= * * PROGRESSBAR @@ -3238,210 +3485,216 @@ NK_API nk_bool nk_color_pick(struct nk_context*, struct nk_colorf*, enum nk_colo * * PROPERTIES * - * ============================================================================= -/// ### Properties -/// Properties are the main value modification widgets in Nuklear. Changing a value -/// can be achieved by dragging, adding/removing incremental steps on button click -/// or by directly typing a number. -/// -/// #### Usage -/// Each property requires a unique name for identification that is also used for -/// displaying a label. If you want to use the same name multiple times make sure -/// add a '#' before your name. The '#' will not be shown but will generate a -/// unique ID. Each property also takes in a minimum and maximum value. If you want -/// to make use of the complete number range of a type just use the provided -/// type limits from `limits.h`. For example `INT_MIN` and `INT_MAX` for -/// `nk_property_int` and `nk_propertyi`. In additional each property takes in -/// a increment value that will be added or subtracted if either the increment -/// decrement button is clicked. Finally there is a value for increment per pixel -/// dragged that is added or subtracted from the value. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int value = 0; -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // Input -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// nk_input_xxx(...); -/// } -/// } -/// nk_input_end(&ctx); -/// // -/// // Window -/// if (nk_begin_xxx(...) { -/// // Property -/// nk_layout_row_dynamic(...); -/// nk_property_int(ctx, "ID", INT_MIN, &value, INT_MAX, 1, 1); -/// } -/// nk_end(ctx); -/// // -/// // Draw -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------- -/// nk_property_int | Integer property directly modifying a passed in value -/// nk_property_float | Float property directly modifying a passed in value -/// nk_property_double | Double property directly modifying a passed in value -/// nk_propertyi | Integer property returning the modified int value -/// nk_propertyf | Float property returning the modified float value -/// nk_propertyd | Double property returning the modified double value -/// -*/ -/*/// #### nk_property_int -/// Integer property directly modifying a passed in value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Integer pointer to be modified -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -*/ + * =============================================================================*/ +/** + * \page Properties + * Properties are the main value modification widgets in Nuklear. Changing a value + * can be achieved by dragging, adding/removing incremental steps on button click + * or by directly typing a number. + * + * # Usage + * Each property requires a unique name for identification that is also used for + * displaying a label. If you want to use the same name multiple times make sure + * add a '#' before your name. The '#' will not be shown but will generate a + * unique ID. Each property also takes in a minimum and maximum value. If you want + * to make use of the complete number range of a type just use the provided + * type limits from `limits.h`. For example `INT_MIN` and `INT_MAX` for + * `nk_property_int` and `nk_propertyi`. In additional each property takes in + * a increment value that will be added or subtracted if either the increment + * decrement button is clicked. Finally there is a value for increment per pixel + * dragged that is added or subtracted from the value. + * + * ```c + * int value = 0; + * struct nk_context ctx; + * nk_init_xxx(&ctx, ...); + * while (1) { + * // Input + * Event evt; + * nk_input_begin(&ctx); + * while (GetEvent(&evt)) { + * if (evt.type == MOUSE_MOVE) + * nk_input_motion(&ctx, evt.motion.x, evt.motion.y); + * else if (evt.type == [...]) { + * nk_input_xxx(...); + * } + * } + * nk_input_end(&ctx); + * // + * // Window + * if (nk_begin_xxx(...) { + * // Property + * nk_layout_row_dynamic(...); + * nk_property_int(ctx, "ID", INT_MIN, &value, INT_MAX, 1, 1); + * } + * nk_end(ctx); + * // + * // Draw + * const struct nk_command *cmd = 0; + * nk_foreach(cmd, &ctx) { + * switch (cmd->type) { + * case NK_COMMAND_LINE: + * your_draw_line_function(...) + * break; + * case NK_COMMAND_RECT + * your_draw_rect_function(...) + * break; + * case ...: + * // [...] + * } + * nk_clear(&ctx); + * } + * nk_free(&ctx); + * ``` + * + * # Reference + * Function | Description + * --------------------|------------------------------------------- + * \ref nk_property_int | Integer property directly modifying a passed in value + * \ref nk_property_float | Float property directly modifying a passed in value + * \ref nk_property_double | Double property directly modifying a passed in value + * \ref nk_propertyi | Integer property returning the modified int value + * \ref nk_propertyf | Float property returning the modified float value + * \ref nk_propertyd | Double property returning the modified double value + * + + * # # nk_property_int + * Integer property directly modifying a passed in value + * !!! \warning + * To generate a unique property ID using the same label make sure to insert + * a `#` at the beginning. It will not be shown but guarantees correct behavior. + * + * ```c + * void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel); + * ``` + * + * Parameter | Description + * --------------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling a layouting function + * \param[in] name | String used both as a label as well as a unique identifier + * \param[in] min | Minimum value not allowed to be underflown + * \param[in] val | Integer pointer to be modified + * \param[in] max | Maximum value not allowed to be overflown + * \param[in] step | Increment added and subtracted on increment and decrement button + * \param[in] inc_per_pixel | Value per pixel added or subtracted on dragging + */ NK_API void nk_property_int(struct nk_context*, const char *name, int min, int *val, int max, int step, float inc_per_pixel); -/*/// #### nk_property_float -/// Float property directly modifying a passed in value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_property_float(struct nk_context *ctx, const char *name, float min, float *val, float max, float step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Float pointer to be modified -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -*/ + +/** + * # # nk_property_float + * Float property directly modifying a passed in value + * !!! \warning + * To generate a unique property ID using the same label make sure to insert + * a `#` at the beginning. It will not be shown but guarantees correct behavior. + * + * ```c + * void nk_property_float(struct nk_context *ctx, const char *name, float min, float *val, float max, float step, float inc_per_pixel); + * ``` + * + * Parameter | Description + * --------------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling a layouting function + * \param[in] name | String used both as a label as well as a unique identifier + * \param[in] min | Minimum value not allowed to be underflown + * \param[in] val | Float pointer to be modified + * \param[in] max | Maximum value not allowed to be overflown + * \param[in] step | Increment added and subtracted on increment and decrement button + * \param[in] inc_per_pixel | Value per pixel added or subtracted on dragging + */ NK_API void nk_property_float(struct nk_context*, const char *name, float min, float *val, float max, float step, float inc_per_pixel); -/*/// #### nk_property_double -/// Double property directly modifying a passed in value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_property_double(struct nk_context *ctx, const char *name, double min, double *val, double max, double step, double inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Double pointer to be modified -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -*/ + +/** + * # # nk_property_double + * Double property directly modifying a passed in value + * !!! \warning + * To generate a unique property ID using the same label make sure to insert + * a `#` at the beginning. It will not be shown but guarantees correct behavior. + * + * ```c + * void nk_property_double(struct nk_context *ctx, const char *name, double min, double *val, double max, double step, double inc_per_pixel); + * ``` + * + * Parameter | Description + * --------------------|----------------------------------------------------------- + * \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling a layouting function + * \param[in] name | String used both as a label as well as a unique identifier + * \param[in] min | Minimum value not allowed to be underflown + * \param[in] val | Double pointer to be modified + * \param[in] max | Maximum value not allowed to be overflown + * \param[in] step | Increment added and subtracted on increment and decrement button + * \param[in] inc_per_pixel | Value per pixel added or subtracted on dragging + */ NK_API void nk_property_double(struct nk_context*, const char *name, double min, double *val, double max, double step, float inc_per_pixel); -/*/// #### nk_propertyi -/// Integer property modifying a passed in value and returning the new value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, int max, int step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Current integer value to be modified and returned -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -/// -/// Returns the new modified integer value -*/ + +/** + * # # nk_propertyi + * Integer property modifying a passed in value and returning the new value + * !!! \warning + * To generate a unique property ID using the same label make sure to insert + * a `#` at the beginning. It will not be shown but guarantees correct behavior. + * + * ```c + * int nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, int max, int step, float inc_per_pixel); + * ``` + * + * \param[in] ctx Must point to an previously initialized `nk_context` struct after calling a layouting function + * \param[in] name String used both as a label as well as a unique identifier + * \param[in] min Minimum value not allowed to be underflown + * \param[in] val Current integer value to be modified and returned + * \param[in] max Maximum value not allowed to be overflown + * \param[in] step Increment added and subtracted on increment and decrement button + * \param[in] inc_per_pixel Value per pixel added or subtracted on dragging + * + * \returns the new modified integer value + */ NK_API int nk_propertyi(struct nk_context*, const char *name, int min, int val, int max, int step, float inc_per_pixel); -/*/// #### nk_propertyf -/// Float property modifying a passed in value and returning the new value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_propertyf(struct nk_context *ctx, const char *name, float min, float val, float max, float step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Current float value to be modified and returned -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -/// -/// Returns the new modified float value -*/ + +/** + * # # nk_propertyf + * Float property modifying a passed in value and returning the new value + * !!! \warning + * To generate a unique property ID using the same label make sure to insert + * a `#` at the beginning. It will not be shown but guarantees correct behavior. + * + * ```c + * float nk_propertyf(struct nk_context *ctx, const char *name, float min, float val, float max, float step, float inc_per_pixel); + * ``` + * + * \param[in] ctx Must point to an previously initialized `nk_context` struct after calling a layouting function + * \param[in] name String used both as a label as well as a unique identifier + * \param[in] min Minimum value not allowed to be underflown + * \param[in] val Current float value to be modified and returned + * \param[in] max Maximum value not allowed to be overflown + * \param[in] step Increment added and subtracted on increment and decrement button + * \param[in] inc_per_pixel Value per pixel added or subtracted on dragging + * + * \returns the new modified float value + */ NK_API float nk_propertyf(struct nk_context*, const char *name, float min, float val, float max, float step, float inc_per_pixel); -/*/// #### nk_propertyd -/// Float property modifying a passed in value and returning the new value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_propertyd(struct nk_context *ctx, const char *name, double min, double val, double max, double step, double inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Current double value to be modified and returned -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -/// -/// Returns the new modified double value -*/ + +/** + * # # nk_propertyd + * Float property modifying a passed in value and returning the new value + * !!! \warning + * To generate a unique property ID using the same label make sure to insert + * a `#` at the beginning. It will not be shown but guarantees correct behavior. + * + * ```c + * float nk_propertyd(struct nk_context *ctx, const char *name, double min, double val, double max, double step, double inc_per_pixel); + * ``` + * + * \param[in] ctx Must point to an previously initialized `nk_context` struct after calling a layouting function + * \param[in] name String used both as a label as well as a unique identifier + * \param[in] min Minimum value not allowed to be underflown + * \param[in] val Current double value to be modified and returned + * \param[in] max Maximum value not allowed to be overflown + * \param[in] step Increment added and subtracted on increment and decrement button + * \param[in] inc_per_pixel Value per pixel added or subtracted on dragging + * + * \returns the new modified double value + */ NK_API double nk_propertyd(struct nk_context*, const char *name, double min, double val, double max, double step, float inc_per_pixel); + /* ============================================================================= * * TEXT EDIT @@ -3469,11 +3722,11 @@ enum nk_edit_types { NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD }; enum nk_edit_events { - NK_EDIT_ACTIVE = NK_FLAG(0), /* edit widget is currently being modified */ - NK_EDIT_INACTIVE = NK_FLAG(1), /* edit widget is not active and is not being modified */ - NK_EDIT_ACTIVATED = NK_FLAG(2), /* edit widget went from state inactive to state active */ - NK_EDIT_DEACTIVATED = NK_FLAG(3), /* edit widget went from state active to state inactive */ - NK_EDIT_COMMITED = NK_FLAG(4) /* edit widget has received an enter and lost focus */ + NK_EDIT_ACTIVE = NK_FLAG(0), /**!< edit widget is currently being modified */ + NK_EDIT_INACTIVE = NK_FLAG(1), /**!< edit widget is not active and is not being modified */ + NK_EDIT_ACTIVATED = NK_FLAG(2), /**!< edit widget went from state inactive to state active */ + NK_EDIT_DEACTIVATED = NK_FLAG(3), /**!< edit widget went from state active to state inactive */ + NK_EDIT_COMMITED = NK_FLAG(4) /**!< edit widget has received an enter and lost focus */ }; NK_API nk_flags nk_edit_string(struct nk_context*, nk_flags, char *buffer, int *len, int max, nk_plugin_filter); NK_API nk_flags nk_edit_string_zero_terminated(struct nk_context*, nk_flags, char *buffer, int max, nk_plugin_filter); @@ -3502,18 +3755,18 @@ NK_API void nk_plot_function(struct nk_context*, enum nk_chart_type, void *userd NK_API nk_bool nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds); NK_API void nk_popup_close(struct nk_context*); NK_API void nk_popup_end(struct nk_context*); -NK_API void nk_popup_get_scroll(struct nk_context*, nk_uint *offset_x, nk_uint *offset_y); +NK_API void nk_popup_get_scroll(const struct nk_context*, nk_uint *offset_x, nk_uint *offset_y); NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y); /* ============================================================================= * * COMBOBOX * * ============================================================================= */ -NK_API int nk_combo(struct nk_context*, const char **items, int count, int selected, int item_height, struct nk_vec2 size); +NK_API int nk_combo(struct nk_context*, const char *const *items, int count, int selected, int item_height, struct nk_vec2 size); NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size); NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size); NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size); -NK_API void nk_combobox(struct nk_context*, const char **items, int count, int *selected, int item_height, struct nk_vec2 size); +NK_API void nk_combobox(struct nk_context*, const char *const *items, int count, int *selected, int item_height, struct nk_vec2 size); NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size); NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int *selected, int count, int item_height, struct nk_vec2 size); NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, int *selected, int count, int item_height, struct nk_vec2 size); @@ -3593,6 +3846,9 @@ NK_API void nk_menu_end(struct nk_context*); * STYLE * * ============================================================================= */ + +#define NK_WIDGET_DISABLED_FACTOR 0.5f + enum nk_style_colors { NK_COLOR_TEXT, NK_COLOR_WINDOW, @@ -3622,6 +3878,10 @@ enum nk_style_colors { NK_COLOR_SCROLLBAR_CURSOR_HOVER, NK_COLOR_SCROLLBAR_CURSOR_ACTIVE, NK_COLOR_TAB_HEADER, + NK_COLOR_KNOB, + NK_COLOR_KNOB_CURSOR, + NK_COLOR_KNOB_CURSOR_HOVER, + NK_COLOR_KNOB_CURSOR_ACTIVE, NK_COLOR_COUNT }; enum nk_style_cursor { @@ -3637,7 +3897,7 @@ enum nk_style_cursor { NK_API void nk_style_default(struct nk_context*); NK_API void nk_style_from_table(struct nk_context*, const struct nk_color*); NK_API void nk_style_load_cursor(struct nk_context*, enum nk_style_cursor, const struct nk_cursor*); -NK_API void nk_style_load_all_cursors(struct nk_context*, struct nk_cursor*); +NK_API void nk_style_load_all_cursors(struct nk_context*, const struct nk_cursor*); NK_API const char* nk_style_get_color_by_name(enum nk_style_colors); NK_API void nk_style_set_font(struct nk_context*, const struct nk_user_font*); NK_API nk_bool nk_style_set_cursor(struct nk_context*, enum nk_style_cursor); @@ -3669,6 +3929,7 @@ NK_API struct nk_color nk_rgb_f(float r, float g, float b); NK_API struct nk_color nk_rgb_fv(const float *rgb); NK_API struct nk_color nk_rgb_cf(struct nk_colorf c); NK_API struct nk_color nk_rgb_hex(const char *rgb); +NK_API struct nk_color nk_rgb_factor(struct nk_color col, float factor); NK_API struct nk_color nk_rgba(int r, int g, int b, int a); NK_API struct nk_color nk_rgba_u32(nk_uint); @@ -3680,7 +3941,7 @@ NK_API struct nk_color nk_rgba_cf(struct nk_colorf c); NK_API struct nk_color nk_rgba_hex(const char *rgb); NK_API struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a); -NK_API struct nk_colorf nk_hsva_colorfv(float *c); +NK_API struct nk_colorf nk_hsva_colorfv(const float *c); NK_API void nk_colorf_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in); NK_API void nk_colorf_hsva_fv(float *hsva, struct nk_colorf in); @@ -3775,11 +4036,11 @@ NK_API struct nk_vec2 nk_rect_size(struct nk_rect); NK_API int nk_strlen(const char *str); NK_API int nk_stricmp(const char *s1, const char *s2); NK_API int nk_stricmpn(const char *s1, const char *s2, int n); -NK_API int nk_strtoi(const char *str, const char **endptr); -NK_API float nk_strtof(const char *str, const char **endptr); +NK_API int nk_strtoi(const char *str, char **endptr); +NK_API float nk_strtof(const char *str, char **endptr); #ifndef NK_STRTOD #define NK_STRTOD nk_strtod -NK_API double nk_strtod(const char *str, const char **endptr); +NK_API double nk_strtod(const char *str, char **endptr); #endif NK_API int nk_strfilter(const char *text, const char *regexp); NK_API int nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score); @@ -3798,156 +4059,158 @@ NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune * FONT * * ===============================================================*/ -/*/// ### Font -/// Font handling in this library was designed to be quite customizable and lets -/// you decide what you want to use and what you want to provide. There are three -/// different ways to use the font atlas. The first two will use your font -/// handling scheme and only requires essential data to run nuklear. The next -/// slightly more advanced features is font handling with vertex buffer output. -/// Finally the most complex API wise is using nuklear's font baking API. -// -/// #### Using your own implementation without vertex buffer output -/// -/// So first up the easiest way to do font handling is by just providing a -/// `nk_user_font` struct which only requires the height in pixel of the used -/// font and a callback to calculate the width of a string. This way of handling -/// fonts is best fitted for using the normal draw shape command API where you -/// do all the text drawing yourself and the library does not require any kind -/// of deeper knowledge about which font handling mechanism you use. -/// IMPORTANT: the `nk_user_font` pointer provided to nuklear has to persist -/// over the complete life time! I know this sucks but it is currently the only -/// way to switch between fonts. -/// -/// ```c -/// float your_text_width_calculation(nk_handle handle, float height, const char *text, int len) -/// { -/// your_font_type *type = handle.ptr; -/// float text_width = ...; -/// return text_width; -/// } -/// -/// struct nk_user_font font; -/// font.userdata.ptr = &your_font_class_or_struct; -/// font.height = your_font_height; -/// font.width = your_text_width_calculation; -/// -/// struct nk_context ctx; -/// nk_init_default(&ctx, &font); -/// ``` -/// #### Using your own implementation with vertex buffer output -/// -/// While the first approach works fine if you don't want to use the optional -/// vertex buffer output it is not enough if you do. To get font handling working -/// for these cases you have to provide two additional parameters inside the -/// `nk_user_font`. First a texture atlas handle used to draw text as subimages -/// of a bigger font atlas texture and a callback to query a character's glyph -/// information (offset, size, ...). So it is still possible to provide your own -/// font and use the vertex buffer output. -/// -/// ```c -/// float your_text_width_calculation(nk_handle handle, float height, const char *text, int len) -/// { -/// your_font_type *type = handle.ptr; -/// float text_width = ...; -/// return text_width; -/// } -/// void query_your_font_glyph(nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint) -/// { -/// your_font_type *type = handle.ptr; -/// glyph.width = ...; -/// glyph.height = ...; -/// glyph.xadvance = ...; -/// glyph.uv[0].x = ...; -/// glyph.uv[0].y = ...; -/// glyph.uv[1].x = ...; -/// glyph.uv[1].y = ...; -/// glyph.offset.x = ...; -/// glyph.offset.y = ...; -/// } -/// -/// struct nk_user_font font; -/// font.userdata.ptr = &your_font_class_or_struct; -/// font.height = your_font_height; -/// font.width = your_text_width_calculation; -/// font.query = query_your_font_glyph; -/// font.texture.id = your_font_texture; -/// -/// struct nk_context ctx; -/// nk_init_default(&ctx, &font); -/// ``` -/// -/// #### Nuklear font baker -/// -/// The final approach if you do not have a font handling functionality or don't -/// want to use it in this library is by using the optional font baker. -/// The font baker APIs can be used to create a font plus font atlas texture -/// and can be used with or without the vertex buffer output. -/// -/// It still uses the `nk_user_font` struct and the two different approaches -/// previously stated still work. The font baker is not located inside -/// `nk_context` like all other systems since it can be understood as more of -/// an extension to nuklear and does not really depend on any `nk_context` state. -/// -/// Font baker need to be initialized first by one of the nk_font_atlas_init_xxx -/// functions. If you don't care about memory just call the default version -/// `nk_font_atlas_init_default` which will allocate all memory from the standard library. -/// If you want to control memory allocation but you don't care if the allocated -/// memory is temporary and therefore can be freed directly after the baking process -/// is over or permanent you can call `nk_font_atlas_init`. -/// -/// After successfully initializing the font baker you can add Truetype(.ttf) fonts from -/// different sources like memory or from file by calling one of the `nk_font_atlas_add_xxx`. -/// functions. Adding font will permanently store each font, font config and ttf memory block(!) -/// inside the font atlas and allows to reuse the font atlas. If you don't want to reuse -/// the font baker by for example adding additional fonts you can call -/// `nk_font_atlas_cleanup` after the baking process is over (after calling nk_font_atlas_end). -/// -/// As soon as you added all fonts you wanted you can now start the baking process -/// for every selected glyph to image by calling `nk_font_atlas_bake`. -/// The baking process returns image memory, width and height which can be used to -/// either create your own image object or upload it to any graphics library. -/// No matter which case you finally have to call `nk_font_atlas_end` which -/// will free all temporary memory including the font atlas image so make sure -/// you created our texture beforehand. `nk_font_atlas_end` requires a handle -/// to your font texture or object and optionally fills a `struct nk_draw_null_texture` -/// which can be used for the optional vertex output. If you don't want it just -/// set the argument to `NULL`. -/// -/// At this point you are done and if you don't want to reuse the font atlas you -/// can call `nk_font_atlas_cleanup` to free all truetype blobs and configuration -/// memory. Finally if you don't use the font atlas and any of it's fonts anymore -/// you need to call `nk_font_atlas_clear` to free all memory still being used. -/// -/// ```c -/// struct nk_font_atlas atlas; -/// nk_font_atlas_init_default(&atlas); -/// nk_font_atlas_begin(&atlas); -/// nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, 0); -/// nk_font *font2 = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font2.ttf", 16, 0); -/// const void* img = nk_font_atlas_bake(&atlas, &img_width, &img_height, NK_FONT_ATLAS_RGBA32); -/// nk_font_atlas_end(&atlas, nk_handle_id(texture), 0); -/// -/// struct nk_context ctx; -/// nk_init_default(&ctx, &font->handle); -/// while (1) { -/// -/// } -/// nk_font_atlas_clear(&atlas); -/// ``` -/// The font baker API is probably the most complex API inside this library and -/// I would suggest reading some of my examples `example/` to get a grip on how -/// to use the font atlas. There are a number of details I left out. For example -/// how to merge fonts, configure a font with `nk_font_config` to use other languages, -/// use another texture coordinate format and a lot more: -/// -/// ```c -/// struct nk_font_config cfg = nk_font_config(font_pixel_height); -/// cfg.merge_mode = nk_false or nk_true; -/// cfg.range = nk_font_korean_glyph_ranges(); -/// cfg.coord_type = NK_COORD_PIXEL; -/// nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, &cfg); -/// ``` -*/ +/** + * \page Font + * Font handling in this library was designed to be quite customizable and lets + * you decide what you want to use and what you want to provide. There are three + * different ways to use the font atlas. The first two will use your font + * handling scheme and only requires essential data to run nuklear. The next + * slightly more advanced features is font handling with vertex buffer output. + * Finally the most complex API wise is using nuklear's font baking API. + * + * # Using your own implementation without vertex buffer output + * + * So first up the easiest way to do font handling is by just providing a + * `nk_user_font` struct which only requires the height in pixel of the used + * font and a callback to calculate the width of a string. This way of handling + * fonts is best fitted for using the normal draw shape command API where you + * do all the text drawing yourself and the library does not require any kind + * of deeper knowledge about which font handling mechanism you use. + * IMPORTANT: the `nk_user_font` pointer provided to nuklear has to persist + * over the complete life time! I know this sucks but it is currently the only + * way to switch between fonts. + * + * ```c + * float your_text_width_calculation(nk_handle handle, float height, const char *text, int len) + * { + * your_font_type *type = handle.ptr; + * float text_width = ...; + * return text_width; + * } + * + * struct nk_user_font font; + * font.userdata.ptr = &your_font_class_or_struct; + * font.height = your_font_height; + * font.width = your_text_width_calculation; + * + * struct nk_context ctx; + * nk_init_default(&ctx, &font); + * ``` + * # Using your own implementation with vertex buffer output + * + * While the first approach works fine if you don't want to use the optional + * vertex buffer output it is not enough if you do. To get font handling working + * for these cases you have to provide two additional parameters inside the + * `nk_user_font`. First a texture atlas handle used to draw text as subimages + * of a bigger font atlas texture and a callback to query a character's glyph + * information (offset, size, ...). So it is still possible to provide your own + * font and use the vertex buffer output. + * + * ```c + * float your_text_width_calculation(nk_handle handle, float height, const char *text, int len) + * { + * your_font_type *type = handle.ptr; + * float text_width = ...; + * return text_width; + * } + * void query_your_font_glyph(nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint) + * { + * your_font_type *type = handle.ptr; + * glyph.width = ...; + * glyph.height = ...; + * glyph.xadvance = ...; + * glyph.uv[0].x = ...; + * glyph.uv[0].y = ...; + * glyph.uv[1].x = ...; + * glyph.uv[1].y = ...; + * glyph.offset.x = ...; + * glyph.offset.y = ...; + * } + * + * struct nk_user_font font; + * font.userdata.ptr = &your_font_class_or_struct; + * font.height = your_font_height; + * font.width = your_text_width_calculation; + * font.query = query_your_font_glyph; + * font.texture.id = your_font_texture; + * + * struct nk_context ctx; + * nk_init_default(&ctx, &font); + * ``` + * + * # Nuklear font baker + * + * The final approach if you do not have a font handling functionality or don't + * want to use it in this library is by using the optional font baker. + * The font baker APIs can be used to create a font plus font atlas texture + * and can be used with or without the vertex buffer output. + * + * It still uses the `nk_user_font` struct and the two different approaches + * previously stated still work. The font baker is not located inside + * `nk_context` like all other systems since it can be understood as more of + * an extension to nuklear and does not really depend on any `nk_context` state. + * + * Font baker need to be initialized first by one of the nk_font_atlas_init_xxx + * functions. If you don't care about memory just call the default version + * `nk_font_atlas_init_default` which will allocate all memory from the standard library. + * If you want to control memory allocation but you don't care if the allocated + * memory is temporary and therefore can be freed directly after the baking process + * is over or permanent you can call `nk_font_atlas_init`. + * + * After successfully initializing the font baker you can add Truetype(.ttf) fonts from + * different sources like memory or from file by calling one of the `nk_font_atlas_add_xxx`. + * functions. Adding font will permanently store each font, font config and ttf memory block(!) + * inside the font atlas and allows to reuse the font atlas. If you don't want to reuse + * the font baker by for example adding additional fonts you can call + * `nk_font_atlas_cleanup` after the baking process is over (after calling nk_font_atlas_end). + * + * As soon as you added all fonts you wanted you can now start the baking process + * for every selected glyph to image by calling `nk_font_atlas_bake`. + * The baking process returns image memory, width and height which can be used to + * either create your own image object or upload it to any graphics library. + * No matter which case you finally have to call `nk_font_atlas_end` which + * will free all temporary memory including the font atlas image so make sure + * you created our texture beforehand. `nk_font_atlas_end` requires a handle + * to your font texture or object and optionally fills a `struct nk_draw_null_texture` + * which can be used for the optional vertex output. If you don't want it just + * set the argument to `NULL`. + * + * At this point you are done and if you don't want to reuse the font atlas you + * can call `nk_font_atlas_cleanup` to free all truetype blobs and configuration + * memory. Finally if you don't use the font atlas and any of it's fonts anymore + * you need to call `nk_font_atlas_clear` to free all memory still being used. + * + * ```c + * struct nk_font_atlas atlas; + * nk_font_atlas_init_default(&atlas); + * nk_font_atlas_begin(&atlas); + * nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, 0); + * nk_font *font2 = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font2.ttf", 16, 0); + * const void* img = nk_font_atlas_bake(&atlas, &img_width, &img_height, NK_FONT_ATLAS_RGBA32); + * nk_font_atlas_end(&atlas, nk_handle_id(texture), 0); + * + * struct nk_context ctx; + * nk_init_default(&ctx, &font->handle); + * while (1) { + * + * } + * nk_font_atlas_clear(&atlas); + * ``` + * The font baker API is probably the most complex API inside this library and + * I would suggest reading some of my examples `example/` to get a grip on how + * to use the font atlas. There are a number of details I left out. For example + * how to merge fonts, configure a font with `nk_font_config` to use other languages, + * use another texture coordinate format and a lot more: + * + * ```c + * struct nk_font_config cfg = nk_font_config(font_pixel_height); + * cfg.merge_mode = nk_false or nk_true; + * cfg.range = nk_font_korean_glyph_ranges(); + * cfg.coord_type = NK_COORD_PIXEL; + * nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, &cfg); + * ``` + */ + struct nk_user_font_glyph; typedef float(*nk_text_width_f)(nk_handle, float h, const char*, int len); typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height, @@ -3956,84 +4219,56 @@ typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height, #if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT) struct nk_user_font_glyph { - struct nk_vec2 uv[2]; - /* texture coordinates */ - struct nk_vec2 offset; - /* offset between top left and glyph */ - float width, height; - /* size of the glyph */ - float xadvance; - /* offset to the next glyph */ + struct nk_vec2 uv[2]; /**!< texture coordinates */ + struct nk_vec2 offset; /**!< offset between top left and glyph */ + float width, height; /**!< size of the glyph */ + float xadvance; /**!< offset to the next glyph */ }; #endif struct nk_user_font { - nk_handle userdata; - /* user provided font handle */ - float height; - /* max height of the font */ - nk_text_width_f width; - /* font string width in pixel callback */ + nk_handle userdata; /**!< user provided font handle */ + float height; /**!< max height of the font */ + nk_text_width_f width; /**!< font string width in pixel callback */ #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT - nk_query_font_glyph_f query; - /* font glyph callback to query drawing info */ - nk_handle texture; - /* texture handle to the used font atlas or texture */ + nk_query_font_glyph_f query; /**!< font glyph callback to query drawing info */ + nk_handle texture; /**!< texture handle to the used font atlas or texture */ #endif }; #ifdef NK_INCLUDE_FONT_BAKING enum nk_font_coord_type { - NK_COORD_UV, /* texture coordinates inside font glyphs are clamped between 0-1 */ - NK_COORD_PIXEL /* texture coordinates inside font glyphs are in absolute pixel */ + NK_COORD_UV, /**!< texture coordinates inside font glyphs are clamped between 0-1 */ + NK_COORD_PIXEL /**!< texture coordinates inside font glyphs are in absolute pixel */ }; struct nk_font; struct nk_baked_font { - float height; - /* height of the font */ - float ascent, descent; - /* font glyphs ascent and descent */ - nk_rune glyph_offset; - /* glyph array offset inside the font glyph baking output array */ - nk_rune glyph_count; - /* number of glyphs of this font inside the glyph baking array output */ - const nk_rune *ranges; - /* font codepoint ranges as pairs of (from/to) and 0 as last element */ + float height; /**!< height of the font */ + float ascent; /**!< font glyphs ascent and descent */ + float descent; /**!< font glyphs ascent and descent */ + nk_rune glyph_offset; /**!< glyph array offset inside the font glyph baking output array */ + nk_rune glyph_count; /**!< number of glyphs of this font inside the glyph baking array output */ + const nk_rune *ranges; /**!< font codepoint ranges as pairs of (from/to) and 0 as last element */ }; struct nk_font_config { - struct nk_font_config *next; - /* NOTE: only used internally */ - void *ttf_blob; - /* pointer to loaded TTF file memory block. - * NOTE: not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */ - nk_size ttf_size; - /* size of the loaded TTF file memory block - * NOTE: not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */ - - unsigned char ttf_data_owned_by_atlas; - /* used inside font atlas: default to: 0*/ - unsigned char merge_mode; - /* merges this font into the last font */ - unsigned char pixel_snap; - /* align every character to pixel boundary (if true set oversample (1,1)) */ - unsigned char oversample_v, oversample_h; - /* rasterize at high quality for sub-pixel position */ + struct nk_font_config *next; /**!< NOTE: only used internally */ + void *ttf_blob; /**!< pointer to loaded TTF file memory block. * \note not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */ + nk_size ttf_size; /**!< size of the loaded TTF file memory block * \note not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */ + + unsigned char ttf_data_owned_by_atlas; /**!< used inside font atlas: default to: 0*/ + unsigned char merge_mode; /**!< merges this font into the last font */ + unsigned char pixel_snap; /**!< align every character to pixel boundary (if true set oversample (1,1)) */ + unsigned char oversample_v, oversample_h; /**!< rasterize at high quality for sub-pixel position */ unsigned char padding[3]; - float size; - /* baked pixel height of the font */ - enum nk_font_coord_type coord_type; - /* texture coordinate format with either pixel or UV coordinates */ - struct nk_vec2 spacing; - /* extra pixel spacing between glyphs */ - const nk_rune *range; - /* list of unicode ranges (2 values per range, zero terminated) */ - struct nk_baked_font *font; - /* font to setup in the baking process: NOTE: not needed for font atlas */ - nk_rune fallback_glyph; - /* fallback glyph to use if a given rune is not found */ + float size; /**!< baked pixel height of the font */ + enum nk_font_coord_type coord_type; /**!< texture coordinate format with either pixel or UV coordinates */ + struct nk_vec2 spacing; /**!< extra pixel spacing between glyphs */ + const nk_rune *range; /**!< list of unicode ranges (2 values per range, zero terminated) */ + struct nk_baked_font *font; /**!< font to setup in the baking process: NOTE: not needed for font atlas */ + nk_rune fallback_glyph; /**!< fallback glyph to use if a given rune is not found */ struct nk_font_config *n; struct nk_font_config *p; }; @@ -4081,7 +4316,7 @@ struct nk_font_atlas { int font_num; }; -/* some language glyph codepoint ranges */ +/** some language glyph codepoint ranges */ NK_API const nk_rune *nk_font_default_glyph_ranges(void); NK_API const nk_rune *nk_font_chinese_glyph_ranges(void); NK_API const nk_rune *nk_font_cyrillic_glyph_ranges(void); @@ -4090,8 +4325,8 @@ NK_API const nk_rune *nk_font_korean_glyph_ranges(void); #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR NK_API void nk_font_atlas_init_default(struct nk_font_atlas*); #endif -NK_API void nk_font_atlas_init(struct nk_font_atlas*, struct nk_allocator*); -NK_API void nk_font_atlas_init_custom(struct nk_font_atlas*, struct nk_allocator *persistent, struct nk_allocator *transient); +NK_API void nk_font_atlas_init(struct nk_font_atlas*, const struct nk_allocator*); +NK_API void nk_font_atlas_init_custom(struct nk_font_atlas*, const struct nk_allocator *persistent, const struct nk_allocator *transient); NK_API void nk_font_atlas_begin(struct nk_font_atlas*); NK_API struct nk_font_config nk_font_config(float pixel_height); NK_API struct nk_font *nk_font_atlas_add(struct nk_font_atlas*, const struct nk_font_config*); @@ -4106,46 +4341,48 @@ NK_API struct nk_font *nk_font_atlas_add_compressed(struct nk_font_atlas*, void NK_API struct nk_font* nk_font_atlas_add_compressed_base85(struct nk_font_atlas*, const char *data, float height, const struct nk_font_config *config); NK_API const void* nk_font_atlas_bake(struct nk_font_atlas*, int *width, int *height, enum nk_font_atlas_format); NK_API void nk_font_atlas_end(struct nk_font_atlas*, nk_handle tex, struct nk_draw_null_texture*); -NK_API const struct nk_font_glyph* nk_font_find_glyph(struct nk_font*, nk_rune unicode); +NK_API const struct nk_font_glyph* nk_font_find_glyph(const struct nk_font*, nk_rune unicode); NK_API void nk_font_atlas_cleanup(struct nk_font_atlas *atlas); NK_API void nk_font_atlas_clear(struct nk_font_atlas*); #endif -/* ============================================================== +/** ============================================================== * * MEMORY BUFFER * * ===============================================================*/ -/*/// ### Memory Buffer -/// A basic (double)-buffer with linear allocation and resetting as only -/// freeing policy. The buffer's main purpose is to control all memory management -/// inside the GUI toolkit and still leave memory control as much as possible in -/// the hand of the user while also making sure the library is easy to use if -/// not as much control is needed. -/// In general all memory inside this library can be provided from the user in -/// three different ways. -/// -/// The first way and the one providing most control is by just passing a fixed -/// size memory block. In this case all control lies in the hand of the user -/// since he can exactly control where the memory comes from and how much memory -/// the library should consume. Of course using the fixed size API removes the -/// ability to automatically resize a buffer if not enough memory is provided so -/// you have to take over the resizing. While being a fixed sized buffer sounds -/// quite limiting, it is very effective in this library since the actual memory -/// consumption is quite stable and has a fixed upper bound for a lot of cases. -/// -/// If you don't want to think about how much memory the library should allocate -/// at all time or have a very dynamic UI with unpredictable memory consumption -/// habits but still want control over memory allocation you can use the dynamic -/// allocator based API. The allocator consists of two callbacks for allocating -/// and freeing memory and optional userdata so you can plugin your own allocator. -/// -/// The final and easiest way can be used by defining -/// NK_INCLUDE_DEFAULT_ALLOCATOR which uses the standard library memory -/// allocation functions malloc and free and takes over complete control over -/// memory in this library. -*/ +/** + * \page Memory Buffer + * A basic (double)-buffer with linear allocation and resetting as only + * freeing policy. The buffer's main purpose is to control all memory management + * inside the GUI toolkit and still leave memory control as much as possible in + * the hand of the user while also making sure the library is easy to use if + * not as much control is needed. + * In general all memory inside this library can be provided from the user in + * three different ways. + * + * The first way and the one providing most control is by just passing a fixed + * size memory block. In this case all control lies in the hand of the user + * since he can exactly control where the memory comes from and how much memory + * the library should consume. Of course using the fixed size API removes the + * ability to automatically resize a buffer if not enough memory is provided so + * you have to take over the resizing. While being a fixed sized buffer sounds + * quite limiting, it is very effective in this library since the actual memory + * consumption is quite stable and has a fixed upper bound for a lot of cases. + * + * If you don't want to think about how much memory the library should allocate + * at all time or have a very dynamic UI with unpredictable memory consumption + * habits but still want control over memory allocation you can use the dynamic + * allocator based API. The allocator consists of two callbacks for allocating + * and freeing memory and optional userdata so you can plugin your own allocator. + * + * The final and easiest way can be used by defining + * NK_INCLUDE_DEFAULT_ALLOCATOR which uses the standard library memory + * allocation functions malloc and free and takes over complete control over + * memory in this library. + */ + struct nk_memory_status { void *memory; unsigned int type; @@ -4173,24 +4410,15 @@ struct nk_buffer_marker { struct nk_memory {void *ptr;nk_size size;}; struct nk_buffer { - struct nk_buffer_marker marker[NK_BUFFER_MAX]; - /* buffer marker to free a buffer to a certain offset */ - struct nk_allocator pool; - /* allocator callback for dynamic buffers */ - enum nk_allocation_type type; - /* memory management type */ - struct nk_memory memory; - /* memory and size of the current memory block */ - float grow_factor; - /* growing factor for dynamic memory management */ - nk_size allocated; - /* total amount of memory allocated */ - nk_size needed; - /* totally consumed memory given that enough memory is present */ - nk_size calls; - /* number of allocation calls */ - nk_size size; - /* current size of the buffer */ + struct nk_buffer_marker marker[NK_BUFFER_MAX]; /**!< buffer marker to free a buffer to a certain offset */ + struct nk_allocator pool; /**!< allocator callback for dynamic buffers */ + enum nk_allocation_type type; /**!< memory management type */ + struct nk_memory memory; /**!< memory and size of the current memory block */ + float grow_factor; /**!< growing factor for dynamic memory management */ + nk_size allocated; /**!< total amount of memory allocated */ + nk_size needed; /**!< totally consumed memory given that enough memory is present */ + nk_size calls; /**!< number of allocation calls */ + nk_size size; /**!< current size of the buffer */ }; #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR @@ -4198,7 +4426,7 @@ NK_API void nk_buffer_init_default(struct nk_buffer*); #endif NK_API void nk_buffer_init(struct nk_buffer*, const struct nk_allocator*, nk_size size); NK_API void nk_buffer_init_fixed(struct nk_buffer*, void *memory, nk_size size); -NK_API void nk_buffer_info(struct nk_memory_status*, struct nk_buffer*); +NK_API void nk_buffer_info(struct nk_memory_status*, const struct nk_buffer*); NK_API void nk_buffer_push(struct nk_buffer*, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align); NK_API void nk_buffer_mark(struct nk_buffer*, enum nk_buffer_allocation_type type); NK_API void nk_buffer_reset(struct nk_buffer*, enum nk_buffer_allocation_type type); @@ -4206,21 +4434,21 @@ NK_API void nk_buffer_clear(struct nk_buffer*); NK_API void nk_buffer_free(struct nk_buffer*); NK_API void *nk_buffer_memory(struct nk_buffer*); NK_API const void *nk_buffer_memory_const(const struct nk_buffer*); -NK_API nk_size nk_buffer_total(struct nk_buffer*); +NK_API nk_size nk_buffer_total(const struct nk_buffer*); -/* ============================================================== +/** ============================================================== * * STRING * * ===============================================================*/ -/* Basic string buffer which is only used in context with the text editor +/** Basic string buffer which is only used in context with the text editor * to manage and manipulate dynamic or fixed size string content. This is _NOT_ * the default string handling method. The only instance you should have any contact * with this API is if you interact with an `nk_text_edit` object inside one of the * copy and paste functions and even there only for more advanced cases. */ struct nk_str { struct nk_buffer buffer; - int len; /* in codepoints/runes/glyphs */ + int len; /**!< in codepoints/runes/glyphs */ }; #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR @@ -4261,38 +4489,40 @@ NK_API const char *nk_str_at_const(const struct nk_str*, int pos, nk_rune *unico NK_API char *nk_str_get(struct nk_str*); NK_API const char *nk_str_get_const(const struct nk_str*); -NK_API int nk_str_len(struct nk_str*); -NK_API int nk_str_len_char(struct nk_str*); +NK_API int nk_str_len(const struct nk_str*); +NK_API int nk_str_len_char(const struct nk_str*); -/*=============================================================== +/**=============================================================== * * TEXT EDITOR * * ===============================================================*/ -/*/// ### Text Editor -/// Editing text in this library is handled by either `nk_edit_string` or -/// `nk_edit_buffer`. But like almost everything in this library there are multiple -/// ways of doing it and a balance between control and ease of use with memory -/// as well as functionality controlled by flags. -/// -/// This library generally allows three different levels of memory control: -/// First of is the most basic way of just providing a simple char array with -/// string length. This method is probably the easiest way of handling simple -/// user text input. Main upside is complete control over memory while the biggest -/// downside in comparison with the other two approaches is missing undo/redo. -/// -/// For UIs that require undo/redo the second way was created. It is based on -/// a fixed size nk_text_edit struct, which has an internal undo/redo stack. -/// This is mainly useful if you want something more like a text editor but don't want -/// to have a dynamically growing buffer. -/// -/// The final way is using a dynamically growing nk_text_edit struct, which -/// has both a default version if you don't care where memory comes from and an -/// allocator version if you do. While the text editor is quite powerful for its -/// complexity I would not recommend editing gigabytes of data with it. -/// It is rather designed for uses cases which make sense for a GUI library not for -/// an full blown text editor. +/** + * \page Text Editor + * Editing text in this library is handled by either `nk_edit_string` or + * `nk_edit_buffer`. But like almost everything in this library there are multiple + * ways of doing it and a balance between control and ease of use with memory + * as well as functionality controlled by flags. + * + * This library generally allows three different levels of memory control: + * First of is the most basic way of just providing a simple char array with + * string length. This method is probably the easiest way of handling simple + * user text input. Main upside is complete control over memory while the biggest + * downside in comparison with the other two approaches is missing undo/redo. + * + * For UIs that require undo/redo the second way was created. It is based on + * a fixed size nk_text_edit struct, which has an internal undo/redo stack. + * This is mainly useful if you want something more like a text editor but don't want + * to have a dynamically growing buffer. + * + * The final way is using a dynamically growing nk_text_edit struct, which + * has both a default version if you don't care where memory comes from and an + * allocator version if you do. While the text editor is quite powerful for its + * complexity I would not recommend editing gigabytes of data with it. + * It is rather designed for uses cases which make sense for a GUI library not for + * an full blown text editor. */ + #ifndef NK_TEXTEDIT_UNDOSTATECOUNT #define NK_TEXTEDIT_UNDOSTATECOUNT 99 #endif @@ -4355,7 +4585,7 @@ struct nk_text_edit { struct nk_text_undo_state undo; }; -/* filter function */ +/** filter function */ NK_API nk_bool nk_filter_default(const struct nk_text_edit*, nk_rune unicode); NK_API nk_bool nk_filter_ascii(const struct nk_text_edit*, nk_rune unicode); NK_API nk_bool nk_filter_float(const struct nk_text_edit*, nk_rune unicode); @@ -4364,11 +4594,11 @@ NK_API nk_bool nk_filter_hex(const struct nk_text_edit*, nk_rune unicode); NK_API nk_bool nk_filter_oct(const struct nk_text_edit*, nk_rune unicode); NK_API nk_bool nk_filter_binary(const struct nk_text_edit*, nk_rune unicode); -/* text editor */ +/** text editor */ #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR NK_API void nk_textedit_init_default(struct nk_text_edit*); #endif -NK_API void nk_textedit_init(struct nk_text_edit*, struct nk_allocator*, nk_size size); +NK_API void nk_textedit_init(struct nk_text_edit*, const struct nk_allocator*, nk_size size); NK_API void nk_textedit_init_fixed(struct nk_text_edit*, void *memory, nk_size size); NK_API void nk_textedit_free(struct nk_text_edit*); NK_API void nk_textedit_text(struct nk_text_edit*, const char*, int total_len); @@ -4385,53 +4615,55 @@ NK_API void nk_textedit_redo(struct nk_text_edit*); * DRAWING * * ===============================================================*/ -/*/// ### Drawing -/// This library was designed to be render backend agnostic so it does -/// not draw anything to screen. Instead all drawn shapes, widgets -/// are made of, are buffered into memory and make up a command queue. -/// Each frame therefore fills the command buffer with draw commands -/// that then need to be executed by the user and his own render backend. -/// After that the command buffer needs to be cleared and a new frame can be -/// started. It is probably important to note that the command buffer is the main -/// drawing API and the optional vertex buffer API only takes this format and -/// converts it into a hardware accessible format. -/// -/// To use the command queue to draw your own widgets you can access the -/// command buffer of each window by calling `nk_window_get_canvas` after -/// previously having called `nk_begin`: -/// -/// ```c -/// void draw_red_rectangle_widget(struct nk_context *ctx) -/// { -/// struct nk_command_buffer *canvas; -/// struct nk_input *input = &ctx->input; -/// canvas = nk_window_get_canvas(ctx); -/// -/// struct nk_rect space; -/// enum nk_widget_layout_states state; -/// state = nk_widget(&space, ctx); -/// if (!state) return; -/// -/// if (state != NK_WIDGET_ROM) -/// update_your_widget_by_user_input(...); -/// nk_fill_rect(canvas, space, 0, nk_rgb(255,0,0)); -/// } -/// -/// if (nk_begin(...)) { -/// nk_layout_row_dynamic(ctx, 25, 1); -/// draw_red_rectangle_widget(ctx); -/// } -/// nk_end(..) -/// -/// ``` -/// Important to know if you want to create your own widgets is the `nk_widget` -/// call. It allocates space on the panel reserved for this widget to be used, -/// but also returns the state of the widget space. If your widget is not seen and does -/// not have to be updated it is '0' and you can just return. If it only has -/// to be drawn the state will be `NK_WIDGET_ROM` otherwise you can do both -/// update and draw your widget. The reason for separating is to only draw and -/// update what is actually necessary which is crucial for performance. -*/ +/** + * \page Drawing + * This library was designed to be render backend agnostic so it does + * not draw anything to screen. Instead all drawn shapes, widgets + * are made of, are buffered into memory and make up a command queue. + * Each frame therefore fills the command buffer with draw commands + * that then need to be executed by the user and his own render backend. + * After that the command buffer needs to be cleared and a new frame can be + * started. It is probably important to note that the command buffer is the main + * drawing API and the optional vertex buffer API only takes this format and + * converts it into a hardware accessible format. + * + * To use the command queue to draw your own widgets you can access the + * command buffer of each window by calling `nk_window_get_canvas` after + * previously having called `nk_begin`: + * + * ```c + * void draw_red_rectangle_widget(struct nk_context *ctx) + * { + * struct nk_command_buffer *canvas; + * struct nk_input *input = &ctx->input; + * canvas = nk_window_get_canvas(ctx); + * + * struct nk_rect space; + * enum nk_widget_layout_states state; + * state = nk_widget(&space, ctx); + * if (!state) return; + * + * if (state != NK_WIDGET_ROM) + * update_your_widget_by_user_input(...); + * nk_fill_rect(canvas, space, 0, nk_rgb(255,0,0)); + * } + * + * if (nk_begin(...)) { + * nk_layout_row_dynamic(ctx, 25, 1); + * draw_red_rectangle_widget(ctx); + * } + * nk_end(..) + * + * ``` + * Important to know if you want to create your own widgets is the `nk_widget` + * call. It allocates space on the panel reserved for this widget to be used, + * but also returns the state of the widget space. If your widget is not seen and does + * not have to be updated it is '0' and you can just return. If it only has + * to be drawn the state will be `NK_WIDGET_ROM` otherwise you can do both + * update and draw your widget. The reason for separating is to only draw and + * update what is actually necessary which is crucial for performance. + */ + enum nk_command_type { NK_COMMAND_NOP, NK_COMMAND_SCISSOR, @@ -4454,7 +4686,7 @@ enum nk_command_type { NK_COMMAND_CUSTOM }; -/* command base and header of every command inside the buffer */ + /** command base and header of every command inside the buffer */ struct nk_command { enum nk_command_type type; nk_size next; @@ -4612,7 +4844,7 @@ struct nk_command_text { unsigned short w, h; float height; int length; - char string[1]; + char string[2]; }; enum nk_command_clipping { @@ -4628,25 +4860,25 @@ struct nk_command_buffer { nk_size begin, end, last; }; -/* shape outlines */ +/** shape outlines */ NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color); NK_API void nk_stroke_curve(struct nk_command_buffer*, float, float, float, float, float, float, float, float, float line_thickness, struct nk_color); NK_API void nk_stroke_rect(struct nk_command_buffer*, struct nk_rect, float rounding, float line_thickness, struct nk_color); NK_API void nk_stroke_circle(struct nk_command_buffer*, struct nk_rect, float line_thickness, struct nk_color); NK_API void nk_stroke_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, struct nk_color); NK_API void nk_stroke_triangle(struct nk_command_buffer*, float, float, float, float, float, float, float line_thichness, struct nk_color); -NK_API void nk_stroke_polyline(struct nk_command_buffer*, float *points, int point_count, float line_thickness, struct nk_color col); -NK_API void nk_stroke_polygon(struct nk_command_buffer*, float*, int point_count, float line_thickness, struct nk_color); +NK_API void nk_stroke_polyline(struct nk_command_buffer*, const float *points, int point_count, float line_thickness, struct nk_color col); +NK_API void nk_stroke_polygon(struct nk_command_buffer*, const float *points, int point_count, float line_thickness, struct nk_color); -/* filled shades */ +/** filled shades */ NK_API void nk_fill_rect(struct nk_command_buffer*, struct nk_rect, float rounding, struct nk_color); NK_API void nk_fill_rect_multi_color(struct nk_command_buffer*, struct nk_rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom); NK_API void nk_fill_circle(struct nk_command_buffer*, struct nk_rect, struct nk_color); NK_API void nk_fill_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, struct nk_color); NK_API void nk_fill_triangle(struct nk_command_buffer*, float x0, float y0, float x1, float y1, float x2, float y2, struct nk_color); -NK_API void nk_fill_polygon(struct nk_command_buffer*, float*, int point_count, struct nk_color); +NK_API void nk_fill_polygon(struct nk_command_buffer*, const float *points, int point_count, struct nk_color); -/* misc */ +/** misc */ NK_API void nk_draw_image(struct nk_command_buffer*, struct nk_rect, const struct nk_image*, struct nk_color); NK_API void nk_draw_nine_slice(struct nk_command_buffer*, struct nk_rect, const struct nk_nine_slice*, struct nk_color); NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color); @@ -4715,30 +4947,30 @@ NK_API nk_bool nk_input_is_key_down(const struct nk_input*, enum nk_keys); * * ===============================================================*/ #ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT -/* ### Draw List -/// The optional vertex buffer draw list provides a 2D drawing context -/// with antialiasing functionality which takes basic filled or outlined shapes -/// or a path and outputs vertexes, elements and draw commands. -/// The actual draw list API is not required to be used directly while using this -/// library since converting the default library draw command output is done by -/// just calling `nk_convert` but I decided to still make this library accessible -/// since it can be useful. -/// -/// The draw list is based on a path buffering and polygon and polyline -/// rendering API which allows a lot of ways to draw 2D content to screen. -/// In fact it is probably more powerful than needed but allows even more crazy -/// things than this library provides by default. -*/ +/** + * \page "Draw List" + * The optional vertex buffer draw list provides a 2D drawing context + * with antialiasing functionality which takes basic filled or outlined shapes + * or a path and outputs vertexes, elements and draw commands. + * The actual draw list API is not required to be used directly while using this + * library since converting the default library draw command output is done by + * just calling `nk_convert` but I decided to still make this library accessible + * since it can be useful. + * + * The draw list is based on a path buffering and polygon and polyline + * rendering API which allows a lot of ways to draw 2D content to screen. + * In fact it is probably more powerful than needed but allows even more crazy + * things than this library provides by default. + */ + #ifdef NK_UINT_DRAW_INDEX typedef nk_uint nk_draw_index; #else typedef nk_ushort nk_draw_index; #endif enum nk_draw_list_stroke { - NK_STROKE_OPEN = nk_false, - /* build up path has no connection back to the beginning */ - NK_STROKE_CLOSED = nk_true - /* build up path has a connection back to the beginning */ + NK_STROKE_OPEN = nk_false, /***< build up path has no connection back to the beginning */ + NK_STROKE_CLOSED = nk_true /***< build up path has a connection back to the beginning */ }; enum nk_draw_vertex_layout_attribute { @@ -4784,12 +5016,9 @@ struct nk_draw_vertex_layout_element { }; struct nk_draw_command { - unsigned int elem_count; - /* number of elements in the current draw batch */ - struct nk_rect clip_rect; - /* current screen clipping rectangle */ - nk_handle texture; - /* current texture to set */ + unsigned int elem_count; /**< number of elements in the current draw batch */ + struct nk_rect clip_rect; /**< current screen clipping rectangle */ + nk_handle texture; /**< current texture to set */ #ifdef NK_INCLUDE_COMMAND_USERDATA nk_handle userdata; #endif @@ -4889,6 +5118,8 @@ struct nk_style_item { struct nk_style_text { struct nk_color color; struct nk_vec2 padding; + float color_factor; + float disabled_factor; }; struct nk_style_button { @@ -4897,6 +5128,7 @@ struct nk_style_button { struct nk_style_item hover; struct nk_style_item active; struct nk_color border_color; + float color_factor_background; /* text */ struct nk_color text_background; @@ -4904,6 +5136,7 @@ struct nk_style_button { struct nk_color text_hover; struct nk_color text_active; nk_flags text_alignment; + float color_factor_text; /* properties */ float border; @@ -4911,6 +5144,7 @@ struct nk_style_button { struct nk_vec2 padding; struct nk_vec2 image_padding; struct nk_vec2 touch_padding; + float disabled_factor; /* optional user callbacks */ nk_handle userdata; @@ -4941,6 +5175,8 @@ struct nk_style_toggle { struct nk_vec2 touch_padding; float spacing; float border; + float color_factor; + float disabled_factor; /* optional user callbacks */ nk_handle userdata; @@ -4976,6 +5212,8 @@ struct nk_style_selectable { struct nk_vec2 padding; struct nk_vec2 touch_padding; struct nk_vec2 image_padding; + float color_factor; + float disabled_factor; /* optional user callbacks */ nk_handle userdata; @@ -5008,6 +5246,8 @@ struct nk_style_slider { struct nk_vec2 padding; struct nk_vec2 spacing; struct nk_vec2 cursor_size; + float color_factor; + float disabled_factor; /* optional buttons */ int show_buttons; @@ -5022,6 +5262,39 @@ struct nk_style_slider { void(*draw_end)(struct nk_command_buffer*, nk_handle); }; +struct nk_style_knob { + /* background */ + struct nk_style_item normal; + struct nk_style_item hover; + struct nk_style_item active; + struct nk_color border_color; + + /* knob */ + struct nk_color knob_normal; + struct nk_color knob_hover; + struct nk_color knob_active; + struct nk_color knob_border_color; + + /* cursor */ + struct nk_color cursor_normal; + struct nk_color cursor_hover; + struct nk_color cursor_active; + + /* properties */ + float border; + float knob_border; + struct nk_vec2 padding; + struct nk_vec2 spacing; + float cursor_width; + float color_factor; + float disabled_factor; + + /* optional user callbacks */ + nk_handle userdata; + void(*draw_begin)(struct nk_command_buffer*, nk_handle); + void(*draw_end)(struct nk_command_buffer*, nk_handle); +}; + struct nk_style_progress { /* background */ struct nk_style_item normal; @@ -5041,6 +5314,8 @@ struct nk_style_progress { float cursor_border; float cursor_rounding; struct nk_vec2 padding; + float color_factor; + float disabled_factor; /* optional user callbacks */ nk_handle userdata; @@ -5067,6 +5342,8 @@ struct nk_style_scrollbar { float border_cursor; float rounding_cursor; struct nk_vec2 padding; + float color_factor; + float disabled_factor; /* optional buttons */ int show_buttons; @@ -5113,6 +5390,8 @@ struct nk_style_edit { struct nk_vec2 scrollbar_size; struct nk_vec2 padding; float row_padding; + float color_factor; + float disabled_factor; }; struct nk_style_property { @@ -5135,6 +5414,8 @@ struct nk_style_property { float border; float rounding; struct nk_vec2 padding; + float color_factor; + float disabled_factor; struct nk_style_edit edit; struct nk_style_button inc_button; @@ -5157,6 +5438,9 @@ struct nk_style_chart { float border; float rounding; struct nk_vec2 padding; + float color_factor; + float disabled_factor; + nk_bool show_markers; }; struct nk_style_combo { @@ -5188,6 +5472,8 @@ struct nk_style_combo { struct nk_vec2 content_padding; struct nk_vec2 button_padding; struct nk_vec2 spacing; + float color_factor; + float disabled_factor; }; struct nk_style_tab { @@ -5210,6 +5496,8 @@ struct nk_style_tab { float indent; struct nk_vec2 padding; struct nk_vec2 spacing; + float color_factor; + float disabled_factor; }; enum nk_style_header_align { @@ -5293,6 +5581,7 @@ struct nk_style { struct nk_style_toggle checkbox; struct nk_style_selectable selectable; struct nk_style_slider slider; + struct nk_style_knob knob; struct nk_style_progress progress; struct nk_style_property property; struct nk_style_edit edit; @@ -5343,6 +5632,7 @@ struct nk_chart_slot { int count; struct nk_vec2 last; int index; + nk_bool show_markers; }; struct nk_chart { @@ -5421,20 +5711,13 @@ struct nk_panel { struct nk_table; enum nk_window_flags { NK_WINDOW_PRIVATE = NK_FLAG(11), - NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE, - /* special window type growing up in height while being filled to a certain maximum height */ - NK_WINDOW_ROM = NK_FLAG(12), - /* sets window widgets into a read only mode and does not allow input changes */ - NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT, - /* prevents all interaction caused by input to either window or widgets inside */ - NK_WINDOW_HIDDEN = NK_FLAG(13), - /* Hides window and stops any window interaction and drawing */ - NK_WINDOW_CLOSED = NK_FLAG(14), - /* Directly closes and frees the window at the end of the frame */ - NK_WINDOW_MINIMIZED = NK_FLAG(15), - /* marks the window as minimized */ - NK_WINDOW_REMOVE_ROM = NK_FLAG(16) - /* Removes read only mode at the end of the window */ + NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE, /**< special window type growing up in height while being filled to a certain maximum height */ + NK_WINDOW_ROM = NK_FLAG(12), /**< sets window widgets into a read only mode and does not allow input changes */ + NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT, /**< prevents all interaction caused by input to either window or widgets inside */ + NK_WINDOW_HIDDEN = NK_FLAG(13), /**< Hides window and stops any window interaction and drawing */ + NK_WINDOW_CLOSED = NK_FLAG(14), /**< Directly closes and frees the window at the end of the frame */ + NK_WINDOW_MINIMIZED = NK_FLAG(15), /**< marks the window as minimized */ + NK_WINDOW_REMOVE_ROM = NK_FLAG(16) /**< Removes read only mode at the end of the window */ }; struct nk_popup_state { @@ -5492,6 +5775,7 @@ struct nk_window { struct nk_popup_state popup; struct nk_edit_state edit; unsigned int scrolled; + nk_bool widgets_disabled; struct nk_table *tables; unsigned int table_count; @@ -5505,29 +5789,32 @@ struct nk_window { /*============================================================== * STACK * =============================================================*/ -/*/// ### Stack -/// The style modifier stack can be used to temporarily change a -/// property inside `nk_style`. For example if you want a special -/// red button you can temporarily push the old button color onto a stack -/// draw the button with a red color and then you just pop the old color -/// back from the stack: -/// -/// nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0))); -/// nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0))); -/// nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0))); -/// nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2)); -/// -/// nk_button(...); -/// -/// nk_style_pop_style_item(ctx); -/// nk_style_pop_style_item(ctx); -/// nk_style_pop_style_item(ctx); -/// nk_style_pop_vec2(ctx); -/// -/// Nuklear has a stack for style_items, float properties, vector properties, -/// flags, colors, fonts and for button_behavior. Each has it's own fixed size stack -/// which can be changed at compile time. +/** + * \page Stack + * # Stack + * The style modifier stack can be used to temporarily change a + * property inside `nk_style`. For example if you want a special + * red button you can temporarily push the old button color onto a stack + * draw the button with a red color and then you just pop the old color + * back from the stack: + * + * nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0))); + * nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0))); + * nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0))); + * nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2)); + * + * nk_button(...); + * + * nk_style_pop_style_item(ctx); + * nk_style_pop_style_item(ctx); + * nk_style_pop_style_item(ctx); + * nk_style_pop_vec2(ctx); + * + * Nuklear has a stack for style_items, float properties, vector properties, + * flags, colors, fonts and for button_behavior. Each has it's own fixed size stack + * which can be changed at compile time. */ + #ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE #define NK_BUTTON_BEHAVIOR_STACK_SIZE 8 #endif @@ -5657,15 +5944,15 @@ struct nk_context { #ifdef NK_INCLUDE_COMMAND_USERDATA nk_handle userdata; #endif - /* text editor objects are quite big because of an internal + /** text editor objects are quite big because of an internal * undo/redo stack. Therefore it does not make sense to have one for * each window for temporary use cases, so I only provide *one* instance * for all windows. This works because the content is cleared anyway */ struct nk_text_edit text_edit; - /* draw buffer used for overlay drawing operation like cursor */ + /** draw buffer used for overlay drawing operation like cursor */ struct nk_command_buffer overlay; - /* windows */ + /** windows */ int build; int use_pool; struct nk_pool pool; @@ -5682,6 +5969,7 @@ struct nk_context { * MATH * =============================================================== */ #define NK_PI 3.141592654f +#define NK_PI_HALF 1.570796326f #define NK_UTF_INVALID 0xFFFD #define NK_MAX_FLOAT_PRECISION 2 @@ -5730,7 +6018,7 @@ struct nk_context { #define NK_ALIGN_PTR_BACK(x, mask)\ (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1)))) -#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__) +#if ((defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)) && !defined(EMSCRIPTEN) #define NK_OFFSETOF(st,m) (__builtin_offsetof(st,m)) #else #define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m)) @@ -5865,6 +6153,12 @@ NK_LIB float nk_sin(float x); #ifndef NK_COS NK_LIB float nk_cos(float x); #endif +#ifndef NK_ATAN +NK_LIB float nk_atan(float x); +#endif +#ifndef NK_ATAN2 +NK_LIB float nk_atan2(float y, float x); +#endif NK_LIB nk_uint nk_round_up_pow2(nk_uint v); NK_LIB struct nk_rect nk_shrink_rect(struct nk_rect r, float amount); NK_LIB struct nk_rect nk_pad_rect(struct nk_rect r, struct nk_vec2 pad); @@ -5874,6 +6168,7 @@ NK_LIB int nk_ifloord(double x); NK_LIB int nk_ifloorf(float x); NK_LIB int nk_iceilf(float x); NK_LIB int nk_log10(double n); +NK_LIB float nk_roundf(float x); /* util */ enum {NK_DO_NOT_STOP_ON_NEW_LINE, NK_STOP_ON_NEW_LINE}; @@ -5900,7 +6195,7 @@ NK_LIB struct nk_vec2 nk_text_calculate_text_bounds(const struct nk_user_font *f NK_LIB int nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args); #endif #ifdef NK_INCLUDE_STANDARD_IO -NK_LIB char *nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc); +NK_LIB char *nk_file_load(const char* path, nk_size* siz, const struct nk_allocator *alloc); #endif /* buffer */ @@ -5941,11 +6236,11 @@ enum nk_window_insert_location { NK_LIB void *nk_create_window(struct nk_context *ctx); NK_LIB void nk_remove_window(struct nk_context*, struct nk_window*); NK_LIB void nk_free_window(struct nk_context *ctx, struct nk_window *win); -NK_LIB struct nk_window *nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name); +NK_LIB struct nk_window *nk_find_window(const struct nk_context *ctx, nk_hash hash, const char *name); NK_LIB void nk_insert_window(struct nk_context *ctx, struct nk_window *win, enum nk_window_insert_location loc); /* pool */ -NK_LIB void nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc, unsigned int capacity); +NK_LIB void nk_pool_init(struct nk_pool *pool, const struct nk_allocator *alloc, unsigned int capacity); NK_LIB void nk_pool_free(struct nk_pool *pool); NK_LIB void nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size); NK_LIB struct nk_page_element *nk_pool_alloc(struct nk_pool *pool); @@ -5961,7 +6256,7 @@ NK_LIB void nk_remove_table(struct nk_window *win, struct nk_table *tbl); NK_LIB void nk_free_table(struct nk_context *ctx, struct nk_table *tbl); NK_LIB void nk_push_table(struct nk_window *win, struct nk_table *tbl); NK_LIB nk_uint *nk_add_value(struct nk_context *ctx, struct nk_window *win, nk_hash name, nk_uint value); -NK_LIB nk_uint *nk_find_value(struct nk_window *win, nk_hash name); +NK_LIB nk_uint *nk_find_value(const struct nk_window *win, nk_hash name); /* panel */ NK_LIB void *nk_create_panel(struct nk_context *ctx); @@ -5982,7 +6277,7 @@ NK_LIB void nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt, flo NK_LIB void nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win); NK_LIB void nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, struct nk_window *win, int modify); NK_LIB void nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx); -NK_LIB void nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx); +NK_LIB void nk_layout_peek(struct nk_rect *bounds, const struct nk_context *ctx); /* popup */ NK_LIB nk_bool nk_nonblock_begin(struct nk_context *ctx, nk_flags flags, struct nk_rect body, struct nk_rect header, enum nk_panel_type panel_type); @@ -6017,9 +6312,9 @@ enum nk_toggle_type { NK_TOGGLE_OPTION }; NK_LIB nk_bool nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, nk_bool active); -NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font); -NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font); -NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font); +NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment); +NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment); +NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); /* progress */ NK_LIB nk_size nk_progress_behavior(nk_flags *state, struct nk_input *in, struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, nk_bool modifiable); @@ -6090,21 +6385,36 @@ NK_LIB void nk_property(struct nk_context *ctx, const char *name, struct nk_prop #ifdef NK_INCLUDE_FONT_BAKING +/** + * @def NK_NO_STB_RECT_PACK_IMPLEMENTATION + * + * When defined, will avoid enabling STB_RECT_PACK_IMPLEMENTATION for when stb_rect_pack.h is already implemented elsewhere. + */ +#ifndef NK_NO_STB_RECT_PACK_IMPLEMENTATION #define STB_RECT_PACK_IMPLEMENTATION +#endif /* NK_NO_STB_RECT_PACK_IMPLEMENTATION */ + +/** + * @def NK_NO_STB_TRUETYPE_IMPLEMENTATION + * + * When defined, will avoid enabling STB_TRUETYPE_IMPLEMENTATION for when stb_truetype.h is already implemented elsewhere. + */ +#ifndef NK_NO_STB_TRUETYPE_IMPLEMENTATION #define STB_TRUETYPE_IMPLEMENTATION +#endif /* NK_NO_STB_TRUETYPE_IMPLEMENTATION */ /* Allow consumer to define own STBTT_malloc/STBTT_free, and use the font atlas' allocator otherwise */ #ifndef STBTT_malloc static void* nk_stbtt_malloc(nk_size size, void *user_data) { - struct nk_allocator *alloc = (struct nk_allocator *) user_data; - return alloc->alloc(alloc->userdata, 0, size); + struct nk_allocator *alloc = (struct nk_allocator *) user_data; + return alloc->alloc(alloc->userdata, 0, size); } static void nk_stbtt_free(void *ptr, void *user_data) { - struct nk_allocator *alloc = (struct nk_allocator *) user_data; - alloc->free(alloc->userdata, ptr); + struct nk_allocator *alloc = (struct nk_allocator *) user_data; + alloc->free(alloc->userdata, ptr); } #define STBTT_malloc(x,u) nk_stbtt_malloc(x,u) @@ -6119,7 +6429,6 @@ nk_stbtt_free(void *ptr, void *user_data) { - /* =============================================================== * * MATH @@ -6203,6 +6512,52 @@ nk_cos(float x) return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*(a7 + x*a8))))))); } #endif +#ifndef NK_ATAN +#define NK_ATAN nk_atan +NK_LIB float +nk_atan(float x) +{ + /* ./lolremez --progress --float -d 9 -r "0:pi*2" "atan(x)" */ + float u = -1.0989005e-05f; + NK_ASSERT(x >= 0.0f && "TODO support negative floats"); + u = u * x + 0.00034117949f; + u = u * x + -0.0044932296f; + u = u * x + 0.032596264f; + u = u * x + -0.14088021f; + u = u * x + 0.36040401f; + u = u * x + -0.47017866f; + u = u * x + 0.00050198776f; + u = u * x + 1.0077682f; + u = u * x + -0.0004765437f; + return u; +} +#endif +#ifndef NK_ATAN2 +#define NK_ATAN2 nk_atan2 +NK_LIB float +nk_atan2(float y, float x) +{ + float ax = NK_ABS(x), + ay = NK_ABS(y); + /* 0 = +y +x 1 = -y +x + 2 = +y -x 3 = -y -x */ + nk_uint signs = (y < 0) | ((x < 0) << 1); + + float a; + if(y == 0.0 && x == 0.0) return 0.0f; + a = (ay > ax) + ? NK_PI_HALF - NK_ATAN(ax / ay) + : NK_ATAN(ay / ax); + + switch(signs){ + case 0: return a; + case 1: return -a; + case 2: return -a + NK_PI; + case 3: return a - NK_PI; + } + return 0.0f; /* prevents warning */ +} +#endif NK_LIB nk_uint nk_round_up_pow2(nk_uint v) { @@ -6270,6 +6625,11 @@ nk_log10(double n) if (neg) exp = -exp; return exp; } +NK_LIB float +nk_roundf(float x) +{ + return (x >= 0.0f) ? (float)nk_ifloorf(x + 0.5f) : (float)nk_iceilf(x - 0.5f); +} NK_API struct nk_rect nk_get_null_rect(void) { @@ -6564,7 +6924,7 @@ nk_strlen(const char *str) return siz; } NK_API int -nk_strtoi(const char *str, const char **endptr) +nk_strtoi(const char *str, char **endptr) { int neg = 1; const char *p = str; @@ -6584,15 +6944,15 @@ nk_strtoi(const char *str, const char **endptr) p++; } if (endptr) - *endptr = p; + *endptr = (char *)p; return neg*value; } NK_API double -nk_strtod(const char *str, const char **endptr) +nk_strtod(const char *str, char **endptr) { double m; double neg = 1.0; - const char *p = str; + char *p = (char *)str; double value = 0; double number = 0; @@ -6645,7 +7005,7 @@ nk_strtod(const char *str, const char **endptr) return number; } NK_API float -nk_strtof(const char *str, const char **endptr) +nk_strtof(const char *str, char **endptr) { float float_value; double double_value; @@ -7056,7 +7416,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args) /* width argument */ width = NK_DEFAULT; if (*iter >= '1' && *iter <= '9') { - const char *end; + char *end; width = nk_strtoi(iter, &end); if (end == iter) width = -1; @@ -7074,7 +7434,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args) precision = va_arg(args, int); iter++; } else { - const char *end; + char *end; precision = nk_strtoi(iter, &end); if (end == iter) precision = -1; @@ -7407,7 +7767,7 @@ nk_murmur_hash(const void * key, int len, nk_hash seed) } #ifdef NK_INCLUDE_STANDARD_IO NK_LIB char* -nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc) +nk_file_load(const char* path, nk_size* siz, const struct nk_allocator *alloc) { char *buf; FILE *fd; @@ -7575,6 +7935,16 @@ nk_parse_hex(const char *p, int length) return i; } NK_API struct nk_color +nk_rgb_factor(struct nk_color col, float factor) +{ + if (factor == 1.0f) + return col; + col.r = (nk_byte)(col.r * factor); + col.g = (nk_byte)(col.g * factor); + col.b = (nk_byte)(col.b * factor); + return col; +} +NK_API struct nk_color nk_rgba(int r, int g, int b, int a) { struct nk_color ret; @@ -7788,7 +8158,7 @@ nk_hsva_colorf(float h, float s, float v, float a) return out; } NK_API struct nk_colorf -nk_hsva_colorfv(float *c) +nk_hsva_colorfv(const float *c) { return nk_hsva_colorf(c[0], c[1], c[2], c[3]); } @@ -7967,7 +8337,6 @@ nk_color_hsv_bv(nk_byte *out, struct nk_color in) - /* =============================================================== * * UTF-8 @@ -8354,7 +8723,7 @@ nk_buffer_free(struct nk_buffer *b) b->pool.free(b->pool.userdata, b->memory.ptr); } NK_API void -nk_buffer_info(struct nk_memory_status *s, struct nk_buffer *b) +nk_buffer_info(struct nk_memory_status *s, const struct nk_buffer *b) { NK_ASSERT(b); NK_ASSERT(s); @@ -8380,7 +8749,7 @@ nk_buffer_memory_const(const struct nk_buffer *buffer) return buffer->memory.ptr; } NK_API nk_size -nk_buffer_total(struct nk_buffer *buffer) +nk_buffer_total(const struct nk_buffer *buffer) { NK_ASSERT(buffer); if (!buffer) return 0; @@ -8390,7 +8759,6 @@ nk_buffer_total(struct nk_buffer *buffer) - /* =============================================================== * * STRING @@ -8809,14 +9177,14 @@ nk_str_get_const(const struct nk_str *s) return (const char*)s->buffer.memory.ptr; } NK_API int -nk_str_len(struct nk_str *s) +nk_str_len(const struct nk_str *s) { NK_ASSERT(s); if (!s || !s->len || !s->buffer.allocated) return 0; return s->len; } NK_API int -nk_str_len_char(struct nk_str *s) +nk_str_len_char(const struct nk_str *s) { NK_ASSERT(s); if (!s || !s->len || !s->buffer.allocated) return 0; @@ -8840,7 +9208,6 @@ nk_str_free(struct nk_str *str) - /* ============================================================== * * DRAW @@ -9169,7 +9536,7 @@ nk_fill_triangle(struct nk_command_buffer *b, float x0, float y0, float x1, cmd->color = c; } NK_API void -nk_stroke_polygon(struct nk_command_buffer *b, float *points, int point_count, +nk_stroke_polygon(struct nk_command_buffer *b, const float *points, int point_count, float line_thickness, struct nk_color col) { int i; @@ -9190,7 +9557,7 @@ nk_stroke_polygon(struct nk_command_buffer *b, float *points, int point_count, } } NK_API void -nk_fill_polygon(struct nk_command_buffer *b, float *points, int point_count, +nk_fill_polygon(struct nk_command_buffer *b, const float *points, int point_count, struct nk_color col) { int i; @@ -9211,7 +9578,7 @@ nk_fill_polygon(struct nk_command_buffer *b, float *points, int point_count, } } NK_API void -nk_stroke_polyline(struct nk_command_buffer *b, float *points, int point_count, +nk_stroke_polyline(struct nk_command_buffer *b, const float *points, int point_count, float line_thickness, struct nk_color col) { int i; @@ -9399,7 +9766,6 @@ nk_draw_text(struct nk_command_buffer *b, struct nk_rect r, - /* =============================================================== * * VERTEX @@ -9595,14 +9961,16 @@ nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture) struct nk_draw_command *prev = nk_draw_list_command_last(list); if (prev->elem_count == 0) { prev->texture = texture; - #ifdef NK_INCLUDE_COMMAND_USERDATA + #ifdef NK_INCLUDE_COMMAND_USERDATA prev->userdata = list->userdata; - #endif - } else if (prev->texture.id != texture.id - #ifdef NK_INCLUDE_COMMAND_USERDATA - || prev->userdata.id != list->userdata.id - #endif - ) nk_draw_list_push_command(list, prev->clip_rect, texture); + #endif + } else if (prev->texture.id != texture.id + #ifdef NK_INCLUDE_COMMAND_USERDATA + || prev->userdata.id != list->userdata.id + #endif + ) { + nk_draw_list_push_command(list, prev->clip_rect, texture); + } } } #ifdef NK_INCLUDE_COMMAND_USERDATA @@ -11049,7 +11417,7 @@ static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0 if (node->y > min_y) { /* raise min_y higher. */ /* we've accounted for all waste up to min_y, */ - /* but we'll now add more waste for everything we've visted */ + /* but we'll now add more waste for everything we've visited */ waste_area += visited_width * (node->y - min_y); min_y = node->y; /* the first time through, visited_width might be reduced */ @@ -11204,7 +11572,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i /* insert the new node into the right starting point, and */ /* let 'cur' point to the remaining nodes needing to be */ - /* stiched back in */ + /* stitched back in */ cur = *res.prev_link; if (cur->x < res.x) { @@ -16586,7 +16954,7 @@ nk_font_baker_memory(nk_size *temp, int *glyph_count, *temp += nk_build_align + nk_baker_align; } NK_INTERN struct nk_font_baker* -nk_font_baker(void *memory, int glyph_count, int count, struct nk_allocator *alloc) +nk_font_baker(void *memory, int glyph_count, int count, const struct nk_allocator *alloc) { struct nk_font_baker *baker; if (!memory) return 0; @@ -16603,7 +16971,7 @@ NK_INTERN int nk_font_bake_pack(struct nk_font_baker *baker, nk_size *image_memory, int *width, int *height, struct nk_recti *custom, const struct nk_font_config *config_list, int count, - struct nk_allocator *alloc) + const struct nk_allocator *alloc) { NK_STORAGE const nk_size max_height = 1024 * 32; const struct nk_font_config *config_iter, *it; @@ -16632,7 +17000,7 @@ nk_font_bake_pack(struct nk_font_baker *baker, it = config_iter; do { struct stbtt_fontinfo *font_info = &baker->build[i++].info; - font_info->userdata = alloc; + font_info->userdata = (void*)alloc; if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, stbtt_GetFontOffsetForIndex((const unsigned char*)it->ttf_blob, 0))) return nk_false; @@ -16640,7 +17008,7 @@ nk_font_bake_pack(struct nk_font_baker *baker, } *height = 0; *width = (total_glyph_count > 1000) ? 1024 : 512; - stbtt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, alloc); + stbtt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, (void*)alloc); { int input_i = 0; int range_n = 0; @@ -16944,7 +17312,7 @@ nk_font_query_font_glyph(nk_handle handle, float height, } #endif NK_API const struct nk_font_glyph* -nk_font_find_glyph(struct nk_font *font, nk_rune unicode) +nk_font_find_glyph(const struct nk_font *font, nk_rune unicode) { int i = 0; int count; @@ -17007,8 +17375,8 @@ nk_font_init(struct nk_font *font, float pixel_height, * * ProggyClean.ttf * Copyright (c) 2004, 2005 Tristan Grimmer - * MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip) - * Download and more information at http://upperbounds.net + * MIT license https://github.com/bluescan/proggyfonts/blob/master/LICENSE + * Download and more information at https://github.com/bluescan/proggyfonts *-----------------------------------------------------------------------------*/ #ifdef __clang__ #pragma clang diagnostic push @@ -17333,7 +17701,7 @@ nk_font_atlas_init_default(struct nk_font_atlas *atlas) } #endif NK_API void -nk_font_atlas_init(struct nk_font_atlas *atlas, struct nk_allocator *alloc) +nk_font_atlas_init(struct nk_font_atlas *atlas, const struct nk_allocator *alloc) { NK_ASSERT(atlas); NK_ASSERT(alloc); @@ -17344,7 +17712,7 @@ nk_font_atlas_init(struct nk_font_atlas *atlas, struct nk_allocator *alloc) } NK_API void nk_font_atlas_init_custom(struct nk_font_atlas *atlas, - struct nk_allocator *permanent, struct nk_allocator *temporary) + const struct nk_allocator *permanent, const struct nk_allocator *temporary) { NK_ASSERT(atlas); NK_ASSERT(permanent); @@ -17814,7 +18182,6 @@ nk_font_atlas_clear(struct nk_font_atlas *atlas) - /* =============================================================== * * INPUT @@ -17897,6 +18264,10 @@ nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, nk_boo btn->clicked_pos.y = (float)y; btn->down = down; btn->clicked++; + + /* Fix Click-Drag for touch events. */ + in->mouse.delta.x = 0; + in->mouse.delta.y = 0; #ifdef NK_BUTTON_TRIGGER_ON_RELEASE if (down == 1 && id == NK_BUTTON_LEFT) { @@ -17934,7 +18305,7 @@ nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph) NK_API void nk_input_char(struct nk_context *ctx, char c) { - nk_glyph glyph; + nk_glyph glyph = {0}; NK_ASSERT(ctx); if (!ctx) return; glyph[0] = c; @@ -18114,13 +18485,13 @@ NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0) NK_COLOR(NK_COLOR_TOGGLE_HOVER, 120,120,120,255) \ NK_COLOR(NK_COLOR_TOGGLE_CURSOR, 45, 45, 45, 255) \ NK_COLOR(NK_COLOR_SELECT, 45, 45, 45, 255) \ - NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \ + NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \ NK_COLOR(NK_COLOR_SLIDER, 38, 38, 38, 255) \ NK_COLOR(NK_COLOR_SLIDER_CURSOR, 100,100,100,255) \ NK_COLOR(NK_COLOR_SLIDER_CURSOR_HOVER, 120,120,120,255) \ NK_COLOR(NK_COLOR_SLIDER_CURSOR_ACTIVE, 150,150,150,255) \ NK_COLOR(NK_COLOR_PROPERTY, 38, 38, 38, 255) \ - NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \ + NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \ NK_COLOR(NK_COLOR_EDIT_CURSOR, 175,175,175,255) \ NK_COLOR(NK_COLOR_COMBO, 45, 45, 45, 255) \ NK_COLOR(NK_COLOR_CHART, 120,120,120,255) \ @@ -18130,7 +18501,11 @@ NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0) NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR, 100,100,100,255) \ NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_HOVER, 120,120,120,255) \ NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_ACTIVE, 150,150,150,255) \ - NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255) + NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255) \ + NK_COLOR(NK_COLOR_KNOB, 38, 38, 38, 255) \ + NK_COLOR(NK_COLOR_KNOB_CURSOR, 100,100,100,255) \ + NK_COLOR(NK_COLOR_KNOB_CURSOR_HOVER, 120,120,120,255) \ + NK_COLOR(NK_COLOR_KNOB_CURSOR_ACTIVE, 150,150,150,255) NK_GLOBAL const struct nk_color nk_default_color_style[NK_COLOR_COUNT] = { @@ -18190,6 +18565,7 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) struct nk_style_toggle *toggle; struct nk_style_selectable *select; struct nk_style_slider *slider; + struct nk_style_knob *knob; struct nk_style_progress *prog; struct nk_style_scrollbar *scroll; struct nk_style_edit *edit; @@ -18208,27 +18584,32 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) text = &style->text; text->color = table[NK_COLOR_TEXT]; text->padding = nk_vec2(0,0); + text->color_factor = 1.0f; + text->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* default button */ button = &style->button; nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]); - button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]); - button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]); - button->border_color = table[NK_COLOR_BORDER]; - button->text_background = table[NK_COLOR_BUTTON]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->image_padding = nk_vec2(0.0f,0.0f); - button->touch_padding = nk_vec2(0.0f, 0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 1.0f; - button->rounding = 4.0f; - button->draw_begin = 0; - button->draw_end = 0; + button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]); + button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]); + button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]); + button->border_color = table[NK_COLOR_BORDER]; + button->text_background = table[NK_COLOR_BUTTON]; + button->text_normal = table[NK_COLOR_TEXT]; + button->text_hover = table[NK_COLOR_TEXT]; + button->text_active = table[NK_COLOR_TEXT]; + button->padding = nk_vec2(2.0f,2.0f); + button->image_padding = nk_vec2(0.0f,0.0f); + button->touch_padding = nk_vec2(0.0f, 0.0f); + button->userdata = nk_handle_ptr(0); + button->text_alignment = NK_TEXT_CENTERED; + button->border = 1.0f; + button->rounding = 4.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; + button->draw_begin = 0; + button->draw_end = 0; /* contextual button */ button = &style->contextual_button; @@ -18247,6 +18628,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; @@ -18267,6 +18651,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 1.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; @@ -18288,6 +18675,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) toggle->border_color = nk_rgba(0,0,0,0); toggle->border = 0.0f; toggle->spacing = 4; + toggle->color_factor = 1.0f; + toggle->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* option toggle */ toggle = &style->option; @@ -18307,6 +18696,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) toggle->border_color = nk_rgba(0,0,0,0); toggle->border = 0.0f; toggle->spacing = 4; + toggle->color_factor = 1.0f; + toggle->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* selectable */ select = &style->selectable; @@ -18328,6 +18719,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) select->touch_padding = nk_vec2(0,0); select->userdata = nk_handle_ptr(0); select->rounding = 0.0f; + select->color_factor = 1.0f; + select->disabled_factor = NK_WIDGET_DISABLED_FACTOR; select->draw_begin = 0; select->draw_end = 0; @@ -18353,6 +18746,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) slider->show_buttons = nk_false; slider->bar_height = 8; slider->rounding = 0; + slider->color_factor = 1.0f; + slider->disabled_factor = NK_WIDGET_DISABLED_FACTOR; slider->draw_begin = 0; slider->draw_end = 0; @@ -18372,10 +18767,39 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 1.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; style->slider.dec_button = style->slider.inc_button; + /* knob */ + knob = &style->knob; + nk_zero_struct(*knob); + knob->normal = nk_style_item_hide(); + knob->hover = nk_style_item_hide(); + knob->active = nk_style_item_hide(); + knob->knob_normal = table[NK_COLOR_KNOB]; + knob->knob_hover = table[NK_COLOR_KNOB]; + knob->knob_active = table[NK_COLOR_KNOB]; + knob->cursor_normal = table[NK_COLOR_KNOB_CURSOR]; + knob->cursor_hover = table[NK_COLOR_KNOB_CURSOR_HOVER]; + knob->cursor_active = table[NK_COLOR_KNOB_CURSOR_ACTIVE]; + + knob->knob_border_color = table[NK_COLOR_BORDER]; + knob->knob_border = 1.0f; + + knob->padding = nk_vec2(2,2); + knob->spacing = nk_vec2(2,2); + knob->cursor_width = 2; + knob->color_factor = 1.0f; + knob->disabled_factor = NK_WIDGET_DISABLED_FACTOR; + + knob->userdata = nk_handle_ptr(0); + knob->draw_begin = 0; + knob->draw_end = 0; + /* progressbar */ prog = &style->progress; nk_zero_struct(*prog); @@ -18393,6 +18817,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) prog->border = 0; prog->cursor_rounding = 0; prog->cursor_border = 0; + prog->color_factor = 1.0f; + prog->disabled_factor = NK_WIDGET_DISABLED_FACTOR; prog->draw_begin = 0; prog->draw_end = 0; @@ -18416,6 +18842,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) scroll->rounding = 0; scroll->border_cursor = 0; scroll->rounding_cursor = 0; + scroll->color_factor = 1.0f; + scroll->disabled_factor = NK_WIDGET_DISABLED_FACTOR; scroll->draw_begin = 0; scroll->draw_end = 0; style->scrollv = style->scrollh; @@ -18436,6 +18864,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 1.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; style->scrollh.dec_button = style->scrollh.inc_button; @@ -18467,6 +18898,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) edit->cursor_size = 4; edit->border = 1; edit->rounding = 0; + edit->color_factor = 1.0f; + edit->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* property */ property = &style->property; @@ -18486,6 +18919,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) property->rounding = 10; property->draw_begin = 0; property->draw_end = 0; + property->color_factor = 1.0f; + property->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* property buttons */ button = &style->property.dec_button; @@ -18504,6 +18939,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; style->property.inc_button = style->property.dec_button; @@ -18530,6 +18968,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) edit->cursor_size = 8; edit->border = 0; edit->rounding = 0; + edit->color_factor = 1.0f; + edit->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* chart */ chart = &style->chart; @@ -18541,6 +18981,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) chart->padding = nk_vec2(4,4); chart->border = 0; chart->rounding = 0; + chart->color_factor = 1.0f; + chart->disabled_factor = NK_WIDGET_DISABLED_FACTOR; + chart->show_markers = nk_true; /* combo */ combo = &style->combo; @@ -18559,6 +19002,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) combo->spacing = nk_vec2(4,0); combo->border = 1; combo->rounding = 0; + combo->color_factor = 1.0f; + combo->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* combo button */ button = &style->combo.button; @@ -18577,6 +19022,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; @@ -18592,6 +19040,8 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) tab->indent = 10.0f; tab->border = 1; tab->rounding = 0; + tab->color_factor = 1.0f; + tab->disabled_factor = NK_WIDGET_DISABLED_FACTOR; /* tab button */ button = &style->tab.tab_minimize_button; @@ -18610,6 +19060,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; style->tab.tab_maximize_button =*button; @@ -18631,6 +19084,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; style->tab.node_maximize_button =*button; @@ -18668,6 +19124,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; @@ -18688,6 +19147,9 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) button->text_alignment = NK_TEXT_CENTERED; button->border = 0.0f; button->rounding = 0.0f; + button->color_factor_text = 1.0f; + button->color_factor_background = 1.0f; + button->disabled_factor = NK_WIDGET_DISABLED_FACTOR; button->draw_begin = 0; button->draw_end = 0; @@ -18854,7 +19316,7 @@ nk_style_load_cursor(struct nk_context *ctx, enum nk_style_cursor cursor, style->cursors[cursor] = c; } NK_API void -nk_style_load_all_cursors(struct nk_context *ctx, struct nk_cursor *cursors) +nk_style_load_all_cursors(struct nk_context *ctx, const struct nk_cursor *cursors) { int i = 0; struct nk_style *style; @@ -18869,7 +19331,6 @@ nk_style_load_all_cursors(struct nk_context *ctx, struct nk_cursor *cursors) - /* ============================================================== * * CONTEXT @@ -18932,7 +19393,7 @@ nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, return 1; } NK_API nk_bool -nk_init(struct nk_context *ctx, struct nk_allocator *alloc, +nk_init(struct nk_context *ctx, const struct nk_allocator *alloc, const struct nk_user_font *font) { NK_ASSERT(alloc); @@ -19221,7 +19682,7 @@ nk__next(struct nk_context *ctx, const struct nk_command *cmd) * * ===============================================================*/ NK_LIB void -nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc, +nk_pool_init(struct nk_pool *pool, const struct nk_allocator *alloc, unsigned int capacity) { NK_ASSERT(capacity >= 1); @@ -19415,7 +19876,7 @@ nk_add_value(struct nk_context *ctx, struct nk_window *win, return &win->tables->values[win->tables->size++]; } NK_LIB nk_uint* -nk_find_value(struct nk_window *win, nk_hash name) +nk_find_value(const struct nk_window *win, nk_hash name) { struct nk_table *iter = win->tables; while (iter) { @@ -19435,7 +19896,6 @@ nk_find_value(struct nk_window *win, nk_hash name) - /* =============================================================== * * PANEL @@ -19511,12 +19971,12 @@ nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type) NK_LIB nk_bool nk_panel_is_sub(enum nk_panel_type type) { - return (type & NK_PANEL_SET_SUB)?1:0; + return ((int)type & (int)NK_PANEL_SET_SUB)?1:0; } NK_LIB nk_bool nk_panel_is_nonblock(enum nk_panel_type type) { - return (type & NK_PANEL_SET_NONBLOCK)?1:0; + return ((int)type & (int)NK_PANEL_SET_NONBLOCK)?1:0; } NK_LIB nk_bool nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type) @@ -19744,7 +20204,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan nk_draw_nine_slice(out, body, &style->window.fixed_background.data.slice, nk_white); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, body, 0, style->window.fixed_background.data.color); + nk_fill_rect(out, body, style->window.rounding, style->window.fixed_background.data.color); break; } } @@ -19856,7 +20316,7 @@ nk_panel_end(struct nk_context *ctx) root_window = root_window->parent; /* only allow scrolling if parent window is active */ - scroll_has_scrolling = 0; + scroll_has_scrolling = nk_false; if ((root_window == ctx->active) && layout->has_scrolling) { /* and panel is being hovered and inside clip rect*/ if (nk_input_is_mouse_hovering_rect(in, layout->bounds) && @@ -19873,13 +20333,13 @@ nk_panel_end(struct nk_context *ctx) scroll_has_scrolling = nk_true; } } - } else if (!nk_panel_is_sub(layout->type)) { + } else { /* window mouse wheel scrolling */ scroll_has_scrolling = (window == ctx->active) && layout->has_scrolling; if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling) window->scrolled = nk_true; else window->scrolled = nk_false; - } else scroll_has_scrolling = nk_false; + } { /* vertical scrollbar */ @@ -19940,7 +20400,7 @@ nk_panel_end(struct nk_context *ctx) : (window->bounds.y + window->bounds.h)); struct nk_rect b = window->bounds; b.h = padding_y - window->bounds.y; - nk_stroke_rect(out, b, 0, layout->border, border_color); + nk_stroke_rect(out, b, style->window.rounding, layout->border, border_color); } /* scaler */ @@ -20100,7 +20560,7 @@ nk_free_window(struct nk_context *ctx, struct nk_window *win) nk_free_page_element(ctx, pe);} } NK_LIB struct nk_window* -nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name) +nk_find_window(const struct nk_context *ctx, nk_hash hash, const char *name) { struct nk_window *iter; iter = ctx->begin; @@ -20237,6 +20697,7 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, NK_MEMCPY(win->name_string, name, name_length); win->name_string[name_length] = 0; win->popup.win = 0; + win->widgets_disabled = nk_false; if (!ctx->active) ctx->active = win; } else { @@ -20408,7 +20869,7 @@ nk_window_get_height(const struct nk_context *ctx) return ctx->current->bounds.h; } NK_API struct nk_rect -nk_window_get_content_region(struct nk_context *ctx) +nk_window_get_content_region(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20416,7 +20877,7 @@ nk_window_get_content_region(struct nk_context *ctx) return ctx->current->layout->clip; } NK_API struct nk_vec2 -nk_window_get_content_region_min(struct nk_context *ctx) +nk_window_get_content_region_min(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20425,7 +20886,7 @@ nk_window_get_content_region_min(struct nk_context *ctx) return nk_vec2(ctx->current->layout->clip.x, ctx->current->layout->clip.y); } NK_API struct nk_vec2 -nk_window_get_content_region_max(struct nk_context *ctx) +nk_window_get_content_region_max(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20435,7 +20896,7 @@ nk_window_get_content_region_max(struct nk_context *ctx) ctx->current->layout->clip.y + ctx->current->layout->clip.h); } NK_API struct nk_vec2 -nk_window_get_content_region_size(struct nk_context *ctx) +nk_window_get_content_region_size(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20444,7 +20905,7 @@ nk_window_get_content_region_size(struct nk_context *ctx) return nk_vec2(ctx->current->layout->clip.w, ctx->current->layout->clip.h); } NK_API struct nk_command_buffer* -nk_window_get_canvas(struct nk_context *ctx) +nk_window_get_canvas(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20453,7 +20914,7 @@ nk_window_get_canvas(struct nk_context *ctx) return &ctx->current->buffer; } NK_API struct nk_panel* -nk_window_get_panel(struct nk_context *ctx) +nk_window_get_panel(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20461,7 +20922,7 @@ nk_window_get_panel(struct nk_context *ctx) return ctx->current->layout; } NK_API void -nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y) +nk_window_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y) { struct nk_window *win; NK_ASSERT(ctx); @@ -20484,7 +20945,7 @@ nk_window_has_focus(const struct nk_context *ctx) return ctx->current == ctx->active; } NK_API nk_bool -nk_window_is_hovered(struct nk_context *ctx) +nk_window_is_hovered(const struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); @@ -20499,7 +20960,7 @@ nk_window_is_hovered(struct nk_context *ctx) } } NK_API nk_bool -nk_window_is_any_hovered(struct nk_context *ctx) +nk_window_is_any_hovered(const struct nk_context *ctx) { struct nk_window *iter; NK_ASSERT(ctx); @@ -20526,14 +20987,14 @@ nk_window_is_any_hovered(struct nk_context *ctx) return 0; } NK_API nk_bool -nk_item_is_any_active(struct nk_context *ctx) +nk_item_is_any_active(const struct nk_context *ctx) { int any_hovered = nk_window_is_any_hovered(ctx); int any_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED); return any_hovered || any_active; } NK_API nk_bool -nk_window_is_collapsed(struct nk_context *ctx, const char *name) +nk_window_is_collapsed(const struct nk_context *ctx, const char *name) { int title_len; nk_hash title_hash; @@ -20548,7 +21009,7 @@ nk_window_is_collapsed(struct nk_context *ctx, const char *name) return win->flags & NK_WINDOW_MINIMIZED; } NK_API nk_bool -nk_window_is_closed(struct nk_context *ctx, const char *name) +nk_window_is_closed(const struct nk_context *ctx, const char *name) { int title_len; nk_hash title_hash; @@ -20563,7 +21024,7 @@ nk_window_is_closed(struct nk_context *ctx, const char *name) return (win->flags & NK_WINDOW_CLOSED); } NK_API nk_bool -nk_window_is_hidden(struct nk_context *ctx, const char *name) +nk_window_is_hidden(const struct nk_context *ctx, const char *name) { int title_len; nk_hash title_hash; @@ -20578,7 +21039,7 @@ nk_window_is_hidden(struct nk_context *ctx, const char *name) return (win->flags & NK_WINDOW_HIDDEN); } NK_API nk_bool -nk_window_is_active(struct nk_context *ctx, const char *name) +nk_window_is_active(const struct nk_context *ctx, const char *name) { int title_len; nk_hash title_hash; @@ -20593,7 +21054,7 @@ nk_window_is_active(struct nk_context *ctx, const char *name) return win == ctx->active; } NK_API struct nk_window* -nk_window_find(struct nk_context *ctx, const char *name) +nk_window_find(const struct nk_context *ctx, const char *name) { int title_len; nk_hash title_hash; @@ -20623,7 +21084,6 @@ nk_window_set_bounds(struct nk_context *ctx, if (!ctx) return; win = nk_window_find(ctx, name); if (!win) return; - NK_ASSERT(ctx->current != win && "You cannot update a currently in procecss window"); win->bounds = bounds; } NK_API void @@ -20726,6 +21186,15 @@ nk_window_set_focus(struct nk_context *ctx, const char *name) } ctx->active = win; } +NK_API void +nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding) +{ + struct nk_rect space; + enum nk_widget_layout_states state = nk_widget(&space, ctx); + struct nk_command_buffer *canvas = nk_window_get_canvas(ctx); + if (!state) return; + nk_fill_rect(canvas, space, rounding && space.h > 1.5f ? space.h / 2.0f : 0, color); +} @@ -20756,7 +21225,7 @@ nk_popup_begin(struct nk_context *ctx, enum nk_popup_type type, win = ctx->current; panel = win->layout; - NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP) && "popups are not allowed to have popups"); + NK_ASSERT(!((int)panel->type & (int)NK_PANEL_SET_POPUP) && "popups are not allowed to have popups"); (void)panel; title_len = (int)nk_strlen(title); title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_POPUP); @@ -20850,7 +21319,7 @@ nk_nonblock_begin(struct nk_context *ctx, /* popups cannot have popups */ win = ctx->current; panel = win->layout; - NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP)); + NK_ASSERT(!((int)panel->type & (int)NK_PANEL_SET_POPUP)); (void)panel; popup = win->popup.win; if (!popup) { @@ -20923,7 +21392,7 @@ nk_popup_close(struct nk_context *ctx) popup = ctx->current; NK_ASSERT(popup->parent); - NK_ASSERT(popup->layout->type & NK_PANEL_SET_POPUP); + NK_ASSERT((int)popup->layout->type & (int)NK_PANEL_SET_POPUP); popup->flags |= NK_WINDOW_HIDDEN; } NK_API void @@ -20959,7 +21428,7 @@ nk_popup_end(struct nk_context *ctx) nk_push_scissor(&win->buffer, win->layout->clip); } NK_API void -nk_popup_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y) +nk_popup_get_scroll(const struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y) { struct nk_window *popup; @@ -21006,6 +21475,7 @@ nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size, struct nk_window *win; struct nk_window *popup; struct nk_rect body; + struct nk_input* in; NK_STORAGE const struct nk_rect null_rect = {-1,-1,0,0}; int is_clicked = 0; @@ -21026,35 +21496,39 @@ nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size, /* check if currently active contextual is active */ popup = win->popup.win; is_open = (popup && win->popup.type == NK_PANEL_CONTEXTUAL); - is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds); - if (win->popup.active_con && win->popup.con_count != win->popup.active_con) - return 0; - if (!is_open && win->popup.active_con) - win->popup.active_con = 0; - if ((!is_open && !is_clicked)) - return 0; + in = win->widgets_disabled ? 0 : &ctx->input; + if (in) { + is_clicked = nk_input_mouse_clicked(in, NK_BUTTON_RIGHT, trigger_bounds); + if (win->popup.active_con && win->popup.con_count != win->popup.active_con) + return 0; + if (!is_open && win->popup.active_con) + win->popup.active_con = 0; + if ((!is_open && !is_clicked)) + return 0; - /* calculate contextual position on click */ - win->popup.active_con = win->popup.con_count; - if (is_clicked) { - body.x = ctx->input.mouse.pos.x; - body.y = ctx->input.mouse.pos.y; - } else { - body.x = popup->bounds.x; - body.y = popup->bounds.y; - } - body.w = size.x; - body.h = size.y; + /* calculate contextual position on click */ + win->popup.active_con = win->popup.con_count; + if (is_clicked) { + body.x = in->mouse.pos.x; + body.y = in->mouse.pos.y; + } else { + body.x = popup->bounds.x; + body.y = popup->bounds.y; + } - /* start nonblocking contextual popup */ - ret = nk_nonblock_begin(ctx, flags|NK_WINDOW_NO_SCROLLBAR, body, + body.w = size.x; + body.h = size.y; + + /* start nonblocking contextual popup */ + ret = nk_nonblock_begin(ctx, flags | NK_WINDOW_NO_SCROLLBAR, body, null_rect, NK_PANEL_CONTEXTUAL); - if (ret) win->popup.type = NK_PANEL_CONTEXTUAL; - else { - win->popup.active_con = 0; - win->popup.type = NK_PANEL_NONE; - if (win->popup.win) - win->popup.win->flags = 0; + if (ret) win->popup.type = NK_PANEL_CONTEXTUAL; + else { + win->popup.active_con = 0; + win->popup.type = NK_PANEL_NONE; + if (win->popup.win) + win->popup.win->flags = 0; + } } return ret; } @@ -21186,7 +21660,7 @@ nk_contextual_end(struct nk_context *ctx) popup = ctx->current; panel = popup->layout; NK_ASSERT(popup->parent); - NK_ASSERT(panel->type & NK_PANEL_SET_POPUP); + NK_ASSERT((int)panel->type & (int)NK_PANEL_SET_POPUP); if (panel->flags & NK_WINDOW_DYNAMIC) { /* Close behavior This is a bit of a hack solution since we do not know before we end our popup @@ -21343,7 +21817,7 @@ nk_menu_begin_text(struct nk_context *ctx, const char *title, int len, win = ctx->current; state = nk_widget(&header, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, header, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font)) is_clicked = nk_true; @@ -21373,7 +21847,7 @@ nk_menu_begin_image(struct nk_context *ctx, const char *id, struct nk_image img, win = ctx->current; state = nk_widget(&header, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; if (nk_do_button_image(&ctx->last_widget_state, &win->buffer, header, img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in)) is_clicked = nk_true; @@ -21398,7 +21872,7 @@ nk_menu_begin_symbol(struct nk_context *ctx, const char *id, win = ctx->current; state = nk_widget(&header, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; if (nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, header, sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font)) is_clicked = nk_true; @@ -21423,7 +21897,7 @@ nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len, win = ctx->current; state = nk_widget(&header, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, ctx->style.font, in)) @@ -21456,7 +21930,7 @@ nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len, state = nk_widget(&header, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, ctx->style.font, in)) is_clicked = nk_true; @@ -21647,7 +22121,7 @@ nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt, win->layout->row.item_width = (float)width; } NK_API float -nk_layout_ratio_from_pixel(struct nk_context *ctx, float pixel_width) +nk_layout_ratio_from_pixel(const struct nk_context *ctx, float pixel_width) { struct nk_window *win; NK_ASSERT(ctx); @@ -21976,7 +22450,7 @@ nk_layout_space_push(struct nk_context *ctx, struct nk_rect rect) layout->row.item = rect; } NK_API struct nk_rect -nk_layout_space_bounds(struct nk_context *ctx) +nk_layout_space_bounds(const struct nk_context *ctx) { struct nk_rect ret; struct nk_window *win; @@ -21995,7 +22469,7 @@ nk_layout_space_bounds(struct nk_context *ctx) return ret; } NK_API struct nk_rect -nk_layout_widget_bounds(struct nk_context *ctx) +nk_layout_widget_bounds(const struct nk_context *ctx) { struct nk_rect ret; struct nk_window *win; @@ -22014,7 +22488,7 @@ nk_layout_widget_bounds(struct nk_context *ctx) return ret; } NK_API struct nk_vec2 -nk_layout_space_to_screen(struct nk_context *ctx, struct nk_vec2 ret) +nk_layout_space_to_screen(const struct nk_context *ctx, struct nk_vec2 ret) { struct nk_window *win; struct nk_panel *layout; @@ -22030,7 +22504,7 @@ nk_layout_space_to_screen(struct nk_context *ctx, struct nk_vec2 ret) return ret; } NK_API struct nk_vec2 -nk_layout_space_to_local(struct nk_context *ctx, struct nk_vec2 ret) +nk_layout_space_to_local(const struct nk_context *ctx, struct nk_vec2 ret) { struct nk_window *win; struct nk_panel *layout; @@ -22046,7 +22520,7 @@ nk_layout_space_to_local(struct nk_context *ctx, struct nk_vec2 ret) return ret; } NK_API struct nk_rect -nk_layout_space_rect_to_screen(struct nk_context *ctx, struct nk_rect ret) +nk_layout_space_rect_to_screen(const struct nk_context *ctx, struct nk_rect ret) { struct nk_window *win; struct nk_panel *layout; @@ -22062,7 +22536,7 @@ nk_layout_space_rect_to_screen(struct nk_context *ctx, struct nk_rect ret) return ret; } NK_API struct nk_rect -nk_layout_space_rect_to_local(struct nk_context *ctx, struct nk_rect ret) +nk_layout_space_rect_to_local(const struct nk_context *ctx, struct nk_rect ret) { struct nk_window *win; struct nk_panel *layout; @@ -22114,7 +22588,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type, layout->bounds.w, layout->row.columns); - #define NK_FRAC(x) (x - (float)(int)x) /* will be used to remove fookin gaps */ + #define NK_FRAC(x) (x - (float)(int)nk_roundf(x)) /* will be used to remove fookin gaps */ /* calculate the width of one item inside the current layout space */ switch (layout->row.type) { case NK_LAYOUT_DYNAMIC_FIXED: { @@ -22243,7 +22717,7 @@ nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx) layout->row.index++; } NK_LIB void -nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) +nk_layout_peek(struct nk_rect *bounds, const struct nk_context *ctx) { float y; int index; @@ -22334,15 +22808,15 @@ nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type, switch(background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, header, &background->data.image, nk_white); + nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, header, &background->data.slice, nk_white); + nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, header, 0, style->tab.border_color); + nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor)); nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), - style->tab.rounding, background->data.color); + style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor)); break; } } else text.background = style->window.background; @@ -22387,7 +22861,7 @@ nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type, label.y = sym.y; label.w = header.w - (sym.w + item_spacing.y + style->tab.indent); label.h = style->font->height; - text.text = style->tab.text; + text.text = nk_rgb_factor(style->tab.text, style->tab.color_factor); text.padding = nk_vec2(0,0); nk_widget_text(out, label, title, nk_strlen(title), &text, NK_TEXT_LEFT, style->font);} @@ -22524,15 +22998,16 @@ nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type switch (background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, header, &background->data.image, nk_white); + nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, header, &background->data.slice, nk_white); + nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, header, 0, style->tab.border_color); + nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor)); nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), - style->tab.rounding, background->data.color); + style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor)); + break; } } @@ -22960,7 +23435,7 @@ nk_list_view_end(struct nk_list_view *view) * * ===============================================================*/ NK_API struct nk_rect -nk_widget_bounds(struct nk_context *ctx) +nk_widget_bounds(const struct nk_context *ctx) { struct nk_rect bounds; NK_ASSERT(ctx); @@ -22971,7 +23446,7 @@ nk_widget_bounds(struct nk_context *ctx) return bounds; } NK_API struct nk_vec2 -nk_widget_position(struct nk_context *ctx) +nk_widget_position(const struct nk_context *ctx) { struct nk_rect bounds; NK_ASSERT(ctx); @@ -22983,7 +23458,7 @@ nk_widget_position(struct nk_context *ctx) return nk_vec2(bounds.x, bounds.y); } NK_API struct nk_vec2 -nk_widget_size(struct nk_context *ctx) +nk_widget_size(const struct nk_context *ctx) { struct nk_rect bounds; NK_ASSERT(ctx); @@ -22995,7 +23470,7 @@ nk_widget_size(struct nk_context *ctx) return nk_vec2(bounds.w, bounds.h); } NK_API float -nk_widget_width(struct nk_context *ctx) +nk_widget_width(const struct nk_context *ctx) { struct nk_rect bounds; NK_ASSERT(ctx); @@ -23007,7 +23482,7 @@ nk_widget_width(struct nk_context *ctx) return bounds.w; } NK_API float -nk_widget_height(struct nk_context *ctx) +nk_widget_height(const struct nk_context *ctx) { struct nk_rect bounds; NK_ASSERT(ctx); @@ -23019,7 +23494,7 @@ nk_widget_height(struct nk_context *ctx) return bounds.h; } NK_API nk_bool -nk_widget_is_hovered(struct nk_context *ctx) +nk_widget_is_hovered(const struct nk_context *ctx) { struct nk_rect c, v; struct nk_rect bounds; @@ -23041,7 +23516,7 @@ nk_widget_is_hovered(struct nk_context *ctx) return nk_input_is_mouse_hovering_rect(&ctx->input, bounds); } NK_API nk_bool -nk_widget_is_mouse_clicked(struct nk_context *ctx, enum nk_buttons btn) +nk_widget_is_mouse_clicked(const struct nk_context *ctx, enum nk_buttons btn) { struct nk_rect c, v; struct nk_rect bounds; @@ -23063,7 +23538,7 @@ nk_widget_is_mouse_clicked(struct nk_context *ctx, enum nk_buttons btn) return nk_input_mouse_clicked(&ctx->input, btn, bounds); } NK_API nk_bool -nk_widget_has_mouse_click_down(struct nk_context *ctx, enum nk_buttons btn, nk_bool down) +nk_widget_has_mouse_click_down(const struct nk_context *ctx, enum nk_buttons btn, nk_bool down) { struct nk_rect c, v; struct nk_rect bounds; @@ -23128,12 +23603,14 @@ nk_widget(struct nk_rect *bounds, const struct nk_context *ctx) nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h); if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h)) return NK_WIDGET_INVALID; + if (win->widgets_disabled) + return NK_WIDGET_DISABLED; if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h)) return NK_WIDGET_ROM; return NK_WIDGET_VALID; } NK_API enum nk_widget_layout_states -nk_widget_fitting(struct nk_rect *bounds, struct nk_context *ctx, +nk_widget_fitting(struct nk_rect *bounds, const struct nk_context *ctx, struct nk_vec2 item_padding) { /* update the bounds to stand without padding */ @@ -23180,7 +23657,132 @@ nk_spacing(struct nk_context *ctx, int cols) nk_panel_alloc_space(&none, ctx); } layout->row.index = index; } +NK_API void +nk_widget_disable_begin(struct nk_context* ctx) +{ + struct nk_window* win; + struct nk_style* style; + + NK_ASSERT(ctx); + NK_ASSERT(ctx->current); + + if (!ctx || !ctx->current) + return; + + win = ctx->current; + style = &ctx->style; + + win->widgets_disabled = nk_true; + + style->button.color_factor_text = style->button.disabled_factor; + style->button.color_factor_background = style->button.disabled_factor; + style->chart.color_factor = style->chart.disabled_factor; + style->checkbox.color_factor = style->checkbox.disabled_factor; + style->combo.color_factor = style->combo.disabled_factor; + style->combo.button.color_factor_text = style->combo.button.disabled_factor; + style->combo.button.color_factor_background = style->combo.button.disabled_factor; + style->contextual_button.color_factor_text = style->contextual_button.disabled_factor; + style->contextual_button.color_factor_background = style->contextual_button.disabled_factor; + style->edit.color_factor = style->edit.disabled_factor; + style->edit.scrollbar.color_factor = style->edit.scrollbar.disabled_factor; + style->menu_button.color_factor_text = style->menu_button.disabled_factor; + style->menu_button.color_factor_background = style->menu_button.disabled_factor; + style->option.color_factor = style->option.disabled_factor; + style->progress.color_factor = style->progress.disabled_factor; + style->property.color_factor = style->property.disabled_factor; + style->property.inc_button.color_factor_text = style->property.inc_button.disabled_factor; + style->property.inc_button.color_factor_background = style->property.inc_button.disabled_factor; + style->property.dec_button.color_factor_text = style->property.dec_button.disabled_factor; + style->property.dec_button.color_factor_background = style->property.dec_button.disabled_factor; + style->property.edit.color_factor = style->property.edit.disabled_factor; + style->scrollh.color_factor = style->scrollh.disabled_factor; + style->scrollh.inc_button.color_factor_text = style->scrollh.inc_button.disabled_factor; + style->scrollh.inc_button.color_factor_background = style->scrollh.inc_button.disabled_factor; + style->scrollh.dec_button.color_factor_text = style->scrollh.dec_button.disabled_factor; + style->scrollh.dec_button.color_factor_background = style->scrollh.dec_button.disabled_factor; + style->scrollv.color_factor = style->scrollv.disabled_factor; + style->scrollv.inc_button.color_factor_text = style->scrollv.inc_button.disabled_factor; + style->scrollv.inc_button.color_factor_background = style->scrollv.inc_button.disabled_factor; + style->scrollv.dec_button.color_factor_text = style->scrollv.dec_button.disabled_factor; + style->scrollv.dec_button.color_factor_background = style->scrollv.dec_button.disabled_factor; + style->selectable.color_factor = style->selectable.disabled_factor; + style->slider.color_factor = style->slider.disabled_factor; + style->slider.inc_button.color_factor_text = style->slider.inc_button.disabled_factor; + style->slider.inc_button.color_factor_background = style->slider.inc_button.disabled_factor; + style->slider.dec_button.color_factor_text = style->slider.dec_button.disabled_factor; + style->slider.dec_button.color_factor_background = style->slider.dec_button.disabled_factor; + style->tab.color_factor = style->tab.disabled_factor; + style->tab.node_maximize_button.color_factor_text = style->tab.node_maximize_button.disabled_factor; + style->tab.node_minimize_button.color_factor_text = style->tab.node_minimize_button.disabled_factor; + style->tab.tab_maximize_button.color_factor_text = style->tab.tab_maximize_button.disabled_factor; + style->tab.tab_maximize_button.color_factor_background = style->tab.tab_maximize_button.disabled_factor; + style->tab.tab_minimize_button.color_factor_text = style->tab.tab_minimize_button.disabled_factor; + style->tab.tab_minimize_button.color_factor_background = style->tab.tab_minimize_button.disabled_factor; + style->text.color_factor = style->text.disabled_factor; +} +NK_API void +nk_widget_disable_end(struct nk_context* ctx) +{ + struct nk_window* win; + struct nk_style* style; + + NK_ASSERT(ctx); + NK_ASSERT(ctx->current); + + if (!ctx || !ctx->current) + return; + + win = ctx->current; + style = &ctx->style; + win->widgets_disabled = nk_false; + + style->button.color_factor_text = 1.0f; + style->button.color_factor_background = 1.0f; + style->chart.color_factor = 1.0f; + style->checkbox.color_factor = 1.0f; + style->combo.color_factor = 1.0f; + style->combo.button.color_factor_text = 1.0f; + style->combo.button.color_factor_background = 1.0f; + style->contextual_button.color_factor_text = 1.0f; + style->contextual_button.color_factor_background = 1.0f; + style->edit.color_factor = 1.0f; + style->edit.scrollbar.color_factor = 1.0f; + style->menu_button.color_factor_text = 1.0f; + style->menu_button.color_factor_background = 1.0f; + style->option.color_factor = 1.0f; + style->progress.color_factor = 1.0f; + style->property.color_factor = 1.0f; + style->property.inc_button.color_factor_text = 1.0f; + style->property.inc_button.color_factor_background = 1.0f; + style->property.dec_button.color_factor_text = 1.0f; + style->property.dec_button.color_factor_background = 1.0f; + style->property.edit.color_factor = 1.0f; + style->scrollh.color_factor = 1.0f; + style->scrollh.inc_button.color_factor_text = 1.0f; + style->scrollh.inc_button.color_factor_background = 1.0f; + style->scrollh.dec_button.color_factor_text = 1.0f; + style->scrollh.dec_button.color_factor_background = 1.0f; + style->scrollv.color_factor = 1.0f; + style->scrollv.inc_button.color_factor_text = 1.0f; + style->scrollv.inc_button.color_factor_background = 1.0f; + style->scrollv.dec_button.color_factor_text = 1.0f; + style->scrollv.dec_button.color_factor_background = 1.0f; + style->selectable.color_factor = 1.0f; + style->slider.color_factor = 1.0f; + style->slider.inc_button.color_factor_text = 1.0f; + style->slider.inc_button.color_factor_background = 1.0f; + style->slider.dec_button.color_factor_text = 1.0f; + style->slider.dec_button.color_factor_background = 1.0f; + style->tab.color_factor = 1.0f; + style->tab.node_maximize_button.color_factor_text = 1.0f; + style->tab.node_minimize_button.color_factor_text = 1.0f; + style->tab.tab_maximize_button.color_factor_text = 1.0f; + style->tab.tab_maximize_button.color_factor_background = 1.0f; + style->tab.tab_minimize_button.color_factor_text = 1.0f; + style->tab.tab_minimize_button.color_factor_background = 1.0f; + style->text.color_factor = 1.0f; +} @@ -23298,7 +23900,7 @@ nk_text_colored(struct nk_context *ctx, const char *str, int len, text.padding.x = item_padding.x; text.padding.y = item_padding.y; text.background = style->window.background; - text.text = color; + text.text = nk_rgb_factor(color, style->text.color_factor); nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font); } NK_API void @@ -23325,7 +23927,7 @@ nk_text_wrap_colored(struct nk_context *ctx, const char *str, text.padding.x = item_padding.x; text.padding.y = item_padding.y; text.background = style->window.background; - text.text = color; + text.text = nk_rgb_factor(color, style->text.color_factor); nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font); } #ifdef NK_INCLUDE_STANDARD_VARARGS @@ -23778,6 +24380,19 @@ nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type, nk_fill_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y, foreground); } break; + case NK_SYMBOL_TRIANGLE_UP_OUTLINE: + case NK_SYMBOL_TRIANGLE_DOWN_OUTLINE: + case NK_SYMBOL_TRIANGLE_LEFT_OUTLINE: + case NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE: { + enum nk_heading heading; + struct nk_vec2 points[3]; + heading = (type == NK_SYMBOL_TRIANGLE_RIGHT_OUTLINE) ? NK_RIGHT : + (type == NK_SYMBOL_TRIANGLE_LEFT_OUTLINE) ? NK_LEFT: + (type == NK_SYMBOL_TRIANGLE_UP_OUTLINE) ? NK_UP: NK_DOWN; + nk_triangle_from_direction(points, content, 0, 0, heading); + nk_stroke_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y, + points[2].x, points[2].y, border_width, foreground); + } break; default: case NK_SYMBOL_NONE: case NK_SYMBOL_MAX: break; @@ -23822,16 +24437,16 @@ nk_draw_button(struct nk_command_buffer *out, background = &style->active; else background = &style->normal; - switch(background->type) { + switch (background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, *bounds, &background->data.image, nk_white); + nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor_background)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor_background)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); + nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor_background)); + nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor_background)); break; } return background; @@ -23851,8 +24466,8 @@ nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, /* calculate button content space */ content->x = r.x + style->padding.x + style->border + style->rounding; content->y = r.y + style->padding.y + style->border + style->rounding; - content->w = r.w - (2 * style->padding.x + style->border + style->rounding*2); - content->h = r.h - (2 * style->padding.y + style->border + style->rounding*2); + content->w = r.w - (2 * (style->padding.x + style->border + style->rounding)); + content->h = r.h - (2 * (style->padding.y + style->border + style->rounding)); /* execute button behavior */ bounds.x = r.x - style->touch_padding.x; @@ -23881,6 +24496,8 @@ nk_draw_button_text(struct nk_command_buffer *out, text.text = style->text_active; else text.text = style->text_normal; + text.text = nk_rgb_factor(text.text, style->color_factor_text); + text.padding = nk_vec2(0,0); nk_widget_text(out, *content, txt, len, &text, text_alignment, font); } @@ -23928,6 +24545,8 @@ nk_draw_button_symbol(struct nk_command_buffer *out, else if (state & NK_WIDGET_STATE_ACTIVED) sym = style->text_active; else sym = style->text_normal; + + sym = nk_rgb_factor(sym, style->color_factor_text); nk_draw_symbol(out, type, *content, bg, sym, 1, font); } NK_LIB nk_bool @@ -23959,7 +24578,7 @@ nk_draw_button_image(struct nk_command_buffer *out, nk_flags state, const struct nk_style_button *style, const struct nk_image *img) { nk_draw_button(out, bounds, state, style); - nk_draw_image(out, *content, img, nk_white); + nk_draw_image(out, *content, img, nk_rgb_factor(nk_white, style->color_factor_background)); } NK_LIB nk_bool nk_do_button_image(nk_flags *state, @@ -24016,6 +24635,8 @@ nk_draw_button_text_symbol(struct nk_command_buffer *out, text.text = style->text_normal; } + sym = nk_rgb_factor(sym, style->color_factor_text); + text.text = nk_rgb_factor(text.text, style->color_factor_text); text.padding = nk_vec2(0,0); nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font); nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font); @@ -24073,9 +24694,10 @@ nk_draw_button_text_image(struct nk_command_buffer *out, text.text = style->text_active; else text.text = style->text_normal; - text.padding = nk_vec2(0,0); + text.text = nk_rgb_factor(text.text, style->color_factor_text); + text.padding = nk_vec2(0, 0); nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font); - nk_draw_image(out, *image, img, nk_white); + nk_draw_image(out, *image, img, nk_rgb_factor(nk_white, style->color_factor_background)); } NK_LIB nk_bool nk_do_button_text_image(nk_flags *state, @@ -24180,7 +24802,7 @@ nk_button_text_styled(struct nk_context *ctx, state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds, title, len, style->text_alignment, ctx->button_behavior, style, in, ctx->style.font); @@ -24225,7 +24847,7 @@ nk_button_color(struct nk_context *ctx, struct nk_color color) state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; button = ctx->style.button; button.normal = nk_style_item_color(color); @@ -24257,7 +24879,7 @@ nk_button_symbol_styled(struct nk_context *ctx, layout = win->layout; state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds, symbol, ctx->button_behavior, style, in, ctx->style.font); } @@ -24290,7 +24912,7 @@ nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *sty state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds, img, ctx->button_behavior, style, in); } @@ -24324,7 +24946,7 @@ nk_button_symbol_text_styled(struct nk_context *ctx, state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds, symbol, text, len, align, ctx->button_behavior, style, ctx->style.font, in); @@ -24371,7 +24993,7 @@ nk_button_image_text_styled(struct nk_context *ctx, state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds, img, text, len, align, ctx->button_behavior, style, ctx->style.font, in); @@ -24423,7 +25045,7 @@ nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, - const struct nk_user_font *font) + const struct nk_user_font *font, nk_flags text_alignment) { const struct nk_style_item *background; const struct nk_style_item *cursor; @@ -24444,28 +25066,29 @@ nk_draw_checkbox(struct nk_command_buffer *out, text.text = style->text_normal; } + text.text = nk_rgb_factor(text.text, style->color_factor); + text.padding.x = 0; + text.padding.y = 0; + text.background = style->text_background; + nk_widget_text(out, *label, string, len, &text, text_alignment, font); + /* draw background and cursor */ if (background->type == NK_STYLE_ITEM_COLOR) { - nk_fill_rect(out, *selector, 0, style->border_color); - nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color); - } else nk_draw_image(out, *selector, &background->data.image, nk_white); + nk_fill_rect(out, *selector, 0, nk_rgb_factor(style->border_color, style->color_factor)); + nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, nk_rgb_factor(background->data.color, style->color_factor)); + } else nk_draw_image(out, *selector, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); if (active) { if (cursor->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, *cursors, &cursor->data.image, nk_white); + nk_draw_image(out, *cursors, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor)); else nk_fill_rect(out, *cursors, 0, cursor->data.color); } - - text.padding.x = 0; - text.padding.y = 0; - text.background = style->text_background; - nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font); } NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, - const struct nk_user_font *font) + const struct nk_user_font *font, nk_flags text_alignment) { const struct nk_style_item *background; const struct nk_style_item *cursor; @@ -24486,28 +25109,29 @@ nk_draw_option(struct nk_command_buffer *out, text.text = style->text_normal; } + text.text = nk_rgb_factor(text.text, style->color_factor); + text.padding.x = 0; + text.padding.y = 0; + text.background = style->text_background; + nk_widget_text(out, *label, string, len, &text, text_alignment, font); + /* draw background and cursor */ if (background->type == NK_STYLE_ITEM_COLOR) { - nk_fill_circle(out, *selector, style->border_color); - nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color); - } else nk_draw_image(out, *selector, &background->data.image, nk_white); + nk_fill_circle(out, *selector, nk_rgb_factor(style->border_color, style->color_factor)); + nk_fill_circle(out, nk_shrink_rect(*selector, style->border), nk_rgb_factor(background->data.color, style->color_factor)); + } else nk_draw_image(out, *selector, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); if (active) { if (cursor->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, *cursors, &cursor->data.image, nk_white); + nk_draw_image(out, *cursors, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor)); else nk_fill_circle(out, *cursors, cursor->data.color); } - - text.padding.x = 0; - text.padding.y = 0; - text.background = style->text_background; - nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font); } NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, - const struct nk_user_font *font) + const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment) { int was_active; struct nk_rect bounds; @@ -24533,8 +25157,37 @@ nk_do_toggle(nk_flags *state, /* calculate the selector space */ select.w = font->height; select.h = select.w; - select.y = r.y + r.h/2.0f - select.h/2.0f; - select.x = r.x; + + if (widget_alignment & NK_WIDGET_ALIGN_RIGHT) { + select.x = r.x + r.w - font->height; + + /* label in front of the selector */ + label.x = r.x; + label.w = r.w - select.w - style->spacing * 2; + } else if (widget_alignment & NK_WIDGET_ALIGN_CENTERED) { + select.x = r.x + (r.w - select.w) / 2; + + /* label in front of selector */ + label.x = r.x; + label.w = (r.w - select.w - style->spacing * 2) / 2; + } else { /* Default: NK_WIDGET_ALIGN_LEFT */ + select.x = r.x; + + /* label behind the selector */ + label.x = select.x + select.w + style->spacing; + label.w = NK_MAX(r.x + r.w, label.x) - label.x; + } + + if (widget_alignment & NK_WIDGET_ALIGN_TOP) { + select.y = r.y; + } else if (widget_alignment & NK_WIDGET_ALIGN_BOTTOM) { + select.y = r.y + r.h - select.h - 2 * style->padding.y; + } else { /* Default: NK_WIDGET_ALIGN_MIDDLE */ + select.y = r.y + r.h/2.0f - select.h/2.0f; + } + + label.y = select.y; + label.h = select.w; /* calculate the bounds of the cursor inside the selector */ cursor.x = select.x + style->padding.x + style->border; @@ -24542,12 +25195,6 @@ nk_do_toggle(nk_flags *state, cursor.w = select.w - (2 * style->padding.x + 2 * style->border); cursor.h = select.h - (2 * style->padding.y + 2 * style->border); - /* label behind the selector */ - label.x = select.x + select.w + style->spacing; - label.y = select.y; - label.w = NK_MAX(r.x + r.w, label.x) - label.x; - label.h = select.w; - /* update selector */ was_active = *active; *active = nk_toggle_behavior(in, bounds, state, *active); @@ -24556,9 +25203,9 @@ nk_do_toggle(nk_flags *state, if (style->draw_begin) style->draw_begin(out, style->userdata); if (type == NK_TOGGLE_CHECK) { - nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font); + nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment); } else { - nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font); + nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment); } if (style->draw_end) style->draw_end(out, style->userdata); @@ -24592,9 +25239,37 @@ nk_check_text(struct nk_context *ctx, const char *text, int len, nk_bool active) state = nk_widget(&bounds, ctx); if (!state) return active; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active, + text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font, NK_WIDGET_LEFT, NK_TEXT_LEFT); + return active; +} +NK_API nk_bool +nk_check_text_align(struct nk_context *ctx, const char *text, int len, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment) +{ + struct nk_window *win; + struct nk_panel *layout; + const struct nk_input *in; + const struct nk_style *style; + + struct nk_rect bounds; + enum nk_widget_layout_states state; + + NK_ASSERT(ctx); + NK_ASSERT(ctx->current); + NK_ASSERT(ctx->current->layout); + if (!ctx || !ctx->current || !ctx->current->layout) + return active; + + win = ctx->current; + style = &ctx->style; + layout = win->layout; + + state = nk_widget(&bounds, ctx); + if (!state) return active; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active, - text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font); + text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font, widget_alignment, text_alignment); return active; } NK_API unsigned int @@ -24624,6 +25299,18 @@ nk_checkbox_text(struct nk_context *ctx, const char *text, int len, nk_bool *act return old_val != *active; } NK_API nk_bool +nk_checkbox_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment) +{ + int old_val; + NK_ASSERT(ctx); + NK_ASSERT(text); + NK_ASSERT(active); + if (!ctx || !text || !active) return 0; + old_val = *active; + *active = nk_check_text_align(ctx, text, len, *active, widget_alignment, text_alignment); + return old_val != *active; +} +NK_API nk_bool nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len, unsigned int *flags, unsigned int value) { @@ -24654,6 +25341,10 @@ NK_API nk_bool nk_checkbox_label(struct nk_context *ctx, const char *label, nk_b { return nk_checkbox_text(ctx, label, nk_strlen(label), active); } +NK_API nk_bool nk_checkbox_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment) +{ + return nk_checkbox_text_align(ctx, label, nk_strlen(label), active, widget_alignment, text_alignment); +} NK_API nk_bool nk_checkbox_flags_label(struct nk_context *ctx, const char *label, unsigned int *flags, unsigned int value) { @@ -24687,9 +25378,37 @@ nk_option_text(struct nk_context *ctx, const char *text, int len, nk_bool is_act state = nk_widget(&bounds, ctx); if (!state) return (int)state; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active, + text, len, NK_TOGGLE_OPTION, &style->option, in, style->font, NK_WIDGET_LEFT, NK_TEXT_LEFT); + return is_active; +} +NK_API nk_bool +nk_option_text_align(struct nk_context *ctx, const char *text, int len, nk_bool is_active, nk_flags widget_alignment, nk_flags text_alignment) +{ + struct nk_window *win; + struct nk_panel *layout; + const struct nk_input *in; + const struct nk_style *style; + + struct nk_rect bounds; + enum nk_widget_layout_states state; + + NK_ASSERT(ctx); + NK_ASSERT(ctx->current); + NK_ASSERT(ctx->current->layout); + if (!ctx || !ctx->current || !ctx->current->layout) + return is_active; + + win = ctx->current; + style = &ctx->style; + layout = win->layout; + + state = nk_widget(&bounds, ctx); + if (!state) return (int)state; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active, - text, len, NK_TOGGLE_OPTION, &style->option, in, style->font); + text, len, NK_TOGGLE_OPTION, &style->option, in, style->font, widget_alignment, text_alignment); return is_active; } NK_API nk_bool @@ -24705,15 +25424,37 @@ nk_radio_text(struct nk_context *ctx, const char *text, int len, nk_bool *active return old_value != *active; } NK_API nk_bool +nk_radio_text_align(struct nk_context *ctx, const char *text, int len, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment) +{ + int old_value; + NK_ASSERT(ctx); + NK_ASSERT(text); + NK_ASSERT(active); + if (!ctx || !text || !active) return 0; + old_value = *active; + *active = nk_option_text_align(ctx, text, len, old_value, widget_alignment, text_alignment); + return old_value != *active; +} +NK_API nk_bool nk_option_label(struct nk_context *ctx, const char *label, nk_bool active) { return nk_option_text(ctx, label, nk_strlen(label), active); } NK_API nk_bool +nk_option_label_align(struct nk_context *ctx, const char *label, nk_bool active, nk_flags widget_alignment, nk_flags text_alignment) +{ + return nk_option_text_align(ctx, label, nk_strlen(label), active, widget_alignment, text_alignment); +} +NK_API nk_bool nk_radio_label(struct nk_context *ctx, const char *label, nk_bool *active) { return nk_radio_text(ctx, label, nk_strlen(label), active); } +NK_API nk_bool +nk_radio_label_align(struct nk_context *ctx, const char *label, nk_bool *active, nk_flags widget_alignment, nk_flags text_alignment) +{ + return nk_radio_text_align(ctx, label, nk_strlen(label), active, widget_alignment, text_alignment); +} @@ -24759,15 +25500,18 @@ nk_draw_selectable(struct nk_command_buffer *out, text.text = style->text_normal_active; } } + + text.text = nk_rgb_factor(text.text, style->color_factor); + /* draw selectable background and text */ switch (background->type) { case NK_STYLE_ITEM_IMAGE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_image(out, *bounds, &background->data.image, nk_white); + nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: text.background = background->data.color; @@ -24775,7 +25519,7 @@ nk_draw_selectable(struct nk_command_buffer *out, break; } if (icon) { - if (img) nk_draw_image(out, *icon, img, nk_white); + if (img) nk_draw_image(out, *icon, img, nk_rgb_factor(nk_white, style->color_factor)); else nk_draw_symbol(out, sym, *icon, text.background, text.text, 1, font); } nk_widget_text(out, *bounds, string, len, &text, align, font); @@ -24936,7 +25680,7 @@ nk_selectable_text(struct nk_context *ctx, const char *str, int len, state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds, str, len, align, value, &style->selectable, in, style->font); } @@ -24965,7 +25709,7 @@ nk_selectable_image_text(struct nk_context *ctx, struct nk_image img, state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds, str, len, align, value, &img, &style->selectable, in, style->font); } @@ -24994,7 +25738,7 @@ nk_selectable_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym, state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_selectable_symbol(&ctx->last_widget_state, &win->buffer, bounds, str, len, align, value, sym, &style->selectable, in, style->font); } @@ -25126,6 +25870,7 @@ nk_draw_slider(struct nk_command_buffer *out, nk_flags state, bar_color = style->bar_normal; cursor = &style->cursor_normal; } + /* calculate slider background bar */ bar.x = bounds->x; bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12; @@ -25141,26 +25886,26 @@ nk_draw_slider(struct nk_command_buffer *out, nk_flags state, /* draw background */ switch(background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, *bounds, &background->data.image, nk_white); + nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); + nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor)); + nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor)); break; } /* draw slider bar */ - nk_fill_rect(out, bar, style->rounding, bar_color); - nk_fill_rect(out, fill, style->rounding, style->bar_filled); + nk_fill_rect(out, bar, style->rounding, nk_rgb_factor(bar_color, style->color_factor)); + nk_fill_rect(out, fill, style->rounding, nk_rgb_factor(style->bar_filled, style->color_factor)); /* draw cursor */ if (cursor->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_white); + nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor)); else - nk_fill_circle(out, *visual_cursor, cursor->data.color); + nk_fill_circle(out, *visual_cursor, nk_rgb_factor(cursor->data.color, style->color_factor)); } NK_LIB float nk_do_slider(nk_flags *state, @@ -25278,7 +26023,7 @@ nk_slider_float(struct nk_context *ctx, float min_value, float *value, float max state = nk_widget(&bounds, ctx); if (!state) return ret; - in = (/*state == NK_WIDGET_ROM || */ layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (/*state == NK_WIDGET_ROM || */ state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; old_value = *value; *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value, @@ -25311,6 +26056,259 @@ nk_slider_int(struct nk_context *ctx, int min, int *val, int max, int step) +/* =============================================================== + * + * KNOB + * + * ===============================================================*/ + +NK_LIB float +nk_knob_behavior(nk_flags *state, struct nk_input *in, + struct nk_rect bounds, float knob_min, float knob_max, float knob_value, + float knob_step, float knob_steps, + enum nk_heading zero_direction, float dead_zone_percent) +{ + struct nk_vec2 origin; + float angle = 0.0f; + origin.x = bounds.x + (bounds.w / 2); + origin.y = bounds.y + (bounds.h / 2); + + nk_widget_state_reset(state); + + /* handle click and drag input */ + if(in && + in->mouse.buttons[NK_BUTTON_LEFT].down && + nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, bounds, nk_true)){ + /* calculate angle from origin and rotate */ + const float direction_rads[4] = { + NK_PI * 2.5f, /* 90 NK_UP */ + NK_PI * 2.0f, /* 0 NK_RIGHT */ + NK_PI * 1.5f, /* 270 NK_DOWN */ + NK_PI, /* 180 NK_LEFT */ + }; + *state = NK_WIDGET_STATE_ACTIVE; + + angle = NK_ATAN2(in->mouse.pos.y - origin.y, in->mouse.pos.x - origin.x) + direction_rads[zero_direction]; + angle -= (angle > NK_PI * 2) ? NK_PI * 3 : NK_PI; + + /* account for dead space applied when drawing */ + angle *= 1.0f / (1.0f - dead_zone_percent); + angle = NK_CLAMP(-NK_PI, angle, NK_PI); + + /* convert -pi -> pi range to 0.0 -> 1.0 */ + angle = (angle + NK_PI) / (NK_PI * 2); + + /* click to closest step */ + knob_value = knob_min + ( (int)(angle * knob_steps + (knob_step / 2)) ) * knob_step; + knob_value = NK_CLAMP(knob_min, knob_value, knob_max); + } + + /* knob widget state */ + if (nk_input_is_mouse_hovering_rect(in, bounds)){ + *state = NK_WIDGET_STATE_HOVERED; + /* handle scroll and arrow inputs */ + if (in->mouse.scroll_delta.y > 0 || + (in->keyboard.keys[NK_KEY_UP].down && in->keyboard.keys[NK_KEY_UP].clicked)) { + knob_value += knob_step; + } + + if (in->mouse.scroll_delta.y < 0 || + (in->keyboard.keys[NK_KEY_DOWN].down && in->keyboard.keys[NK_KEY_DOWN].clicked)) { + knob_value -= knob_step; + } + /* easiest way to disable scrolling of parent panels..knob eats scrolling */ + in->mouse.scroll_delta.y = 0; + knob_value = NK_CLAMP(knob_min, knob_value, knob_max); + } + if (*state & NK_WIDGET_STATE_HOVER && + !nk_input_is_mouse_prev_hovering_rect(in, bounds)) + *state |= NK_WIDGET_STATE_ENTERED; + else if (nk_input_is_mouse_prev_hovering_rect(in, bounds)) + *state |= NK_WIDGET_STATE_LEFT; + + return knob_value; +} +NK_LIB void +nk_draw_knob(struct nk_command_buffer *out, nk_flags state, + const struct nk_style_knob *style, const struct nk_rect *bounds, float min, float value, float max, + enum nk_heading zero_direction, float dead_zone_percent) +{ + const struct nk_style_item *background; + struct nk_color knob_color, cursor; + + NK_UNUSED(min); + NK_UNUSED(max); + NK_UNUSED(value); + + if (state & NK_WIDGET_STATE_ACTIVED) { + background = &style->active; + knob_color = style->knob_active; + cursor = style->cursor_active; + } else if (state & NK_WIDGET_STATE_HOVER) { + background = &style->hover; + knob_color = style->knob_hover; + cursor = style->cursor_hover; + } else { + background = &style->normal; + knob_color = style->knob_normal; + cursor = style->cursor_normal; + } + + /* draw background */ + switch(background->type) { + case NK_STYLE_ITEM_IMAGE: + nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); + break; + case NK_STYLE_ITEM_NINE_SLICE: + nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); + break; + case NK_STYLE_ITEM_COLOR: + nk_fill_rect(out, *bounds, 0, nk_rgb_factor(background->data.color, style->color_factor)); + nk_stroke_rect(out, *bounds, 0, style->border, nk_rgb_factor(style->border_color, style->color_factor)); + break; + } + + /* draw knob */ + nk_fill_circle(out, *bounds, nk_rgb_factor(knob_color, style->color_factor)); + if(style->knob_border > 0){ + struct nk_rect border_bounds = *bounds; + border_bounds.x += style->knob_border / 2; + border_bounds.y += style->knob_border / 2; + border_bounds.w -= style->knob_border; + border_bounds.h -= style->knob_border; + nk_stroke_circle(out, border_bounds, style->knob_border, nk_rgb_factor(style->knob_border_color, style->color_factor)); + } + { /* calculate cursor line cords */ + float half_circle_size = (bounds->w / 2); + float angle = (value - min) / (max - min); + float alive_zone = 1.0f - dead_zone_percent; + struct nk_vec2 cursor_start, cursor_end; + const float direction_rads[4] = { + NK_PI * 1.5f, /* 90 NK_UP */ + 0.0f, /* 0 NK_RIGHT */ + NK_PI * 0.5f, /* 270 NK_DOWN */ + NK_PI, /* 180 NK_LEFT */ + }; + /* calculate + apply dead zone */ + angle = (angle * alive_zone) + (dead_zone_percent / 2); + + /* percentage 0.0 -> 1.0 to radians, rads are 0.0 to (2*pi) NOT -pi to pi */ + angle *= NK_PI * 2; + + /* apply zero angle */ + angle += direction_rads[zero_direction]; + if(angle > NK_PI * 2) + angle -= NK_PI * 2; + + cursor_start.x = bounds->x + half_circle_size + (angle > NK_PI); + cursor_start.y = bounds->y + half_circle_size + (angle < NK_PI_HALF || angle > (NK_PI * 1.5f)); + + cursor_end.x = cursor_start.x + (half_circle_size * NK_COS(angle)); + cursor_end.y = cursor_start.y + (half_circle_size * NK_SIN(angle)); + + /* cut off half of the cursor */ + cursor_start.x = (cursor_start.x + cursor_end.x) / 2; + cursor_start.y = (cursor_start.y + cursor_end.y) / 2; + + /* draw cursor */ + nk_stroke_line(out, cursor_start.x, cursor_start.y, cursor_end.x, cursor_end.y, 2, nk_rgb_factor(cursor, style->color_factor)); + } +} +NK_LIB float +nk_do_knob(nk_flags *state, + struct nk_command_buffer *out, struct nk_rect bounds, + float min, float val, float max, float step, + enum nk_heading zero_direction, float dead_zone_percent, + const struct nk_style_knob *style, struct nk_input *in) +{ + float knob_range; + float knob_min; + float knob_max; + float knob_value; + float knob_steps; + + NK_ASSERT(style); + NK_ASSERT(out); + if (!out || !style) + return 0; + + /* remove padding from knob bounds */ + bounds.y = bounds.y + style->padding.y; + bounds.x = bounds.x + style->padding.x; + bounds.h = NK_MAX(bounds.h, 2*style->padding.y); + bounds.w = NK_MAX(bounds.w, 2*style->padding.x); + bounds.w -= 2 * style->padding.x; + bounds.h -= 2 * style->padding.y; + if(bounds.h < bounds.w){ + bounds.x += (bounds.w - bounds.h) / 2; + bounds.w = bounds.h; + } + + /* make sure the provided values are correct */ + knob_max = NK_MAX(min, max); + knob_min = NK_MIN(min, max); + knob_value = NK_CLAMP(knob_min, val, knob_max); + knob_range = knob_max - knob_min; + knob_steps = knob_range / step; + + knob_value = nk_knob_behavior(state, in, bounds, knob_min, knob_max, knob_value, step, knob_steps, zero_direction, dead_zone_percent); + + /* draw knob */ + if (style->draw_begin) style->draw_begin(out, style->userdata); + nk_draw_knob(out, *state, style, &bounds, knob_min, knob_value, knob_max, zero_direction, dead_zone_percent); + if (style->draw_end) style->draw_end(out, style->userdata); + return knob_value; +} +NK_API nk_bool +nk_knob_float(struct nk_context *ctx, float min_value, float *value, float max_value, + float value_step, enum nk_heading zero_direction, float dead_zone_degrees) +{ + struct nk_window *win; + struct nk_panel *layout; + struct nk_input *in; + const struct nk_style *style; + + int ret = 0; + float old_value; + struct nk_rect bounds; + enum nk_widget_layout_states state; + + NK_ASSERT(ctx); + NK_ASSERT(ctx->current); + NK_ASSERT(ctx->current->layout); + NK_ASSERT(value); + NK_ASSERT(NK_BETWEEN(dead_zone_degrees, 0.0f, 360.0f)); + if (!ctx || !ctx->current || !ctx->current->layout || !value) + return ret; + + win = ctx->current; + style = &ctx->style; + layout = win->layout; + + state = nk_widget(&bounds, ctx); + if (!state) return ret; + in = (state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + + old_value = *value; + *value = nk_do_knob(&ctx->last_widget_state, &win->buffer, bounds, min_value, + old_value, max_value, value_step, zero_direction, dead_zone_degrees / 360.0f, &style->knob, in); + + return (old_value > *value || old_value < *value); +} +NK_API nk_bool +nk_knob_int(struct nk_context *ctx, int min, int *val, int max, int step, + enum nk_heading zero_direction, float dead_zone_degrees) +{ + int ret; + float value = (float)*val; + ret = nk_knob_float(ctx, (float)min, &value, (float)max, (float)step, zero_direction, dead_zone_degrees); + *val = (int)value; + return ret; +} + + + + /* =============================================================== * * PROGRESS @@ -25372,28 +26370,28 @@ nk_draw_progress(struct nk_command_buffer *out, nk_flags state, /* draw background */ switch(background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, *bounds, &background->data.image, nk_white); + nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); + nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor)); + nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor)); break; } /* draw cursor */ switch(cursor->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, *scursor, &cursor->data.image, nk_white); + nk_draw_image(out, *scursor, &cursor->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, *scursor, &cursor->data.slice, nk_white); + nk_draw_nine_slice(out, *scursor, &cursor->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, *scursor, style->rounding, cursor->data.color); - nk_stroke_rect(out, *scursor, style->rounding, style->border, style->border_color); + nk_fill_rect(out, *scursor, style->rounding, nk_rgb_factor(cursor->data.color, style->color_factor)); + nk_stroke_rect(out, *scursor, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor)); break; } } @@ -25453,7 +26451,7 @@ nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, nk_bool is_modify state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; old_value = *cur; *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds, *cur, max, is_modifyable, &style->progress, in); @@ -26057,21 +27055,28 @@ nk_is_word_boundary( struct nk_text_edit *state, int idx) { int len; nk_rune c; - if (idx <= 0) return 1; + if (idx < 0) return 1; if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1; - return (c == ' ' || c == '\t' ||c == 0x3000 || c == ',' || c == ';' || - c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']' || - c == '|'); +#ifndef NK_IS_WORD_BOUNDARY + return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || + c == '\v' || c == 0x3000); +#else + return NK_IS_WORD_BOUNDARY(c); +#endif } NK_INTERN int nk_textedit_move_to_word_previous(struct nk_text_edit *state) { int c = state->cursor - 1; - while( c >= 0 && !nk_is_word_boundary(state, c)) - --c; - - if( c < 0 ) - c = 0; + if (c > 0) { + if (nk_is_word_boundary(state, c)) { + while (c > 0 && nk_is_word_boundary(state, --c)); + } + while (!nk_is_word_boundary(state, --c)); + c++; + } else { + return 0; + } return c; } @@ -26079,12 +27084,15 @@ NK_INTERN int nk_textedit_move_to_word_next(struct nk_text_edit *state) { const int len = state->string.len; - int c = state->cursor+1; - while( c < len && !nk_is_word_boundary(state, c)) - ++c; - - if( c > len ) - c = len; + int c = state->cursor; + if (c < len) { + if (!nk_is_word_boundary(state, c)) { + while (c < len && !nk_is_word_boundary(state, ++c)); + } + while (c < len && nk_is_word_boundary(state, ++c)); + } else { + return len; + } return c; } @@ -26269,7 +27277,7 @@ nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod, case NK_KEY_TEXT_WORD_LEFT: if (shift_mod) { if( !NK_TEXT_HAS_SELECTION( state ) ) - nk_textedit_prep_selection_at_cursor(state); + nk_textedit_prep_selection_at_cursor(state); state->cursor = nk_textedit_move_to_word_previous(state); state->select_end = state->cursor; nk_textedit_clamp(state ); @@ -26772,7 +27780,7 @@ nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size) nk_str_init_fixed(&state->string, memory, size); } NK_API void -nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size size) +nk_textedit_init(struct nk_text_edit *state, const struct nk_allocator *alloc, nk_size size) { NK_ASSERT(state); NK_ASSERT(alloc); @@ -26904,6 +27912,9 @@ nk_edit_draw_text(struct nk_command_buffer *out, txt.background = background; txt.text = foreground; + foreground = nk_rgb_factor(foreground, style->color_factor); + background = nk_rgb_factor(background, style->color_factor); + glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len); if (!glyph_len) return; while ((text_len < byte_len) && glyph_len) @@ -26995,7 +28006,6 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, /* update edit state */ prev_state = (char)edit->active; - is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds); if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) { edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, bounds.x, bounds.y, bounds.w, bounds.h); @@ -27141,14 +28151,14 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, /* draw background frame */ switch(background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, bounds, &background->data.image, nk_white); + nk_draw_image(out, bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(out, bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, bounds, style->rounding, background->data.color); - nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color); + nk_fill_rect(out, bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor)); + nk_stroke_rect(out, bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor)); break; }} @@ -27287,10 +28297,12 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, } else edit->scrollbar.x = 0; if (flags & NK_EDIT_MULTILINE) { - /* vertical scroll */ + /* vertical scroll: like horizontal, it only adjusts if the + * cursor leaves the visible area, and then only just enough + * to keep it visible */ if (cursor_pos.y < edit->scrollbar.y) - edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height); - if (cursor_pos.y >= edit->scrollbar.y + row_height) + edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y); + if (cursor_pos.y > edit->scrollbar.y + area.h - row_height) edit->scrollbar.y = edit->scrollbar.y + row_height; } else edit->scrollbar.y = 0; } @@ -27313,9 +28325,13 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, scroll_step = scroll.h * 0.10f; scroll_inc = scroll.h * 0.01f; scroll_target = text_size.y; - edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, 0, + edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, is_hovered, scroll_offset, scroll_target, scroll_step, scroll_inc, &style->scrollbar, in, font); + /* Eat mouse scroll if we're active */ + if (is_hovered && in->mouse.scroll_delta.y) { + in->mouse.scroll_delta.y = 0; + } } } @@ -27357,6 +28373,8 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, else background_color = background->data.color; + cursor_color = nk_rgb_factor(cursor_color, style->color_factor); + cursor_text_color = nk_rgb_factor(cursor_text_color, style->color_factor); if (edit->select_start == edit->select_end) { /* no selection so just draw the complete text */ @@ -27464,6 +28482,10 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, background_color = nk_rgba(0,0,0,0); else background_color = background->data.color; + + background_color = nk_rgb_factor(background_color, style->color_factor); + text_color = nk_rgb_factor(text_color, style->color_factor); + nk_edit_draw_text(out, style, area.x - edit->scrollbar.x, area.y - edit->scrollbar.y, 0, begin, l, row_height, font, background_color, text_color, nk_false); @@ -27583,6 +28605,8 @@ nk_edit_buffer(struct nk_context *ctx, nk_flags flags, style = &ctx->style; state = nk_widget(&bounds, ctx); if (!state) return state; + else if (state == NK_WIDGET_DISABLED) + flags |= NK_EDIT_READ_ONLY; in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; /* check if edit is currently hot item */ @@ -27716,26 +28740,30 @@ nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property * text.text = style->label_normal; } + text.text = nk_rgb_factor(text.text, style->color_factor); + /* draw background */ switch(background->type) { case NK_STYLE_ITEM_IMAGE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_image(out, *bounds, &background->data.image, nk_white); + nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: text.background = background->data.color; - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color); + nk_fill_rect(out, *bounds, style->rounding, nk_rgb_factor(background->data.color, style->color_factor)); + nk_stroke_rect(out, *bounds, style->rounding, style->border, nk_rgb_factor(style->border_color, style->color_factor)); break; } /* draw label */ text.padding = nk_vec2(0,0); - nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font); + if (name && name[0] != '#') { + nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font); + } } NK_LIB void nk_do_property(nk_flags *ws, @@ -27753,7 +28781,7 @@ nk_do_property(nk_flags *ws, nk_filter_float }; nk_bool active, old; - int num_len = 0, name_len; + int num_len = 0, name_len = 0; char string[NK_MAX_NUMBER_BUFFER]; float size; @@ -27773,7 +28801,9 @@ nk_do_property(nk_flags *ws, left.y = property.y + style->border + property.h/2.0f - left.h/2; /* text label */ - name_len = nk_strlen(name); + if (name && name[0] != '#') { + name_len = nk_strlen(name); + } size = font->width(font->userdata, font->height, name, name_len); label.x = left.x + left.w + style->padding.x; label.w = (float)size + 2 * style->padding.x; @@ -27880,7 +28910,7 @@ nk_do_property(nk_flags *ws, text_edit->string.buffer.memory.ptr = dst; text_edit->string.buffer.size = NK_MAX_NUMBER_BUFFER; text_edit->mode = NK_TEXT_EDIT_MODE_INSERT; - nk_do_edit(ws, out, edit, NK_EDIT_FIELD|NK_EDIT_AUTO_SELECT, + nk_do_edit(ws, out, edit, (int)NK_EDIT_FIELD|(int)NK_EDIT_AUTO_SELECT, filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font); *length = text_edit->string.len; @@ -28014,7 +29044,7 @@ nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant old_state = *state; ctx->text_edit.clip = ctx->clip; in = ((s == NK_WIDGET_ROM && !win->property.active) || - layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED) ? 0 : &ctx->input; nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name, variant, inc_per_pixel, buffer, len, state, cursor, select_begin, select_end, &style->property, filter, in, style->font, &ctx->text_edit, @@ -28183,26 +29213,27 @@ nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type, {struct nk_chart_slot *slot = &chart->slots[chart->slot++]; slot->type = type; slot->count = count; - slot->color = color; + slot->color = nk_rgb_factor(color, style->color_factor); slot->highlight = highlight; slot->min = NK_MIN(min_value, max_value); slot->max = NK_MAX(min_value, max_value); - slot->range = slot->max - slot->min;} + slot->range = slot->max - slot->min; + slot->show_markers = style->show_markers;} /* draw chart background */ background = &style->background; switch(background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white); + nk_draw_image(&win->buffer, bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(&win->buffer, bounds, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color); + nk_fill_rect(&win->buffer, bounds, style->rounding, nk_rgb_factor(style->border_color, style->color_factor)); nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border), - style->rounding, style->background.data.color); + style->rounding, nk_rgb_factor(style->background.data.color, style->color_factor)); break; } return 1; @@ -28219,6 +29250,8 @@ nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type, struct nk_color color, struct nk_color highlight, int count, float min_value, float max_value) { + const struct nk_style_chart* style; + NK_ASSERT(ctx); NK_ASSERT(ctx->current); NK_ASSERT(ctx->current->layout); @@ -28226,16 +29259,19 @@ nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type, if (!ctx || !ctx->current || !ctx->current->layout) return; if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return; + style = &ctx->style.chart; + /* add another slot into the graph */ {struct nk_chart *chart = &ctx->current->layout->chart; struct nk_chart_slot *slot = &chart->slots[chart->slot++]; slot->type = type; slot->count = count; - slot->color = color; + slot->color = nk_rgb_factor(color, style->color_factor); slot->highlight = highlight; slot->min = NK_MIN(min_value, max_value); slot->max = NK_MAX(min_value, max_value); - slot->range = slot->max - slot->min;} + slot->range = slot->max - slot->min; + slot->show_markers = style->show_markers;} } NK_API void nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type, @@ -28249,7 +29285,7 @@ nk_chart_push_line(struct nk_context *ctx, struct nk_window *win, struct nk_chart *g, float value, int slot) { struct nk_panel *layout = win->layout; - const struct nk_input *i = &ctx->input; + const struct nk_input *i = ctx->current->widgets_disabled ? 0 : &ctx->input; struct nk_command_buffer *out = &win->buffer; nk_flags ret = 0; @@ -28275,14 +29311,16 @@ nk_chart_push_line(struct nk_context *ctx, struct nk_window *win, bounds.w = bounds.h = 4; color = g->slots[slot].color; - if (!(layout->flags & NK_WINDOW_ROM) && + if (!(layout->flags & NK_WINDOW_ROM) && i && NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){ ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0; ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down && i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0; color = g->slots[slot].highlight; } - nk_fill_rect(out, bounds, 0, color); + if (g->slots[slot].show_markers) { + nk_fill_rect(out, bounds, 0, color); + } g->slots[slot].index += 1; return ret; } @@ -28306,7 +29344,9 @@ nk_chart_push_line(struct nk_context *ctx, struct nk_window *win, color = g->slots[slot].highlight; } } - nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color); + if (g->slots[slot].show_markers) { + nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color); + } /* save current data point position */ g->slots[slot].last.x = cur.x; @@ -28319,7 +29359,7 @@ nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win, struct nk_chart *chart, float value, int slot) { struct nk_command_buffer *out = &win->buffer; - const struct nk_input *in = &ctx->input; + const struct nk_input *in = ctx->current->widgets_disabled ? 0 : &ctx->input; struct nk_panel *layout = win->layout; float ratio; @@ -28349,7 +29389,7 @@ nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win, item.x = item.x + ((float)chart->slots[slot].index); /* user chart bar selection */ - if (!(layout->flags & NK_WINDOW_ROM) && + if (!(layout->flags & NK_WINDOW_ROM) && in && NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) { ret = NK_CHART_HOVERING; ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down && @@ -28648,7 +29688,7 @@ nk_color_pick(struct nk_context * ctx, struct nk_colorf *color, layout = win->layout; state = nk_widget(&bounds, ctx); if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; + in = (state == NK_WIDGET_ROM || state == NK_WIDGET_DISABLED || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds, nk_vec2(0,0), in, config->font); } @@ -28730,7 +29770,7 @@ nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len, if (s == NK_WIDGET_INVALID) return 0; - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; + in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; @@ -28746,19 +29786,21 @@ nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len, text.text = style->combo.label_normal; } + text.text = nk_rgb_factor(text.text, style->combo.color_factor); + switch(background->type) { case NK_STYLE_ITEM_IMAGE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); + nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_COLOR: text.background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); + nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor)); + nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor)); break; } { @@ -28838,7 +29880,7 @@ nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_ve if (s == NK_WIDGET_INVALID) return 0; - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; + in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; @@ -28851,14 +29893,14 @@ nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_ve switch(background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); + nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); + nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor)); + nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor)); break; } { @@ -28896,7 +29938,7 @@ nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_ve bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x; else bounds.w = header.w - 4 * style->combo.content_padding.x; - nk_fill_rect(&win->buffer, bounds, 0, color); + nk_fill_rect(&win->buffer, bounds, 0, nk_rgb_factor(color, style->combo.color_factor)); /* draw open/close button */ if (draw_button_symbol) @@ -28931,7 +29973,7 @@ nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct if (s == NK_WIDGET_INVALID) return 0; - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; + in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; @@ -28947,19 +29989,21 @@ nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct symbol_color = style->combo.symbol_hover; } + symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor); + switch(background->type) { case NK_STYLE_ITEM_IMAGE: sym_background = nk_rgba(0, 0, 0, 0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); + nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: sym_background = nk_rgba(0, 0, 0, 0); - nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_COLOR: sym_background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); + nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor)); + nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor)); break; } { @@ -29025,7 +30069,7 @@ nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len s = nk_widget(&header, ctx); if (!s) return 0; - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; + in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; @@ -29044,19 +30088,22 @@ nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len text.text = style->combo.label_normal; } + text.text = nk_rgb_factor(text.text, style->combo.color_factor); + symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor); + switch(background->type) { case NK_STYLE_ITEM_IMAGE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); + nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_COLOR: text.background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); + nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor)); + nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor)); break; } { @@ -29127,7 +30174,7 @@ nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 if (s == NK_WIDGET_INVALID) return 0; - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; + in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; @@ -29140,14 +30187,14 @@ nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 switch (background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); + nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); + nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor)); + nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor)); break; } { @@ -29185,7 +30232,7 @@ nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x; else bounds.w = header.w - 2 * style->combo.content_padding.x; - nk_draw_image(&win->buffer, bounds, &img, nk_white); + nk_draw_image(&win->buffer, bounds, &img, nk_rgb_factor(nk_white, style->combo.color_factor)); /* draw open/close button */ if (draw_button_symbol) @@ -29219,7 +30266,7 @@ nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len, s = nk_widget(&header, ctx); if (!s) return 0; - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; + in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input; if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) is_clicked = nk_true; @@ -29235,19 +30282,21 @@ nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len, text.text = style->combo.label_normal; } + text.text = nk_rgb_factor(text.text, style->combo.color_factor); + switch(background->type) { case NK_STYLE_ITEM_IMAGE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); + nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: text.background = nk_rgba(0, 0, 0, 0); - nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_white); + nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor)); break; case NK_STYLE_ITEM_COLOR: text.background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); + nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor)); + nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor)); break; } { @@ -29286,7 +30335,7 @@ nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len, image.y = header.y + style->combo.content_padding.y; image.h = header.h - 2 * style->combo.content_padding.y; image.w = image.h; - nk_draw_image(&win->buffer, image, &img, nk_white); + nk_draw_image(&win->buffer, image, &img, nk_rgb_factor(nk_white, style->combo.color_factor)); /* draw label */ text.padding = nk_vec2(0,0); @@ -29356,7 +30405,7 @@ NK_API void nk_combo_close(struct nk_context *ctx) nk_contextual_close(ctx); } NK_API int -nk_combo(struct nk_context *ctx, const char **items, int count, +nk_combo(struct nk_context *ctx, const char *const *items, int count, int selected, int item_height, struct nk_vec2 size) { int i = 0; @@ -29474,7 +30523,7 @@ nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const c } return selected; } NK_API void -nk_combobox(struct nk_context *ctx, const char **items, int count, +nk_combobox(struct nk_context *ctx, const char *const *items, int count, int *selected, int item_height, struct nk_vec2 size) { *selected = nk_combo(ctx, items, count, *selected, item_height, size); @@ -29503,7 +30552,6 @@ nk_combobox_callback(struct nk_context *ctx, - /* =============================================================== * * TOOLTIP @@ -29527,7 +30575,7 @@ nk_tooltip_begin(struct nk_context *ctx, float width) /* make sure that no nonblocking popup is currently active */ win = ctx->current; in = &ctx->input; - if (win->popup.win && (win->popup.type & NK_PANEL_SET_NONBLOCK)) + if (win->popup.win && ((int)win->popup.type & (int)NK_PANEL_SET_NONBLOCK)) return 0; w = nk_iceilf(width); @@ -29668,6 +30716,15 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// - [y]: Minor version with non-breaking API and library changes /// - [z]: Patch version with no direct changes to the API /// +/// - 2025/04/06 (4.12.7) - Fix text input navigation and mouse scrolling +/// - 2025/03/29 (4.12.6) - Fix unitialized data in nk_input_char +/// - 2025/03/05 (4.12.5) - Fix scrolling knob also scrolling parent window, remove dead code +/// - 2024/12/11 (4.12.4) - Fix array subscript [0, 0] is outside array bounds of ‘char[1]’ +/// - 2024/12/11 (4.12.3) - Fix border color for property widgets +/// - 2024/11/20 (4.12.2) - Fix int/float type conversion warnings in `nk_roundf` +/// - 2024/03/07 (4.12.1) - Fix bitwise operations warnings in C++20 +/// - 2023/11/26 (4.12.0) - Added an alignment option to checkboxes and radio buttons. +/// - 2023/10/11 (4.11.0) - Added nk_widget_disable_begin() and nk_widget_disable_end() /// - 2022/12/23 (4.10.6) - Fix incorrect glyph index in nk_font_bake() /// - 2022/12/17 (4.10.5) - Fix nk_font_bake_pack() using TTC font offset incorrectly /// - 2022/10/24 (4.10.4) - Fix nk_str_{append,insert}_str_utf8 always returning 0 @@ -29676,6 +30733,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// - 2022/08/01 (4.10.1) - Fix cursor jumping back to beginning of text when typing more than /// nk_edit_xxx limit /// - 2022/05/27 (4.10.0) - Add nk_input_has_mouse_click_in_button_rect() to fix window move bug +/// - 2022/04/19 (4.9.8) - Added nk_rule_horizontal() widget /// - 2022/04/18 (4.9.7) - Change button behavior when NK_BUTTON_TRIGGER_ON_RELEASE is defined to /// only trigger when the mouse position was inside the same button on down /// - 2022/02/03 (4.9.6) - Allow overriding the NK_INV_SQRT function, similar to NK_SIN and NK_COS @@ -29811,7 +30869,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// dynamic and static widgets. /// - 2016/12/31 (1.30.0) - Extended scrollbar offset from 16-bit to 32-bit. /// - 2016/12/31 (1.29.2) - Fixed closing window bug of minimized windows. -/// - 2016/12/03 (1.29.1) - Fixed wrapped text with no seperator and C89 error. +/// - 2016/12/03 (1.29.1) - Fixed wrapped text with no separator and C89 error. /// - 2016/12/03 (1.29.0) - Changed text wrapping to process words not characters. /// - 2016/11/22 (1.28.6) - Fixed window minimized closing bug. /// - 2016/11/19 (1.28.5) - Fixed abstract combo box closing behavior. @@ -29949,7 +31007,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// precision. /// - 2016/08/08 (1.07.2) - Fixed compiling error without define `NK_INCLUDE_FIXED_TYPE`. /// - 2016/08/08 (1.07.1) - Fixed possible floating point error inside `nk_widget` leading -/// to wrong wiget width calculation which results in widgets falsely +/// to wrong widget width calculation which results in widgets falsely /// becoming tagged as not inside window and cannot be accessed. /// - 2016/08/08 (1.07.0) - Nuklear now differentiates between hiding a window (NK_WINDOW_HIDDEN) and /// closing a window (NK_WINDOW_CLOSED). A window can be hidden/shown diff --git a/nk/types.go b/nk/types.go index 951771d..1efa134 100644 --- a/nk/types.go +++ b/nk/types.go @@ -1,6 +1,6 @@ // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS. -// WARNING: This file has automatically been generated on Tue, 14 Nov 2023 12:28:21 +03. +// WARNING: This file has automatically been generated on Tue, 28 Oct 2025 01:24:27 -03. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package nk @@ -13,198 +13,198 @@ package nk import "C" import "unsafe" -// Char type as declared in nk/nuklear.h:411 +// Char type as declared in nk/nuklear.h:419 type Char int8 -// Uchar type as declared in nk/nuklear.h:412 +// Uchar type as declared in nk/nuklear.h:420 type Uchar byte -// Byte type as declared in nk/nuklear.h:413 +// Byte type as declared in nk/nuklear.h:421 type Byte byte -// Short type as declared in nk/nuklear.h:414 +// Short type as declared in nk/nuklear.h:422 type Short int16 -// Ushort type as declared in nk/nuklear.h:415 +// Ushort type as declared in nk/nuklear.h:423 type Ushort uint16 -// Int type as declared in nk/nuklear.h:416 +// Int type as declared in nk/nuklear.h:424 type Int int32 -// Uint type as declared in nk/nuklear.h:417 +// Uint type as declared in nk/nuklear.h:425 type Uint uint32 -// Size type as declared in nk/nuklear.h:418 +// Size type as declared in nk/nuklear.h:426 type Size uint64 -// Ptr type as declared in nk/nuklear.h:419 +// Ptr type as declared in nk/nuklear.h:427 type Ptr uint64 -// Bool type as declared in nk/nuklear.h:420 +// Bool type as declared in nk/nuklear.h:428 type Bool int32 -// Hash type as declared in nk/nuklear.h:422 +// Hash type as declared in nk/nuklear.h:430 type Hash uint32 -// Flags type as declared in nk/nuklear.h:423 +// Flags type as declared in nk/nuklear.h:431 type Flags uint32 -// Rune type as declared in nk/nuklear.h:424 +// Rune type as declared in nk/nuklear.h:432 type Rune uint32 -// Glyph type as declared in nk/nuklear.h:482 +// Glyph type as declared in nk/nuklear.h:490 type Glyph [4]byte -// Handle as declared in nk/nuklear.h:483 +// Handle as declared in nk/nuklear.h:491 const sizeofHandle = unsafe.Sizeof(C.nk_handle{}) type Handle [sizeofHandle]byte -// PluginAlloc type as declared in nk/nuklear.h:502 +// PluginAlloc type as declared in nk/nuklear.h:510 type PluginAlloc func(arg0 Handle, old unsafe.Pointer, arg2 Size) unsafe.Pointer -// PluginFree type as declared in nk/nuklear.h:503 +// PluginFree type as declared in nk/nuklear.h:511 type PluginFree func(arg0 Handle, old unsafe.Pointer) -// PluginFilter type as declared in nk/nuklear.h:504 +// PluginFilter type as declared in nk/nuklear.h:512 type PluginFilter func(arg0 *TextEdit, unicode Rune) Bool -// PluginPaste type as declared in nk/nuklear.h:505 +// PluginPaste type as declared in nk/nuklear.h:513 type PluginPaste func(arg0 Handle, arg1 *TextEdit) -// PluginCopy type as declared in nk/nuklear.h:506 +// PluginCopy type as declared in nk/nuklear.h:514 type PluginCopy func(arg0 Handle, arg1 *byte, len int32) -// TextWidthF type as declared in nk/nuklear.h:3952 +// TextWidthF type as declared in nk/nuklear.h:4215 type TextWidthF func(arg0 Handle, h float32, arg2 *byte, len int32) float32 -// QueryFontGlyphF type as declared in nk/nuklear.h:3953 +// QueryFontGlyphF type as declared in nk/nuklear.h:4216 type QueryFontGlyphF func(handle Handle, fontHeight float32, glyph *UserFontGlyph, codepoint Rune, nextCodepoint Rune) -// CommandCustomCallback type as declared in nk/nuklear.h:4596 +// CommandCustomCallback type as declared in nk/nuklear.h:4828 type CommandCustomCallback func(canvas unsafe.Pointer, x int16, y int16, w uint16, h uint16, callbackData Handle) -// DrawIndex type as declared in nk/nuklear.h:4735 +// DrawIndex type as declared in nk/nuklear.h:4969 type DrawIndex uint16 -// Allocator as declared in nk/nuklear.h:450 +// Allocator as declared in nk/nuklear.h:458 type Allocator C.struct_nk_allocator -// BakedFont as declared in nk/nuklear.h:3992 +// BakedFont as declared in nk/nuklear.h:4246 type BakedFont C.struct_nk_baked_font -// Buffer as declared in nk/nuklear.h:449 +// Buffer as declared in nk/nuklear.h:457 type Buffer C.struct_nk_buffer -// BufferMarker as declared in nk/nuklear.h:4169 +// BufferMarker as declared in nk/nuklear.h:4406 type BufferMarker C.struct_nk_buffer_marker -// Chart as declared in nk/nuklear.h:5348 +// Chart as declared in nk/nuklear.h:5638 type Chart C.struct_nk_chart -// ChartSlot as declared in nk/nuklear.h:5338 +// ChartSlot as declared in nk/nuklear.h:5627 type ChartSlot C.struct_nk_chart_slot -// Clipboard as declared in nk/nuklear.h:4305 +// Clipboard as declared in nk/nuklear.h:4535 type Clipboard C.struct_nk_clipboard -// Color as declared in nk/nuklear.h:476 +// Color as declared in nk/nuklear.h:484 type Color C.struct_nk_color -// Colorf as declared in nk/nuklear.h:477 +// Colorf as declared in nk/nuklear.h:485 type Colorf C.struct_nk_colorf -// Command as declared in nk/nuklear.h:4458 +// Command as declared in nk/nuklear.h:4690 type Command C.struct_nk_command -// CommandArc as declared in nk/nuklear.h:4548 +// CommandArc as declared in nk/nuklear.h:4780 type CommandArc C.struct_nk_command_arc -// CommandArcFilled as declared in nk/nuklear.h:4557 +// CommandArcFilled as declared in nk/nuklear.h:4789 type CommandArcFilled C.struct_nk_command_arc_filled -// CommandBuffer as declared in nk/nuklear.h:451 +// CommandBuffer as declared in nk/nuklear.h:459 type CommandBuffer C.struct_nk_command_buffer -// CommandCircle as declared in nk/nuklear.h:4533 +// CommandCircle as declared in nk/nuklear.h:4765 type CommandCircle C.struct_nk_command_circle -// CommandCircleFilled as declared in nk/nuklear.h:4541 +// CommandCircleFilled as declared in nk/nuklear.h:4773 type CommandCircleFilled C.struct_nk_command_circle_filled -// CommandCurve as declared in nk/nuklear.h:4480 +// CommandCurve as declared in nk/nuklear.h:4712 type CommandCurve C.struct_nk_command_curve -// CommandCustom as declared in nk/nuklear.h:4598 +// CommandCustom as declared in nk/nuklear.h:4830 type CommandCustom C.struct_nk_command_custom -// CommandImage as declared in nk/nuklear.h:4588 +// CommandImage as declared in nk/nuklear.h:4820 type CommandImage C.struct_nk_command_image -// CommandLine as declared in nk/nuklear.h:4472 +// CommandLine as declared in nk/nuklear.h:4704 type CommandLine C.struct_nk_command_line -// CommandPolygon as declared in nk/nuklear.h:4565 +// CommandPolygon as declared in nk/nuklear.h:4797 type CommandPolygon C.struct_nk_command_polygon -// CommandPolygonFilled as declared in nk/nuklear.h:4573 +// CommandPolygonFilled as declared in nk/nuklear.h:4805 type CommandPolygonFilled C.struct_nk_command_polygon_filled -// CommandPolyline as declared in nk/nuklear.h:4580 +// CommandPolyline as declared in nk/nuklear.h:4812 type CommandPolyline C.struct_nk_command_polyline -// CommandRect as declared in nk/nuklear.h:4489 +// CommandRect as declared in nk/nuklear.h:4721 type CommandRect C.struct_nk_command_rect -// CommandRectFilled as declared in nk/nuklear.h:4498 +// CommandRectFilled as declared in nk/nuklear.h:4730 type CommandRectFilled C.struct_nk_command_rect_filled -// CommandRectMultiColor as declared in nk/nuklear.h:4506 +// CommandRectMultiColor as declared in nk/nuklear.h:4738 type CommandRectMultiColor C.struct_nk_command_rect_multi_color -// CommandScissor as declared in nk/nuklear.h:4466 +// CommandScissor as declared in nk/nuklear.h:4698 type CommandScissor C.struct_nk_command_scissor -// CommandText as declared in nk/nuklear.h:4606 +// CommandText as declared in nk/nuklear.h:4838 type CommandText C.struct_nk_command_text -// CommandTriangle as declared in nk/nuklear.h:4516 +// CommandTriangle as declared in nk/nuklear.h:4748 type CommandTriangle C.struct_nk_command_triangle -// CommandTriangleFilled as declared in nk/nuklear.h:4525 +// CommandTriangleFilled as declared in nk/nuklear.h:4757 type CommandTriangleFilled C.struct_nk_command_triangle_filled -// ConfigStackButtonBehavior as declared in nk/nuklear.h:5585 +// ConfigStackButtonBehavior as declared in nk/nuklear.h:5872 type ConfigStackButtonBehavior C.struct_nk_config_stack_button_behavior -// ConfigStackButtonBehaviorElement as declared in nk/nuklear.h:5577 +// ConfigStackButtonBehaviorElement as declared in nk/nuklear.h:5864 type ConfigStackButtonBehaviorElement C.struct_nk_config_stack_button_behavior_element -// ConfigStackColor as declared in nk/nuklear.h:5583 +// ConfigStackColor as declared in nk/nuklear.h:5870 type ConfigStackColor C.struct_nk_config_stack_color -// ConfigStackColorElement as declared in nk/nuklear.h:5575 +// ConfigStackColorElement as declared in nk/nuklear.h:5862 type ConfigStackColorElement C.struct_nk_config_stack_color_element -// ConfigStackFlags as declared in nk/nuklear.h:5582 +// ConfigStackFlags as declared in nk/nuklear.h:5869 type ConfigStackFlags C.struct_nk_config_stack_flags -// ConfigStackFlagsElement as declared in nk/nuklear.h:5574 +// ConfigStackFlagsElement as declared in nk/nuklear.h:5861 type ConfigStackFlagsElement C.struct_nk_config_stack_flags_element -// ConfigStackFloat as declared in nk/nuklear.h:5580 +// ConfigStackFloat as declared in nk/nuklear.h:5867 type ConfigStackFloat C.struct_nk_config_stack_float -// ConfigStackFloatElement as declared in nk/nuklear.h:5572 +// ConfigStackFloatElement as declared in nk/nuklear.h:5859 type ConfigStackFloatElement C.struct_nk_config_stack_float_element -// ConfigStackStyleItem as declared in nk/nuklear.h:5579 +// ConfigStackStyleItem as declared in nk/nuklear.h:5866 type ConfigStackStyleItem C.struct_nk_config_stack_style_item -// ConfigStackStyleItemElement as declared in nk/nuklear.h:5571 +// ConfigStackStyleItemElement as declared in nk/nuklear.h:5858 type ConfigStackStyleItemElement C.struct_nk_config_stack_style_item_element -// ConfigStackUserFont as declared in nk/nuklear.h:5584 +// ConfigStackUserFont as declared in nk/nuklear.h:5871 type ConfigStackUserFont struct { Head int32 Elements [8]ConfigStackUserFontElement @@ -212,7 +212,7 @@ type ConfigStackUserFont struct { allocsa664861d interface{} } -// ConfigStackUserFontElement as declared in nk/nuklear.h:5576 +// ConfigStackUserFontElement as declared in nk/nuklear.h:5863 type ConfigStackUserFontElement struct { Address [][]UserFont OldValue []UserFont @@ -220,19 +220,19 @@ type ConfigStackUserFontElement struct { allocs5572630c interface{} } -// ConfigStackVec2 as declared in nk/nuklear.h:5581 +// ConfigStackVec2 as declared in nk/nuklear.h:5868 type ConfigStackVec2 C.struct_nk_config_stack_vec2 -// ConfigStackVec2Element as declared in nk/nuklear.h:5573 +// ConfigStackVec2Element as declared in nk/nuklear.h:5860 type ConfigStackVec2Element C.struct_nk_config_stack_vec2_element -// ConfigurationStacks as declared in nk/nuklear.h:5587 +// ConfigurationStacks as declared in nk/nuklear.h:5874 type ConfigurationStacks C.struct_nk_configuration_stacks -// Context as declared in nk/nuklear.h:459 +// Context as declared in nk/nuklear.h:467 type Context C.struct_nk_context -// ConvertConfig as declared in nk/nuklear.h:453 +// ConvertConfig as declared in nk/nuklear.h:461 type ConvertConfig struct { GlobalAlpha float32 CircleSegmentCount uint32 @@ -246,183 +246,186 @@ type ConvertConfig struct { allocs82bf4c25 interface{} } -// Cursor as declared in nk/nuklear.h:486 +// Cursor as declared in nk/nuklear.h:494 type Cursor C.struct_nk_cursor -// DrawCommand as declared in nk/nuklear.h:452 +// DrawCommand as declared in nk/nuklear.h:460 type DrawCommand C.struct_nk_draw_command -// DrawList as declared in nk/nuklear.h:456 +// DrawList as declared in nk/nuklear.h:464 type DrawList C.struct_nk_draw_list -// DrawNullTexture as declared in nk/nuklear.h:1170 +// DrawNullTexture as declared in nk/nuklear.h:1197 type DrawNullTexture C.struct_nk_draw_null_texture -// DrawVertexLayoutElement as declared in nk/nuklear.h:460 +// DrawVertexLayoutElement as declared in nk/nuklear.h:468 type DrawVertexLayoutElement struct { Offset Size refeb0614d6 *C.struct_nk_draw_vertex_layout_element allocseb0614d6 interface{} } -// EditState as declared in nk/nuklear.h:5452 +// EditState as declared in nk/nuklear.h:5735 type EditState C.struct_nk_edit_state -// Font as declared in nk/nuklear.h:3991 +// Font as declared in nk/nuklear.h:4245 type Font C.struct_nk_font -// FontAtlas as declared in nk/nuklear.h:4065 +// FontAtlas as declared in nk/nuklear.h:4300 type FontAtlas C.struct_nk_font_atlas -// FontConfig as declared in nk/nuklear.h:4005 +// FontConfig as declared in nk/nuklear.h:4255 type FontConfig C.struct_nk_font_config -// FontGlyph as declared in nk/nuklear.h:4041 +// FontGlyph as declared in nk/nuklear.h:4276 type FontGlyph C.struct_nk_font_glyph -// Image as declared in nk/nuklear.h:484 +// Image as declared in nk/nuklear.h:492 type Image C.struct_nk_image -// Input as declared in nk/nuklear.h:4690 +// Input as declared in nk/nuklear.h:4922 type Input C.struct_nk_input -// Key as declared in nk/nuklear.h:4680 +// Key as declared in nk/nuklear.h:4912 type Key C.struct_nk_key -// Keyboard as declared in nk/nuklear.h:4684 +// Keyboard as declared in nk/nuklear.h:4916 type Keyboard C.struct_nk_keyboard -// ListView as declared in nk/nuklear.h:3060 +// ListView as declared in nk/nuklear.h:3288 type ListView C.struct_nk_list_view -// Memory as declared in nk/nuklear.h:4174 +// Memory as declared in nk/nuklear.h:4411 type Memory C.struct_nk_memory -// MemoryStatus as declared in nk/nuklear.h:4149 +// MemoryStatus as declared in nk/nuklear.h:4386 type MemoryStatus C.struct_nk_memory_status -// MenuState as declared in nk/nuklear.h:5390 +// MenuState as declared in nk/nuklear.h:5680 type MenuState C.struct_nk_menu_state -// Mouse as declared in nk/nuklear.h:4666 +// Mouse as declared in nk/nuklear.h:4898 type Mouse C.struct_nk_mouse -// MouseButton as declared in nk/nuklear.h:4661 +// MouseButton as declared in nk/nuklear.h:4893 type MouseButton C.struct_nk_mouse_button -// NineSlice as declared in nk/nuklear.h:485 +// NineSlice as declared in nk/nuklear.h:493 type NineSlice C.struct_nk_nine_slice -// Page as declared in nk/nuklear.h:5623 +// Page as declared in nk/nuklear.h:5910 type Page C.struct_nk_page -// PageData as declared in nk/nuklear.h:5611 +// PageData as declared in nk/nuklear.h:5898 const sizeofPageData = unsafe.Sizeof(C.union_nk_page_data{}) type PageData [sizeofPageData]byte -// PageElement as declared in nk/nuklear.h:5617 +// PageElement as declared in nk/nuklear.h:5904 type PageElement C.struct_nk_page_element -// Panel as declared in nk/nuklear.h:458 +// Panel as declared in nk/nuklear.h:466 type Panel C.struct_nk_panel -// Pool as declared in nk/nuklear.h:5629 +// Pool as declared in nk/nuklear.h:5916 type Pool C.struct_nk_pool -// PopupBuffer as declared in nk/nuklear.h:5382 +// PopupBuffer as declared in nk/nuklear.h:5672 type PopupBuffer C.struct_nk_popup_buffer -// PopupState as declared in nk/nuklear.h:5440 +// PopupState as declared in nk/nuklear.h:5723 type PopupState C.struct_nk_popup_state -// PropertyState as declared in nk/nuklear.h:5465 +// PropertyState as declared in nk/nuklear.h:5748 type PropertyState C.struct_nk_property_state -// Rect as declared in nk/nuklear.h:480 +// Rect as declared in nk/nuklear.h:488 type Rect C.struct_nk_rect -// Recti as declared in nk/nuklear.h:481 +// Recti as declared in nk/nuklear.h:489 type Recti C.struct_nk_recti -// RowLayout as declared in nk/nuklear.h:5366 +// RowLayout as declared in nk/nuklear.h:5656 type RowLayout C.struct_nk_row_layout -// Scroll as declared in nk/nuklear.h:487 +// Scroll as declared in nk/nuklear.h:495 type Scroll C.struct_nk_scroll -// Str as declared in nk/nuklear.h:4221 +// Str as declared in nk/nuklear.h:4449 type Str C.struct_nk_str -// Style as declared in nk/nuklear.h:5281 +// Style as declared in nk/nuklear.h:5569 type Style C.struct_nk_style -// StyleButton as declared in nk/nuklear.h:461 +// StyleButton as declared in nk/nuklear.h:469 type StyleButton C.struct_nk_style_button -// StyleChart as declared in nk/nuklear.h:469 +// StyleChart as declared in nk/nuklear.h:477 type StyleChart C.struct_nk_style_chart -// StyleCombo as declared in nk/nuklear.h:470 +// StyleCombo as declared in nk/nuklear.h:478 type StyleCombo C.struct_nk_style_combo -// StyleEdit as declared in nk/nuklear.h:467 +// StyleEdit as declared in nk/nuklear.h:475 type StyleEdit C.struct_nk_style_edit -// StyleItem as declared in nk/nuklear.h:454 +// StyleItem as declared in nk/nuklear.h:462 type StyleItem C.struct_nk_style_item -// StyleItemData as declared in nk/nuklear.h:4878 +// StyleItemData as declared in nk/nuklear.h:5107 const sizeofStyleItemData = unsafe.Sizeof(C.union_nk_style_item_data{}) type StyleItemData [sizeofStyleItemData]byte -// StyleProgress as declared in nk/nuklear.h:465 +// StyleKnob as declared in nk/nuklear.h:5265 +type StyleKnob C.struct_nk_style_knob + +// StyleProgress as declared in nk/nuklear.h:473 type StyleProgress C.struct_nk_style_progress -// StyleProperty as declared in nk/nuklear.h:468 +// StyleProperty as declared in nk/nuklear.h:476 type StyleProperty C.struct_nk_style_property -// StyleScrollbar as declared in nk/nuklear.h:466 +// StyleScrollbar as declared in nk/nuklear.h:474 type StyleScrollbar C.struct_nk_style_scrollbar -// StyleSelectable as declared in nk/nuklear.h:463 +// StyleSelectable as declared in nk/nuklear.h:471 type StyleSelectable C.struct_nk_style_selectable -// StyleSlide as declared in nk/nuklear.h:464 +// StyleSlide as declared in nk/nuklear.h:472 type StyleSlide C.struct_nk_style_slide -// StyleSlider as declared in nk/nuklear.h:4986 +// StyleSlider as declared in nk/nuklear.h:5224 type StyleSlider C.struct_nk_style_slider -// StyleTab as declared in nk/nuklear.h:471 +// StyleTab as declared in nk/nuklear.h:479 type StyleTab C.struct_nk_style_tab -// StyleText as declared in nk/nuklear.h:4889 +// StyleText as declared in nk/nuklear.h:5118 type StyleText C.struct_nk_style_text -// StyleToggle as declared in nk/nuklear.h:462 +// StyleToggle as declared in nk/nuklear.h:470 type StyleToggle C.struct_nk_style_toggle -// StyleWindow as declared in nk/nuklear.h:473 +// StyleWindow as declared in nk/nuklear.h:481 type StyleWindow C.struct_nk_style_window -// StyleWindowHeader as declared in nk/nuklear.h:472 +// StyleWindowHeader as declared in nk/nuklear.h:480 type StyleWindowHeader C.struct_nk_style_window_header -// Table as declared in nk/nuklear.h:5421 +// Table as declared in nk/nuklear.h:5711 type Table C.struct_nk_table -// TextEdit as declared in nk/nuklear.h:455 +// TextEdit as declared in nk/nuklear.h:463 type TextEdit C.struct_nk_text_edit -// TextUndoRecord as declared in nk/nuklear.h:4311 +// TextUndoRecord as declared in nk/nuklear.h:4541 type TextUndoRecord C.struct_nk_text_undo_record -// TextUndoState as declared in nk/nuklear.h:4318 +// TextUndoState as declared in nk/nuklear.h:4548 type TextUndoState C.struct_nk_text_undo_state -// UserFont as declared in nk/nuklear.h:457 +// UserFont as declared in nk/nuklear.h:465 type UserFont struct { Userdata Handle Height float32 @@ -433,7 +436,7 @@ type UserFont struct { allocs738ce62e interface{} } -// UserFontGlyph as declared in nk/nuklear.h:3951 +// UserFontGlyph as declared in nk/nuklear.h:4214 type UserFontGlyph struct { Uv [2]Vec2 Offset Vec2 @@ -444,11 +447,11 @@ type UserFontGlyph struct { allocs4a84b297 interface{} } -// Vec2 as declared in nk/nuklear.h:478 +// Vec2 as declared in nk/nuklear.h:486 type Vec2 C.struct_nk_vec2 -// Vec2i as declared in nk/nuklear.h:479 +// Vec2i as declared in nk/nuklear.h:487 type Vec2i C.struct_nk_vec2i -// Window as declared in nk/nuklear.h:5478 +// Window as declared in nk/nuklear.h:5761 type Window C.struct_nk_window