// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.

// WARNING: This file has automatically been generated on Wed, 18 Dec 2019 20:58:41 CST.
// Code generated by https://git.io/c-for-go. DO NOT EDIT.

package nk

/*
#include "nk.h"
#include <stdlib.h>
#include "cgo_helpers.h"
*/
import "C"
import (
	"runtime"
	"sync"
	"unsafe"
)

// cgoAllocMap stores pointers to C allocated memory for future reference.
type cgoAllocMap struct {
	mux sync.RWMutex
	m   map[unsafe.Pointer]struct{}
}

var cgoAllocsUnknown = new(cgoAllocMap)

func (a *cgoAllocMap) Add(ptr unsafe.Pointer) {
	a.mux.Lock()
	if a.m == nil {
		a.m = make(map[unsafe.Pointer]struct{})
	}
	a.m[ptr] = struct{}{}
	a.mux.Unlock()
}

func (a *cgoAllocMap) IsEmpty() bool {
	a.mux.RLock()
	isEmpty := len(a.m) == 0
	a.mux.RUnlock()
	return isEmpty
}

func (a *cgoAllocMap) Borrow(b *cgoAllocMap) {
	if b == nil || b.IsEmpty() {
		return
	}
	b.mux.Lock()
	a.mux.Lock()
	for ptr := range b.m {
		if a.m == nil {
			a.m = make(map[unsafe.Pointer]struct{})
		}
		a.m[ptr] = struct{}{}
		delete(b.m, ptr)
	}
	a.mux.Unlock()
	b.mux.Unlock()
}

func (a *cgoAllocMap) Free() {
	a.mux.Lock()
	for ptr := range a.m {
		C.free(ptr)
		delete(a.m, ptr)
	}
	a.mux.Unlock()
}

func (x PluginAlloc) PassRef() (ref *C.nk_plugin_alloc, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginAlloc88237AC9Func == nil {
		pluginAlloc88237AC9Func = x
	}
	return (*C.nk_plugin_alloc)(C.nk_plugin_alloc_88237ac9), nil
}

func (x PluginAlloc) PassValue() (ref C.nk_plugin_alloc, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginAlloc88237AC9Func == nil {
		pluginAlloc88237AC9Func = x
	}
	return (C.nk_plugin_alloc)(C.nk_plugin_alloc_88237ac9), nil
}

func NewPluginAllocRef(ref unsafe.Pointer) *PluginAlloc {
	return (*PluginAlloc)(ref)
}

//export pluginAlloc88237AC9
func pluginAlloc88237AC9(carg0 C.nk_handle, cold unsafe.Pointer, carg2 C.nk_size) unsafe.Pointer {
	if pluginAlloc88237AC9Func != nil {
		arg088237ac9 := *(*Handle)(unsafe.Pointer(&carg0))
		old88237ac9 := (unsafe.Pointer)(unsafe.Pointer(cold))
		arg288237ac9 := (Size)(carg2)
		ret88237ac9 := pluginAlloc88237AC9Func(arg088237ac9, old88237ac9, arg288237ac9)
		ret, _ := ret88237ac9, cgoAllocsUnknown
		return ret
	}
	panic("callback func has not been set (race?)")
}

var pluginAlloc88237AC9Func PluginAlloc

func (x PluginFree) PassRef() (ref *C.nk_plugin_free, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginFree9E32BB09Func == nil {
		pluginFree9E32BB09Func = x
	}
	return (*C.nk_plugin_free)(C.nk_plugin_free_9e32bb09), nil
}

func (x PluginFree) PassValue() (ref C.nk_plugin_free, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginFree9E32BB09Func == nil {
		pluginFree9E32BB09Func = x
	}
	return (C.nk_plugin_free)(C.nk_plugin_free_9e32bb09), nil
}

func NewPluginFreeRef(ref unsafe.Pointer) *PluginFree {
	return (*PluginFree)(ref)
}

//export pluginFree9E32BB09
func pluginFree9E32BB09(carg0 C.nk_handle, cold unsafe.Pointer) {
	if pluginFree9E32BB09Func != nil {
		arg09e32bb09 := *(*Handle)(unsafe.Pointer(&carg0))
		old9e32bb09 := (unsafe.Pointer)(unsafe.Pointer(cold))
		pluginFree9E32BB09Func(arg09e32bb09, old9e32bb09)
		return
	}
	panic("callback func has not been set (race?)")
}

var pluginFree9E32BB09Func PluginFree

func (x PluginFilter) PassRef() (ref *C.nk_plugin_filter, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginFilter1DF5F22CFunc == nil {
		pluginFilter1DF5F22CFunc = x
	}
	return (*C.nk_plugin_filter)(C.nk_plugin_filter_1df5f22c), nil
}

func (x PluginFilter) PassValue() (ref C.nk_plugin_filter, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginFilter1DF5F22CFunc == nil {
		pluginFilter1DF5F22CFunc = x
	}
	return (C.nk_plugin_filter)(C.nk_plugin_filter_1df5f22c), nil
}

func NewPluginFilterRef(ref unsafe.Pointer) *PluginFilter {
	return (*PluginFilter)(ref)
}

//export pluginFilter1DF5F22C
func pluginFilter1DF5F22C(carg0 *C.struct_nk_text_edit, cunicode C.nk_rune) C.int {
	if pluginFilter1DF5F22CFunc != nil {
		arg01df5f22c := NewTextEditRef(unsafe.Pointer(carg0))
		unicode1df5f22c := (Rune)(cunicode)
		ret1df5f22c := pluginFilter1DF5F22CFunc(arg01df5f22c, unicode1df5f22c)
		ret, _ := (C.int)(ret1df5f22c), cgoAllocsUnknown
		return ret
	}
	panic("callback func has not been set (race?)")
}

var pluginFilter1DF5F22CFunc PluginFilter

func (x PluginPaste) PassRef() (ref *C.nk_plugin_paste, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginPaste70E696C4Func == nil {
		pluginPaste70E696C4Func = x
	}
	return (*C.nk_plugin_paste)(C.nk_plugin_paste_70e696c4), nil
}

func (x PluginPaste) PassValue() (ref C.nk_plugin_paste, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginPaste70E696C4Func == nil {
		pluginPaste70E696C4Func = x
	}
	return (C.nk_plugin_paste)(C.nk_plugin_paste_70e696c4), nil
}

func NewPluginPasteRef(ref unsafe.Pointer) *PluginPaste {
	return (*PluginPaste)(ref)
}

//export pluginPaste70E696C4
func pluginPaste70E696C4(carg0 C.nk_handle, carg1 *C.struct_nk_text_edit) {
	if pluginPaste70E696C4Func != nil {
		arg070e696c4 := *(*Handle)(unsafe.Pointer(&carg0))
		arg170e696c4 := NewTextEditRef(unsafe.Pointer(carg1))
		pluginPaste70E696C4Func(arg070e696c4, arg170e696c4)
		return
	}
	panic("callback func has not been set (race?)")
}

var pluginPaste70E696C4Func PluginPaste

// packPCharString creates a Go string backed by *C.char and avoids copying.
func packPCharString(p *C.char) (raw string) {
	if p != nil && *p != 0 {
		h := (*stringHeader)(unsafe.Pointer(&raw))
		h.Data = unsafe.Pointer(p)
		for *p != 0 {
			p = (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) // p++
		}
		h.Len = int(uintptr(unsafe.Pointer(p)) - uintptr(h.Data))
	}
	return
}

type stringHeader struct {
	Data unsafe.Pointer
	Len  int
}

// RawString reperesents a string backed by data on the C side.
type RawString string

// Copy returns a Go-managed copy of raw string.
func (raw RawString) Copy() string {
	if len(raw) == 0 {
		return ""
	}
	h := (*stringHeader)(unsafe.Pointer(&raw))
	return C.GoStringN((*C.char)(h.Data), C.int(h.Len))
}

func (x PluginCopy) PassRef() (ref *C.nk_plugin_copy, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginCopy9EA6C143Func == nil {
		pluginCopy9EA6C143Func = x
	}
	return (*C.nk_plugin_copy)(C.nk_plugin_copy_9ea6c143), nil
}

func (x PluginCopy) PassValue() (ref C.nk_plugin_copy, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if pluginCopy9EA6C143Func == nil {
		pluginCopy9EA6C143Func = x
	}
	return (C.nk_plugin_copy)(C.nk_plugin_copy_9ea6c143), nil
}

func NewPluginCopyRef(ref unsafe.Pointer) *PluginCopy {
	return (*PluginCopy)(ref)
}

//export pluginCopy9EA6C143
func pluginCopy9EA6C143(carg0 C.nk_handle, carg1 *C.char, clen C.int) {
	if pluginCopy9EA6C143Func != nil {
		arg09ea6c143 := *(*Handle)(unsafe.Pointer(&carg0))
		arg19ea6c143 := packPCharString(carg1)
		len9ea6c143 := (int32)(clen)
		pluginCopy9EA6C143Func(arg09ea6c143, arg19ea6c143, len9ea6c143)
		return
	}
	panic("callback func has not been set (race?)")
}

var pluginCopy9EA6C143Func PluginCopy

func (x TextWidthF) PassRef() (ref *C.nk_text_width_f, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if textWidthF67477C0Func == nil {
		textWidthF67477C0Func = x
	}
	return (*C.nk_text_width_f)(C.nk_text_width_f_67477c0), nil
}

func (x TextWidthF) PassValue() (ref C.nk_text_width_f, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if textWidthF67477C0Func == nil {
		textWidthF67477C0Func = x
	}
	return (C.nk_text_width_f)(C.nk_text_width_f_67477c0), nil
}

func NewTextWidthFRef(ref unsafe.Pointer) *TextWidthF {
	return (*TextWidthF)(ref)
}

//export textWidthF67477C0
func textWidthF67477C0(carg0 C.nk_handle, ch C.float, carg2 *C.char, clen C.int) C.float {
	if textWidthF67477C0Func != nil {
		arg067477c0 := *(*Handle)(unsafe.Pointer(&carg0))
		h67477c0 := (float32)(ch)
		arg267477c0 := packPCharString(carg2)
		len67477c0 := (int32)(clen)
		ret67477c0 := textWidthF67477C0Func(arg067477c0, h67477c0, arg267477c0, len67477c0)
		ret, _ := (C.float)(ret67477c0), cgoAllocsUnknown
		return ret
	}
	panic("callback func has not been set (race?)")
}

var textWidthF67477C0Func TextWidthF

func (x QueryFontGlyphF) PassRef() (ref *C.nk_query_font_glyph_f, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if queryFontGlyphF5BA87240Func == nil {
		queryFontGlyphF5BA87240Func = x
	}
	return (*C.nk_query_font_glyph_f)(C.nk_query_font_glyph_f_5ba87240), nil
}

func (x QueryFontGlyphF) PassValue() (ref C.nk_query_font_glyph_f, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if queryFontGlyphF5BA87240Func == nil {
		queryFontGlyphF5BA87240Func = x
	}
	return (C.nk_query_font_glyph_f)(C.nk_query_font_glyph_f_5ba87240), nil
}

func NewQueryFontGlyphFRef(ref unsafe.Pointer) *QueryFontGlyphF {
	return (*QueryFontGlyphF)(ref)
}

//export queryFontGlyphF5BA87240
func queryFontGlyphF5BA87240(chandle C.nk_handle, cfontHeight C.float, cglyph *C.struct_nk_user_font_glyph, ccodepoint C.nk_rune, cnextCodepoint C.nk_rune) {
	if queryFontGlyphF5BA87240Func != nil {
		handle5ba87240 := *(*Handle)(unsafe.Pointer(&chandle))
		fontHeight5ba87240 := (float32)(cfontHeight)
		glyph5ba87240 := NewUserFontGlyphRef(unsafe.Pointer(cglyph))
		codepoint5ba87240 := (Rune)(ccodepoint)
		nextCodepoint5ba87240 := (Rune)(cnextCodepoint)
		queryFontGlyphF5BA87240Func(handle5ba87240, fontHeight5ba87240, glyph5ba87240, codepoint5ba87240, nextCodepoint5ba87240)
		return
	}
	panic("callback func has not been set (race?)")
}

var queryFontGlyphF5BA87240Func QueryFontGlyphF

func (x CommandCustomCallback) PassRef() (ref *C.nk_command_custom_callback, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if commandCustomCallbackD451FDB1Func == nil {
		commandCustomCallbackD451FDB1Func = x
	}
	return (*C.nk_command_custom_callback)(C.nk_command_custom_callback_d451fdb1), nil
}

func (x CommandCustomCallback) PassValue() (ref C.nk_command_custom_callback, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	if commandCustomCallbackD451FDB1Func == nil {
		commandCustomCallbackD451FDB1Func = x
	}
	return (C.nk_command_custom_callback)(C.nk_command_custom_callback_d451fdb1), nil
}

func NewCommandCustomCallbackRef(ref unsafe.Pointer) *CommandCustomCallback {
	return (*CommandCustomCallback)(ref)
}

//export commandCustomCallbackD451FDB1
func commandCustomCallbackD451FDB1(ccanvas unsafe.Pointer, cx C.short, cy C.short, cw C.ushort, ch C.ushort, ccallbackData C.nk_handle) {
	if commandCustomCallbackD451FDB1Func != nil {
		canvasd451fdb1 := (unsafe.Pointer)(unsafe.Pointer(ccanvas))
		xd451fdb1 := (int16)(cx)
		yd451fdb1 := (int16)(cy)
		wd451fdb1 := (uint16)(cw)
		hd451fdb1 := (uint16)(ch)
		callbackDatad451fdb1 := *(*Handle)(unsafe.Pointer(&ccallbackData))
		commandCustomCallbackD451FDB1Func(canvasd451fdb1, xd451fdb1, yd451fdb1, wd451fdb1, hd451fdb1, callbackDatad451fdb1)
		return
	}
	panic("callback func has not been set (race?)")
}

var commandCustomCallbackD451FDB1Func CommandCustomCallback

// Ref returns a reference to C object as it is.
func (x *Allocator) Ref() *C.struct_nk_allocator {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_allocator)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Allocator) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewAllocatorRef converts the C object reference into a raw struct reference without wrapping.
func NewAllocatorRef(ref unsafe.Pointer) *Allocator {
	return (*Allocator)(ref)
}

// NewAllocator allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewAllocator() *Allocator {
	return (*Allocator)(allocStructNkAllocatorMemory(1))
}

// allocStructNkAllocatorMemory allocates memory for type C.struct_nk_allocator in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkAllocatorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkAllocatorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkAllocatorValue = unsafe.Sizeof([1]C.struct_nk_allocator{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Allocator) PassRef() *C.struct_nk_allocator {
	if x == nil {
		x = (*Allocator)(allocStructNkAllocatorMemory(1))
	}
	return (*C.struct_nk_allocator)(unsafe.Pointer(x))
}

// GetUserdata returns a reference to C object within a struct
func (s *Allocator) GetUserdata() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.userdata))
	return ret
}

// GetAlloc returns a reference to C object within a struct
func (s *Allocator) GetAlloc() *PluginAlloc {
	var ret *PluginAlloc
	ret = NewPluginAllocRef(unsafe.Pointer(&s.alloc))
	return ret
}

// GetFree returns a reference to C object within a struct
func (s *Allocator) GetFree() *PluginFree {
	var ret *PluginFree
	ret = NewPluginFreeRef(unsafe.Pointer(&s.free))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *BakedFont) Ref() *C.struct_nk_baked_font {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_baked_font)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *BakedFont) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewBakedFontRef converts the C object reference into a raw struct reference without wrapping.
func NewBakedFontRef(ref unsafe.Pointer) *BakedFont {
	return (*BakedFont)(ref)
}

// NewBakedFont allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewBakedFont() *BakedFont {
	return (*BakedFont)(allocStructNkBakedFontMemory(1))
}

// allocStructNkBakedFontMemory allocates memory for type C.struct_nk_baked_font in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkBakedFontMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkBakedFontValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkBakedFontValue = unsafe.Sizeof([1]C.struct_nk_baked_font{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *BakedFont) PassRef() *C.struct_nk_baked_font {
	if x == nil {
		x = (*BakedFont)(allocStructNkBakedFontMemory(1))
	}
	return (*C.struct_nk_baked_font)(unsafe.Pointer(x))
}

// GetHeight returns a reference to C object within a struct
func (s *BakedFont) GetHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.height))
	return ret
}

// GetAscent returns a reference to C object within a struct
func (s *BakedFont) GetAscent() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.ascent))
	return ret
}

// GetDescent returns a reference to C object within a struct
func (s *BakedFont) GetDescent() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.descent))
	return ret
}

// GetGlyphOffset returns a reference to C object within a struct
func (s *BakedFont) GetGlyphOffset() *Rune {
	var ret *Rune
	ret = (*Rune)(unsafe.Pointer(&s.glyph_offset))
	return ret
}

// GetGlyphCount returns a reference to C object within a struct
func (s *BakedFont) GetGlyphCount() *Rune {
	var ret *Rune
	ret = (*Rune)(unsafe.Pointer(&s.glyph_count))
	return ret
}

// GetRanges returns a reference to C object within a struct
func (s *BakedFont) GetRanges() **Rune {
	var ret **Rune
	ret = (**Rune)(unsafe.Pointer(&s.ranges))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Buffer) Ref() *C.struct_nk_buffer {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_buffer)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Buffer) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewBufferRef converts the C object reference into a raw struct reference without wrapping.
func NewBufferRef(ref unsafe.Pointer) *Buffer {
	return (*Buffer)(ref)
}

// NewBuffer allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewBuffer() *Buffer {
	return (*Buffer)(allocStructNkBufferMemory(1))
}

// allocStructNkBufferMemory allocates memory for type C.struct_nk_buffer in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkBufferMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkBufferValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkBufferValue = unsafe.Sizeof([1]C.struct_nk_buffer{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Buffer) PassRef() *C.struct_nk_buffer {
	if x == nil {
		x = (*Buffer)(allocStructNkBufferMemory(1))
	}
	return (*C.struct_nk_buffer)(unsafe.Pointer(x))
}

// GetMarker returns a reference to C object within a struct
func (s *Buffer) GetMarker() [2]BufferMarker {
	var ret [2]BufferMarker
	ret = *(*[2]BufferMarker)(unsafe.Pointer(&s.marker))
	return ret
}

// GetPool returns a reference to C object within a struct
func (s *Buffer) GetPool() *Allocator {
	var ret *Allocator
	ret = (*Allocator)(unsafe.Pointer(&s.pool))
	return ret
}

// GetType returns a reference to C object within a struct
func (s *Buffer) GetType() *AllocationType {
	var ret *AllocationType
	ret = (*AllocationType)(unsafe.Pointer(&s._type))
	return ret
}

// GetMemory returns a reference to C object within a struct
func (s *Buffer) GetMemory() *Memory {
	var ret *Memory
	ret = (*Memory)(unsafe.Pointer(&s.memory))
	return ret
}

// GetGrowFactor returns a reference to C object within a struct
func (s *Buffer) GetGrowFactor() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.grow_factor))
	return ret
}

// GetAllocated returns a reference to C object within a struct
func (s *Buffer) GetAllocated() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.allocated))
	return ret
}

// GetNeeded returns a reference to C object within a struct
func (s *Buffer) GetNeeded() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.needed))
	return ret
}

// GetCalls returns a reference to C object within a struct
func (s *Buffer) GetCalls() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.calls))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *Buffer) GetSize() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.size))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *BufferMarker) Ref() *C.struct_nk_buffer_marker {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_buffer_marker)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *BufferMarker) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewBufferMarkerRef converts the C object reference into a raw struct reference without wrapping.
func NewBufferMarkerRef(ref unsafe.Pointer) *BufferMarker {
	return (*BufferMarker)(ref)
}

// NewBufferMarker allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewBufferMarker() *BufferMarker {
	return (*BufferMarker)(allocStructNkBufferMarkerMemory(1))
}

// allocStructNkBufferMarkerMemory allocates memory for type C.struct_nk_buffer_marker in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkBufferMarkerMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkBufferMarkerValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkBufferMarkerValue = unsafe.Sizeof([1]C.struct_nk_buffer_marker{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *BufferMarker) PassRef() *C.struct_nk_buffer_marker {
	if x == nil {
		x = (*BufferMarker)(allocStructNkBufferMarkerMemory(1))
	}
	return (*C.struct_nk_buffer_marker)(unsafe.Pointer(x))
}

// GetActive returns a reference to C object within a struct
func (s *BufferMarker) GetActive() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.active))
	return ret
}

// GetOffset returns a reference to C object within a struct
func (s *BufferMarker) GetOffset() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.offset))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Chart) Ref() *C.struct_nk_chart {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_chart)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Chart) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewChartRef converts the C object reference into a raw struct reference without wrapping.
func NewChartRef(ref unsafe.Pointer) *Chart {
	return (*Chart)(ref)
}

// NewChart allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewChart() *Chart {
	return (*Chart)(allocStructNkChartMemory(1))
}

// allocStructNkChartMemory allocates memory for type C.struct_nk_chart in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkChartMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkChartValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkChartValue = unsafe.Sizeof([1]C.struct_nk_chart{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Chart) PassRef() *C.struct_nk_chart {
	if x == nil {
		x = (*Chart)(allocStructNkChartMemory(1))
	}
	return (*C.struct_nk_chart)(unsafe.Pointer(x))
}

// GetSlot returns a reference to C object within a struct
func (s *Chart) GetSlot() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.slot))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *Chart) GetX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *Chart) GetY() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *Chart) GetW() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *Chart) GetH() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.h))
	return ret
}

// GetSlots returns a reference to C object within a struct
func (s *Chart) GetSlots() [4]ChartSlot {
	var ret [4]ChartSlot
	ret = *(*[4]ChartSlot)(unsafe.Pointer(&s.slots))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ChartSlot) Ref() *C.struct_nk_chart_slot {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_chart_slot)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ChartSlot) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewChartSlotRef converts the C object reference into a raw struct reference without wrapping.
func NewChartSlotRef(ref unsafe.Pointer) *ChartSlot {
	return (*ChartSlot)(ref)
}

// NewChartSlot allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewChartSlot() *ChartSlot {
	return (*ChartSlot)(allocStructNkChartSlotMemory(1))
}

// allocStructNkChartSlotMemory allocates memory for type C.struct_nk_chart_slot in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkChartSlotMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkChartSlotValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkChartSlotValue = unsafe.Sizeof([1]C.struct_nk_chart_slot{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ChartSlot) PassRef() *C.struct_nk_chart_slot {
	if x == nil {
		x = (*ChartSlot)(allocStructNkChartSlotMemory(1))
	}
	return (*C.struct_nk_chart_slot)(unsafe.Pointer(x))
}

// GetType returns a reference to C object within a struct
func (s *ChartSlot) GetType() *ChartType {
	var ret *ChartType
	ret = (*ChartType)(unsafe.Pointer(&s._type))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *ChartSlot) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// GetHighlight returns a reference to C object within a struct
func (s *ChartSlot) GetHighlight() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.highlight))
	return ret
}

// GetMin returns a reference to C object within a struct
func (s *ChartSlot) GetMin() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.min))
	return ret
}

// GetMax returns a reference to C object within a struct
func (s *ChartSlot) GetMax() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.max))
	return ret
}

// GetRange returns a reference to C object within a struct
func (s *ChartSlot) GetRange() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s._range))
	return ret
}

// GetCount returns a reference to C object within a struct
func (s *ChartSlot) GetCount() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.count))
	return ret
}

// GetLast returns a reference to C object within a struct
func (s *ChartSlot) GetLast() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.last))
	return ret
}

// GetIndex returns a reference to C object within a struct
func (s *ChartSlot) GetIndex() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.index))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Clipboard) Ref() *C.struct_nk_clipboard {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_clipboard)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Clipboard) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewClipboardRef converts the C object reference into a raw struct reference without wrapping.
func NewClipboardRef(ref unsafe.Pointer) *Clipboard {
	return (*Clipboard)(ref)
}

// NewClipboard allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewClipboard() *Clipboard {
	return (*Clipboard)(allocStructNkClipboardMemory(1))
}

// allocStructNkClipboardMemory allocates memory for type C.struct_nk_clipboard in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkClipboardMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkClipboardValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkClipboardValue = unsafe.Sizeof([1]C.struct_nk_clipboard{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Clipboard) PassRef() *C.struct_nk_clipboard {
	if x == nil {
		x = (*Clipboard)(allocStructNkClipboardMemory(1))
	}
	return (*C.struct_nk_clipboard)(unsafe.Pointer(x))
}

// GetUserdata returns a reference to C object within a struct
func (s *Clipboard) GetUserdata() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.userdata))
	return ret
}

// GetPaste returns a reference to C object within a struct
func (s *Clipboard) GetPaste() *PluginPaste {
	var ret *PluginPaste
	ret = NewPluginPasteRef(unsafe.Pointer(&s.paste))
	return ret
}

// GetCopy returns a reference to C object within a struct
func (s *Clipboard) GetCopy() *PluginCopy {
	var ret *PluginCopy
	ret = NewPluginCopyRef(unsafe.Pointer(&s.copy))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Color) Ref() *C.struct_nk_color {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_color)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Color) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewColorRef converts the C object reference into a raw struct reference without wrapping.
func NewColorRef(ref unsafe.Pointer) *Color {
	return (*Color)(ref)
}

// NewColor allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewColor() *Color {
	return (*Color)(allocStructNkColorMemory(1))
}

// allocStructNkColorMemory allocates memory for type C.struct_nk_color in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkColorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkColorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkColorValue = unsafe.Sizeof([1]C.struct_nk_color{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Color) PassRef() *C.struct_nk_color {
	if x == nil {
		x = (*Color)(allocStructNkColorMemory(1))
	}
	return (*C.struct_nk_color)(unsafe.Pointer(x))
}

// GetR returns a reference to C object within a struct
func (s *Color) GetR() *Byte {
	var ret *Byte
	ret = (*Byte)(unsafe.Pointer(&s.r))
	return ret
}

// GetG returns a reference to C object within a struct
func (s *Color) GetG() *Byte {
	var ret *Byte
	ret = (*Byte)(unsafe.Pointer(&s.g))
	return ret
}

// GetB returns a reference to C object within a struct
func (s *Color) GetB() *Byte {
	var ret *Byte
	ret = (*Byte)(unsafe.Pointer(&s.b))
	return ret
}

// GetA returns a reference to C object within a struct
func (s *Color) GetA() *Byte {
	var ret *Byte
	ret = (*Byte)(unsafe.Pointer(&s.a))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Colorf) Ref() *C.struct_nk_colorf {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_colorf)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Colorf) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewColorfRef converts the C object reference into a raw struct reference without wrapping.
func NewColorfRef(ref unsafe.Pointer) *Colorf {
	return (*Colorf)(ref)
}

// NewColorf allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewColorf() *Colorf {
	return (*Colorf)(allocStructNkColorfMemory(1))
}

// allocStructNkColorfMemory allocates memory for type C.struct_nk_colorf in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkColorfMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkColorfValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkColorfValue = unsafe.Sizeof([1]C.struct_nk_colorf{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Colorf) PassRef() *C.struct_nk_colorf {
	if x == nil {
		x = (*Colorf)(allocStructNkColorfMemory(1))
	}
	return (*C.struct_nk_colorf)(unsafe.Pointer(x))
}

// GetR returns a reference to C object within a struct
func (s *Colorf) GetR() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.r))
	return ret
}

// GetG returns a reference to C object within a struct
func (s *Colorf) GetG() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.g))
	return ret
}

// GetB returns a reference to C object within a struct
func (s *Colorf) GetB() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.b))
	return ret
}

// GetA returns a reference to C object within a struct
func (s *Colorf) GetA() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.a))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Command) Ref() *C.struct_nk_command {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Command) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandRef(ref unsafe.Pointer) *Command {
	return (*Command)(ref)
}

// NewCommand allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommand() *Command {
	return (*Command)(allocStructNkCommandMemory(1))
}

// allocStructNkCommandMemory allocates memory for type C.struct_nk_command in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandValue = unsafe.Sizeof([1]C.struct_nk_command{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Command) PassRef() *C.struct_nk_command {
	if x == nil {
		x = (*Command)(allocStructNkCommandMemory(1))
	}
	return (*C.struct_nk_command)(unsafe.Pointer(x))
}

// GetType returns a reference to C object within a struct
func (s *Command) GetType() *CommandType {
	var ret *CommandType
	ret = (*CommandType)(unsafe.Pointer(&s._type))
	return ret
}

// GetNext returns a reference to C object within a struct
func (s *Command) GetNext() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.next))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandArc) Ref() *C.struct_nk_command_arc {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_arc)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandArc) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandArcRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandArcRef(ref unsafe.Pointer) *CommandArc {
	return (*CommandArc)(ref)
}

// NewCommandArc allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandArc() *CommandArc {
	return (*CommandArc)(allocStructNkCommandArcMemory(1))
}

// allocStructNkCommandArcMemory allocates memory for type C.struct_nk_command_arc in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandArcMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandArcValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandArcValue = unsafe.Sizeof([1]C.struct_nk_command_arc{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandArc) PassRef() *C.struct_nk_command_arc {
	if x == nil {
		x = (*CommandArc)(allocStructNkCommandArcMemory(1))
	}
	return (*C.struct_nk_command_arc)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandArc) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetCx returns a reference to C object within a struct
func (s *CommandArc) GetCx() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.cx))
	return ret
}

// GetCy returns a reference to C object within a struct
func (s *CommandArc) GetCy() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.cy))
	return ret
}

// GetR returns a reference to C object within a struct
func (s *CommandArc) GetR() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.r))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandArc) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetA returns a reference to C object within a struct
func (s *CommandArc) GetA() [2]float32 {
	var ret [2]float32
	ret = *(*[2]float32)(unsafe.Pointer(&s.a))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandArc) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandArcFilled) Ref() *C.struct_nk_command_arc_filled {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_arc_filled)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandArcFilled) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandArcFilledRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandArcFilledRef(ref unsafe.Pointer) *CommandArcFilled {
	return (*CommandArcFilled)(ref)
}

// NewCommandArcFilled allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandArcFilled() *CommandArcFilled {
	return (*CommandArcFilled)(allocStructNkCommandArcFilledMemory(1))
}

// allocStructNkCommandArcFilledMemory allocates memory for type C.struct_nk_command_arc_filled in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandArcFilledMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandArcFilledValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandArcFilledValue = unsafe.Sizeof([1]C.struct_nk_command_arc_filled{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandArcFilled) PassRef() *C.struct_nk_command_arc_filled {
	if x == nil {
		x = (*CommandArcFilled)(allocStructNkCommandArcFilledMemory(1))
	}
	return (*C.struct_nk_command_arc_filled)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandArcFilled) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetCx returns a reference to C object within a struct
func (s *CommandArcFilled) GetCx() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.cx))
	return ret
}

// GetCy returns a reference to C object within a struct
func (s *CommandArcFilled) GetCy() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.cy))
	return ret
}

// GetR returns a reference to C object within a struct
func (s *CommandArcFilled) GetR() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.r))
	return ret
}

// GetA returns a reference to C object within a struct
func (s *CommandArcFilled) GetA() [2]float32 {
	var ret [2]float32
	ret = *(*[2]float32)(unsafe.Pointer(&s.a))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandArcFilled) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandBuffer) Ref() *C.struct_nk_command_buffer {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_buffer)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandBuffer) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandBufferRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandBufferRef(ref unsafe.Pointer) *CommandBuffer {
	return (*CommandBuffer)(ref)
}

// NewCommandBuffer allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandBuffer() *CommandBuffer {
	return (*CommandBuffer)(allocStructNkCommandBufferMemory(1))
}

// allocStructNkCommandBufferMemory allocates memory for type C.struct_nk_command_buffer in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandBufferMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandBufferValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandBufferValue = unsafe.Sizeof([1]C.struct_nk_command_buffer{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandBuffer) PassRef() *C.struct_nk_command_buffer {
	if x == nil {
		x = (*CommandBuffer)(allocStructNkCommandBufferMemory(1))
	}
	return (*C.struct_nk_command_buffer)(unsafe.Pointer(x))
}

// GetBase returns a reference to C object within a struct
func (s *CommandBuffer) GetBase() **Buffer {
	var ret **Buffer
	ret = (**Buffer)(unsafe.Pointer(&s.base))
	return ret
}

// GetClip returns a reference to C object within a struct
func (s *CommandBuffer) GetClip() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.clip))
	return ret
}

// GetUseClipping returns a reference to C object within a struct
func (s *CommandBuffer) GetUseClipping() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.use_clipping))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *CommandBuffer) GetUserdata() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.userdata))
	return ret
}

// GetBegin returns a reference to C object within a struct
func (s *CommandBuffer) GetBegin() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.begin))
	return ret
}

// GetEnd returns a reference to C object within a struct
func (s *CommandBuffer) GetEnd() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.end))
	return ret
}

// GetLast returns a reference to C object within a struct
func (s *CommandBuffer) GetLast() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.last))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandCircle) Ref() *C.struct_nk_command_circle {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_circle)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandCircle) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandCircleRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandCircleRef(ref unsafe.Pointer) *CommandCircle {
	return (*CommandCircle)(ref)
}

// NewCommandCircle allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandCircle() *CommandCircle {
	return (*CommandCircle)(allocStructNkCommandCircleMemory(1))
}

// allocStructNkCommandCircleMemory allocates memory for type C.struct_nk_command_circle in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandCircleMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandCircleValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandCircleValue = unsafe.Sizeof([1]C.struct_nk_command_circle{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandCircle) PassRef() *C.struct_nk_command_circle {
	if x == nil {
		x = (*CommandCircle)(allocStructNkCommandCircleMemory(1))
	}
	return (*C.struct_nk_command_circle)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandCircle) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandCircle) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandCircle) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandCircle) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandCircle) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandCircle) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandCircle) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandCircleFilled) Ref() *C.struct_nk_command_circle_filled {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_circle_filled)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandCircleFilled) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandCircleFilledRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandCircleFilledRef(ref unsafe.Pointer) *CommandCircleFilled {
	return (*CommandCircleFilled)(ref)
}

// NewCommandCircleFilled allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandCircleFilled() *CommandCircleFilled {
	return (*CommandCircleFilled)(allocStructNkCommandCircleFilledMemory(1))
}

// allocStructNkCommandCircleFilledMemory allocates memory for type C.struct_nk_command_circle_filled in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandCircleFilledMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandCircleFilledValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandCircleFilledValue = unsafe.Sizeof([1]C.struct_nk_command_circle_filled{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandCircleFilled) PassRef() *C.struct_nk_command_circle_filled {
	if x == nil {
		x = (*CommandCircleFilled)(allocStructNkCommandCircleFilledMemory(1))
	}
	return (*C.struct_nk_command_circle_filled)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandCircleFilled) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandCircleFilled) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandCircleFilled) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandCircleFilled) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandCircleFilled) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandCircleFilled) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandCurve) Ref() *C.struct_nk_command_curve {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_curve)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandCurve) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandCurveRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandCurveRef(ref unsafe.Pointer) *CommandCurve {
	return (*CommandCurve)(ref)
}

// NewCommandCurve allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandCurve() *CommandCurve {
	return (*CommandCurve)(allocStructNkCommandCurveMemory(1))
}

// allocStructNkCommandCurveMemory allocates memory for type C.struct_nk_command_curve in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandCurveMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandCurveValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandCurveValue = unsafe.Sizeof([1]C.struct_nk_command_curve{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandCurve) PassRef() *C.struct_nk_command_curve {
	if x == nil {
		x = (*CommandCurve)(allocStructNkCommandCurveMemory(1))
	}
	return (*C.struct_nk_command_curve)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandCurve) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandCurve) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetBegin returns a reference to C object within a struct
func (s *CommandCurve) GetBegin() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.begin))
	return ret
}

// GetEnd returns a reference to C object within a struct
func (s *CommandCurve) GetEnd() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.end))
	return ret
}

// GetCtrl returns a reference to C object within a struct
func (s *CommandCurve) GetCtrl() [2]Vec2i {
	var ret [2]Vec2i
	ret = *(*[2]Vec2i)(unsafe.Pointer(&s.ctrl))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandCurve) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandCustom) Ref() *C.struct_nk_command_custom {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_custom)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandCustom) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandCustomRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandCustomRef(ref unsafe.Pointer) *CommandCustom {
	return (*CommandCustom)(ref)
}

// NewCommandCustom allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandCustom() *CommandCustom {
	return (*CommandCustom)(allocStructNkCommandCustomMemory(1))
}

// allocStructNkCommandCustomMemory allocates memory for type C.struct_nk_command_custom in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandCustomMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandCustomValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandCustomValue = unsafe.Sizeof([1]C.struct_nk_command_custom{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandCustom) PassRef() *C.struct_nk_command_custom {
	if x == nil {
		x = (*CommandCustom)(allocStructNkCommandCustomMemory(1))
	}
	return (*C.struct_nk_command_custom)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandCustom) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandCustom) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandCustom) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandCustom) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandCustom) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetCallbackData returns a reference to C object within a struct
func (s *CommandCustom) GetCallbackData() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.callback_data))
	return ret
}

// GetCallback returns a reference to C object within a struct
func (s *CommandCustom) GetCallback() *CommandCustomCallback {
	var ret *CommandCustomCallback
	// ret is a callback func
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandImage) Ref() *C.struct_nk_command_image {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_image)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandImage) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandImageRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandImageRef(ref unsafe.Pointer) *CommandImage {
	return (*CommandImage)(ref)
}

// NewCommandImage allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandImage() *CommandImage {
	return (*CommandImage)(allocStructNkCommandImageMemory(1))
}

// allocStructNkCommandImageMemory allocates memory for type C.struct_nk_command_image in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandImageMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandImageValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandImageValue = unsafe.Sizeof([1]C.struct_nk_command_image{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandImage) PassRef() *C.struct_nk_command_image {
	if x == nil {
		x = (*CommandImage)(allocStructNkCommandImageMemory(1))
	}
	return (*C.struct_nk_command_image)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandImage) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandImage) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandImage) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandImage) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandImage) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetImg returns a reference to C object within a struct
func (s *CommandImage) GetImg() *Image {
	var ret *Image
	ret = (*Image)(unsafe.Pointer(&s.img))
	return ret
}

// GetCol returns a reference to C object within a struct
func (s *CommandImage) GetCol() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.col))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandLine) Ref() *C.struct_nk_command_line {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_line)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandLine) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandLineRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandLineRef(ref unsafe.Pointer) *CommandLine {
	return (*CommandLine)(ref)
}

// NewCommandLine allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandLine() *CommandLine {
	return (*CommandLine)(allocStructNkCommandLineMemory(1))
}

// allocStructNkCommandLineMemory allocates memory for type C.struct_nk_command_line in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandLineMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandLineValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandLineValue = unsafe.Sizeof([1]C.struct_nk_command_line{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandLine) PassRef() *C.struct_nk_command_line {
	if x == nil {
		x = (*CommandLine)(allocStructNkCommandLineMemory(1))
	}
	return (*C.struct_nk_command_line)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandLine) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandLine) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetBegin returns a reference to C object within a struct
func (s *CommandLine) GetBegin() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.begin))
	return ret
}

// GetEnd returns a reference to C object within a struct
func (s *CommandLine) GetEnd() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.end))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandLine) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandPolygon) Ref() *C.struct_nk_command_polygon {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_polygon)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandPolygon) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandPolygonRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandPolygonRef(ref unsafe.Pointer) *CommandPolygon {
	return (*CommandPolygon)(ref)
}

// NewCommandPolygon allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandPolygon() *CommandPolygon {
	return (*CommandPolygon)(allocStructNkCommandPolygonMemory(1))
}

// allocStructNkCommandPolygonMemory allocates memory for type C.struct_nk_command_polygon in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandPolygonMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandPolygonValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandPolygonValue = unsafe.Sizeof([1]C.struct_nk_command_polygon{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandPolygon) PassRef() *C.struct_nk_command_polygon {
	if x == nil {
		x = (*CommandPolygon)(allocStructNkCommandPolygonMemory(1))
	}
	return (*C.struct_nk_command_polygon)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandPolygon) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandPolygon) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandPolygon) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetPointCount returns a reference to C object within a struct
func (s *CommandPolygon) GetPointCount() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.point_count))
	return ret
}

// GetPoints returns a reference to C object within a struct
func (s *CommandPolygon) GetPoints() [1]Vec2i {
	var ret [1]Vec2i
	ret = *(*[1]Vec2i)(unsafe.Pointer(&s.points))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandPolygonFilled) Ref() *C.struct_nk_command_polygon_filled {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_polygon_filled)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandPolygonFilled) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandPolygonFilledRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandPolygonFilledRef(ref unsafe.Pointer) *CommandPolygonFilled {
	return (*CommandPolygonFilled)(ref)
}

// NewCommandPolygonFilled allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandPolygonFilled() *CommandPolygonFilled {
	return (*CommandPolygonFilled)(allocStructNkCommandPolygonFilledMemory(1))
}

// allocStructNkCommandPolygonFilledMemory allocates memory for type C.struct_nk_command_polygon_filled in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandPolygonFilledMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandPolygonFilledValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandPolygonFilledValue = unsafe.Sizeof([1]C.struct_nk_command_polygon_filled{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandPolygonFilled) PassRef() *C.struct_nk_command_polygon_filled {
	if x == nil {
		x = (*CommandPolygonFilled)(allocStructNkCommandPolygonFilledMemory(1))
	}
	return (*C.struct_nk_command_polygon_filled)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandPolygonFilled) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandPolygonFilled) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// GetPointCount returns a reference to C object within a struct
func (s *CommandPolygonFilled) GetPointCount() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.point_count))
	return ret
}

// GetPoints returns a reference to C object within a struct
func (s *CommandPolygonFilled) GetPoints() [1]Vec2i {
	var ret [1]Vec2i
	ret = *(*[1]Vec2i)(unsafe.Pointer(&s.points))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandPolyline) Ref() *C.struct_nk_command_polyline {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_polyline)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandPolyline) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandPolylineRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandPolylineRef(ref unsafe.Pointer) *CommandPolyline {
	return (*CommandPolyline)(ref)
}

// NewCommandPolyline allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandPolyline() *CommandPolyline {
	return (*CommandPolyline)(allocStructNkCommandPolylineMemory(1))
}

// allocStructNkCommandPolylineMemory allocates memory for type C.struct_nk_command_polyline in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandPolylineMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandPolylineValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandPolylineValue = unsafe.Sizeof([1]C.struct_nk_command_polyline{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandPolyline) PassRef() *C.struct_nk_command_polyline {
	if x == nil {
		x = (*CommandPolyline)(allocStructNkCommandPolylineMemory(1))
	}
	return (*C.struct_nk_command_polyline)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandPolyline) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandPolyline) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandPolyline) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetPointCount returns a reference to C object within a struct
func (s *CommandPolyline) GetPointCount() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.point_count))
	return ret
}

// GetPoints returns a reference to C object within a struct
func (s *CommandPolyline) GetPoints() [1]Vec2i {
	var ret [1]Vec2i
	ret = *(*[1]Vec2i)(unsafe.Pointer(&s.points))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandRect) Ref() *C.struct_nk_command_rect {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_rect)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandRect) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandRectRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandRectRef(ref unsafe.Pointer) *CommandRect {
	return (*CommandRect)(ref)
}

// NewCommandRect allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandRect() *CommandRect {
	return (*CommandRect)(allocStructNkCommandRectMemory(1))
}

// allocStructNkCommandRectMemory allocates memory for type C.struct_nk_command_rect in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandRectMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandRectValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandRectValue = unsafe.Sizeof([1]C.struct_nk_command_rect{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandRect) PassRef() *C.struct_nk_command_rect {
	if x == nil {
		x = (*CommandRect)(allocStructNkCommandRectMemory(1))
	}
	return (*C.struct_nk_command_rect)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandRect) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *CommandRect) GetRounding() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandRect) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandRect) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandRect) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandRect) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandRect) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandRect) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandRectFilled) Ref() *C.struct_nk_command_rect_filled {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_rect_filled)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandRectFilled) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandRectFilledRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandRectFilledRef(ref unsafe.Pointer) *CommandRectFilled {
	return (*CommandRectFilled)(ref)
}

// NewCommandRectFilled allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandRectFilled() *CommandRectFilled {
	return (*CommandRectFilled)(allocStructNkCommandRectFilledMemory(1))
}

// allocStructNkCommandRectFilledMemory allocates memory for type C.struct_nk_command_rect_filled in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandRectFilledMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandRectFilledValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandRectFilledValue = unsafe.Sizeof([1]C.struct_nk_command_rect_filled{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandRectFilled) PassRef() *C.struct_nk_command_rect_filled {
	if x == nil {
		x = (*CommandRectFilled)(allocStructNkCommandRectFilledMemory(1))
	}
	return (*C.struct_nk_command_rect_filled)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandRectFilled) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *CommandRectFilled) GetRounding() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandRectFilled) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandRectFilled) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandRectFilled) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandRectFilled) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandRectFilled) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandRectMultiColor) Ref() *C.struct_nk_command_rect_multi_color {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_rect_multi_color)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandRectMultiColor) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandRectMultiColorRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandRectMultiColorRef(ref unsafe.Pointer) *CommandRectMultiColor {
	return (*CommandRectMultiColor)(ref)
}

// NewCommandRectMultiColor allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandRectMultiColor() *CommandRectMultiColor {
	return (*CommandRectMultiColor)(allocStructNkCommandRectMultiColorMemory(1))
}

// allocStructNkCommandRectMultiColorMemory allocates memory for type C.struct_nk_command_rect_multi_color in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandRectMultiColorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandRectMultiColorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandRectMultiColorValue = unsafe.Sizeof([1]C.struct_nk_command_rect_multi_color{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandRectMultiColor) PassRef() *C.struct_nk_command_rect_multi_color {
	if x == nil {
		x = (*CommandRectMultiColor)(allocStructNkCommandRectMultiColorMemory(1))
	}
	return (*C.struct_nk_command_rect_multi_color)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetLeft returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetLeft() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.left))
	return ret
}

// GetTop returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetTop() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.top))
	return ret
}

// GetBottom returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetBottom() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.bottom))
	return ret
}

// GetRight returns a reference to C object within a struct
func (s *CommandRectMultiColor) GetRight() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.right))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandScissor) Ref() *C.struct_nk_command_scissor {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_scissor)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandScissor) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandScissorRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandScissorRef(ref unsafe.Pointer) *CommandScissor {
	return (*CommandScissor)(ref)
}

// NewCommandScissor allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandScissor() *CommandScissor {
	return (*CommandScissor)(allocStructNkCommandScissorMemory(1))
}

// allocStructNkCommandScissorMemory allocates memory for type C.struct_nk_command_scissor in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandScissorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandScissorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandScissorValue = unsafe.Sizeof([1]C.struct_nk_command_scissor{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandScissor) PassRef() *C.struct_nk_command_scissor {
	if x == nil {
		x = (*CommandScissor)(allocStructNkCommandScissorMemory(1))
	}
	return (*C.struct_nk_command_scissor)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandScissor) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandScissor) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandScissor) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandScissor) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandScissor) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

const sizeOfPtr = unsafe.Sizeof(&struct{}{})

type sliceHeader struct {
	Data unsafe.Pointer
	Len  int
	Cap  int
}

// packSPUserFont reads sliced Go data structure out from plain C format.
func packSPUserFont(v []*UserFont, ptr0 **C.struct_nk_user_font) {
	const m = 0x7fffffff
	for i0 := range v {
		ptr1 := (*(*[m / sizeOfPtr]*C.struct_nk_user_font)(unsafe.Pointer(ptr0)))[i0]
		v[i0] = NewUserFontRef(unsafe.Pointer(ptr1))
	}
}

// Ref returns a reference to C object as it is.
func (x *CommandText) Ref() *C.struct_nk_command_text {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_text)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandText) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandTextRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandTextRef(ref unsafe.Pointer) *CommandText {
	return (*CommandText)(ref)
}

// NewCommandText allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandText() *CommandText {
	return (*CommandText)(allocStructNkCommandTextMemory(1))
}

// allocStructNkCommandTextMemory allocates memory for type C.struct_nk_command_text in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandTextMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandTextValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandTextValue = unsafe.Sizeof([1]C.struct_nk_command_text{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandText) PassRef() *C.struct_nk_command_text {
	if x == nil {
		x = (*CommandText)(allocStructNkCommandTextMemory(1))
	}
	return (*C.struct_nk_command_text)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandText) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetFont returns a reference to C object within a struct
func (s *CommandText) GetFont() []*UserFont {
	var ret []*UserFont
	packSPUserFont(ret, &s.font)
	return ret
}

// GetBackground returns a reference to C object within a struct
func (s *CommandText) GetBackground() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.background))
	return ret
}

// GetForeground returns a reference to C object within a struct
func (s *CommandText) GetForeground() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.foreground))
	return ret
}

// GetX returns a reference to C object within a struct
func (s *CommandText) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *CommandText) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *CommandText) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *CommandText) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetHeight returns a reference to C object within a struct
func (s *CommandText) GetHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.height))
	return ret
}

// GetLength returns a reference to C object within a struct
func (s *CommandText) GetLength() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.length))
	return ret
}

// 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))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandTriangle) Ref() *C.struct_nk_command_triangle {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_triangle)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandTriangle) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandTriangleRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandTriangleRef(ref unsafe.Pointer) *CommandTriangle {
	return (*CommandTriangle)(ref)
}

// NewCommandTriangle allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandTriangle() *CommandTriangle {
	return (*CommandTriangle)(allocStructNkCommandTriangleMemory(1))
}

// allocStructNkCommandTriangleMemory allocates memory for type C.struct_nk_command_triangle in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandTriangleMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandTriangleValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandTriangleValue = unsafe.Sizeof([1]C.struct_nk_command_triangle{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandTriangle) PassRef() *C.struct_nk_command_triangle {
	if x == nil {
		x = (*CommandTriangle)(allocStructNkCommandTriangleMemory(1))
	}
	return (*C.struct_nk_command_triangle)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandTriangle) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetLineThickness returns a reference to C object within a struct
func (s *CommandTriangle) GetLineThickness() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.line_thickness))
	return ret
}

// GetA returns a reference to C object within a struct
func (s *CommandTriangle) GetA() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.a))
	return ret
}

// GetB returns a reference to C object within a struct
func (s *CommandTriangle) GetB() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.b))
	return ret
}

// GetC returns a reference to C object within a struct
func (s *CommandTriangle) GetC() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.c))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandTriangle) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *CommandTriangleFilled) Ref() *C.struct_nk_command_triangle_filled {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_command_triangle_filled)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *CommandTriangleFilled) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCommandTriangleFilledRef converts the C object reference into a raw struct reference without wrapping.
func NewCommandTriangleFilledRef(ref unsafe.Pointer) *CommandTriangleFilled {
	return (*CommandTriangleFilled)(ref)
}

// NewCommandTriangleFilled allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCommandTriangleFilled() *CommandTriangleFilled {
	return (*CommandTriangleFilled)(allocStructNkCommandTriangleFilledMemory(1))
}

// allocStructNkCommandTriangleFilledMemory allocates memory for type C.struct_nk_command_triangle_filled in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCommandTriangleFilledMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCommandTriangleFilledValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCommandTriangleFilledValue = unsafe.Sizeof([1]C.struct_nk_command_triangle_filled{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *CommandTriangleFilled) PassRef() *C.struct_nk_command_triangle_filled {
	if x == nil {
		x = (*CommandTriangleFilled)(allocStructNkCommandTriangleFilledMemory(1))
	}
	return (*C.struct_nk_command_triangle_filled)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *CommandTriangleFilled) GetHeader() *Command {
	var ret *Command
	ret = (*Command)(unsafe.Pointer(&s.header))
	return ret
}

// GetA returns a reference to C object within a struct
func (s *CommandTriangleFilled) GetA() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.a))
	return ret
}

// GetB returns a reference to C object within a struct
func (s *CommandTriangleFilled) GetB() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.b))
	return ret
}

// GetC returns a reference to C object within a struct
func (s *CommandTriangleFilled) GetC() *Vec2i {
	var ret *Vec2i
	ret = (*Vec2i)(unsafe.Pointer(&s.c))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *CommandTriangleFilled) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackButtonBehavior) Ref() *C.struct_nk_config_stack_button_behavior {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_button_behavior)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackButtonBehavior) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackButtonBehaviorRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackButtonBehaviorRef(ref unsafe.Pointer) *ConfigStackButtonBehavior {
	return (*ConfigStackButtonBehavior)(ref)
}

// NewConfigStackButtonBehavior allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackButtonBehavior() *ConfigStackButtonBehavior {
	return (*ConfigStackButtonBehavior)(allocStructNkConfigStackButtonBehaviorMemory(1))
}

// allocStructNkConfigStackButtonBehaviorMemory allocates memory for type C.struct_nk_config_stack_button_behavior in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackButtonBehaviorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackButtonBehaviorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackButtonBehaviorValue = unsafe.Sizeof([1]C.struct_nk_config_stack_button_behavior{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackButtonBehavior) PassRef() *C.struct_nk_config_stack_button_behavior {
	if x == nil {
		x = (*ConfigStackButtonBehavior)(allocStructNkConfigStackButtonBehaviorMemory(1))
	}
	return (*C.struct_nk_config_stack_button_behavior)(unsafe.Pointer(x))
}

// GetHead returns a reference to C object within a struct
func (s *ConfigStackButtonBehavior) GetHead() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.head))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *ConfigStackButtonBehavior) GetElements() [8]ConfigStackButtonBehaviorElement {
	var ret [8]ConfigStackButtonBehaviorElement
	ret = *(*[8]ConfigStackButtonBehaviorElement)(unsafe.Pointer(&s.elements))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackButtonBehaviorElement) Ref() *C.struct_nk_config_stack_button_behavior_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_button_behavior_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackButtonBehaviorElement) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackButtonBehaviorElementRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackButtonBehaviorElementRef(ref unsafe.Pointer) *ConfigStackButtonBehaviorElement {
	return (*ConfigStackButtonBehaviorElement)(ref)
}

// NewConfigStackButtonBehaviorElement allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackButtonBehaviorElement() *ConfigStackButtonBehaviorElement {
	return (*ConfigStackButtonBehaviorElement)(allocStructNkConfigStackButtonBehaviorElementMemory(1))
}

// allocStructNkConfigStackButtonBehaviorElementMemory allocates memory for type C.struct_nk_config_stack_button_behavior_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackButtonBehaviorElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackButtonBehaviorElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackButtonBehaviorElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_button_behavior_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackButtonBehaviorElement) PassRef() *C.struct_nk_config_stack_button_behavior_element {
	if x == nil {
		x = (*ConfigStackButtonBehaviorElement)(allocStructNkConfigStackButtonBehaviorElementMemory(1))
	}
	return (*C.struct_nk_config_stack_button_behavior_element)(unsafe.Pointer(x))
}

// GetAddress returns a reference to C object within a struct
func (s *ConfigStackButtonBehaviorElement) GetAddress() **ButtonBehavior {
	var ret **ButtonBehavior
	ret = (**ButtonBehavior)(unsafe.Pointer(&s.address))
	return ret
}

// GetOldValue returns a reference to C object within a struct
func (s *ConfigStackButtonBehaviorElement) GetOldValue() *ButtonBehavior {
	var ret *ButtonBehavior
	ret = (*ButtonBehavior)(unsafe.Pointer(&s.old_value))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackColor) Ref() *C.struct_nk_config_stack_color {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_color)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackColor) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackColorRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackColorRef(ref unsafe.Pointer) *ConfigStackColor {
	return (*ConfigStackColor)(ref)
}

// NewConfigStackColor allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackColor() *ConfigStackColor {
	return (*ConfigStackColor)(allocStructNkConfigStackColorMemory(1))
}

// allocStructNkConfigStackColorMemory allocates memory for type C.struct_nk_config_stack_color in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackColorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackColorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackColorValue = unsafe.Sizeof([1]C.struct_nk_config_stack_color{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackColor) PassRef() *C.struct_nk_config_stack_color {
	if x == nil {
		x = (*ConfigStackColor)(allocStructNkConfigStackColorMemory(1))
	}
	return (*C.struct_nk_config_stack_color)(unsafe.Pointer(x))
}

// GetHead returns a reference to C object within a struct
func (s *ConfigStackColor) GetHead() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.head))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *ConfigStackColor) GetElements() [32]ConfigStackColorElement {
	var ret [32]ConfigStackColorElement
	ret = *(*[32]ConfigStackColorElement)(unsafe.Pointer(&s.elements))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackColorElement) Ref() *C.struct_nk_config_stack_color_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_color_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackColorElement) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackColorElementRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackColorElementRef(ref unsafe.Pointer) *ConfigStackColorElement {
	return (*ConfigStackColorElement)(ref)
}

// NewConfigStackColorElement allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackColorElement() *ConfigStackColorElement {
	return (*ConfigStackColorElement)(allocStructNkConfigStackColorElementMemory(1))
}

// allocStructNkConfigStackColorElementMemory allocates memory for type C.struct_nk_config_stack_color_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackColorElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackColorElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackColorElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_color_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackColorElement) PassRef() *C.struct_nk_config_stack_color_element {
	if x == nil {
		x = (*ConfigStackColorElement)(allocStructNkConfigStackColorElementMemory(1))
	}
	return (*C.struct_nk_config_stack_color_element)(unsafe.Pointer(x))
}

// GetAddress returns a reference to C object within a struct
func (s *ConfigStackColorElement) GetAddress() **Color {
	var ret **Color
	ret = (**Color)(unsafe.Pointer(&s.address))
	return ret
}

// GetOldValue returns a reference to C object within a struct
func (s *ConfigStackColorElement) GetOldValue() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.old_value))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackFlags) Ref() *C.struct_nk_config_stack_flags {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_flags)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackFlags) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackFlagsRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackFlagsRef(ref unsafe.Pointer) *ConfigStackFlags {
	return (*ConfigStackFlags)(ref)
}

// NewConfigStackFlags allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackFlags() *ConfigStackFlags {
	return (*ConfigStackFlags)(allocStructNkConfigStackFlagsMemory(1))
}

// allocStructNkConfigStackFlagsMemory allocates memory for type C.struct_nk_config_stack_flags in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackFlagsMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackFlagsValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackFlagsValue = unsafe.Sizeof([1]C.struct_nk_config_stack_flags{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackFlags) PassRef() *C.struct_nk_config_stack_flags {
	if x == nil {
		x = (*ConfigStackFlags)(allocStructNkConfigStackFlagsMemory(1))
	}
	return (*C.struct_nk_config_stack_flags)(unsafe.Pointer(x))
}

// GetHead returns a reference to C object within a struct
func (s *ConfigStackFlags) GetHead() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.head))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *ConfigStackFlags) GetElements() [32]ConfigStackFlagsElement {
	var ret [32]ConfigStackFlagsElement
	ret = *(*[32]ConfigStackFlagsElement)(unsafe.Pointer(&s.elements))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackFlagsElement) Ref() *C.struct_nk_config_stack_flags_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_flags_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackFlagsElement) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackFlagsElementRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackFlagsElementRef(ref unsafe.Pointer) *ConfigStackFlagsElement {
	return (*ConfigStackFlagsElement)(ref)
}

// NewConfigStackFlagsElement allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackFlagsElement() *ConfigStackFlagsElement {
	return (*ConfigStackFlagsElement)(allocStructNkConfigStackFlagsElementMemory(1))
}

// allocStructNkConfigStackFlagsElementMemory allocates memory for type C.struct_nk_config_stack_flags_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackFlagsElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackFlagsElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackFlagsElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_flags_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackFlagsElement) PassRef() *C.struct_nk_config_stack_flags_element {
	if x == nil {
		x = (*ConfigStackFlagsElement)(allocStructNkConfigStackFlagsElementMemory(1))
	}
	return (*C.struct_nk_config_stack_flags_element)(unsafe.Pointer(x))
}

// GetAddress returns a reference to C object within a struct
func (s *ConfigStackFlagsElement) GetAddress() **Flags {
	var ret **Flags
	ret = (**Flags)(unsafe.Pointer(&s.address))
	return ret
}

// GetOldValue returns a reference to C object within a struct
func (s *ConfigStackFlagsElement) GetOldValue() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.old_value))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackFloat) Ref() *C.struct_nk_config_stack_float {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_float)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackFloat) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackFloatRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackFloatRef(ref unsafe.Pointer) *ConfigStackFloat {
	return (*ConfigStackFloat)(ref)
}

// NewConfigStackFloat allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackFloat() *ConfigStackFloat {
	return (*ConfigStackFloat)(allocStructNkConfigStackFloatMemory(1))
}

// allocStructNkConfigStackFloatMemory allocates memory for type C.struct_nk_config_stack_float in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackFloatMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackFloatValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackFloatValue = unsafe.Sizeof([1]C.struct_nk_config_stack_float{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackFloat) PassRef() *C.struct_nk_config_stack_float {
	if x == nil {
		x = (*ConfigStackFloat)(allocStructNkConfigStackFloatMemory(1))
	}
	return (*C.struct_nk_config_stack_float)(unsafe.Pointer(x))
}

// GetHead returns a reference to C object within a struct
func (s *ConfigStackFloat) GetHead() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.head))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *ConfigStackFloat) GetElements() [32]ConfigStackFloatElement {
	var ret [32]ConfigStackFloatElement
	ret = *(*[32]ConfigStackFloatElement)(unsafe.Pointer(&s.elements))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackFloatElement) Ref() *C.struct_nk_config_stack_float_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_float_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackFloatElement) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackFloatElementRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackFloatElementRef(ref unsafe.Pointer) *ConfigStackFloatElement {
	return (*ConfigStackFloatElement)(ref)
}

// NewConfigStackFloatElement allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackFloatElement() *ConfigStackFloatElement {
	return (*ConfigStackFloatElement)(allocStructNkConfigStackFloatElementMemory(1))
}

// allocStructNkConfigStackFloatElementMemory allocates memory for type C.struct_nk_config_stack_float_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackFloatElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackFloatElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackFloatElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_float_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackFloatElement) PassRef() *C.struct_nk_config_stack_float_element {
	if x == nil {
		x = (*ConfigStackFloatElement)(allocStructNkConfigStackFloatElementMemory(1))
	}
	return (*C.struct_nk_config_stack_float_element)(unsafe.Pointer(x))
}

// GetAddress returns a reference to C object within a struct
func (s *ConfigStackFloatElement) GetAddress() []*float32 {
	var ret []*float32
	hxfc4425b := (*sliceHeader)(unsafe.Pointer(&ret))
	hxfc4425b.Data = unsafe.Pointer(&s.address)
	hxfc4425b.Cap = 0x7fffffff
	// hxfc4425b.Len = ?

	return ret
}

// GetOldValue returns a reference to C object within a struct
func (s *ConfigStackFloatElement) GetOldValue() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.old_value))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackStyleItem) Ref() *C.struct_nk_config_stack_style_item {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_style_item)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackStyleItem) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackStyleItemRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackStyleItemRef(ref unsafe.Pointer) *ConfigStackStyleItem {
	return (*ConfigStackStyleItem)(ref)
}

// NewConfigStackStyleItem allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackStyleItem() *ConfigStackStyleItem {
	return (*ConfigStackStyleItem)(allocStructNkConfigStackStyleItemMemory(1))
}

// allocStructNkConfigStackStyleItemMemory allocates memory for type C.struct_nk_config_stack_style_item in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackStyleItemMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackStyleItemValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackStyleItemValue = unsafe.Sizeof([1]C.struct_nk_config_stack_style_item{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackStyleItem) PassRef() *C.struct_nk_config_stack_style_item {
	if x == nil {
		x = (*ConfigStackStyleItem)(allocStructNkConfigStackStyleItemMemory(1))
	}
	return (*C.struct_nk_config_stack_style_item)(unsafe.Pointer(x))
}

// GetHead returns a reference to C object within a struct
func (s *ConfigStackStyleItem) GetHead() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.head))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *ConfigStackStyleItem) GetElements() [16]ConfigStackStyleItemElement {
	var ret [16]ConfigStackStyleItemElement
	ret = *(*[16]ConfigStackStyleItemElement)(unsafe.Pointer(&s.elements))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackStyleItemElement) Ref() *C.struct_nk_config_stack_style_item_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_style_item_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackStyleItemElement) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackStyleItemElementRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackStyleItemElementRef(ref unsafe.Pointer) *ConfigStackStyleItemElement {
	return (*ConfigStackStyleItemElement)(ref)
}

// NewConfigStackStyleItemElement allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackStyleItemElement() *ConfigStackStyleItemElement {
	return (*ConfigStackStyleItemElement)(allocStructNkConfigStackStyleItemElementMemory(1))
}

// allocStructNkConfigStackStyleItemElementMemory allocates memory for type C.struct_nk_config_stack_style_item_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackStyleItemElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackStyleItemElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackStyleItemElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_style_item_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackStyleItemElement) PassRef() *C.struct_nk_config_stack_style_item_element {
	if x == nil {
		x = (*ConfigStackStyleItemElement)(allocStructNkConfigStackStyleItemElementMemory(1))
	}
	return (*C.struct_nk_config_stack_style_item_element)(unsafe.Pointer(x))
}

// GetAddress returns a reference to C object within a struct
func (s *ConfigStackStyleItemElement) GetAddress() **StyleItem {
	var ret **StyleItem
	ret = (**StyleItem)(unsafe.Pointer(&s.address))
	return ret
}

// GetOldValue returns a reference to C object within a struct
func (s *ConfigStackStyleItemElement) GetOldValue() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.old_value))
	return ret
}

// allocStructNkConfigStackUserFontMemory allocates memory for type C.struct_nk_config_stack_user_font in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackUserFontMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackUserFontValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackUserFontValue = unsafe.Sizeof([1]C.struct_nk_config_stack_user_font{})

// allocA8StructNkConfigStackUserFontElementMemory allocates memory for type [8]C.struct_nk_config_stack_user_font_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocA8StructNkConfigStackUserFontElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfA8StructNkConfigStackUserFontElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfA8StructNkConfigStackUserFontElementValue = unsafe.Sizeof([1][8]C.struct_nk_config_stack_user_font_element{})

// unpackA8ConfigStackUserFontElement transforms a sliced Go data structure into plain C format.
func unpackA8ConfigStackUserFontElement(x [8]ConfigStackUserFontElement) (unpacked [8]C.struct_nk_config_stack_user_font_element, allocs *cgoAllocMap) {
	allocs = new(cgoAllocMap)
	defer runtime.SetFinalizer(&unpacked, func(*[8]C.struct_nk_config_stack_user_font_element) {
		go allocs.Free()
	})

	mem0 := allocA8StructNkConfigStackUserFontElementMemory(1)
	allocs.Add(mem0)
	v0 := (*[8]C.struct_nk_config_stack_user_font_element)(mem0)
	for i0 := range x {
		allocs0 := new(cgoAllocMap)
		v0[i0], allocs0 = x[i0].PassValue()
		allocs.Borrow(allocs0)
	}
	unpacked = *(*[8]C.struct_nk_config_stack_user_font_element)(mem0)
	return
}

// packA8ConfigStackUserFontElement reads sliced Go data structure out from plain C format.
func packA8ConfigStackUserFontElement(v *[8]ConfigStackUserFontElement, ptr0 *[8]C.struct_nk_config_stack_user_font_element) {
	for i0 := range v {
		ptr1 := ptr0[i0]
		v[i0] = *NewConfigStackUserFontElementRef(unsafe.Pointer(&ptr1))
	}
}

// Ref returns the underlying reference to C object or nil if struct is nil.
func (x *ConfigStackUserFont) Ref() *C.struct_nk_config_stack_user_font {
	if x == nil {
		return nil
	}
	return x.refa664861d
}

// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free.
// Does nothing if struct is nil or has no allocation map.
func (x *ConfigStackUserFont) Free() {
	if x != nil && x.allocsa664861d != nil {
		x.allocsa664861d.(*cgoAllocMap).Free()
		x.refa664861d = nil
	}
}

// NewConfigStackUserFontRef creates a new wrapper struct with underlying reference set to the original C object.
// Returns nil if the provided pointer to C object is nil too.
func NewConfigStackUserFontRef(ref unsafe.Pointer) *ConfigStackUserFont {
	if ref == nil {
		return nil
	}
	obj := new(ConfigStackUserFont)
	obj.refa664861d = (*C.struct_nk_config_stack_user_font)(unsafe.Pointer(ref))
	return obj
}

// PassRef returns the underlying C object, otherwise it will allocate one and set its values
// from this wrapping struct, counting allocations into an allocation map.
func (x *ConfigStackUserFont) PassRef() (*C.struct_nk_config_stack_user_font, *cgoAllocMap) {
	if x == nil {
		return nil, nil
	} else if x.refa664861d != nil {
		return x.refa664861d, nil
	}
	mema664861d := allocStructNkConfigStackUserFontMemory(1)
	refa664861d := (*C.struct_nk_config_stack_user_font)(mema664861d)
	allocsa664861d := new(cgoAllocMap)
	allocsa664861d.Add(mema664861d)

	var chead_allocs *cgoAllocMap
	refa664861d.head, chead_allocs = (C.int)(x.Head), cgoAllocsUnknown
	allocsa664861d.Borrow(chead_allocs)

	var celements_allocs *cgoAllocMap
	refa664861d.elements, celements_allocs = unpackA8ConfigStackUserFontElement(x.Elements)
	allocsa664861d.Borrow(celements_allocs)

	x.refa664861d = refa664861d
	x.allocsa664861d = allocsa664861d
	return refa664861d, allocsa664861d

}

// PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (x ConfigStackUserFont) PassValue() (C.struct_nk_config_stack_user_font, *cgoAllocMap) {
	if x.refa664861d != nil {
		return *x.refa664861d, nil
	}
	ref, allocs := x.PassRef()
	return *ref, allocs
}

// Deref uses the underlying reference to C object and fills the wrapping struct with values.
// Do not forget to call this method whether you get a struct for C object and want to read its values.
func (x *ConfigStackUserFont) Deref() {
	if x.refa664861d == nil {
		return
	}
	x.Head = (int32)(x.refa664861d.head)
	packA8ConfigStackUserFontElement(&x.Elements, (*[8]C.struct_nk_config_stack_user_font_element)(unsafe.Pointer(&x.refa664861d.elements)))
}

// allocStructNkConfigStackUserFontElementMemory allocates memory for type C.struct_nk_config_stack_user_font_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackUserFontElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackUserFontElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackUserFontElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_user_font_element{})

// allocPStructNkUserFontMemory allocates memory for type *C.struct_nk_user_font in C.
// The caller is responsible for freeing the this memory via C.free.
func allocPStructNkUserFontMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPStructNkUserFontValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfPStructNkUserFontValue = unsafe.Sizeof([1]*C.struct_nk_user_font{})

// allocStructNkUserFontMemory allocates memory for type C.struct_nk_user_font in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkUserFontMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkUserFontValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkUserFontValue = unsafe.Sizeof([1]C.struct_nk_user_font{})

// unpackSSUserFont transforms a sliced Go data structure into plain C format.
func unpackSSUserFont(x [][]UserFont) (unpacked **C.struct_nk_user_font, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	allocs = new(cgoAllocMap)
	defer runtime.SetFinalizer(&unpacked, func(***C.struct_nk_user_font) {
		go allocs.Free()
	})

	len0 := len(x)
	mem0 := allocPStructNkUserFontMemory(len0)
	allocs.Add(mem0)
	h0 := &sliceHeader{
		Data: mem0,
		Cap:  len0,
		Len:  len0,
	}
	v0 := *(*[]*C.struct_nk_user_font)(unsafe.Pointer(h0))
	for i0 := range x {
		len1 := len(x[i0])
		mem1 := allocStructNkUserFontMemory(len1)
		allocs.Add(mem1)
		h1 := &sliceHeader{
			Data: mem1,
			Cap:  len1,
			Len:  len1,
		}
		v1 := *(*[]C.struct_nk_user_font)(unsafe.Pointer(h1))
		for i1 := range x[i0] {
			allocs1 := new(cgoAllocMap)
			v1[i1], allocs1 = x[i0][i1].PassValue()
			allocs.Borrow(allocs1)
		}
		h := (*sliceHeader)(unsafe.Pointer(&v1))
		v0[i0] = (*C.struct_nk_user_font)(h.Data)
	}
	h := (*sliceHeader)(unsafe.Pointer(&v0))
	unpacked = (**C.struct_nk_user_font)(h.Data)
	return
}

// unpackSUserFont transforms a sliced Go data structure into plain C format.
func unpackSUserFont(x []UserFont) (unpacked *C.struct_nk_user_font, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	allocs = new(cgoAllocMap)
	defer runtime.SetFinalizer(&unpacked, func(**C.struct_nk_user_font) {
		go allocs.Free()
	})

	len0 := len(x)
	mem0 := allocStructNkUserFontMemory(len0)
	allocs.Add(mem0)
	h0 := &sliceHeader{
		Data: mem0,
		Cap:  len0,
		Len:  len0,
	}
	v0 := *(*[]C.struct_nk_user_font)(unsafe.Pointer(h0))
	for i0 := range x {
		allocs0 := new(cgoAllocMap)
		v0[i0], allocs0 = x[i0].PassValue()
		allocs.Borrow(allocs0)
	}
	h := (*sliceHeader)(unsafe.Pointer(&v0))
	unpacked = (*C.struct_nk_user_font)(h.Data)
	return
}

// packSSUserFont reads sliced Go data structure out from plain C format.
func packSSUserFont(v [][]UserFont, ptr0 **C.struct_nk_user_font) {
	const m = 0x7fffffff
	for i0 := range v {
		ptr1 := (*(*[m / sizeOfPtr]*C.struct_nk_user_font)(unsafe.Pointer(ptr0)))[i0]
		for i1 := range v[i0] {
			ptr2 := (*(*[m / sizeOfStructNkUserFontValue]C.struct_nk_user_font)(unsafe.Pointer(ptr1)))[i1]
			v[i0][i1] = *NewUserFontRef(unsafe.Pointer(&ptr2))
		}
	}
}

// packSUserFont reads sliced Go data structure out from plain C format.
func packSUserFont(v []UserFont, ptr0 *C.struct_nk_user_font) {
	const m = 0x7fffffff
	for i0 := range v {
		ptr1 := (*(*[m / sizeOfStructNkUserFontValue]C.struct_nk_user_font)(unsafe.Pointer(ptr0)))[i0]
		v[i0] = *NewUserFontRef(unsafe.Pointer(&ptr1))
	}
}

// Ref returns the underlying reference to C object or nil if struct is nil.
func (x *ConfigStackUserFontElement) Ref() *C.struct_nk_config_stack_user_font_element {
	if x == nil {
		return nil
	}
	return x.ref5572630c
}

// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free.
// Does nothing if struct is nil or has no allocation map.
func (x *ConfigStackUserFontElement) Free() {
	if x != nil && x.allocs5572630c != nil {
		x.allocs5572630c.(*cgoAllocMap).Free()
		x.ref5572630c = nil
	}
}

// NewConfigStackUserFontElementRef creates a new wrapper struct with underlying reference set to the original C object.
// Returns nil if the provided pointer to C object is nil too.
func NewConfigStackUserFontElementRef(ref unsafe.Pointer) *ConfigStackUserFontElement {
	if ref == nil {
		return nil
	}
	obj := new(ConfigStackUserFontElement)
	obj.ref5572630c = (*C.struct_nk_config_stack_user_font_element)(unsafe.Pointer(ref))
	return obj
}

// PassRef returns the underlying C object, otherwise it will allocate one and set its values
// from this wrapping struct, counting allocations into an allocation map.
func (x *ConfigStackUserFontElement) PassRef() (*C.struct_nk_config_stack_user_font_element, *cgoAllocMap) {
	if x == nil {
		return nil, nil
	} else if x.ref5572630c != nil {
		return x.ref5572630c, nil
	}
	mem5572630c := allocStructNkConfigStackUserFontElementMemory(1)
	ref5572630c := (*C.struct_nk_config_stack_user_font_element)(mem5572630c)
	allocs5572630c := new(cgoAllocMap)
	allocs5572630c.Add(mem5572630c)

	var caddress_allocs *cgoAllocMap
	ref5572630c.address, caddress_allocs = unpackSSUserFont(x.Address)
	allocs5572630c.Borrow(caddress_allocs)

	var cold_value_allocs *cgoAllocMap
	ref5572630c.old_value, cold_value_allocs = unpackSUserFont(x.OldValue)
	allocs5572630c.Borrow(cold_value_allocs)

	x.ref5572630c = ref5572630c
	x.allocs5572630c = allocs5572630c
	return ref5572630c, allocs5572630c

}

// PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (x ConfigStackUserFontElement) PassValue() (C.struct_nk_config_stack_user_font_element, *cgoAllocMap) {
	if x.ref5572630c != nil {
		return *x.ref5572630c, nil
	}
	ref, allocs := x.PassRef()
	return *ref, allocs
}

// Deref uses the underlying reference to C object and fills the wrapping struct with values.
// Do not forget to call this method whether you get a struct for C object and want to read its values.
func (x *ConfigStackUserFontElement) Deref() {
	if x.ref5572630c == nil {
		return
	}
	packSSUserFont(x.Address, x.ref5572630c.address)
	packSUserFont(x.OldValue, x.ref5572630c.old_value)
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackVec2) Ref() *C.struct_nk_config_stack_vec2 {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_vec2)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackVec2) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackVec2Ref converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackVec2Ref(ref unsafe.Pointer) *ConfigStackVec2 {
	return (*ConfigStackVec2)(ref)
}

// NewConfigStackVec2 allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackVec2() *ConfigStackVec2 {
	return (*ConfigStackVec2)(allocStructNkConfigStackVec2Memory(1))
}

// allocStructNkConfigStackVec2Memory allocates memory for type C.struct_nk_config_stack_vec2 in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackVec2Memory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackVec2Value))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackVec2Value = unsafe.Sizeof([1]C.struct_nk_config_stack_vec2{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackVec2) PassRef() *C.struct_nk_config_stack_vec2 {
	if x == nil {
		x = (*ConfigStackVec2)(allocStructNkConfigStackVec2Memory(1))
	}
	return (*C.struct_nk_config_stack_vec2)(unsafe.Pointer(x))
}

// GetHead returns a reference to C object within a struct
func (s *ConfigStackVec2) GetHead() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.head))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *ConfigStackVec2) GetElements() [16]ConfigStackVec2Element {
	var ret [16]ConfigStackVec2Element
	ret = *(*[16]ConfigStackVec2Element)(unsafe.Pointer(&s.elements))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigStackVec2Element) Ref() *C.struct_nk_config_stack_vec2_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_config_stack_vec2_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigStackVec2Element) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigStackVec2ElementRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigStackVec2ElementRef(ref unsafe.Pointer) *ConfigStackVec2Element {
	return (*ConfigStackVec2Element)(ref)
}

// NewConfigStackVec2Element allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigStackVec2Element() *ConfigStackVec2Element {
	return (*ConfigStackVec2Element)(allocStructNkConfigStackVec2ElementMemory(1))
}

// allocStructNkConfigStackVec2ElementMemory allocates memory for type C.struct_nk_config_stack_vec2_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigStackVec2ElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigStackVec2ElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigStackVec2ElementValue = unsafe.Sizeof([1]C.struct_nk_config_stack_vec2_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigStackVec2Element) PassRef() *C.struct_nk_config_stack_vec2_element {
	if x == nil {
		x = (*ConfigStackVec2Element)(allocStructNkConfigStackVec2ElementMemory(1))
	}
	return (*C.struct_nk_config_stack_vec2_element)(unsafe.Pointer(x))
}

// GetAddress returns a reference to C object within a struct
func (s *ConfigStackVec2Element) GetAddress() **Vec2 {
	var ret **Vec2
	ret = (**Vec2)(unsafe.Pointer(&s.address))
	return ret
}

// GetOldValue returns a reference to C object within a struct
func (s *ConfigStackVec2Element) GetOldValue() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.old_value))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ConfigurationStacks) Ref() *C.struct_nk_configuration_stacks {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_configuration_stacks)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ConfigurationStacks) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewConfigurationStacksRef converts the C object reference into a raw struct reference without wrapping.
func NewConfigurationStacksRef(ref unsafe.Pointer) *ConfigurationStacks {
	return (*ConfigurationStacks)(ref)
}

// NewConfigurationStacks allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewConfigurationStacks() *ConfigurationStacks {
	return (*ConfigurationStacks)(allocStructNkConfigurationStacksMemory(1))
}

// allocStructNkConfigurationStacksMemory allocates memory for type C.struct_nk_configuration_stacks in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConfigurationStacksMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConfigurationStacksValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConfigurationStacksValue = unsafe.Sizeof([1]C.struct_nk_configuration_stacks{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ConfigurationStacks) PassRef() *C.struct_nk_configuration_stacks {
	if x == nil {
		x = (*ConfigurationStacks)(allocStructNkConfigurationStacksMemory(1))
	}
	return (*C.struct_nk_configuration_stacks)(unsafe.Pointer(x))
}

// GetStyleItems returns a reference to C object within a struct
func (s *ConfigurationStacks) GetStyleItems() *ConfigStackStyleItem {
	var ret *ConfigStackStyleItem
	ret = (*ConfigStackStyleItem)(unsafe.Pointer(&s.style_items))
	return ret
}

// GetFloats returns a reference to C object within a struct
func (s *ConfigurationStacks) GetFloats() *ConfigStackFloat {
	var ret *ConfigStackFloat
	ret = (*ConfigStackFloat)(unsafe.Pointer(&s.floats))
	return ret
}

// GetVectors returns a reference to C object within a struct
func (s *ConfigurationStacks) GetVectors() *ConfigStackVec2 {
	var ret *ConfigStackVec2
	ret = (*ConfigStackVec2)(unsafe.Pointer(&s.vectors))
	return ret
}

// GetFlags returns a reference to C object within a struct
func (s *ConfigurationStacks) GetFlags() *ConfigStackFlags {
	var ret *ConfigStackFlags
	ret = (*ConfigStackFlags)(unsafe.Pointer(&s.flags))
	return ret
}

// GetColors returns a reference to C object within a struct
func (s *ConfigurationStacks) GetColors() *ConfigStackColor {
	var ret *ConfigStackColor
	ret = (*ConfigStackColor)(unsafe.Pointer(&s.colors))
	return ret
}

// GetFonts returns a reference to C object within a struct
func (s *ConfigurationStacks) GetFonts() *ConfigStackUserFont {
	var ret *ConfigStackUserFont
	ret = NewConfigStackUserFontRef(unsafe.Pointer(&s.fonts))
	return ret
}

// GetButtonBehaviors returns a reference to C object within a struct
func (s *ConfigurationStacks) GetButtonBehaviors() *ConfigStackButtonBehavior {
	var ret *ConfigStackButtonBehavior
	ret = (*ConfigStackButtonBehavior)(unsafe.Pointer(&s.button_behaviors))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Context) Ref() *C.struct_nk_context {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_context)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Context) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewContextRef converts the C object reference into a raw struct reference without wrapping.
func NewContextRef(ref unsafe.Pointer) *Context {
	return (*Context)(ref)
}

// NewContext allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewContext() *Context {
	return (*Context)(allocStructNkContextMemory(1))
}

// allocStructNkContextMemory allocates memory for type C.struct_nk_context in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkContextMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkContextValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkContextValue = unsafe.Sizeof([1]C.struct_nk_context{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Context) PassRef() *C.struct_nk_context {
	if x == nil {
		x = (*Context)(allocStructNkContextMemory(1))
	}
	return (*C.struct_nk_context)(unsafe.Pointer(x))
}

// GetInput returns a reference to C object within a struct
func (s *Context) GetInput() *Input {
	var ret *Input
	ret = (*Input)(unsafe.Pointer(&s.input))
	return ret
}

// GetStyle returns a reference to C object within a struct
func (s *Context) GetStyle() *Style {
	var ret *Style
	ret = (*Style)(unsafe.Pointer(&s.style))
	return ret
}

// GetMemory returns a reference to C object within a struct
func (s *Context) GetMemory() *Buffer {
	var ret *Buffer
	ret = (*Buffer)(unsafe.Pointer(&s.memory))
	return ret
}

// GetClip returns a reference to C object within a struct
func (s *Context) GetClip() *Clipboard {
	var ret *Clipboard
	ret = (*Clipboard)(unsafe.Pointer(&s.clip))
	return ret
}

// GetLastWidgetState returns a reference to C object within a struct
func (s *Context) GetLastWidgetState() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.last_widget_state))
	return ret
}

// GetButtonBehavior returns a reference to C object within a struct
func (s *Context) GetButtonBehavior() *ButtonBehavior {
	var ret *ButtonBehavior
	ret = (*ButtonBehavior)(unsafe.Pointer(&s.button_behavior))
	return ret
}

// GetStacks returns a reference to C object within a struct
func (s *Context) GetStacks() *ConfigurationStacks {
	var ret *ConfigurationStacks
	ret = (*ConfigurationStacks)(unsafe.Pointer(&s.stacks))
	return ret
}

// GetDeltaTimeSeconds returns a reference to C object within a struct
func (s *Context) GetDeltaTimeSeconds() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.delta_time_seconds))
	return ret
}

// GetDrawList returns a reference to C object within a struct
func (s *Context) GetDrawList() *DrawList {
	var ret *DrawList
	ret = (*DrawList)(unsafe.Pointer(&s.draw_list))
	return ret
}

// GetTextEdit returns a reference to C object within a struct
func (s *Context) GetTextEdit() *TextEdit {
	var ret *TextEdit
	ret = (*TextEdit)(unsafe.Pointer(&s.text_edit))
	return ret
}

// GetOverlay returns a reference to C object within a struct
func (s *Context) GetOverlay() *CommandBuffer {
	var ret *CommandBuffer
	ret = (*CommandBuffer)(unsafe.Pointer(&s.overlay))
	return ret
}

// GetBuild returns a reference to C object within a struct
func (s *Context) GetBuild() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.build))
	return ret
}

// GetUsePool returns a reference to C object within a struct
func (s *Context) GetUsePool() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.use_pool))
	return ret
}

// GetPool returns a reference to C object within a struct
func (s *Context) GetPool() *Pool {
	var ret *Pool
	ret = (*Pool)(unsafe.Pointer(&s.pool))
	return ret
}

// GetBegin returns a reference to C object within a struct
func (s *Context) GetBegin() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.begin))
	return ret
}

// GetEnd returns a reference to C object within a struct
func (s *Context) GetEnd() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.end))
	return ret
}

// GetActive returns a reference to C object within a struct
func (s *Context) GetActive() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.active))
	return ret
}

// GetCurrent returns a reference to C object within a struct
func (s *Context) GetCurrent() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.current))
	return ret
}

// GetFreelist returns a reference to C object within a struct
func (s *Context) GetFreelist() **PageElement {
	var ret **PageElement
	ret = (**PageElement)(unsafe.Pointer(&s.freelist))
	return ret
}

// GetCount returns a reference to C object within a struct
func (s *Context) GetCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.count))
	return ret
}

// GetSeq returns a reference to C object within a struct
func (s *Context) GetSeq() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.seq))
	return ret
}

// allocStructNkConvertConfigMemory allocates memory for type C.struct_nk_convert_config in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkConvertConfigMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkConvertConfigValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkConvertConfigValue = unsafe.Sizeof([1]C.struct_nk_convert_config{})

// allocStructNkDrawVertexLayoutElementMemory allocates memory for type C.struct_nk_draw_vertex_layout_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkDrawVertexLayoutElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkDrawVertexLayoutElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkDrawVertexLayoutElementValue = unsafe.Sizeof([1]C.struct_nk_draw_vertex_layout_element{})

// unpackSDrawVertexLayoutElement transforms a sliced Go data structure into plain C format.
func unpackSDrawVertexLayoutElement(x []DrawVertexLayoutElement) (unpacked *C.struct_nk_draw_vertex_layout_element, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	allocs = new(cgoAllocMap)
	defer runtime.SetFinalizer(&unpacked, func(**C.struct_nk_draw_vertex_layout_element) {
		go allocs.Free()
	})

	len0 := len(x)
	mem0 := allocStructNkDrawVertexLayoutElementMemory(len0)
	allocs.Add(mem0)
	h0 := &sliceHeader{
		Data: mem0,
		Cap:  len0,
		Len:  len0,
	}
	v0 := *(*[]C.struct_nk_draw_vertex_layout_element)(unsafe.Pointer(h0))
	for i0 := range x {
		allocs0 := new(cgoAllocMap)
		v0[i0], allocs0 = x[i0].PassValue()
		allocs.Borrow(allocs0)
	}
	h := (*sliceHeader)(unsafe.Pointer(&v0))
	unpacked = (*C.struct_nk_draw_vertex_layout_element)(h.Data)
	return
}

// packSDrawVertexLayoutElement reads sliced Go data structure out from plain C format.
func packSDrawVertexLayoutElement(v []DrawVertexLayoutElement, ptr0 *C.struct_nk_draw_vertex_layout_element) {
	const m = 0x7fffffff
	for i0 := range v {
		ptr1 := (*(*[m / sizeOfStructNkDrawVertexLayoutElementValue]C.struct_nk_draw_vertex_layout_element)(unsafe.Pointer(ptr0)))[i0]
		v[i0] = *NewDrawVertexLayoutElementRef(unsafe.Pointer(&ptr1))
	}
}

// Ref returns the underlying reference to C object or nil if struct is nil.
func (x *ConvertConfig) Ref() *C.struct_nk_convert_config {
	if x == nil {
		return nil
	}
	return x.ref82bf4c25
}

// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free.
// Does nothing if struct is nil or has no allocation map.
func (x *ConvertConfig) Free() {
	if x != nil && x.allocs82bf4c25 != nil {
		x.allocs82bf4c25.(*cgoAllocMap).Free()
		x.ref82bf4c25 = nil
	}
}

// NewConvertConfigRef creates a new wrapper struct with underlying reference set to the original C object.
// Returns nil if the provided pointer to C object is nil too.
func NewConvertConfigRef(ref unsafe.Pointer) *ConvertConfig {
	if ref == nil {
		return nil
	}
	obj := new(ConvertConfig)
	obj.ref82bf4c25 = (*C.struct_nk_convert_config)(unsafe.Pointer(ref))
	return obj
}

// PassRef returns the underlying C object, otherwise it will allocate one and set its values
// from this wrapping struct, counting allocations into an allocation map.
func (x *ConvertConfig) PassRef() (*C.struct_nk_convert_config, *cgoAllocMap) {
	if x == nil {
		return nil, nil
	} else if x.ref82bf4c25 != nil {
		return x.ref82bf4c25, nil
	}
	mem82bf4c25 := allocStructNkConvertConfigMemory(1)
	ref82bf4c25 := (*C.struct_nk_convert_config)(mem82bf4c25)
	allocs82bf4c25 := new(cgoAllocMap)
	allocs82bf4c25.Add(mem82bf4c25)

	var cglobal_alpha_allocs *cgoAllocMap
	ref82bf4c25.global_alpha, cglobal_alpha_allocs = (C.float)(x.GlobalAlpha), cgoAllocsUnknown
	allocs82bf4c25.Borrow(cglobal_alpha_allocs)

	var cline_AA_allocs *cgoAllocMap
	ref82bf4c25.line_AA, cline_AA_allocs = (C.enum_nk_anti_aliasing)(x.LineAa), cgoAllocsUnknown
	allocs82bf4c25.Borrow(cline_AA_allocs)

	var cshape_AA_allocs *cgoAllocMap
	ref82bf4c25.shape_AA, cshape_AA_allocs = (C.enum_nk_anti_aliasing)(x.ShapeAa), cgoAllocsUnknown
	allocs82bf4c25.Borrow(cshape_AA_allocs)

	var ccircle_segment_count_allocs *cgoAllocMap
	ref82bf4c25.circle_segment_count, ccircle_segment_count_allocs = (C.uint)(x.CircleSegmentCount), cgoAllocsUnknown
	allocs82bf4c25.Borrow(ccircle_segment_count_allocs)

	var carc_segment_count_allocs *cgoAllocMap
	ref82bf4c25.arc_segment_count, carc_segment_count_allocs = (C.uint)(x.ArcSegmentCount), cgoAllocsUnknown
	allocs82bf4c25.Borrow(carc_segment_count_allocs)

	var ccurve_segment_count_allocs *cgoAllocMap
	ref82bf4c25.curve_segment_count, ccurve_segment_count_allocs = (C.uint)(x.CurveSegmentCount), cgoAllocsUnknown
	allocs82bf4c25.Borrow(ccurve_segment_count_allocs)

	var cnull_allocs *cgoAllocMap
	ref82bf4c25.null, cnull_allocs = *(*C.struct_nk_draw_null_texture)(unsafe.Pointer(&x.Null)), cgoAllocsUnknown
	allocs82bf4c25.Borrow(cnull_allocs)

	var cvertex_layout_allocs *cgoAllocMap
	ref82bf4c25.vertex_layout, cvertex_layout_allocs = unpackSDrawVertexLayoutElement(x.VertexLayout)
	allocs82bf4c25.Borrow(cvertex_layout_allocs)

	var cvertex_size_allocs *cgoAllocMap
	ref82bf4c25.vertex_size, cvertex_size_allocs = (C.nk_size)(x.VertexSize), cgoAllocsUnknown
	allocs82bf4c25.Borrow(cvertex_size_allocs)

	var cvertex_alignment_allocs *cgoAllocMap
	ref82bf4c25.vertex_alignment, cvertex_alignment_allocs = (C.nk_size)(x.VertexAlignment), cgoAllocsUnknown
	allocs82bf4c25.Borrow(cvertex_alignment_allocs)

	x.ref82bf4c25 = ref82bf4c25
	x.allocs82bf4c25 = allocs82bf4c25
	return ref82bf4c25, allocs82bf4c25

}

// PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (x ConvertConfig) PassValue() (C.struct_nk_convert_config, *cgoAllocMap) {
	if x.ref82bf4c25 != nil {
		return *x.ref82bf4c25, nil
	}
	ref, allocs := x.PassRef()
	return *ref, allocs
}

// Deref uses the underlying reference to C object and fills the wrapping struct with values.
// Do not forget to call this method whether you get a struct for C object and want to read its values.
func (x *ConvertConfig) Deref() {
	if x.ref82bf4c25 == nil {
		return
	}
	x.GlobalAlpha = (float32)(x.ref82bf4c25.global_alpha)
	x.LineAa = (AntiAliasing)(x.ref82bf4c25.line_AA)
	x.ShapeAa = (AntiAliasing)(x.ref82bf4c25.shape_AA)
	x.CircleSegmentCount = (uint32)(x.ref82bf4c25.circle_segment_count)
	x.ArcSegmentCount = (uint32)(x.ref82bf4c25.arc_segment_count)
	x.CurveSegmentCount = (uint32)(x.ref82bf4c25.curve_segment_count)
	x.Null = *(*DrawNullTexture)(unsafe.Pointer(&x.ref82bf4c25.null))
	packSDrawVertexLayoutElement(x.VertexLayout, x.ref82bf4c25.vertex_layout)
	x.VertexSize = (Size)(x.ref82bf4c25.vertex_size)
	x.VertexAlignment = (Size)(x.ref82bf4c25.vertex_alignment)
}

// Ref returns a reference to C object as it is.
func (x *Cursor) Ref() *C.struct_nk_cursor {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_cursor)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Cursor) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewCursorRef converts the C object reference into a raw struct reference without wrapping.
func NewCursorRef(ref unsafe.Pointer) *Cursor {
	return (*Cursor)(ref)
}

// NewCursor allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewCursor() *Cursor {
	return (*Cursor)(allocStructNkCursorMemory(1))
}

// allocStructNkCursorMemory allocates memory for type C.struct_nk_cursor in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkCursorMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkCursorValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkCursorValue = unsafe.Sizeof([1]C.struct_nk_cursor{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Cursor) PassRef() *C.struct_nk_cursor {
	if x == nil {
		x = (*Cursor)(allocStructNkCursorMemory(1))
	}
	return (*C.struct_nk_cursor)(unsafe.Pointer(x))
}

// GetImg returns a reference to C object within a struct
func (s *Cursor) GetImg() *Image {
	var ret *Image
	ret = (*Image)(unsafe.Pointer(&s.img))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *Cursor) GetSize() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.size))
	return ret
}

// GetOffset returns a reference to C object within a struct
func (s *Cursor) GetOffset() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.offset))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *DrawCommand) Ref() *C.struct_nk_draw_command {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_draw_command)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *DrawCommand) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewDrawCommandRef converts the C object reference into a raw struct reference without wrapping.
func NewDrawCommandRef(ref unsafe.Pointer) *DrawCommand {
	return (*DrawCommand)(ref)
}

// NewDrawCommand allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewDrawCommand() *DrawCommand {
	return (*DrawCommand)(allocStructNkDrawCommandMemory(1))
}

// allocStructNkDrawCommandMemory allocates memory for type C.struct_nk_draw_command in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkDrawCommandMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkDrawCommandValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkDrawCommandValue = unsafe.Sizeof([1]C.struct_nk_draw_command{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *DrawCommand) PassRef() *C.struct_nk_draw_command {
	if x == nil {
		x = (*DrawCommand)(allocStructNkDrawCommandMemory(1))
	}
	return (*C.struct_nk_draw_command)(unsafe.Pointer(x))
}

// GetElemCount returns a reference to C object within a struct
func (s *DrawCommand) GetElemCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.elem_count))
	return ret
}

// GetClipRect returns a reference to C object within a struct
func (s *DrawCommand) GetClipRect() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.clip_rect))
	return ret
}

// GetTexture returns a reference to C object within a struct
func (s *DrawCommand) GetTexture() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.texture))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *DrawList) Ref() *C.struct_nk_draw_list {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_draw_list)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *DrawList) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewDrawListRef converts the C object reference into a raw struct reference without wrapping.
func NewDrawListRef(ref unsafe.Pointer) *DrawList {
	return (*DrawList)(ref)
}

// NewDrawList allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewDrawList() *DrawList {
	return (*DrawList)(allocStructNkDrawListMemory(1))
}

// allocStructNkDrawListMemory allocates memory for type C.struct_nk_draw_list in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkDrawListMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkDrawListValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkDrawListValue = unsafe.Sizeof([1]C.struct_nk_draw_list{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *DrawList) PassRef() *C.struct_nk_draw_list {
	if x == nil {
		x = (*DrawList)(allocStructNkDrawListMemory(1))
	}
	return (*C.struct_nk_draw_list)(unsafe.Pointer(x))
}

// GetClipRect returns a reference to C object within a struct
func (s *DrawList) GetClipRect() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.clip_rect))
	return ret
}

// GetCircleVtx returns a reference to C object within a struct
func (s *DrawList) GetCircleVtx() [12]Vec2 {
	var ret [12]Vec2
	ret = *(*[12]Vec2)(unsafe.Pointer(&s.circle_vtx))
	return ret
}

// GetConfig returns a reference to C object within a struct
func (s *DrawList) GetConfig() *ConvertConfig {
	var ret *ConvertConfig
	ret = NewConvertConfigRef(unsafe.Pointer(&s.config))
	return ret
}

// GetBuffer returns a reference to C object within a struct
func (s *DrawList) GetBuffer() **Buffer {
	var ret **Buffer
	ret = (**Buffer)(unsafe.Pointer(&s.buffer))
	return ret
}

// GetVertices returns a reference to C object within a struct
func (s *DrawList) GetVertices() **Buffer {
	var ret **Buffer
	ret = (**Buffer)(unsafe.Pointer(&s.vertices))
	return ret
}

// GetElements returns a reference to C object within a struct
func (s *DrawList) GetElements() **Buffer {
	var ret **Buffer
	ret = (**Buffer)(unsafe.Pointer(&s.elements))
	return ret
}

// GetElementCount returns a reference to C object within a struct
func (s *DrawList) GetElementCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.element_count))
	return ret
}

// GetVertexCount returns a reference to C object within a struct
func (s *DrawList) GetVertexCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.vertex_count))
	return ret
}

// GetCmdCount returns a reference to C object within a struct
func (s *DrawList) GetCmdCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.cmd_count))
	return ret
}

// GetCmdOffset returns a reference to C object within a struct
func (s *DrawList) GetCmdOffset() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.cmd_offset))
	return ret
}

// GetPathCount returns a reference to C object within a struct
func (s *DrawList) GetPathCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.path_count))
	return ret
}

// GetPathOffset returns a reference to C object within a struct
func (s *DrawList) GetPathOffset() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.path_offset))
	return ret
}

// GetLineAa returns a reference to C object within a struct
func (s *DrawList) GetLineAa() *AntiAliasing {
	var ret *AntiAliasing
	ret = (*AntiAliasing)(unsafe.Pointer(&s.line_AA))
	return ret
}

// GetShapeAa returns a reference to C object within a struct
func (s *DrawList) GetShapeAa() *AntiAliasing {
	var ret *AntiAliasing
	ret = (*AntiAliasing)(unsafe.Pointer(&s.shape_AA))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *DrawNullTexture) Ref() *C.struct_nk_draw_null_texture {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_draw_null_texture)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *DrawNullTexture) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewDrawNullTextureRef converts the C object reference into a raw struct reference without wrapping.
func NewDrawNullTextureRef(ref unsafe.Pointer) *DrawNullTexture {
	return (*DrawNullTexture)(ref)
}

// NewDrawNullTexture allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewDrawNullTexture() *DrawNullTexture {
	return (*DrawNullTexture)(allocStructNkDrawNullTextureMemory(1))
}

// allocStructNkDrawNullTextureMemory allocates memory for type C.struct_nk_draw_null_texture in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkDrawNullTextureMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkDrawNullTextureValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkDrawNullTextureValue = unsafe.Sizeof([1]C.struct_nk_draw_null_texture{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *DrawNullTexture) PassRef() *C.struct_nk_draw_null_texture {
	if x == nil {
		x = (*DrawNullTexture)(allocStructNkDrawNullTextureMemory(1))
	}
	return (*C.struct_nk_draw_null_texture)(unsafe.Pointer(x))
}

// GetTexture returns a reference to C object within a struct
func (s *DrawNullTexture) GetTexture() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.texture))
	return ret
}

// GetUv returns a reference to C object within a struct
func (s *DrawNullTexture) GetUv() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.uv))
	return ret
}

// Ref returns the underlying reference to C object or nil if struct is nil.
func (x *DrawVertexLayoutElement) Ref() *C.struct_nk_draw_vertex_layout_element {
	if x == nil {
		return nil
	}
	return x.refeb0614d6
}

// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free.
// Does nothing if struct is nil or has no allocation map.
func (x *DrawVertexLayoutElement) Free() {
	if x != nil && x.allocseb0614d6 != nil {
		x.allocseb0614d6.(*cgoAllocMap).Free()
		x.refeb0614d6 = nil
	}
}

// NewDrawVertexLayoutElementRef creates a new wrapper struct with underlying reference set to the original C object.
// Returns nil if the provided pointer to C object is nil too.
func NewDrawVertexLayoutElementRef(ref unsafe.Pointer) *DrawVertexLayoutElement {
	if ref == nil {
		return nil
	}
	obj := new(DrawVertexLayoutElement)
	obj.refeb0614d6 = (*C.struct_nk_draw_vertex_layout_element)(unsafe.Pointer(ref))
	return obj
}

// PassRef returns the underlying C object, otherwise it will allocate one and set its values
// from this wrapping struct, counting allocations into an allocation map.
func (x *DrawVertexLayoutElement) PassRef() (*C.struct_nk_draw_vertex_layout_element, *cgoAllocMap) {
	if x == nil {
		return nil, nil
	} else if x.refeb0614d6 != nil {
		return x.refeb0614d6, nil
	}
	memeb0614d6 := allocStructNkDrawVertexLayoutElementMemory(1)
	refeb0614d6 := (*C.struct_nk_draw_vertex_layout_element)(memeb0614d6)
	allocseb0614d6 := new(cgoAllocMap)
	allocseb0614d6.Add(memeb0614d6)

	var cattribute_allocs *cgoAllocMap
	refeb0614d6.attribute, cattribute_allocs = (C.enum_nk_draw_vertex_layout_attribute)(x.Attribute), cgoAllocsUnknown
	allocseb0614d6.Borrow(cattribute_allocs)

	var cformat_allocs *cgoAllocMap
	refeb0614d6.format, cformat_allocs = (C.enum_nk_draw_vertex_layout_format)(x.Format), cgoAllocsUnknown
	allocseb0614d6.Borrow(cformat_allocs)

	var coffset_allocs *cgoAllocMap
	refeb0614d6.offset, coffset_allocs = (C.nk_size)(x.Offset), cgoAllocsUnknown
	allocseb0614d6.Borrow(coffset_allocs)

	x.refeb0614d6 = refeb0614d6
	x.allocseb0614d6 = allocseb0614d6
	return refeb0614d6, allocseb0614d6

}

// PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (x DrawVertexLayoutElement) PassValue() (C.struct_nk_draw_vertex_layout_element, *cgoAllocMap) {
	if x.refeb0614d6 != nil {
		return *x.refeb0614d6, nil
	}
	ref, allocs := x.PassRef()
	return *ref, allocs
}

// Deref uses the underlying reference to C object and fills the wrapping struct with values.
// Do not forget to call this method whether you get a struct for C object and want to read its values.
func (x *DrawVertexLayoutElement) Deref() {
	if x.refeb0614d6 == nil {
		return
	}
	x.Attribute = (DrawVertexLayoutAttribute)(x.refeb0614d6.attribute)
	x.Format = (DrawVertexLayoutFormat)(x.refeb0614d6.format)
	x.Offset = (Size)(x.refeb0614d6.offset)
}

// Ref returns a reference to C object as it is.
func (x *EditState) Ref() *C.struct_nk_edit_state {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_edit_state)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *EditState) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewEditStateRef converts the C object reference into a raw struct reference without wrapping.
func NewEditStateRef(ref unsafe.Pointer) *EditState {
	return (*EditState)(ref)
}

// NewEditState allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewEditState() *EditState {
	return (*EditState)(allocStructNkEditStateMemory(1))
}

// allocStructNkEditStateMemory allocates memory for type C.struct_nk_edit_state in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkEditStateMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkEditStateValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkEditStateValue = unsafe.Sizeof([1]C.struct_nk_edit_state{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *EditState) PassRef() *C.struct_nk_edit_state {
	if x == nil {
		x = (*EditState)(allocStructNkEditStateMemory(1))
	}
	return (*C.struct_nk_edit_state)(unsafe.Pointer(x))
}

// GetName returns a reference to C object within a struct
func (s *EditState) GetName() *Hash {
	var ret *Hash
	ret = (*Hash)(unsafe.Pointer(&s.name))
	return ret
}

// GetSeq returns a reference to C object within a struct
func (s *EditState) GetSeq() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.seq))
	return ret
}

// GetOld returns a reference to C object within a struct
func (s *EditState) GetOld() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.old))
	return ret
}

// GetActive returns a reference to C object within a struct
func (s *EditState) GetActive() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.active))
	return ret
}

// GetPrev returns a reference to C object within a struct
func (s *EditState) GetPrev() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.prev))
	return ret
}

// GetCursor returns a reference to C object within a struct
func (s *EditState) GetCursor() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.cursor))
	return ret
}

// GetSelStart returns a reference to C object within a struct
func (s *EditState) GetSelStart() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.sel_start))
	return ret
}

// GetSelEnd returns a reference to C object within a struct
func (s *EditState) GetSelEnd() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.sel_end))
	return ret
}

// GetScrollbar returns a reference to C object within a struct
func (s *EditState) GetScrollbar() *Scroll {
	var ret *Scroll
	ret = (*Scroll)(unsafe.Pointer(&s.scrollbar))
	return ret
}

// GetMode returns a reference to C object within a struct
func (s *EditState) GetMode() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.mode))
	return ret
}

// GetSingleLine returns a reference to C object within a struct
func (s *EditState) GetSingleLine() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.single_line))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Font) Ref() *C.struct_nk_font {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_font)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Font) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewFontRef converts the C object reference into a raw struct reference without wrapping.
func NewFontRef(ref unsafe.Pointer) *Font {
	return (*Font)(ref)
}

// NewFont allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewFont() *Font {
	return (*Font)(allocStructNkFontMemory(1))
}

// allocStructNkFontMemory allocates memory for type C.struct_nk_font in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkFontMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkFontValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkFontValue = unsafe.Sizeof([1]C.struct_nk_font{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Font) PassRef() *C.struct_nk_font {
	if x == nil {
		x = (*Font)(allocStructNkFontMemory(1))
	}
	return (*C.struct_nk_font)(unsafe.Pointer(x))
}

// GetNext returns a reference to C object within a struct
func (s *Font) GetNext() **Font {
	var ret **Font
	ret = (**Font)(unsafe.Pointer(&s.next))
	return ret
}

// GetHandle returns a reference to C object within a struct
func (s *Font) GetHandle() *UserFont {
	var ret *UserFont
	ret = NewUserFontRef(unsafe.Pointer(&s.handle))
	return ret
}

// GetInfo returns a reference to C object within a struct
func (s *Font) GetInfo() *BakedFont {
	var ret *BakedFont
	ret = (*BakedFont)(unsafe.Pointer(&s.info))
	return ret
}

// GetScale returns a reference to C object within a struct
func (s *Font) GetScale() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.scale))
	return ret
}

// GetGlyphs returns a reference to C object within a struct
func (s *Font) GetGlyphs() **FontGlyph {
	var ret **FontGlyph
	ret = (**FontGlyph)(unsafe.Pointer(&s.glyphs))
	return ret
}

// GetFallback returns a reference to C object within a struct
func (s *Font) GetFallback() **FontGlyph {
	var ret **FontGlyph
	ret = (**FontGlyph)(unsafe.Pointer(&s.fallback))
	return ret
}

// GetFallbackCodepoint returns a reference to C object within a struct
func (s *Font) GetFallbackCodepoint() *Rune {
	var ret *Rune
	ret = (*Rune)(unsafe.Pointer(&s.fallback_codepoint))
	return ret
}

// GetTexture returns a reference to C object within a struct
func (s *Font) GetTexture() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.texture))
	return ret
}

// GetConfig returns a reference to C object within a struct
func (s *Font) GetConfig() **FontConfig {
	var ret **FontConfig
	ret = (**FontConfig)(unsafe.Pointer(&s.config))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *FontAtlas) Ref() *C.struct_nk_font_atlas {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_font_atlas)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *FontAtlas) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewFontAtlasRef converts the C object reference into a raw struct reference without wrapping.
func NewFontAtlasRef(ref unsafe.Pointer) *FontAtlas {
	return (*FontAtlas)(ref)
}

// NewFontAtlas allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewFontAtlas() *FontAtlas {
	return (*FontAtlas)(allocStructNkFontAtlasMemory(1))
}

// allocStructNkFontAtlasMemory allocates memory for type C.struct_nk_font_atlas in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkFontAtlasMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkFontAtlasValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkFontAtlasValue = unsafe.Sizeof([1]C.struct_nk_font_atlas{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *FontAtlas) PassRef() *C.struct_nk_font_atlas {
	if x == nil {
		x = (*FontAtlas)(allocStructNkFontAtlasMemory(1))
	}
	return (*C.struct_nk_font_atlas)(unsafe.Pointer(x))
}

// GetPixel returns a reference to C object within a struct
func (s *FontAtlas) GetPixel() *unsafe.Pointer {
	var ret *unsafe.Pointer
	ret = (*unsafe.Pointer)(unsafe.Pointer(&s.pixel))
	return ret
}

// GetTexWidth returns a reference to C object within a struct
func (s *FontAtlas) GetTexWidth() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.tex_width))
	return ret
}

// GetTexHeight returns a reference to C object within a struct
func (s *FontAtlas) GetTexHeight() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.tex_height))
	return ret
}

// GetPermanent returns a reference to C object within a struct
func (s *FontAtlas) GetPermanent() *Allocator {
	var ret *Allocator
	ret = (*Allocator)(unsafe.Pointer(&s.permanent))
	return ret
}

// GetTemporary returns a reference to C object within a struct
func (s *FontAtlas) GetTemporary() *Allocator {
	var ret *Allocator
	ret = (*Allocator)(unsafe.Pointer(&s.temporary))
	return ret
}

// GetCustom returns a reference to C object within a struct
func (s *FontAtlas) GetCustom() *Recti {
	var ret *Recti
	ret = (*Recti)(unsafe.Pointer(&s.custom))
	return ret
}

// GetCursors returns a reference to C object within a struct
func (s *FontAtlas) GetCursors() [7]Cursor {
	var ret [7]Cursor
	ret = *(*[7]Cursor)(unsafe.Pointer(&s.cursors))
	return ret
}

// GetGlyphCount returns a reference to C object within a struct
func (s *FontAtlas) GetGlyphCount() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.glyph_count))
	return ret
}

// GetGlyphs returns a reference to C object within a struct
func (s *FontAtlas) GetGlyphs() **FontGlyph {
	var ret **FontGlyph
	ret = (**FontGlyph)(unsafe.Pointer(&s.glyphs))
	return ret
}

// GetDefaultFont returns a reference to C object within a struct
func (s *FontAtlas) GetDefaultFont() **Font {
	var ret **Font
	ret = (**Font)(unsafe.Pointer(&s.default_font))
	return ret
}

// GetFonts returns a reference to C object within a struct
func (s *FontAtlas) GetFonts() **Font {
	var ret **Font
	ret = (**Font)(unsafe.Pointer(&s.fonts))
	return ret
}

// GetConfig returns a reference to C object within a struct
func (s *FontAtlas) GetConfig() **FontConfig {
	var ret **FontConfig
	ret = (**FontConfig)(unsafe.Pointer(&s.config))
	return ret
}

// GetFontNum returns a reference to C object within a struct
func (s *FontAtlas) GetFontNum() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.font_num))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *FontConfig) Ref() *C.struct_nk_font_config {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_font_config)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *FontConfig) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewFontConfigRef converts the C object reference into a raw struct reference without wrapping.
func NewFontConfigRef(ref unsafe.Pointer) *FontConfig {
	return (*FontConfig)(ref)
}

// NewFontConfig allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewFontConfig() *FontConfig {
	return (*FontConfig)(allocStructNkFontConfigMemory(1))
}

// allocStructNkFontConfigMemory allocates memory for type C.struct_nk_font_config in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkFontConfigMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkFontConfigValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkFontConfigValue = unsafe.Sizeof([1]C.struct_nk_font_config{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *FontConfig) PassRef() *C.struct_nk_font_config {
	if x == nil {
		x = (*FontConfig)(allocStructNkFontConfigMemory(1))
	}
	return (*C.struct_nk_font_config)(unsafe.Pointer(x))
}

// GetNext returns a reference to C object within a struct
func (s *FontConfig) GetNext() **FontConfig {
	var ret **FontConfig
	ret = (**FontConfig)(unsafe.Pointer(&s.next))
	return ret
}

// GetTtfBlob returns a reference to C object within a struct
func (s *FontConfig) GetTtfBlob() *unsafe.Pointer {
	var ret *unsafe.Pointer
	ret = (*unsafe.Pointer)(unsafe.Pointer(&s.ttf_blob))
	return ret
}

// GetTtfSize returns a reference to C object within a struct
func (s *FontConfig) GetTtfSize() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.ttf_size))
	return ret
}

// GetTtfDataOwnedByAtlas returns a reference to C object within a struct
func (s *FontConfig) GetTtfDataOwnedByAtlas() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.ttf_data_owned_by_atlas))
	return ret
}

// GetMergeMode returns a reference to C object within a struct
func (s *FontConfig) GetMergeMode() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.merge_mode))
	return ret
}

// GetPixelSnap returns a reference to C object within a struct
func (s *FontConfig) GetPixelSnap() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.pixel_snap))
	return ret
}

// GetOversampleV returns a reference to C object within a struct
func (s *FontConfig) GetOversampleV() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.oversample_v))
	return ret
}

// GetOversampleH returns a reference to C object within a struct
func (s *FontConfig) GetOversampleH() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.oversample_h))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *FontConfig) GetPadding() [3]byte {
	var ret [3]byte
	ret = *(*[3]byte)(unsafe.Pointer(&s.padding))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *FontConfig) GetSize() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.size))
	return ret
}

// GetCoordType returns a reference to C object within a struct
func (s *FontConfig) GetCoordType() *FontCoordType {
	var ret *FontCoordType
	ret = (*FontCoordType)(unsafe.Pointer(&s.coord_type))
	return ret
}

// GetSpacing returns a reference to C object within a struct
func (s *FontConfig) GetSpacing() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.spacing))
	return ret
}

// GetRange returns a reference to C object within a struct
func (s *FontConfig) GetRange() **Rune {
	var ret **Rune
	ret = (**Rune)(unsafe.Pointer(&s._range))
	return ret
}

// GetFont returns a reference to C object within a struct
func (s *FontConfig) GetFont() **BakedFont {
	var ret **BakedFont
	ret = (**BakedFont)(unsafe.Pointer(&s.font))
	return ret
}

// GetFallbackGlyph returns a reference to C object within a struct
func (s *FontConfig) GetFallbackGlyph() *Rune {
	var ret *Rune
	ret = (*Rune)(unsafe.Pointer(&s.fallback_glyph))
	return ret
}

// GetN returns a reference to C object within a struct
func (s *FontConfig) GetN() **FontConfig {
	var ret **FontConfig
	ret = (**FontConfig)(unsafe.Pointer(&s.n))
	return ret
}

// GetP returns a reference to C object within a struct
func (s *FontConfig) GetP() **FontConfig {
	var ret **FontConfig
	ret = (**FontConfig)(unsafe.Pointer(&s.p))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *FontGlyph) Ref() *C.struct_nk_font_glyph {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_font_glyph)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *FontGlyph) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewFontGlyphRef converts the C object reference into a raw struct reference without wrapping.
func NewFontGlyphRef(ref unsafe.Pointer) *FontGlyph {
	return (*FontGlyph)(ref)
}

// NewFontGlyph allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewFontGlyph() *FontGlyph {
	return (*FontGlyph)(allocStructNkFontGlyphMemory(1))
}

// allocStructNkFontGlyphMemory allocates memory for type C.struct_nk_font_glyph in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkFontGlyphMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkFontGlyphValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkFontGlyphValue = unsafe.Sizeof([1]C.struct_nk_font_glyph{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *FontGlyph) PassRef() *C.struct_nk_font_glyph {
	if x == nil {
		x = (*FontGlyph)(allocStructNkFontGlyphMemory(1))
	}
	return (*C.struct_nk_font_glyph)(unsafe.Pointer(x))
}

// GetCodepoint returns a reference to C object within a struct
func (s *FontGlyph) GetCodepoint() *Rune {
	var ret *Rune
	ret = (*Rune)(unsafe.Pointer(&s.codepoint))
	return ret
}

// GetXadvance returns a reference to C object within a struct
func (s *FontGlyph) GetXadvance() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.xadvance))
	return ret
}

// GetX0 returns a reference to C object within a struct
func (s *FontGlyph) GetX0() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.x0))
	return ret
}

// GetY0 returns a reference to C object within a struct
func (s *FontGlyph) GetY0() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.y0))
	return ret
}

// GetX1 returns a reference to C object within a struct
func (s *FontGlyph) GetX1() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.x1))
	return ret
}

// GetY1 returns a reference to C object within a struct
func (s *FontGlyph) GetY1() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.y1))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *FontGlyph) GetW() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *FontGlyph) GetH() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.h))
	return ret
}

// GetU0 returns a reference to C object within a struct
func (s *FontGlyph) GetU0() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.u0))
	return ret
}

// GetV0 returns a reference to C object within a struct
func (s *FontGlyph) GetV0() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.v0))
	return ret
}

// GetU1 returns a reference to C object within a struct
func (s *FontGlyph) GetU1() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.u1))
	return ret
}

// GetV1 returns a reference to C object within a struct
func (s *FontGlyph) GetV1() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.v1))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Image) Ref() *C.struct_nk_image {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_image)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Image) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewImageRef converts the C object reference into a raw struct reference without wrapping.
func NewImageRef(ref unsafe.Pointer) *Image {
	return (*Image)(ref)
}

// NewImage allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewImage() *Image {
	return (*Image)(allocStructNkImageMemory(1))
}

// allocStructNkImageMemory allocates memory for type C.struct_nk_image in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkImageMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkImageValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkImageValue = unsafe.Sizeof([1]C.struct_nk_image{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Image) PassRef() *C.struct_nk_image {
	if x == nil {
		x = (*Image)(allocStructNkImageMemory(1))
	}
	return (*C.struct_nk_image)(unsafe.Pointer(x))
}

// GetHandle returns a reference to C object within a struct
func (s *Image) GetHandle() *Handle {
	var ret *Handle
	ret = (*Handle)(unsafe.Pointer(&s.handle))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *Image) GetW() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *Image) GetH() *uint16 {
	var ret *uint16
	ret = (*uint16)(unsafe.Pointer(&s.h))
	return ret
}

// GetRegion returns a reference to C object within a struct
func (s *Image) GetRegion() [4]uint16 {
	var ret [4]uint16
	ret = *(*[4]uint16)(unsafe.Pointer(&s.region))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Input) Ref() *C.struct_nk_input {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_input)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Input) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewInputRef converts the C object reference into a raw struct reference without wrapping.
func NewInputRef(ref unsafe.Pointer) *Input {
	return (*Input)(ref)
}

// NewInput allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewInput() *Input {
	return (*Input)(allocStructNkInputMemory(1))
}

// allocStructNkInputMemory allocates memory for type C.struct_nk_input in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkInputMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkInputValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkInputValue = unsafe.Sizeof([1]C.struct_nk_input{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Input) PassRef() *C.struct_nk_input {
	if x == nil {
		x = (*Input)(allocStructNkInputMemory(1))
	}
	return (*C.struct_nk_input)(unsafe.Pointer(x))
}

// GetKeyboard returns a reference to C object within a struct
func (s *Input) GetKeyboard() *Keyboard {
	var ret *Keyboard
	ret = (*Keyboard)(unsafe.Pointer(&s.keyboard))
	return ret
}

// GetMouse returns a reference to C object within a struct
func (s *Input) GetMouse() *Mouse {
	var ret *Mouse
	ret = (*Mouse)(unsafe.Pointer(&s.mouse))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Key) Ref() *C.struct_nk_key {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_key)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Key) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewKeyRef converts the C object reference into a raw struct reference without wrapping.
func NewKeyRef(ref unsafe.Pointer) *Key {
	return (*Key)(ref)
}

// NewKey allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewKey() *Key {
	return (*Key)(allocStructNkKeyMemory(1))
}

// allocStructNkKeyMemory allocates memory for type C.struct_nk_key in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkKeyMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkKeyValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkKeyValue = unsafe.Sizeof([1]C.struct_nk_key{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Key) PassRef() *C.struct_nk_key {
	if x == nil {
		x = (*Key)(allocStructNkKeyMemory(1))
	}
	return (*C.struct_nk_key)(unsafe.Pointer(x))
}

// GetDown returns a reference to C object within a struct
func (s *Key) GetDown() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.down))
	return ret
}

// GetClicked returns a reference to C object within a struct
func (s *Key) GetClicked() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.clicked))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Keyboard) Ref() *C.struct_nk_keyboard {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_keyboard)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Keyboard) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewKeyboardRef converts the C object reference into a raw struct reference without wrapping.
func NewKeyboardRef(ref unsafe.Pointer) *Keyboard {
	return (*Keyboard)(ref)
}

// NewKeyboard allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewKeyboard() *Keyboard {
	return (*Keyboard)(allocStructNkKeyboardMemory(1))
}

// allocStructNkKeyboardMemory allocates memory for type C.struct_nk_keyboard in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkKeyboardMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkKeyboardValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkKeyboardValue = unsafe.Sizeof([1]C.struct_nk_keyboard{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Keyboard) PassRef() *C.struct_nk_keyboard {
	if x == nil {
		x = (*Keyboard)(allocStructNkKeyboardMemory(1))
	}
	return (*C.struct_nk_keyboard)(unsafe.Pointer(x))
}

// GetKeys returns a reference to C object within a struct
func (s *Keyboard) GetKeys() [30]Key {
	var ret [30]Key
	ret = *(*[30]Key)(unsafe.Pointer(&s.keys))
	return ret
}

// GetText returns a reference to C object within a struct
func (s *Keyboard) GetText() [16]byte {
	var ret [16]byte
	ret = *(*[16]byte)(unsafe.Pointer(&s.text))
	return ret
}

// GetTextLen returns a reference to C object within a struct
func (s *Keyboard) GetTextLen() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.text_len))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *ListView) Ref() *C.struct_nk_list_view {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_list_view)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *ListView) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewListViewRef converts the C object reference into a raw struct reference without wrapping.
func NewListViewRef(ref unsafe.Pointer) *ListView {
	return (*ListView)(ref)
}

// NewListView allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewListView() *ListView {
	return (*ListView)(allocStructNkListViewMemory(1))
}

// allocStructNkListViewMemory allocates memory for type C.struct_nk_list_view in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkListViewMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkListViewValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkListViewValue = unsafe.Sizeof([1]C.struct_nk_list_view{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *ListView) PassRef() *C.struct_nk_list_view {
	if x == nil {
		x = (*ListView)(allocStructNkListViewMemory(1))
	}
	return (*C.struct_nk_list_view)(unsafe.Pointer(x))
}

// GetBegin returns a reference to C object within a struct
func (s *ListView) GetBegin() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.begin))
	return ret
}

// GetEnd returns a reference to C object within a struct
func (s *ListView) GetEnd() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.end))
	return ret
}

// GetCount returns a reference to C object within a struct
func (s *ListView) GetCount() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.count))
	return ret
}

// GetTotalHeight returns a reference to C object within a struct
func (s *ListView) GetTotalHeight() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.total_height))
	return ret
}

// GetCtx returns a reference to C object within a struct
func (s *ListView) GetCtx() **Context {
	var ret **Context
	ret = (**Context)(unsafe.Pointer(&s.ctx))
	return ret
}

// GetScrollPointer returns a reference to C object within a struct
func (s *ListView) GetScrollPointer() **Uint {
	var ret **Uint
	ret = (**Uint)(unsafe.Pointer(&s.scroll_pointer))
	return ret
}

// GetScrollValue returns a reference to C object within a struct
func (s *ListView) GetScrollValue() *Uint {
	var ret *Uint
	ret = (*Uint)(unsafe.Pointer(&s.scroll_value))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Memory) Ref() *C.struct_nk_memory {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_memory)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Memory) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewMemoryRef converts the C object reference into a raw struct reference without wrapping.
func NewMemoryRef(ref unsafe.Pointer) *Memory {
	return (*Memory)(ref)
}

// NewMemory allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewMemory() *Memory {
	return (*Memory)(allocStructNkMemoryMemory(1))
}

// allocStructNkMemoryMemory allocates memory for type C.struct_nk_memory in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkMemoryMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkMemoryValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkMemoryValue = unsafe.Sizeof([1]C.struct_nk_memory{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Memory) PassRef() *C.struct_nk_memory {
	if x == nil {
		x = (*Memory)(allocStructNkMemoryMemory(1))
	}
	return (*C.struct_nk_memory)(unsafe.Pointer(x))
}

// GetPtr returns a reference to C object within a struct
func (s *Memory) GetPtr() *unsafe.Pointer {
	var ret *unsafe.Pointer
	ret = (*unsafe.Pointer)(unsafe.Pointer(&s.ptr))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *Memory) GetSize() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.size))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *MemoryStatus) Ref() *C.struct_nk_memory_status {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_memory_status)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *MemoryStatus) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewMemoryStatusRef converts the C object reference into a raw struct reference without wrapping.
func NewMemoryStatusRef(ref unsafe.Pointer) *MemoryStatus {
	return (*MemoryStatus)(ref)
}

// NewMemoryStatus allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewMemoryStatus() *MemoryStatus {
	return (*MemoryStatus)(allocStructNkMemoryStatusMemory(1))
}

// allocStructNkMemoryStatusMemory allocates memory for type C.struct_nk_memory_status in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkMemoryStatusMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkMemoryStatusValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkMemoryStatusValue = unsafe.Sizeof([1]C.struct_nk_memory_status{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *MemoryStatus) PassRef() *C.struct_nk_memory_status {
	if x == nil {
		x = (*MemoryStatus)(allocStructNkMemoryStatusMemory(1))
	}
	return (*C.struct_nk_memory_status)(unsafe.Pointer(x))
}

// GetMemory returns a reference to C object within a struct
func (s *MemoryStatus) GetMemory() *unsafe.Pointer {
	var ret *unsafe.Pointer
	ret = (*unsafe.Pointer)(unsafe.Pointer(&s.memory))
	return ret
}

// GetType returns a reference to C object within a struct
func (s *MemoryStatus) GetType() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s._type))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *MemoryStatus) GetSize() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.size))
	return ret
}

// GetAllocated returns a reference to C object within a struct
func (s *MemoryStatus) GetAllocated() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.allocated))
	return ret
}

// GetNeeded returns a reference to C object within a struct
func (s *MemoryStatus) GetNeeded() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.needed))
	return ret
}

// GetCalls returns a reference to C object within a struct
func (s *MemoryStatus) GetCalls() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.calls))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *MenuState) Ref() *C.struct_nk_menu_state {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_menu_state)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *MenuState) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewMenuStateRef converts the C object reference into a raw struct reference without wrapping.
func NewMenuStateRef(ref unsafe.Pointer) *MenuState {
	return (*MenuState)(ref)
}

// NewMenuState allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewMenuState() *MenuState {
	return (*MenuState)(allocStructNkMenuStateMemory(1))
}

// allocStructNkMenuStateMemory allocates memory for type C.struct_nk_menu_state in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkMenuStateMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkMenuStateValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkMenuStateValue = unsafe.Sizeof([1]C.struct_nk_menu_state{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *MenuState) PassRef() *C.struct_nk_menu_state {
	if x == nil {
		x = (*MenuState)(allocStructNkMenuStateMemory(1))
	}
	return (*C.struct_nk_menu_state)(unsafe.Pointer(x))
}

// GetX returns a reference to C object within a struct
func (s *MenuState) GetX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *MenuState) GetY() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *MenuState) GetW() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *MenuState) GetH() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.h))
	return ret
}

// GetOffset returns a reference to C object within a struct
func (s *MenuState) GetOffset() *Scroll {
	var ret *Scroll
	ret = (*Scroll)(unsafe.Pointer(&s.offset))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Mouse) Ref() *C.struct_nk_mouse {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_mouse)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Mouse) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewMouseRef converts the C object reference into a raw struct reference without wrapping.
func NewMouseRef(ref unsafe.Pointer) *Mouse {
	return (*Mouse)(ref)
}

// NewMouse allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewMouse() *Mouse {
	return (*Mouse)(allocStructNkMouseMemory(1))
}

// allocStructNkMouseMemory allocates memory for type C.struct_nk_mouse in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkMouseMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkMouseValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkMouseValue = unsafe.Sizeof([1]C.struct_nk_mouse{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Mouse) PassRef() *C.struct_nk_mouse {
	if x == nil {
		x = (*Mouse)(allocStructNkMouseMemory(1))
	}
	return (*C.struct_nk_mouse)(unsafe.Pointer(x))
}

// GetButtons returns a reference to C object within a struct
func (s *Mouse) GetButtons() [4]MouseButton {
	var ret [4]MouseButton
	ret = *(*[4]MouseButton)(unsafe.Pointer(&s.buttons))
	return ret
}

// GetPos returns a reference to C object within a struct
func (s *Mouse) GetPos() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.pos))
	return ret
}

// GetPrev returns a reference to C object within a struct
func (s *Mouse) GetPrev() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.prev))
	return ret
}

// GetDelta returns a reference to C object within a struct
func (s *Mouse) GetDelta() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.delta))
	return ret
}

// GetScrollDelta returns a reference to C object within a struct
func (s *Mouse) GetScrollDelta() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.scroll_delta))
	return ret
}

// GetGrab returns a reference to C object within a struct
func (s *Mouse) GetGrab() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.grab))
	return ret
}

// GetGrabbed returns a reference to C object within a struct
func (s *Mouse) GetGrabbed() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.grabbed))
	return ret
}

// GetUngrab returns a reference to C object within a struct
func (s *Mouse) GetUngrab() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.ungrab))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *MouseButton) Ref() *C.struct_nk_mouse_button {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_mouse_button)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *MouseButton) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewMouseButtonRef converts the C object reference into a raw struct reference without wrapping.
func NewMouseButtonRef(ref unsafe.Pointer) *MouseButton {
	return (*MouseButton)(ref)
}

// NewMouseButton allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewMouseButton() *MouseButton {
	return (*MouseButton)(allocStructNkMouseButtonMemory(1))
}

// allocStructNkMouseButtonMemory allocates memory for type C.struct_nk_mouse_button in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkMouseButtonMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkMouseButtonValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkMouseButtonValue = unsafe.Sizeof([1]C.struct_nk_mouse_button{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *MouseButton) PassRef() *C.struct_nk_mouse_button {
	if x == nil {
		x = (*MouseButton)(allocStructNkMouseButtonMemory(1))
	}
	return (*C.struct_nk_mouse_button)(unsafe.Pointer(x))
}

// GetDown returns a reference to C object within a struct
func (s *MouseButton) GetDown() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.down))
	return ret
}

// GetClicked returns a reference to C object within a struct
func (s *MouseButton) GetClicked() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.clicked))
	return ret
}

// GetClickedPos returns a reference to C object within a struct
func (s *MouseButton) GetClickedPos() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.clicked_pos))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Page) Ref() *C.struct_nk_page {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_page)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Page) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPageRef converts the C object reference into a raw struct reference without wrapping.
func NewPageRef(ref unsafe.Pointer) *Page {
	return (*Page)(ref)
}

// NewPage allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPage() *Page {
	return (*Page)(allocStructNkPageMemory(1))
}

// allocStructNkPageMemory allocates memory for type C.struct_nk_page in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPageMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPageValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPageValue = unsafe.Sizeof([1]C.struct_nk_page{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Page) PassRef() *C.struct_nk_page {
	if x == nil {
		x = (*Page)(allocStructNkPageMemory(1))
	}
	return (*C.struct_nk_page)(unsafe.Pointer(x))
}

// GetSize returns a reference to C object within a struct
func (s *Page) GetSize() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.size))
	return ret
}

// GetNext returns a reference to C object within a struct
func (s *Page) GetNext() **Page {
	var ret **Page
	ret = (**Page)(unsafe.Pointer(&s.next))
	return ret
}

// GetWin returns a reference to C object within a struct
func (s *Page) GetWin() [1]PageElement {
	var ret [1]PageElement
	ret = *(*[1]PageElement)(unsafe.Pointer(&s.win))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *PageElement) Ref() *C.struct_nk_page_element {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_page_element)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *PageElement) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPageElementRef converts the C object reference into a raw struct reference without wrapping.
func NewPageElementRef(ref unsafe.Pointer) *PageElement {
	return (*PageElement)(ref)
}

// NewPageElement allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPageElement() *PageElement {
	return (*PageElement)(allocStructNkPageElementMemory(1))
}

// allocStructNkPageElementMemory allocates memory for type C.struct_nk_page_element in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPageElementMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPageElementValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPageElementValue = unsafe.Sizeof([1]C.struct_nk_page_element{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *PageElement) PassRef() *C.struct_nk_page_element {
	if x == nil {
		x = (*PageElement)(allocStructNkPageElementMemory(1))
	}
	return (*C.struct_nk_page_element)(unsafe.Pointer(x))
}

// GetData returns a reference to C object within a struct
func (s *PageElement) GetData() *PageData {
	var ret *PageData
	ret = (*PageData)(unsafe.Pointer(&s.data))
	return ret
}

// GetNext returns a reference to C object within a struct
func (s *PageElement) GetNext() **PageElement {
	var ret **PageElement
	ret = (**PageElement)(unsafe.Pointer(&s.next))
	return ret
}

// GetPrev returns a reference to C object within a struct
func (s *PageElement) GetPrev() **PageElement {
	var ret **PageElement
	ret = (**PageElement)(unsafe.Pointer(&s.prev))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Panel) Ref() *C.struct_nk_panel {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_panel)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Panel) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPanelRef converts the C object reference into a raw struct reference without wrapping.
func NewPanelRef(ref unsafe.Pointer) *Panel {
	return (*Panel)(ref)
}

// NewPanel allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPanel() *Panel {
	return (*Panel)(allocStructNkPanelMemory(1))
}

// allocStructNkPanelMemory allocates memory for type C.struct_nk_panel in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPanelMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPanelValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPanelValue = unsafe.Sizeof([1]C.struct_nk_panel{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Panel) PassRef() *C.struct_nk_panel {
	if x == nil {
		x = (*Panel)(allocStructNkPanelMemory(1))
	}
	return (*C.struct_nk_panel)(unsafe.Pointer(x))
}

// GetType returns a reference to C object within a struct
func (s *Panel) GetType() *PanelType {
	var ret *PanelType
	ret = (*PanelType)(unsafe.Pointer(&s._type))
	return ret
}

// GetFlags returns a reference to C object within a struct
func (s *Panel) GetFlags() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.flags))
	return ret
}

// GetBounds returns a reference to C object within a struct
func (s *Panel) GetBounds() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.bounds))
	return ret
}

// GetOffsetX returns a reference to C object within a struct
func (s *Panel) GetOffsetX() **Uint {
	var ret **Uint
	ret = (**Uint)(unsafe.Pointer(&s.offset_x))
	return ret
}

// GetOffsetY returns a reference to C object within a struct
func (s *Panel) GetOffsetY() **Uint {
	var ret **Uint
	ret = (**Uint)(unsafe.Pointer(&s.offset_y))
	return ret
}

// GetAtX returns a reference to C object within a struct
func (s *Panel) GetAtX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.at_x))
	return ret
}

// GetAtY returns a reference to C object within a struct
func (s *Panel) GetAtY() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.at_y))
	return ret
}

// GetMaxX returns a reference to C object within a struct
func (s *Panel) GetMaxX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.max_x))
	return ret
}

// GetFooterHeight returns a reference to C object within a struct
func (s *Panel) GetFooterHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.footer_height))
	return ret
}

// GetHeaderHeight returns a reference to C object within a struct
func (s *Panel) GetHeaderHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.header_height))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *Panel) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetHasScrolling returns a reference to C object within a struct
func (s *Panel) GetHasScrolling() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.has_scrolling))
	return ret
}

// GetClip returns a reference to C object within a struct
func (s *Panel) GetClip() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.clip))
	return ret
}

// GetMenu returns a reference to C object within a struct
func (s *Panel) GetMenu() *MenuState {
	var ret *MenuState
	ret = (*MenuState)(unsafe.Pointer(&s.menu))
	return ret
}

// GetRow returns a reference to C object within a struct
func (s *Panel) GetRow() *RowLayout {
	var ret *RowLayout
	ret = (*RowLayout)(unsafe.Pointer(&s.row))
	return ret
}

// GetChart returns a reference to C object within a struct
func (s *Panel) GetChart() *Chart {
	var ret *Chart
	ret = (*Chart)(unsafe.Pointer(&s.chart))
	return ret
}

// GetBuffer returns a reference to C object within a struct
func (s *Panel) GetBuffer() **CommandBuffer {
	var ret **CommandBuffer
	ret = (**CommandBuffer)(unsafe.Pointer(&s.buffer))
	return ret
}

// GetParent returns a reference to C object within a struct
func (s *Panel) GetParent() **Panel {
	var ret **Panel
	ret = (**Panel)(unsafe.Pointer(&s.parent))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Pool) Ref() *C.struct_nk_pool {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_pool)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Pool) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPoolRef converts the C object reference into a raw struct reference without wrapping.
func NewPoolRef(ref unsafe.Pointer) *Pool {
	return (*Pool)(ref)
}

// NewPool allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPool() *Pool {
	return (*Pool)(allocStructNkPoolMemory(1))
}

// allocStructNkPoolMemory allocates memory for type C.struct_nk_pool in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPoolMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPoolValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPoolValue = unsafe.Sizeof([1]C.struct_nk_pool{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Pool) PassRef() *C.struct_nk_pool {
	if x == nil {
		x = (*Pool)(allocStructNkPoolMemory(1))
	}
	return (*C.struct_nk_pool)(unsafe.Pointer(x))
}

// GetAlloc returns a reference to C object within a struct
func (s *Pool) GetAlloc() *Allocator {
	var ret *Allocator
	ret = (*Allocator)(unsafe.Pointer(&s.alloc))
	return ret
}

// GetType returns a reference to C object within a struct
func (s *Pool) GetType() *AllocationType {
	var ret *AllocationType
	ret = (*AllocationType)(unsafe.Pointer(&s._type))
	return ret
}

// GetPageCount returns a reference to C object within a struct
func (s *Pool) GetPageCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.page_count))
	return ret
}

// GetPages returns a reference to C object within a struct
func (s *Pool) GetPages() **Page {
	var ret **Page
	ret = (**Page)(unsafe.Pointer(&s.pages))
	return ret
}

// GetFreelist returns a reference to C object within a struct
func (s *Pool) GetFreelist() **PageElement {
	var ret **PageElement
	ret = (**PageElement)(unsafe.Pointer(&s.freelist))
	return ret
}

// GetCapacity returns a reference to C object within a struct
func (s *Pool) GetCapacity() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.capacity))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *Pool) GetSize() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.size))
	return ret
}

// GetCap returns a reference to C object within a struct
func (s *Pool) GetCap() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.cap))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *PopupBuffer) Ref() *C.struct_nk_popup_buffer {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_popup_buffer)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *PopupBuffer) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPopupBufferRef converts the C object reference into a raw struct reference without wrapping.
func NewPopupBufferRef(ref unsafe.Pointer) *PopupBuffer {
	return (*PopupBuffer)(ref)
}

// NewPopupBuffer allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPopupBuffer() *PopupBuffer {
	return (*PopupBuffer)(allocStructNkPopupBufferMemory(1))
}

// allocStructNkPopupBufferMemory allocates memory for type C.struct_nk_popup_buffer in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPopupBufferMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPopupBufferValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPopupBufferValue = unsafe.Sizeof([1]C.struct_nk_popup_buffer{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *PopupBuffer) PassRef() *C.struct_nk_popup_buffer {
	if x == nil {
		x = (*PopupBuffer)(allocStructNkPopupBufferMemory(1))
	}
	return (*C.struct_nk_popup_buffer)(unsafe.Pointer(x))
}

// GetBegin returns a reference to C object within a struct
func (s *PopupBuffer) GetBegin() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.begin))
	return ret
}

// GetParent returns a reference to C object within a struct
func (s *PopupBuffer) GetParent() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.parent))
	return ret
}

// GetLast returns a reference to C object within a struct
func (s *PopupBuffer) GetLast() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.last))
	return ret
}

// GetEnd returns a reference to C object within a struct
func (s *PopupBuffer) GetEnd() *Size {
	var ret *Size
	ret = (*Size)(unsafe.Pointer(&s.end))
	return ret
}

// GetActive returns a reference to C object within a struct
func (s *PopupBuffer) GetActive() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.active))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *PopupState) Ref() *C.struct_nk_popup_state {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_popup_state)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *PopupState) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPopupStateRef converts the C object reference into a raw struct reference without wrapping.
func NewPopupStateRef(ref unsafe.Pointer) *PopupState {
	return (*PopupState)(ref)
}

// NewPopupState allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPopupState() *PopupState {
	return (*PopupState)(allocStructNkPopupStateMemory(1))
}

// allocStructNkPopupStateMemory allocates memory for type C.struct_nk_popup_state in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPopupStateMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPopupStateValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPopupStateValue = unsafe.Sizeof([1]C.struct_nk_popup_state{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *PopupState) PassRef() *C.struct_nk_popup_state {
	if x == nil {
		x = (*PopupState)(allocStructNkPopupStateMemory(1))
	}
	return (*C.struct_nk_popup_state)(unsafe.Pointer(x))
}

// GetWin returns a reference to C object within a struct
func (s *PopupState) GetWin() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.win))
	return ret
}

// GetType returns a reference to C object within a struct
func (s *PopupState) GetType() *PanelType {
	var ret *PanelType
	ret = (*PanelType)(unsafe.Pointer(&s._type))
	return ret
}

// GetBuf returns a reference to C object within a struct
func (s *PopupState) GetBuf() *PopupBuffer {
	var ret *PopupBuffer
	ret = (*PopupBuffer)(unsafe.Pointer(&s.buf))
	return ret
}

// GetName returns a reference to C object within a struct
func (s *PopupState) GetName() *Hash {
	var ret *Hash
	ret = (*Hash)(unsafe.Pointer(&s.name))
	return ret
}

// GetActive returns a reference to C object within a struct
func (s *PopupState) GetActive() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.active))
	return ret
}

// GetComboCount returns a reference to C object within a struct
func (s *PopupState) GetComboCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.combo_count))
	return ret
}

// GetConCount returns a reference to C object within a struct
func (s *PopupState) GetConCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.con_count))
	return ret
}

// GetConOld returns a reference to C object within a struct
func (s *PopupState) GetConOld() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.con_old))
	return ret
}

// GetActiveCon returns a reference to C object within a struct
func (s *PopupState) GetActiveCon() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.active_con))
	return ret
}

// GetHeader returns a reference to C object within a struct
func (s *PopupState) GetHeader() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.header))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *PropertyState) Ref() *C.struct_nk_property_state {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_property_state)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *PropertyState) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewPropertyStateRef converts the C object reference into a raw struct reference without wrapping.
func NewPropertyStateRef(ref unsafe.Pointer) *PropertyState {
	return (*PropertyState)(ref)
}

// NewPropertyState allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewPropertyState() *PropertyState {
	return (*PropertyState)(allocStructNkPropertyStateMemory(1))
}

// allocStructNkPropertyStateMemory allocates memory for type C.struct_nk_property_state in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkPropertyStateMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkPropertyStateValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkPropertyStateValue = unsafe.Sizeof([1]C.struct_nk_property_state{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *PropertyState) PassRef() *C.struct_nk_property_state {
	if x == nil {
		x = (*PropertyState)(allocStructNkPropertyStateMemory(1))
	}
	return (*C.struct_nk_property_state)(unsafe.Pointer(x))
}

// GetActive returns a reference to C object within a struct
func (s *PropertyState) GetActive() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.active))
	return ret
}

// GetPrev returns a reference to C object within a struct
func (s *PropertyState) GetPrev() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.prev))
	return ret
}

// GetBuffer returns a reference to C object within a struct
func (s *PropertyState) GetBuffer() [64]byte {
	var ret [64]byte
	ret = *(*[64]byte)(unsafe.Pointer(&s.buffer))
	return ret
}

// GetLength returns a reference to C object within a struct
func (s *PropertyState) GetLength() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.length))
	return ret
}

// GetCursor returns a reference to C object within a struct
func (s *PropertyState) GetCursor() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.cursor))
	return ret
}

// GetSelectStart returns a reference to C object within a struct
func (s *PropertyState) GetSelectStart() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.select_start))
	return ret
}

// GetSelectEnd returns a reference to C object within a struct
func (s *PropertyState) GetSelectEnd() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.select_end))
	return ret
}

// GetName returns a reference to C object within a struct
func (s *PropertyState) GetName() *Hash {
	var ret *Hash
	ret = (*Hash)(unsafe.Pointer(&s.name))
	return ret
}

// GetSeq returns a reference to C object within a struct
func (s *PropertyState) GetSeq() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.seq))
	return ret
}

// GetOld returns a reference to C object within a struct
func (s *PropertyState) GetOld() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.old))
	return ret
}

// GetState returns a reference to C object within a struct
func (s *PropertyState) GetState() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.state))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Rect) Ref() *C.struct_nk_rect {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_rect)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Rect) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewRectRef converts the C object reference into a raw struct reference without wrapping.
func NewRectRef(ref unsafe.Pointer) *Rect {
	return (*Rect)(ref)
}

// NewRect allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewRect() *Rect {
	return (*Rect)(allocStructNkRectMemory(1))
}

// allocStructNkRectMemory allocates memory for type C.struct_nk_rect in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkRectMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkRectValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkRectValue = unsafe.Sizeof([1]C.struct_nk_rect{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Rect) PassRef() *C.struct_nk_rect {
	if x == nil {
		x = (*Rect)(allocStructNkRectMemory(1))
	}
	return (*C.struct_nk_rect)(unsafe.Pointer(x))
}

// GetX returns a reference to C object within a struct
func (s *Rect) GetX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *Rect) GetY() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *Rect) GetW() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *Rect) GetH() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.h))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Recti) Ref() *C.struct_nk_recti {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_recti)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Recti) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewRectiRef converts the C object reference into a raw struct reference without wrapping.
func NewRectiRef(ref unsafe.Pointer) *Recti {
	return (*Recti)(ref)
}

// NewRecti allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewRecti() *Recti {
	return (*Recti)(allocStructNkRectiMemory(1))
}

// allocStructNkRectiMemory allocates memory for type C.struct_nk_recti in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkRectiMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkRectiValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkRectiValue = unsafe.Sizeof([1]C.struct_nk_recti{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Recti) PassRef() *C.struct_nk_recti {
	if x == nil {
		x = (*Recti)(allocStructNkRectiMemory(1))
	}
	return (*C.struct_nk_recti)(unsafe.Pointer(x))
}

// GetX returns a reference to C object within a struct
func (s *Recti) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *Recti) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// GetW returns a reference to C object within a struct
func (s *Recti) GetW() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.w))
	return ret
}

// GetH returns a reference to C object within a struct
func (s *Recti) GetH() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.h))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *RowLayout) Ref() *C.struct_nk_row_layout {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_row_layout)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *RowLayout) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewRowLayoutRef converts the C object reference into a raw struct reference without wrapping.
func NewRowLayoutRef(ref unsafe.Pointer) *RowLayout {
	return (*RowLayout)(ref)
}

// NewRowLayout allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewRowLayout() *RowLayout {
	return (*RowLayout)(allocStructNkRowLayoutMemory(1))
}

// allocStructNkRowLayoutMemory allocates memory for type C.struct_nk_row_layout in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkRowLayoutMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkRowLayoutValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkRowLayoutValue = unsafe.Sizeof([1]C.struct_nk_row_layout{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *RowLayout) PassRef() *C.struct_nk_row_layout {
	if x == nil {
		x = (*RowLayout)(allocStructNkRowLayoutMemory(1))
	}
	return (*C.struct_nk_row_layout)(unsafe.Pointer(x))
}

// GetType returns a reference to C object within a struct
func (s *RowLayout) GetType() *PanelRowLayoutType {
	var ret *PanelRowLayoutType
	ret = (*PanelRowLayoutType)(unsafe.Pointer(&s._type))
	return ret
}

// GetIndex returns a reference to C object within a struct
func (s *RowLayout) GetIndex() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.index))
	return ret
}

// GetHeight returns a reference to C object within a struct
func (s *RowLayout) GetHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.height))
	return ret
}

// GetMinHeight returns a reference to C object within a struct
func (s *RowLayout) GetMinHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.min_height))
	return ret
}

// GetColumns returns a reference to C object within a struct
func (s *RowLayout) GetColumns() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.columns))
	return ret
}

// GetRatio returns a reference to C object within a struct
func (s *RowLayout) GetRatio() []*float32 {
	var ret []*float32
	hxf95e7c8 := (*sliceHeader)(unsafe.Pointer(&ret))
	hxf95e7c8.Data = unsafe.Pointer(&s.ratio)
	hxf95e7c8.Cap = 0x7fffffff
	// hxf95e7c8.Len = ?

	return ret
}

// GetItemWidth returns a reference to C object within a struct
func (s *RowLayout) GetItemWidth() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.item_width))
	return ret
}

// GetItemHeight returns a reference to C object within a struct
func (s *RowLayout) GetItemHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.item_height))
	return ret
}

// GetItemOffset returns a reference to C object within a struct
func (s *RowLayout) GetItemOffset() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.item_offset))
	return ret
}

// GetFilled returns a reference to C object within a struct
func (s *RowLayout) GetFilled() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.filled))
	return ret
}

// GetItem returns a reference to C object within a struct
func (s *RowLayout) GetItem() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.item))
	return ret
}

// GetTreeDepth returns a reference to C object within a struct
func (s *RowLayout) GetTreeDepth() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.tree_depth))
	return ret
}

// GetTemplates returns a reference to C object within a struct
func (s *RowLayout) GetTemplates() [16]float32 {
	var ret [16]float32
	ret = *(*[16]float32)(unsafe.Pointer(&s.templates))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Scroll) Ref() *C.struct_nk_scroll {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_scroll)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Scroll) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewScrollRef converts the C object reference into a raw struct reference without wrapping.
func NewScrollRef(ref unsafe.Pointer) *Scroll {
	return (*Scroll)(ref)
}

// NewScroll allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewScroll() *Scroll {
	return (*Scroll)(allocStructNkScrollMemory(1))
}

// allocStructNkScrollMemory allocates memory for type C.struct_nk_scroll in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkScrollMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkScrollValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkScrollValue = unsafe.Sizeof([1]C.struct_nk_scroll{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Scroll) PassRef() *C.struct_nk_scroll {
	if x == nil {
		x = (*Scroll)(allocStructNkScrollMemory(1))
	}
	return (*C.struct_nk_scroll)(unsafe.Pointer(x))
}

// GetX returns a reference to C object within a struct
func (s *Scroll) GetX() *Uint {
	var ret *Uint
	ret = (*Uint)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *Scroll) GetY() *Uint {
	var ret *Uint
	ret = (*Uint)(unsafe.Pointer(&s.y))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Str) Ref() *C.struct_nk_str {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_str)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Str) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStrRef converts the C object reference into a raw struct reference without wrapping.
func NewStrRef(ref unsafe.Pointer) *Str {
	return (*Str)(ref)
}

// NewStr allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStr() *Str {
	return (*Str)(allocStructNkStrMemory(1))
}

// allocStructNkStrMemory allocates memory for type C.struct_nk_str in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStrMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStrValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStrValue = unsafe.Sizeof([1]C.struct_nk_str{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Str) PassRef() *C.struct_nk_str {
	if x == nil {
		x = (*Str)(allocStructNkStrMemory(1))
	}
	return (*C.struct_nk_str)(unsafe.Pointer(x))
}

// GetBuffer returns a reference to C object within a struct
func (s *Str) GetBuffer() *Buffer {
	var ret *Buffer
	ret = (*Buffer)(unsafe.Pointer(&s.buffer))
	return ret
}

// GetLen returns a reference to C object within a struct
func (s *Str) GetLen() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.len))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Style) Ref() *C.struct_nk_style {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Style) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleRef(ref unsafe.Pointer) *Style {
	return (*Style)(ref)
}

// NewStyle allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyle() *Style {
	return (*Style)(allocStructNkStyleMemory(1))
}

// allocStructNkStyleMemory allocates memory for type C.struct_nk_style in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleValue = unsafe.Sizeof([1]C.struct_nk_style{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Style) PassRef() *C.struct_nk_style {
	if x == nil {
		x = (*Style)(allocStructNkStyleMemory(1))
	}
	return (*C.struct_nk_style)(unsafe.Pointer(x))
}

// GetFont returns a reference to C object within a struct
func (s *Style) GetFont() []*UserFont {
	var ret []*UserFont
	packSPUserFont(ret, &s.font)
	return ret
}

// GetCursors returns a reference to C object within a struct
func (s *Style) GetCursors() [7]*Cursor {
	var ret [7]*Cursor
	ret = *(*[7]*Cursor)(unsafe.Pointer(&s.cursors))
	return ret
}

// GetCursorActive returns a reference to C object within a struct
func (s *Style) GetCursorActive() **Cursor {
	var ret **Cursor
	ret = (**Cursor)(unsafe.Pointer(&s.cursor_active))
	return ret
}

// GetCursorLast returns a reference to C object within a struct
func (s *Style) GetCursorLast() **Cursor {
	var ret **Cursor
	ret = (**Cursor)(unsafe.Pointer(&s.cursor_last))
	return ret
}

// GetCursorVisible returns a reference to C object within a struct
func (s *Style) GetCursorVisible() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.cursor_visible))
	return ret
}

// GetText returns a reference to C object within a struct
func (s *Style) GetText() *StyleText {
	var ret *StyleText
	ret = (*StyleText)(unsafe.Pointer(&s.text))
	return ret
}

// GetButton returns a reference to C object within a struct
func (s *Style) GetButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.button))
	return ret
}

// GetContextualButton returns a reference to C object within a struct
func (s *Style) GetContextualButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.contextual_button))
	return ret
}

// GetMenuButton returns a reference to C object within a struct
func (s *Style) GetMenuButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.menu_button))
	return ret
}

// GetOption returns a reference to C object within a struct
func (s *Style) GetOption() *StyleToggle {
	var ret *StyleToggle
	ret = (*StyleToggle)(unsafe.Pointer(&s.option))
	return ret
}

// GetCheckbox returns a reference to C object within a struct
func (s *Style) GetCheckbox() *StyleToggle {
	var ret *StyleToggle
	ret = (*StyleToggle)(unsafe.Pointer(&s.checkbox))
	return ret
}

// GetSelectable returns a reference to C object within a struct
func (s *Style) GetSelectable() *StyleSelectable {
	var ret *StyleSelectable
	ret = (*StyleSelectable)(unsafe.Pointer(&s.selectable))
	return ret
}

// GetSlider returns a reference to C object within a struct
func (s *Style) GetSlider() *StyleSlider {
	var ret *StyleSlider
	ret = (*StyleSlider)(unsafe.Pointer(&s.slider))
	return ret
}

// GetProgress returns a reference to C object within a struct
func (s *Style) GetProgress() *StyleProgress {
	var ret *StyleProgress
	ret = (*StyleProgress)(unsafe.Pointer(&s.progress))
	return ret
}

// GetProperty returns a reference to C object within a struct
func (s *Style) GetProperty() *StyleProperty {
	var ret *StyleProperty
	ret = (*StyleProperty)(unsafe.Pointer(&s.property))
	return ret
}

// GetEdit returns a reference to C object within a struct
func (s *Style) GetEdit() *StyleEdit {
	var ret *StyleEdit
	ret = (*StyleEdit)(unsafe.Pointer(&s.edit))
	return ret
}

// GetChart returns a reference to C object within a struct
func (s *Style) GetChart() *StyleChart {
	var ret *StyleChart
	ret = (*StyleChart)(unsafe.Pointer(&s.chart))
	return ret
}

// GetScrollh returns a reference to C object within a struct
func (s *Style) GetScrollh() *StyleScrollbar {
	var ret *StyleScrollbar
	ret = (*StyleScrollbar)(unsafe.Pointer(&s.scrollh))
	return ret
}

// GetScrollv returns a reference to C object within a struct
func (s *Style) GetScrollv() *StyleScrollbar {
	var ret *StyleScrollbar
	ret = (*StyleScrollbar)(unsafe.Pointer(&s.scrollv))
	return ret
}

// GetTab returns a reference to C object within a struct
func (s *Style) GetTab() *StyleTab {
	var ret *StyleTab
	ret = (*StyleTab)(unsafe.Pointer(&s.tab))
	return ret
}

// GetCombo returns a reference to C object within a struct
func (s *Style) GetCombo() *StyleCombo {
	var ret *StyleCombo
	ret = (*StyleCombo)(unsafe.Pointer(&s.combo))
	return ret
}

// GetWindow returns a reference to C object within a struct
func (s *Style) GetWindow() *StyleWindow {
	var ret *StyleWindow
	ret = (*StyleWindow)(unsafe.Pointer(&s.window))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleButton) Ref() *C.struct_nk_style_button {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_button)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleButton) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleButtonRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleButtonRef(ref unsafe.Pointer) *StyleButton {
	return (*StyleButton)(ref)
}

// NewStyleButton allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleButton() *StyleButton {
	return (*StyleButton)(allocStructNkStyleButtonMemory(1))
}

// allocStructNkStyleButtonMemory allocates memory for type C.struct_nk_style_button in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleButtonMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleButtonValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleButtonValue = unsafe.Sizeof([1]C.struct_nk_style_button{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleButton) PassRef() *C.struct_nk_style_button {
	if x == nil {
		x = (*StyleButton)(allocStructNkStyleButtonMemory(1))
	}
	return (*C.struct_nk_style_button)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleButton) 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 *StyleButton) 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 *StyleButton) 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 *StyleButton) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetTextBackground returns a reference to C object within a struct
func (s *StyleButton) GetTextBackground() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_background))
	return ret
}

// GetTextNormal returns a reference to C object within a struct
func (s *StyleButton) GetTextNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_normal))
	return ret
}

// GetTextHover returns a reference to C object within a struct
func (s *StyleButton) GetTextHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_hover))
	return ret
}

// GetTextActive returns a reference to C object within a struct
func (s *StyleButton) GetTextActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_active))
	return ret
}

// GetTextAlignment returns a reference to C object within a struct
func (s *StyleButton) GetTextAlignment() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.text_alignment))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleButton) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleButton) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleButton) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetImagePadding returns a reference to C object within a struct
func (s *StyleButton) GetImagePadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.image_padding))
	return ret
}

// GetTouchPadding returns a reference to C object within a struct
func (s *StyleButton) GetTouchPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.touch_padding))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleButton) 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 *StyleChart) Ref() *C.struct_nk_style_chart {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_chart)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleChart) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleChartRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleChartRef(ref unsafe.Pointer) *StyleChart {
	return (*StyleChart)(ref)
}

// NewStyleChart allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleChart() *StyleChart {
	return (*StyleChart)(allocStructNkStyleChartMemory(1))
}

// allocStructNkStyleChartMemory allocates memory for type C.struct_nk_style_chart in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleChartMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleChartValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleChartValue = unsafe.Sizeof([1]C.struct_nk_style_chart{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleChart) PassRef() *C.struct_nk_style_chart {
	if x == nil {
		x = (*StyleChart)(allocStructNkStyleChartMemory(1))
	}
	return (*C.struct_nk_style_chart)(unsafe.Pointer(x))
}

// GetBackground returns a reference to C object within a struct
func (s *StyleChart) GetBackground() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.background))
	return ret
}

// GetBorderColor returns a reference to C object within a struct
func (s *StyleChart) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetSelectedColor returns a reference to C object within a struct
func (s *StyleChart) GetSelectedColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.selected_color))
	return ret
}

// GetColor returns a reference to C object within a struct
func (s *StyleChart) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleChart) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleChart) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleChart) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleCombo) Ref() *C.struct_nk_style_combo {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_combo)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleCombo) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleComboRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleComboRef(ref unsafe.Pointer) *StyleCombo {
	return (*StyleCombo)(ref)
}

// NewStyleCombo allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleCombo() *StyleCombo {
	return (*StyleCombo)(allocStructNkStyleComboMemory(1))
}

// allocStructNkStyleComboMemory allocates memory for type C.struct_nk_style_combo in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleComboMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleComboValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleComboValue = unsafe.Sizeof([1]C.struct_nk_style_combo{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleCombo) PassRef() *C.struct_nk_style_combo {
	if x == nil {
		x = (*StyleCombo)(allocStructNkStyleComboMemory(1))
	}
	return (*C.struct_nk_style_combo)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleCombo) 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 *StyleCombo) 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 *StyleCombo) 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 *StyleCombo) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetLabelNormal returns a reference to C object within a struct
func (s *StyleCombo) GetLabelNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_normal))
	return ret
}

// GetLabelHover returns a reference to C object within a struct
func (s *StyleCombo) GetLabelHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_hover))
	return ret
}

// GetLabelActive returns a reference to C object within a struct
func (s *StyleCombo) GetLabelActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_active))
	return ret
}

// GetSymbolNormal returns a reference to C object within a struct
func (s *StyleCombo) GetSymbolNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.symbol_normal))
	return ret
}

// GetSymbolHover returns a reference to C object within a struct
func (s *StyleCombo) GetSymbolHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.symbol_hover))
	return ret
}

// GetSymbolActive returns a reference to C object within a struct
func (s *StyleCombo) GetSymbolActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.symbol_active))
	return ret
}

// GetButton returns a reference to C object within a struct
func (s *StyleCombo) GetButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.button))
	return ret
}

// GetSymNormal returns a reference to C object within a struct
func (s *StyleCombo) GetSymNormal() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_normal))
	return ret
}

// GetSymHover returns a reference to C object within a struct
func (s *StyleCombo) GetSymHover() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_hover))
	return ret
}

// GetSymActive returns a reference to C object within a struct
func (s *StyleCombo) GetSymActive() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_active))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleCombo) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleCombo) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetContentPadding returns a reference to C object within a struct
func (s *StyleCombo) GetContentPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.content_padding))
	return ret
}

// GetButtonPadding returns a reference to C object within a struct
func (s *StyleCombo) GetButtonPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.button_padding))
	return ret
}

// GetSpacing returns a reference to C object within a struct
func (s *StyleCombo) GetSpacing() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.spacing))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleEdit) Ref() *C.struct_nk_style_edit {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_edit)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleEdit) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleEditRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleEditRef(ref unsafe.Pointer) *StyleEdit {
	return (*StyleEdit)(ref)
}

// NewStyleEdit allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleEdit() *StyleEdit {
	return (*StyleEdit)(allocStructNkStyleEditMemory(1))
}

// allocStructNkStyleEditMemory allocates memory for type C.struct_nk_style_edit in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleEditMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleEditValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleEditValue = unsafe.Sizeof([1]C.struct_nk_style_edit{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleEdit) PassRef() *C.struct_nk_style_edit {
	if x == nil {
		x = (*StyleEdit)(allocStructNkStyleEditMemory(1))
	}
	return (*C.struct_nk_style_edit)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleEdit) 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 *StyleEdit) 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 *StyleEdit) 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 *StyleEdit) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetScrollbar returns a reference to C object within a struct
func (s *StyleEdit) GetScrollbar() *StyleScrollbar {
	var ret *StyleScrollbar
	ret = (*StyleScrollbar)(unsafe.Pointer(&s.scrollbar))
	return ret
}

// GetCursorNormal returns a reference to C object within a struct
func (s *StyleEdit) 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 *StyleEdit) GetCursorHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.cursor_hover))
	return ret
}

// GetCursorTextNormal returns a reference to C object within a struct
func (s *StyleEdit) GetCursorTextNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.cursor_text_normal))
	return ret
}

// GetCursorTextHover returns a reference to C object within a struct
func (s *StyleEdit) GetCursorTextHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.cursor_text_hover))
	return ret
}

// GetTextNormal returns a reference to C object within a struct
func (s *StyleEdit) GetTextNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_normal))
	return ret
}

// GetTextHover returns a reference to C object within a struct
func (s *StyleEdit) GetTextHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_hover))
	return ret
}

// GetTextActive returns a reference to C object within a struct
func (s *StyleEdit) GetTextActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_active))
	return ret
}

// GetSelectedNormal returns a reference to C object within a struct
func (s *StyleEdit) GetSelectedNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.selected_normal))
	return ret
}

// GetSelectedHover returns a reference to C object within a struct
func (s *StyleEdit) GetSelectedHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.selected_hover))
	return ret
}

// GetSelectedTextNormal returns a reference to C object within a struct
func (s *StyleEdit) GetSelectedTextNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.selected_text_normal))
	return ret
}

// GetSelectedTextHover returns a reference to C object within a struct
func (s *StyleEdit) GetSelectedTextHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.selected_text_hover))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleEdit) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleEdit) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetCursorSize returns a reference to C object within a struct
func (s *StyleEdit) GetCursorSize() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.cursor_size))
	return ret
}

// GetScrollbarSize returns a reference to C object within a struct
func (s *StyleEdit) GetScrollbarSize() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.scrollbar_size))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleEdit) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetRowPadding returns a reference to C object within a struct
func (s *StyleEdit) GetRowPadding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.row_padding))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleItem) Ref() *C.struct_nk_style_item {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_item)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleItem) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleItemRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleItemRef(ref unsafe.Pointer) *StyleItem {
	return (*StyleItem)(ref)
}

// NewStyleItem allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleItem() *StyleItem {
	return (*StyleItem)(allocStructNkStyleItemMemory(1))
}

// allocStructNkStyleItemMemory allocates memory for type C.struct_nk_style_item in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleItemMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleItemValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleItemValue = unsafe.Sizeof([1]C.struct_nk_style_item{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleItem) PassRef() *C.struct_nk_style_item {
	if x == nil {
		x = (*StyleItem)(allocStructNkStyleItemMemory(1))
	}
	return (*C.struct_nk_style_item)(unsafe.Pointer(x))
}

// GetType returns a reference to C object within a struct
func (s *StyleItem) GetType() *StyleItemType {
	var ret *StyleItemType
	ret = (*StyleItemType)(unsafe.Pointer(&s._type))
	return ret
}

// GetData returns a reference to C object within a struct
func (s *StyleItem) GetData() *StyleItemData {
	var ret *StyleItemData
	ret = (*StyleItemData)(unsafe.Pointer(&s.data))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleProgress) Ref() *C.struct_nk_style_progress {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_progress)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleProgress) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleProgressRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleProgressRef(ref unsafe.Pointer) *StyleProgress {
	return (*StyleProgress)(ref)
}

// NewStyleProgress allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleProgress() *StyleProgress {
	return (*StyleProgress)(allocStructNkStyleProgressMemory(1))
}

// allocStructNkStyleProgressMemory allocates memory for type C.struct_nk_style_progress in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleProgressMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleProgressValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleProgressValue = unsafe.Sizeof([1]C.struct_nk_style_progress{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleProgress) PassRef() *C.struct_nk_style_progress {
	if x == nil {
		x = (*StyleProgress)(allocStructNkStyleProgressMemory(1))
	}
	return (*C.struct_nk_style_progress)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleProgress) 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 *StyleProgress) 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 *StyleProgress) 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 *StyleProgress) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetCursorNormal returns a reference to C object within a struct
func (s *StyleProgress) GetCursorNormal() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_normal))
	return ret
}

// GetCursorHover returns a reference to C object within a struct
func (s *StyleProgress) GetCursorHover() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_hover))
	return ret
}

// GetCursorActive returns a reference to C object within a struct
func (s *StyleProgress) GetCursorActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_active))
	return ret
}

// GetCursorBorderColor returns a reference to C object within a struct
func (s *StyleProgress) GetCursorBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.cursor_border_color))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleProgress) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleProgress) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetCursorBorder returns a reference to C object within a struct
func (s *StyleProgress) GetCursorBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.cursor_border))
	return ret
}

// GetCursorRounding returns a reference to C object within a struct
func (s *StyleProgress) GetCursorRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.cursor_rounding))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleProgress) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleProgress) 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 *StyleProperty) Ref() *C.struct_nk_style_property {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_property)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleProperty) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStylePropertyRef converts the C object reference into a raw struct reference without wrapping.
func NewStylePropertyRef(ref unsafe.Pointer) *StyleProperty {
	return (*StyleProperty)(ref)
}

// NewStyleProperty allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleProperty() *StyleProperty {
	return (*StyleProperty)(allocStructNkStylePropertyMemory(1))
}

// allocStructNkStylePropertyMemory allocates memory for type C.struct_nk_style_property in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStylePropertyMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStylePropertyValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStylePropertyValue = unsafe.Sizeof([1]C.struct_nk_style_property{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleProperty) PassRef() *C.struct_nk_style_property {
	if x == nil {
		x = (*StyleProperty)(allocStructNkStylePropertyMemory(1))
	}
	return (*C.struct_nk_style_property)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleProperty) 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 *StyleProperty) 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 *StyleProperty) 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 *StyleProperty) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetLabelNormal returns a reference to C object within a struct
func (s *StyleProperty) GetLabelNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_normal))
	return ret
}

// GetLabelHover returns a reference to C object within a struct
func (s *StyleProperty) GetLabelHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_hover))
	return ret
}

// GetLabelActive returns a reference to C object within a struct
func (s *StyleProperty) GetLabelActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_active))
	return ret
}

// GetSymLeft returns a reference to C object within a struct
func (s *StyleProperty) GetSymLeft() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_left))
	return ret
}

// GetSymRight returns a reference to C object within a struct
func (s *StyleProperty) GetSymRight() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_right))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleProperty) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleProperty) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleProperty) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetEdit returns a reference to C object within a struct
func (s *StyleProperty) GetEdit() *StyleEdit {
	var ret *StyleEdit
	ret = (*StyleEdit)(unsafe.Pointer(&s.edit))
	return ret
}

// GetIncButton returns a reference to C object within a struct
func (s *StyleProperty) GetIncButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.inc_button))
	return ret
}

// GetDecButton returns a reference to C object within a struct
func (s *StyleProperty) GetDecButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.dec_button))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleProperty) 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 *StyleScrollbar) Ref() *C.struct_nk_style_scrollbar {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_scrollbar)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleScrollbar) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleScrollbarRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleScrollbarRef(ref unsafe.Pointer) *StyleScrollbar {
	return (*StyleScrollbar)(ref)
}

// NewStyleScrollbar allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleScrollbar() *StyleScrollbar {
	return (*StyleScrollbar)(allocStructNkStyleScrollbarMemory(1))
}

// allocStructNkStyleScrollbarMemory allocates memory for type C.struct_nk_style_scrollbar in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleScrollbarMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleScrollbarValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleScrollbarValue = unsafe.Sizeof([1]C.struct_nk_style_scrollbar{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleScrollbar) PassRef() *C.struct_nk_style_scrollbar {
	if x == nil {
		x = (*StyleScrollbar)(allocStructNkStyleScrollbarMemory(1))
	}
	return (*C.struct_nk_style_scrollbar)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleScrollbar) 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 *StyleScrollbar) 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 *StyleScrollbar) 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 *StyleScrollbar) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetCursorNormal returns a reference to C object within a struct
func (s *StyleScrollbar) GetCursorNormal() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_normal))
	return ret
}

// GetCursorHover returns a reference to C object within a struct
func (s *StyleScrollbar) GetCursorHover() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_hover))
	return ret
}

// GetCursorActive returns a reference to C object within a struct
func (s *StyleScrollbar) GetCursorActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_active))
	return ret
}

// GetCursorBorderColor returns a reference to C object within a struct
func (s *StyleScrollbar) GetCursorBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.cursor_border_color))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleScrollbar) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleScrollbar) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetBorderCursor returns a reference to C object within a struct
func (s *StyleScrollbar) GetBorderCursor() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border_cursor))
	return ret
}

// GetRoundingCursor returns a reference to C object within a struct
func (s *StyleScrollbar) GetRoundingCursor() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding_cursor))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleScrollbar) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetShowButtons returns a reference to C object within a struct
func (s *StyleScrollbar) GetShowButtons() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.show_buttons))
	return ret
}

// GetIncButton returns a reference to C object within a struct
func (s *StyleScrollbar) GetIncButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.inc_button))
	return ret
}

// GetDecButton returns a reference to C object within a struct
func (s *StyleScrollbar) GetDecButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.dec_button))
	return ret
}

// GetIncSymbol returns a reference to C object within a struct
func (s *StyleScrollbar) GetIncSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.inc_symbol))
	return ret
}

// GetDecSymbol returns a reference to C object within a struct
func (s *StyleScrollbar) GetDecSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.dec_symbol))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleScrollbar) 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 *StyleSelectable) Ref() *C.struct_nk_style_selectable {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_selectable)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleSelectable) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleSelectableRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleSelectableRef(ref unsafe.Pointer) *StyleSelectable {
	return (*StyleSelectable)(ref)
}

// NewStyleSelectable allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleSelectable() *StyleSelectable {
	return (*StyleSelectable)(allocStructNkStyleSelectableMemory(1))
}

// allocStructNkStyleSelectableMemory allocates memory for type C.struct_nk_style_selectable in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleSelectableMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleSelectableValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleSelectableValue = unsafe.Sizeof([1]C.struct_nk_style_selectable{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleSelectable) PassRef() *C.struct_nk_style_selectable {
	if x == nil {
		x = (*StyleSelectable)(allocStructNkStyleSelectableMemory(1))
	}
	return (*C.struct_nk_style_selectable)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleSelectable) 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 *StyleSelectable) GetHover() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.hover))
	return ret
}

// GetPressed returns a reference to C object within a struct
func (s *StyleSelectable) GetPressed() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.pressed))
	return ret
}

// GetNormalActive returns a reference to C object within a struct
func (s *StyleSelectable) GetNormalActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.normal_active))
	return ret
}

// GetHoverActive returns a reference to C object within a struct
func (s *StyleSelectable) GetHoverActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.hover_active))
	return ret
}

// GetPressedActive returns a reference to C object within a struct
func (s *StyleSelectable) GetPressedActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.pressed_active))
	return ret
}

// GetTextNormal returns a reference to C object within a struct
func (s *StyleSelectable) GetTextNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_normal))
	return ret
}

// GetTextHover returns a reference to C object within a struct
func (s *StyleSelectable) GetTextHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_hover))
	return ret
}

// GetTextPressed returns a reference to C object within a struct
func (s *StyleSelectable) GetTextPressed() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_pressed))
	return ret
}

// GetTextNormalActive returns a reference to C object within a struct
func (s *StyleSelectable) GetTextNormalActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_normal_active))
	return ret
}

// GetTextHoverActive returns a reference to C object within a struct
func (s *StyleSelectable) GetTextHoverActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_hover_active))
	return ret
}

// GetTextPressedActive returns a reference to C object within a struct
func (s *StyleSelectable) GetTextPressedActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_pressed_active))
	return ret
}

// GetTextBackground returns a reference to C object within a struct
func (s *StyleSelectable) GetTextBackground() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_background))
	return ret
}

// GetTextAlignment returns a reference to C object within a struct
func (s *StyleSelectable) GetTextAlignment() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.text_alignment))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleSelectable) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleSelectable) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetTouchPadding returns a reference to C object within a struct
func (s *StyleSelectable) GetTouchPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.touch_padding))
	return ret
}

// GetImagePadding returns a reference to C object within a struct
func (s *StyleSelectable) GetImagePadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.image_padding))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleSelectable) 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 *StyleSlide) Ref() *C.struct_nk_style_slide {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_slide)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleSlide) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleSlideRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleSlideRef(ref unsafe.Pointer) *StyleSlide {
	return (*StyleSlide)(ref)
}

// NewStyleSlide allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleSlide() *StyleSlide {
	return (*StyleSlide)(allocStructNkStyleSlideMemory(1))
}

// allocStructNkStyleSlideMemory allocates memory for type C.struct_nk_style_slide in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleSlideMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleSlideValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleSlideValue = unsafe.Sizeof([1]C.struct_nk_style_slide{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleSlide) PassRef() *C.struct_nk_style_slide {
	if x == nil {
		x = (*StyleSlide)(allocStructNkStyleSlideMemory(1))
	}
	return (*C.struct_nk_style_slide)(unsafe.Pointer(x))
}

// Ref returns a reference to C object as it is.
func (x *StyleSlider) Ref() *C.struct_nk_style_slider {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_slider)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleSlider) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleSliderRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleSliderRef(ref unsafe.Pointer) *StyleSlider {
	return (*StyleSlider)(ref)
}

// NewStyleSlider allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleSlider() *StyleSlider {
	return (*StyleSlider)(allocStructNkStyleSliderMemory(1))
}

// allocStructNkStyleSliderMemory allocates memory for type C.struct_nk_style_slider in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleSliderMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleSliderValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleSliderValue = unsafe.Sizeof([1]C.struct_nk_style_slider{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleSlider) PassRef() *C.struct_nk_style_slider {
	if x == nil {
		x = (*StyleSlider)(allocStructNkStyleSliderMemory(1))
	}
	return (*C.struct_nk_style_slider)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleSlider) 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 *StyleSlider) 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 *StyleSlider) 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 *StyleSlider) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetBarNormal returns a reference to C object within a struct
func (s *StyleSlider) GetBarNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.bar_normal))
	return ret
}

// GetBarHover returns a reference to C object within a struct
func (s *StyleSlider) GetBarHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.bar_hover))
	return ret
}

// GetBarActive returns a reference to C object within a struct
func (s *StyleSlider) GetBarActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.bar_active))
	return ret
}

// GetBarFilled returns a reference to C object within a struct
func (s *StyleSlider) GetBarFilled() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.bar_filled))
	return ret
}

// GetCursorNormal returns a reference to C object within a struct
func (s *StyleSlider) GetCursorNormal() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_normal))
	return ret
}

// GetCursorHover returns a reference to C object within a struct
func (s *StyleSlider) GetCursorHover() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_hover))
	return ret
}

// GetCursorActive returns a reference to C object within a struct
func (s *StyleSlider) GetCursorActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_active))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleSlider) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleSlider) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetBarHeight returns a reference to C object within a struct
func (s *StyleSlider) GetBarHeight() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.bar_height))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleSlider) 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 *StyleSlider) GetSpacing() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.spacing))
	return ret
}

// GetCursorSize returns a reference to C object within a struct
func (s *StyleSlider) GetCursorSize() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.cursor_size))
	return ret
}

// GetShowButtons returns a reference to C object within a struct
func (s *StyleSlider) GetShowButtons() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.show_buttons))
	return ret
}

// GetIncButton returns a reference to C object within a struct
func (s *StyleSlider) GetIncButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.inc_button))
	return ret
}

// GetDecButton returns a reference to C object within a struct
func (s *StyleSlider) GetDecButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.dec_button))
	return ret
}

// GetIncSymbol returns a reference to C object within a struct
func (s *StyleSlider) GetIncSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.inc_symbol))
	return ret
}

// GetDecSymbol returns a reference to C object within a struct
func (s *StyleSlider) GetDecSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.dec_symbol))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleSlider) 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 *StyleTab) Ref() *C.struct_nk_style_tab {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_tab)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleTab) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleTabRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleTabRef(ref unsafe.Pointer) *StyleTab {
	return (*StyleTab)(ref)
}

// NewStyleTab allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleTab() *StyleTab {
	return (*StyleTab)(allocStructNkStyleTabMemory(1))
}

// allocStructNkStyleTabMemory allocates memory for type C.struct_nk_style_tab in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleTabMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleTabValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleTabValue = unsafe.Sizeof([1]C.struct_nk_style_tab{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleTab) PassRef() *C.struct_nk_style_tab {
	if x == nil {
		x = (*StyleTab)(allocStructNkStyleTabMemory(1))
	}
	return (*C.struct_nk_style_tab)(unsafe.Pointer(x))
}

// GetBackground returns a reference to C object within a struct
func (s *StyleTab) GetBackground() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.background))
	return ret
}

// GetBorderColor returns a reference to C object within a struct
func (s *StyleTab) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetText returns a reference to C object within a struct
func (s *StyleTab) GetText() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text))
	return ret
}

// GetTabMaximizeButton returns a reference to C object within a struct
func (s *StyleTab) GetTabMaximizeButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.tab_maximize_button))
	return ret
}

// GetTabMinimizeButton returns a reference to C object within a struct
func (s *StyleTab) GetTabMinimizeButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.tab_minimize_button))
	return ret
}

// GetNodeMaximizeButton returns a reference to C object within a struct
func (s *StyleTab) GetNodeMaximizeButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.node_maximize_button))
	return ret
}

// GetNodeMinimizeButton returns a reference to C object within a struct
func (s *StyleTab) GetNodeMinimizeButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.node_minimize_button))
	return ret
}

// GetSymMinimize returns a reference to C object within a struct
func (s *StyleTab) GetSymMinimize() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_minimize))
	return ret
}

// GetSymMaximize returns a reference to C object within a struct
func (s *StyleTab) GetSymMaximize() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.sym_maximize))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleTab) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleTab) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetIndent returns a reference to C object within a struct
func (s *StyleTab) GetIndent() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.indent))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleTab) 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 *StyleTab) GetSpacing() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.spacing))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleText) Ref() *C.struct_nk_style_text {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_text)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleText) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleTextRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleTextRef(ref unsafe.Pointer) *StyleText {
	return (*StyleText)(ref)
}

// NewStyleText allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleText() *StyleText {
	return (*StyleText)(allocStructNkStyleTextMemory(1))
}

// allocStructNkStyleTextMemory allocates memory for type C.struct_nk_style_text in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleTextMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleTextValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleTextValue = unsafe.Sizeof([1]C.struct_nk_style_text{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleText) PassRef() *C.struct_nk_style_text {
	if x == nil {
		x = (*StyleText)(allocStructNkStyleTextMemory(1))
	}
	return (*C.struct_nk_style_text)(unsafe.Pointer(x))
}

// GetColor returns a reference to C object within a struct
func (s *StyleText) GetColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.color))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleText) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleToggle) Ref() *C.struct_nk_style_toggle {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_toggle)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleToggle) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleToggleRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleToggleRef(ref unsafe.Pointer) *StyleToggle {
	return (*StyleToggle)(ref)
}

// NewStyleToggle allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleToggle() *StyleToggle {
	return (*StyleToggle)(allocStructNkStyleToggleMemory(1))
}

// allocStructNkStyleToggleMemory allocates memory for type C.struct_nk_style_toggle in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleToggleMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleToggleValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleToggleValue = unsafe.Sizeof([1]C.struct_nk_style_toggle{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleToggle) PassRef() *C.struct_nk_style_toggle {
	if x == nil {
		x = (*StyleToggle)(allocStructNkStyleToggleMemory(1))
	}
	return (*C.struct_nk_style_toggle)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleToggle) 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 *StyleToggle) 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 *StyleToggle) 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 *StyleToggle) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetCursorNormal returns a reference to C object within a struct
func (s *StyleToggle) GetCursorNormal() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_normal))
	return ret
}

// GetCursorHover returns a reference to C object within a struct
func (s *StyleToggle) GetCursorHover() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.cursor_hover))
	return ret
}

// GetTextNormal returns a reference to C object within a struct
func (s *StyleToggle) GetTextNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_normal))
	return ret
}

// GetTextHover returns a reference to C object within a struct
func (s *StyleToggle) GetTextHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_hover))
	return ret
}

// GetTextActive returns a reference to C object within a struct
func (s *StyleToggle) GetTextActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_active))
	return ret
}

// GetTextBackground returns a reference to C object within a struct
func (s *StyleToggle) GetTextBackground() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.text_background))
	return ret
}

// GetTextAlignment returns a reference to C object within a struct
func (s *StyleToggle) GetTextAlignment() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.text_alignment))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleToggle) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetTouchPadding returns a reference to C object within a struct
func (s *StyleToggle) GetTouchPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.touch_padding))
	return ret
}

// GetSpacing returns a reference to C object within a struct
func (s *StyleToggle) GetSpacing() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.spacing))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleToggle) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetUserdata returns a reference to C object within a struct
func (s *StyleToggle) 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 *StyleWindow) Ref() *C.struct_nk_style_window {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_window)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleWindow) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleWindowRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleWindowRef(ref unsafe.Pointer) *StyleWindow {
	return (*StyleWindow)(ref)
}

// NewStyleWindow allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleWindow() *StyleWindow {
	return (*StyleWindow)(allocStructNkStyleWindowMemory(1))
}

// allocStructNkStyleWindowMemory allocates memory for type C.struct_nk_style_window in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleWindowMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleWindowValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleWindowValue = unsafe.Sizeof([1]C.struct_nk_style_window{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleWindow) PassRef() *C.struct_nk_style_window {
	if x == nil {
		x = (*StyleWindow)(allocStructNkStyleWindowMemory(1))
	}
	return (*C.struct_nk_style_window)(unsafe.Pointer(x))
}

// GetHeader returns a reference to C object within a struct
func (s *StyleWindow) GetHeader() *StyleWindowHeader {
	var ret *StyleWindowHeader
	ret = (*StyleWindowHeader)(unsafe.Pointer(&s.header))
	return ret
}

// GetFixedBackground returns a reference to C object within a struct
func (s *StyleWindow) GetFixedBackground() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.fixed_background))
	return ret
}

// GetBackground returns a reference to C object within a struct
func (s *StyleWindow) GetBackground() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.background))
	return ret
}

// GetBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.border_color))
	return ret
}

// GetPopupBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetPopupBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.popup_border_color))
	return ret
}

// GetComboBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetComboBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.combo_border_color))
	return ret
}

// GetContextualBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetContextualBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.contextual_border_color))
	return ret
}

// GetMenuBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetMenuBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.menu_border_color))
	return ret
}

// GetGroupBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetGroupBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.group_border_color))
	return ret
}

// GetTooltipBorderColor returns a reference to C object within a struct
func (s *StyleWindow) GetTooltipBorderColor() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.tooltip_border_color))
	return ret
}

// GetScaler returns a reference to C object within a struct
func (s *StyleWindow) GetScaler() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.scaler))
	return ret
}

// GetBorder returns a reference to C object within a struct
func (s *StyleWindow) GetBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.border))
	return ret
}

// GetComboBorder returns a reference to C object within a struct
func (s *StyleWindow) GetComboBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.combo_border))
	return ret
}

// GetContextualBorder returns a reference to C object within a struct
func (s *StyleWindow) GetContextualBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.contextual_border))
	return ret
}

// GetMenuBorder returns a reference to C object within a struct
func (s *StyleWindow) GetMenuBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.menu_border))
	return ret
}

// GetGroupBorder returns a reference to C object within a struct
func (s *StyleWindow) GetGroupBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.group_border))
	return ret
}

// GetTooltipBorder returns a reference to C object within a struct
func (s *StyleWindow) GetTooltipBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.tooltip_border))
	return ret
}

// GetPopupBorder returns a reference to C object within a struct
func (s *StyleWindow) GetPopupBorder() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.popup_border))
	return ret
}

// GetMinRowHeightPadding returns a reference to C object within a struct
func (s *StyleWindow) GetMinRowHeightPadding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.min_row_height_padding))
	return ret
}

// GetRounding returns a reference to C object within a struct
func (s *StyleWindow) GetRounding() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.rounding))
	return ret
}

// GetSpacing returns a reference to C object within a struct
func (s *StyleWindow) GetSpacing() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.spacing))
	return ret
}

// GetScrollbarSize returns a reference to C object within a struct
func (s *StyleWindow) GetScrollbarSize() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.scrollbar_size))
	return ret
}

// GetMinSize returns a reference to C object within a struct
func (s *StyleWindow) GetMinSize() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.min_size))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleWindow) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetGroupPadding returns a reference to C object within a struct
func (s *StyleWindow) GetGroupPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.group_padding))
	return ret
}

// GetPopupPadding returns a reference to C object within a struct
func (s *StyleWindow) GetPopupPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.popup_padding))
	return ret
}

// GetComboPadding returns a reference to C object within a struct
func (s *StyleWindow) GetComboPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.combo_padding))
	return ret
}

// GetContextualPadding returns a reference to C object within a struct
func (s *StyleWindow) GetContextualPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.contextual_padding))
	return ret
}

// GetMenuPadding returns a reference to C object within a struct
func (s *StyleWindow) GetMenuPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.menu_padding))
	return ret
}

// GetTooltipPadding returns a reference to C object within a struct
func (s *StyleWindow) GetTooltipPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.tooltip_padding))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *StyleWindowHeader) Ref() *C.struct_nk_style_window_header {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_style_window_header)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *StyleWindowHeader) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewStyleWindowHeaderRef converts the C object reference into a raw struct reference without wrapping.
func NewStyleWindowHeaderRef(ref unsafe.Pointer) *StyleWindowHeader {
	return (*StyleWindowHeader)(ref)
}

// NewStyleWindowHeader allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewStyleWindowHeader() *StyleWindowHeader {
	return (*StyleWindowHeader)(allocStructNkStyleWindowHeaderMemory(1))
}

// allocStructNkStyleWindowHeaderMemory allocates memory for type C.struct_nk_style_window_header in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkStyleWindowHeaderMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkStyleWindowHeaderValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkStyleWindowHeaderValue = unsafe.Sizeof([1]C.struct_nk_style_window_header{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *StyleWindowHeader) PassRef() *C.struct_nk_style_window_header {
	if x == nil {
		x = (*StyleWindowHeader)(allocStructNkStyleWindowHeaderMemory(1))
	}
	return (*C.struct_nk_style_window_header)(unsafe.Pointer(x))
}

// GetNormal returns a reference to C object within a struct
func (s *StyleWindowHeader) 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 *StyleWindowHeader) 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 *StyleWindowHeader) GetActive() *StyleItem {
	var ret *StyleItem
	ret = (*StyleItem)(unsafe.Pointer(&s.active))
	return ret
}

// GetCloseButton returns a reference to C object within a struct
func (s *StyleWindowHeader) GetCloseButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.close_button))
	return ret
}

// GetMinimizeButton returns a reference to C object within a struct
func (s *StyleWindowHeader) GetMinimizeButton() *StyleButton {
	var ret *StyleButton
	ret = (*StyleButton)(unsafe.Pointer(&s.minimize_button))
	return ret
}

// GetCloseSymbol returns a reference to C object within a struct
func (s *StyleWindowHeader) GetCloseSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.close_symbol))
	return ret
}

// GetMinimizeSymbol returns a reference to C object within a struct
func (s *StyleWindowHeader) GetMinimizeSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.minimize_symbol))
	return ret
}

// GetMaximizeSymbol returns a reference to C object within a struct
func (s *StyleWindowHeader) GetMaximizeSymbol() *SymbolType {
	var ret *SymbolType
	ret = (*SymbolType)(unsafe.Pointer(&s.maximize_symbol))
	return ret
}

// GetLabelNormal returns a reference to C object within a struct
func (s *StyleWindowHeader) GetLabelNormal() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_normal))
	return ret
}

// GetLabelHover returns a reference to C object within a struct
func (s *StyleWindowHeader) GetLabelHover() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_hover))
	return ret
}

// GetLabelActive returns a reference to C object within a struct
func (s *StyleWindowHeader) GetLabelActive() *Color {
	var ret *Color
	ret = (*Color)(unsafe.Pointer(&s.label_active))
	return ret
}

// GetAlign returns a reference to C object within a struct
func (s *StyleWindowHeader) GetAlign() *StyleHeaderAlign {
	var ret *StyleHeaderAlign
	ret = (*StyleHeaderAlign)(unsafe.Pointer(&s.align))
	return ret
}

// GetPadding returns a reference to C object within a struct
func (s *StyleWindowHeader) GetPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.padding))
	return ret
}

// GetLabelPadding returns a reference to C object within a struct
func (s *StyleWindowHeader) GetLabelPadding() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.label_padding))
	return ret
}

// GetSpacing returns a reference to C object within a struct
func (s *StyleWindowHeader) GetSpacing() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.spacing))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Table) Ref() *C.struct_nk_table {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_table)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Table) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewTableRef converts the C object reference into a raw struct reference without wrapping.
func NewTableRef(ref unsafe.Pointer) *Table {
	return (*Table)(ref)
}

// NewTable allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewTable() *Table {
	return (*Table)(allocStructNkTableMemory(1))
}

// allocStructNkTableMemory allocates memory for type C.struct_nk_table in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkTableMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkTableValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkTableValue = unsafe.Sizeof([1]C.struct_nk_table{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Table) PassRef() *C.struct_nk_table {
	if x == nil {
		x = (*Table)(allocStructNkTableMemory(1))
	}
	return (*C.struct_nk_table)(unsafe.Pointer(x))
}

// GetSeq returns a reference to C object within a struct
func (s *Table) GetSeq() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.seq))
	return ret
}

// GetSize returns a reference to C object within a struct
func (s *Table) GetSize() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.size))
	return ret
}

// 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))
	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))
	return ret
}

// GetNext returns a reference to C object within a struct
func (s *Table) GetNext() **Table {
	var ret **Table
	ret = (**Table)(unsafe.Pointer(&s.next))
	return ret
}

// GetPrev returns a reference to C object within a struct
func (s *Table) GetPrev() **Table {
	var ret **Table
	ret = (**Table)(unsafe.Pointer(&s.prev))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *TextEdit) Ref() *C.struct_nk_text_edit {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_text_edit)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *TextEdit) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewTextEditRef converts the C object reference into a raw struct reference without wrapping.
func NewTextEditRef(ref unsafe.Pointer) *TextEdit {
	return (*TextEdit)(ref)
}

// NewTextEdit allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewTextEdit() *TextEdit {
	return (*TextEdit)(allocStructNkTextEditMemory(1))
}

// allocStructNkTextEditMemory allocates memory for type C.struct_nk_text_edit in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkTextEditMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkTextEditValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkTextEditValue = unsafe.Sizeof([1]C.struct_nk_text_edit{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *TextEdit) PassRef() *C.struct_nk_text_edit {
	if x == nil {
		x = (*TextEdit)(allocStructNkTextEditMemory(1))
	}
	return (*C.struct_nk_text_edit)(unsafe.Pointer(x))
}

// GetClip returns a reference to C object within a struct
func (s *TextEdit) GetClip() *Clipboard {
	var ret *Clipboard
	ret = (*Clipboard)(unsafe.Pointer(&s.clip))
	return ret
}

// GetString returns a reference to C object within a struct
func (s *TextEdit) GetString() *Str {
	var ret *Str
	ret = (*Str)(unsafe.Pointer(&s.string))
	return ret
}

// GetFilter returns a reference to C object within a struct
func (s *TextEdit) GetFilter() *PluginFilter {
	var ret *PluginFilter
	ret = NewPluginFilterRef(unsafe.Pointer(&s.filter))
	return ret
}

// GetScrollbar returns a reference to C object within a struct
func (s *TextEdit) GetScrollbar() *Vec2 {
	var ret *Vec2
	ret = (*Vec2)(unsafe.Pointer(&s.scrollbar))
	return ret
}

// GetCursor returns a reference to C object within a struct
func (s *TextEdit) GetCursor() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.cursor))
	return ret
}

// GetSelectStart returns a reference to C object within a struct
func (s *TextEdit) GetSelectStart() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.select_start))
	return ret
}

// GetSelectEnd returns a reference to C object within a struct
func (s *TextEdit) GetSelectEnd() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.select_end))
	return ret
}

// GetMode returns a reference to C object within a struct
func (s *TextEdit) GetMode() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.mode))
	return ret
}

// GetCursorAtEndOfLine returns a reference to C object within a struct
func (s *TextEdit) GetCursorAtEndOfLine() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.cursor_at_end_of_line))
	return ret
}

// GetInitialized returns a reference to C object within a struct
func (s *TextEdit) GetInitialized() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.initialized))
	return ret
}

// GetHasPreferredX returns a reference to C object within a struct
func (s *TextEdit) GetHasPreferredX() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.has_preferred_x))
	return ret
}

// GetSingleLine returns a reference to C object within a struct
func (s *TextEdit) GetSingleLine() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.single_line))
	return ret
}

// GetActive returns a reference to C object within a struct
func (s *TextEdit) GetActive() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.active))
	return ret
}

// GetPadding1 returns a reference to C object within a struct
func (s *TextEdit) GetPadding1() *byte {
	var ret *byte
	ret = (*byte)(unsafe.Pointer(&s.padding1))
	return ret
}

// GetPreferredX returns a reference to C object within a struct
func (s *TextEdit) GetPreferredX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.preferred_x))
	return ret
}

// GetUndo returns a reference to C object within a struct
func (s *TextEdit) GetUndo() *TextUndoState {
	var ret *TextUndoState
	ret = (*TextUndoState)(unsafe.Pointer(&s.undo))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *TextUndoRecord) Ref() *C.struct_nk_text_undo_record {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_text_undo_record)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *TextUndoRecord) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewTextUndoRecordRef converts the C object reference into a raw struct reference without wrapping.
func NewTextUndoRecordRef(ref unsafe.Pointer) *TextUndoRecord {
	return (*TextUndoRecord)(ref)
}

// NewTextUndoRecord allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewTextUndoRecord() *TextUndoRecord {
	return (*TextUndoRecord)(allocStructNkTextUndoRecordMemory(1))
}

// allocStructNkTextUndoRecordMemory allocates memory for type C.struct_nk_text_undo_record in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkTextUndoRecordMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkTextUndoRecordValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkTextUndoRecordValue = unsafe.Sizeof([1]C.struct_nk_text_undo_record{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *TextUndoRecord) PassRef() *C.struct_nk_text_undo_record {
	if x == nil {
		x = (*TextUndoRecord)(allocStructNkTextUndoRecordMemory(1))
	}
	return (*C.struct_nk_text_undo_record)(unsafe.Pointer(x))
}

// GetWhere returns a reference to C object within a struct
func (s *TextUndoRecord) GetWhere() *int32 {
	var ret *int32
	ret = (*int32)(unsafe.Pointer(&s.where))
	return ret
}

// GetInsertLength returns a reference to C object within a struct
func (s *TextUndoRecord) GetInsertLength() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.insert_length))
	return ret
}

// GetDeleteLength returns a reference to C object within a struct
func (s *TextUndoRecord) GetDeleteLength() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.delete_length))
	return ret
}

// GetCharStorage returns a reference to C object within a struct
func (s *TextUndoRecord) GetCharStorage() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.char_storage))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *TextUndoState) Ref() *C.struct_nk_text_undo_state {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_text_undo_state)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *TextUndoState) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewTextUndoStateRef converts the C object reference into a raw struct reference without wrapping.
func NewTextUndoStateRef(ref unsafe.Pointer) *TextUndoState {
	return (*TextUndoState)(ref)
}

// NewTextUndoState allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewTextUndoState() *TextUndoState {
	return (*TextUndoState)(allocStructNkTextUndoStateMemory(1))
}

// allocStructNkTextUndoStateMemory allocates memory for type C.struct_nk_text_undo_state in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkTextUndoStateMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkTextUndoStateValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkTextUndoStateValue = unsafe.Sizeof([1]C.struct_nk_text_undo_state{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *TextUndoState) PassRef() *C.struct_nk_text_undo_state {
	if x == nil {
		x = (*TextUndoState)(allocStructNkTextUndoStateMemory(1))
	}
	return (*C.struct_nk_text_undo_state)(unsafe.Pointer(x))
}

// GetUndoRec returns a reference to C object within a struct
func (s *TextUndoState) GetUndoRec() [99]TextUndoRecord {
	var ret [99]TextUndoRecord
	ret = *(*[99]TextUndoRecord)(unsafe.Pointer(&s.undo_rec))
	return ret
}

// GetUndoChar returns a reference to C object within a struct
func (s *TextUndoState) GetUndoChar() [999]Rune {
	var ret [999]Rune
	ret = *(*[999]Rune)(unsafe.Pointer(&s.undo_char))
	return ret
}

// GetUndoPoint returns a reference to C object within a struct
func (s *TextUndoState) GetUndoPoint() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.undo_point))
	return ret
}

// GetRedoPoint returns a reference to C object within a struct
func (s *TextUndoState) GetRedoPoint() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.redo_point))
	return ret
}

// GetUndoCharPoint returns a reference to C object within a struct
func (s *TextUndoState) GetUndoCharPoint() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.undo_char_point))
	return ret
}

// GetRedoCharPoint returns a reference to C object within a struct
func (s *TextUndoState) GetRedoCharPoint() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.redo_char_point))
	return ret
}

// Ref returns the underlying reference to C object or nil if struct is nil.
func (x *UserFont) Ref() *C.struct_nk_user_font {
	if x == nil {
		return nil
	}
	return x.ref738ce62e
}

// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free.
// Does nothing if struct is nil or has no allocation map.
func (x *UserFont) Free() {
	if x != nil && x.allocs738ce62e != nil {
		x.allocs738ce62e.(*cgoAllocMap).Free()
		x.ref738ce62e = nil
	}
}

// NewUserFontRef creates a new wrapper struct with underlying reference set to the original C object.
// Returns nil if the provided pointer to C object is nil too.
func NewUserFontRef(ref unsafe.Pointer) *UserFont {
	if ref == nil {
		return nil
	}
	obj := new(UserFont)
	obj.ref738ce62e = (*C.struct_nk_user_font)(unsafe.Pointer(ref))
	return obj
}

// PassRef returns the underlying C object, otherwise it will allocate one and set its values
// from this wrapping struct, counting allocations into an allocation map.
func (x *UserFont) PassRef() (*C.struct_nk_user_font, *cgoAllocMap) {
	if x == nil {
		return nil, nil
	} else if x.ref738ce62e != nil {
		return x.ref738ce62e, nil
	}
	mem738ce62e := allocStructNkUserFontMemory(1)
	ref738ce62e := (*C.struct_nk_user_font)(mem738ce62e)
	allocs738ce62e := new(cgoAllocMap)
	allocs738ce62e.Add(mem738ce62e)

	var cuserdata_allocs *cgoAllocMap
	ref738ce62e.userdata, cuserdata_allocs = *(*C.nk_handle)(unsafe.Pointer(&x.Userdata)), cgoAllocsUnknown
	allocs738ce62e.Borrow(cuserdata_allocs)

	var cheight_allocs *cgoAllocMap
	ref738ce62e.height, cheight_allocs = (C.float)(x.Height), cgoAllocsUnknown
	allocs738ce62e.Borrow(cheight_allocs)

	var cwidth_allocs *cgoAllocMap
	ref738ce62e.width, cwidth_allocs = x.Width.PassValue()
	allocs738ce62e.Borrow(cwidth_allocs)

	var cquery_allocs *cgoAllocMap
	ref738ce62e.query, cquery_allocs = x.Query.PassValue()
	allocs738ce62e.Borrow(cquery_allocs)

	var ctexture_allocs *cgoAllocMap
	ref738ce62e.texture, ctexture_allocs = *(*C.nk_handle)(unsafe.Pointer(&x.Texture)), cgoAllocsUnknown
	allocs738ce62e.Borrow(ctexture_allocs)

	x.ref738ce62e = ref738ce62e
	x.allocs738ce62e = allocs738ce62e
	return ref738ce62e, allocs738ce62e

}

// PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (x UserFont) PassValue() (C.struct_nk_user_font, *cgoAllocMap) {
	if x.ref738ce62e != nil {
		return *x.ref738ce62e, nil
	}
	ref, allocs := x.PassRef()
	return *ref, allocs
}

// Deref uses the underlying reference to C object and fills the wrapping struct with values.
// Do not forget to call this method whether you get a struct for C object and want to read its values.
func (x *UserFont) Deref() {
	if x.ref738ce62e == nil {
		return
	}
	x.Userdata = *(*Handle)(unsafe.Pointer(&x.ref738ce62e.userdata))
	x.Height = (float32)(x.ref738ce62e.height)
	x.Width = *NewTextWidthFRef(unsafe.Pointer(&x.ref738ce62e.width))
	x.Query = *NewQueryFontGlyphFRef(unsafe.Pointer(&x.ref738ce62e.query))
	x.Texture = *(*Handle)(unsafe.Pointer(&x.ref738ce62e.texture))
}

// allocStructNkUserFontGlyphMemory allocates memory for type C.struct_nk_user_font_glyph in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkUserFontGlyphMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkUserFontGlyphValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkUserFontGlyphValue = unsafe.Sizeof([1]C.struct_nk_user_font_glyph{})

// Ref returns the underlying reference to C object or nil if struct is nil.
func (x *UserFontGlyph) Ref() *C.struct_nk_user_font_glyph {
	if x == nil {
		return nil
	}
	return x.ref4a84b297
}

// Free invokes alloc map's free mechanism that cleanups any allocated memory using C free.
// Does nothing if struct is nil or has no allocation map.
func (x *UserFontGlyph) Free() {
	if x != nil && x.allocs4a84b297 != nil {
		x.allocs4a84b297.(*cgoAllocMap).Free()
		x.ref4a84b297 = nil
	}
}

// NewUserFontGlyphRef creates a new wrapper struct with underlying reference set to the original C object.
// Returns nil if the provided pointer to C object is nil too.
func NewUserFontGlyphRef(ref unsafe.Pointer) *UserFontGlyph {
	if ref == nil {
		return nil
	}
	obj := new(UserFontGlyph)
	obj.ref4a84b297 = (*C.struct_nk_user_font_glyph)(unsafe.Pointer(ref))
	return obj
}

// PassRef returns the underlying C object, otherwise it will allocate one and set its values
// from this wrapping struct, counting allocations into an allocation map.
func (x *UserFontGlyph) PassRef() (*C.struct_nk_user_font_glyph, *cgoAllocMap) {
	if x == nil {
		return nil, nil
	} else if x.ref4a84b297 != nil {
		return x.ref4a84b297, nil
	}
	mem4a84b297 := allocStructNkUserFontGlyphMemory(1)
	ref4a84b297 := (*C.struct_nk_user_font_glyph)(mem4a84b297)
	allocs4a84b297 := new(cgoAllocMap)
	allocs4a84b297.Add(mem4a84b297)

	var cuv_allocs *cgoAllocMap
	ref4a84b297.uv, cuv_allocs = *(*[2]C.struct_nk_vec2)(unsafe.Pointer(&x.Uv)), cgoAllocsUnknown
	allocs4a84b297.Borrow(cuv_allocs)

	var coffset_allocs *cgoAllocMap
	ref4a84b297.offset, coffset_allocs = *(*C.struct_nk_vec2)(unsafe.Pointer(&x.Offset)), cgoAllocsUnknown
	allocs4a84b297.Borrow(coffset_allocs)

	var cwidth_allocs *cgoAllocMap
	ref4a84b297.width, cwidth_allocs = (C.float)(x.Width), cgoAllocsUnknown
	allocs4a84b297.Borrow(cwidth_allocs)

	var cheight_allocs *cgoAllocMap
	ref4a84b297.height, cheight_allocs = (C.float)(x.Height), cgoAllocsUnknown
	allocs4a84b297.Borrow(cheight_allocs)

	var cxadvance_allocs *cgoAllocMap
	ref4a84b297.xadvance, cxadvance_allocs = (C.float)(x.Xadvance), cgoAllocsUnknown
	allocs4a84b297.Borrow(cxadvance_allocs)

	x.ref4a84b297 = ref4a84b297
	x.allocs4a84b297 = allocs4a84b297
	return ref4a84b297, allocs4a84b297

}

// PassValue does the same as PassRef except that it will try to dereference the returned pointer.
func (x UserFontGlyph) PassValue() (C.struct_nk_user_font_glyph, *cgoAllocMap) {
	if x.ref4a84b297 != nil {
		return *x.ref4a84b297, nil
	}
	ref, allocs := x.PassRef()
	return *ref, allocs
}

// Deref uses the underlying reference to C object and fills the wrapping struct with values.
// Do not forget to call this method whether you get a struct for C object and want to read its values.
func (x *UserFontGlyph) Deref() {
	if x.ref4a84b297 == nil {
		return
	}
	x.Uv = *(*[2]Vec2)(unsafe.Pointer(&x.ref4a84b297.uv))
	x.Offset = *(*Vec2)(unsafe.Pointer(&x.ref4a84b297.offset))
	x.Width = (float32)(x.ref4a84b297.width)
	x.Height = (float32)(x.ref4a84b297.height)
	x.Xadvance = (float32)(x.ref4a84b297.xadvance)
}

// Ref returns a reference to C object as it is.
func (x *Vec2) Ref() *C.struct_nk_vec2 {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_vec2)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Vec2) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewVec2Ref converts the C object reference into a raw struct reference without wrapping.
func NewVec2Ref(ref unsafe.Pointer) *Vec2 {
	return (*Vec2)(ref)
}

// NewVec2 allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewVec2() *Vec2 {
	return (*Vec2)(allocStructNkVec2Memory(1))
}

// allocStructNkVec2Memory allocates memory for type C.struct_nk_vec2 in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkVec2Memory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkVec2Value))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkVec2Value = unsafe.Sizeof([1]C.struct_nk_vec2{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Vec2) PassRef() *C.struct_nk_vec2 {
	if x == nil {
		x = (*Vec2)(allocStructNkVec2Memory(1))
	}
	return (*C.struct_nk_vec2)(unsafe.Pointer(x))
}

// GetX returns a reference to C object within a struct
func (s *Vec2) GetX() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *Vec2) GetY() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.y))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Vec2i) Ref() *C.struct_nk_vec2i {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_vec2i)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Vec2i) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewVec2iRef converts the C object reference into a raw struct reference without wrapping.
func NewVec2iRef(ref unsafe.Pointer) *Vec2i {
	return (*Vec2i)(ref)
}

// NewVec2i allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewVec2i() *Vec2i {
	return (*Vec2i)(allocStructNkVec2iMemory(1))
}

// allocStructNkVec2iMemory allocates memory for type C.struct_nk_vec2i in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkVec2iMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkVec2iValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkVec2iValue = unsafe.Sizeof([1]C.struct_nk_vec2i{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Vec2i) PassRef() *C.struct_nk_vec2i {
	if x == nil {
		x = (*Vec2i)(allocStructNkVec2iMemory(1))
	}
	return (*C.struct_nk_vec2i)(unsafe.Pointer(x))
}

// GetX returns a reference to C object within a struct
func (s *Vec2i) GetX() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.x))
	return ret
}

// GetY returns a reference to C object within a struct
func (s *Vec2i) GetY() *int16 {
	var ret *int16
	ret = (*int16)(unsafe.Pointer(&s.y))
	return ret
}

// Ref returns a reference to C object as it is.
func (x *Window) Ref() *C.struct_nk_window {
	if x == nil {
		return nil
	}
	return (*C.struct_nk_window)(unsafe.Pointer(x))
}

// Free cleanups the referenced memory using C free.
func (x *Window) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}

// NewWindowRef converts the C object reference into a raw struct reference without wrapping.
func NewWindowRef(ref unsafe.Pointer) *Window {
	return (*Window)(ref)
}

// NewWindow allocates a new C object of this type and converts the reference into
// a raw struct reference without wrapping.
func NewWindow() *Window {
	return (*Window)(allocStructNkWindowMemory(1))
}

// allocStructNkWindowMemory allocates memory for type C.struct_nk_window in C.
// The caller is responsible for freeing the this memory via C.free.
func allocStructNkWindowMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfStructNkWindowValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfStructNkWindowValue = unsafe.Sizeof([1]C.struct_nk_window{})

// PassRef returns a reference to C object as it is or allocates a new C object of this type.
func (x *Window) PassRef() *C.struct_nk_window {
	if x == nil {
		x = (*Window)(allocStructNkWindowMemory(1))
	}
	return (*C.struct_nk_window)(unsafe.Pointer(x))
}

// GetSeq returns a reference to C object within a struct
func (s *Window) GetSeq() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.seq))
	return ret
}

// GetName returns a reference to C object within a struct
func (s *Window) GetName() *Hash {
	var ret *Hash
	ret = (*Hash)(unsafe.Pointer(&s.name))
	return ret
}

// GetNameString returns a reference to C object within a struct
func (s *Window) GetNameString() [64]byte {
	var ret [64]byte
	ret = *(*[64]byte)(unsafe.Pointer(&s.name_string))
	return ret
}

// GetFlags returns a reference to C object within a struct
func (s *Window) GetFlags() *Flags {
	var ret *Flags
	ret = (*Flags)(unsafe.Pointer(&s.flags))
	return ret
}

// GetBounds returns a reference to C object within a struct
func (s *Window) GetBounds() *Rect {
	var ret *Rect
	ret = (*Rect)(unsafe.Pointer(&s.bounds))
	return ret
}

// GetScrollbar returns a reference to C object within a struct
func (s *Window) GetScrollbar() *Scroll {
	var ret *Scroll
	ret = (*Scroll)(unsafe.Pointer(&s.scrollbar))
	return ret
}

// GetBuffer returns a reference to C object within a struct
func (s *Window) GetBuffer() *CommandBuffer {
	var ret *CommandBuffer
	ret = (*CommandBuffer)(unsafe.Pointer(&s.buffer))
	return ret
}

// GetLayout returns a reference to C object within a struct
func (s *Window) GetLayout() **Panel {
	var ret **Panel
	ret = (**Panel)(unsafe.Pointer(&s.layout))
	return ret
}

// GetScrollbarHidingTimer returns a reference to C object within a struct
func (s *Window) GetScrollbarHidingTimer() *float32 {
	var ret *float32
	ret = (*float32)(unsafe.Pointer(&s.scrollbar_hiding_timer))
	return ret
}

// GetProperty returns a reference to C object within a struct
func (s *Window) GetProperty() *PropertyState {
	var ret *PropertyState
	ret = (*PropertyState)(unsafe.Pointer(&s.property))
	return ret
}

// GetPopup returns a reference to C object within a struct
func (s *Window) GetPopup() *PopupState {
	var ret *PopupState
	ret = (*PopupState)(unsafe.Pointer(&s.popup))
	return ret
}

// GetEdit returns a reference to C object within a struct
func (s *Window) GetEdit() *EditState {
	var ret *EditState
	ret = (*EditState)(unsafe.Pointer(&s.edit))
	return ret
}

// GetScrolled returns a reference to C object within a struct
func (s *Window) GetScrolled() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.scrolled))
	return ret
}

// GetTables returns a reference to C object within a struct
func (s *Window) GetTables() **Table {
	var ret **Table
	ret = (**Table)(unsafe.Pointer(&s.tables))
	return ret
}

// GetTableCount returns a reference to C object within a struct
func (s *Window) GetTableCount() *uint32 {
	var ret *uint32
	ret = (*uint32)(unsafe.Pointer(&s.table_count))
	return ret
}

// GetNext returns a reference to C object within a struct
func (s *Window) GetNext() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.next))
	return ret
}

// GetPrev returns a reference to C object within a struct
func (s *Window) GetPrev() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.prev))
	return ret
}

// GetParent returns a reference to C object within a struct
func (s *Window) GetParent() **Window {
	var ret **Window
	ret = (**Window)(unsafe.Pointer(&s.parent))
	return ret
}

// safeString ensures that the string is NULL-terminated, a NULL-terminated copy is created otherwise.
func safeString(str string) string {
	if len(str) > 0 && str[len(str)-1] != '\x00' {
		str = str + "\x00"
	} else if len(str) == 0 {
		str = "\x00"
	}
	return str
}

// unpackPCharString represents the data from Go string as *C.char and avoids copying.
func unpackPCharString(str string) (*C.char, *cgoAllocMap) {
	str = safeString(str)
	h := (*stringHeader)(unsafe.Pointer(&str))
	return (*C.char)(h.Data), cgoAllocsUnknown
}

// allocPCharMemory allocates memory for type *C.char in C.
// The caller is responsible for freeing the this memory via C.free.
func allocPCharMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPCharValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}

const sizeOfPCharValue = unsafe.Sizeof([1]*C.char{})

// unpackArgSString transforms a sliced Go data structure into plain C format.
func unpackArgSString(x []string) (unpacked **C.char, allocs *cgoAllocMap) {
	if x == nil {
		return nil, nil
	}
	allocs = new(cgoAllocMap)
	defer runtime.SetFinalizer(&unpacked, func(***C.char) {
		go allocs.Free()
	})

	len0 := len(x)
	mem0 := allocPCharMemory(len0)
	allocs.Add(mem0)
	h0 := &sliceHeader{
		Data: mem0,
		Cap:  len0,
		Len:  len0,
	}
	v0 := *(*[]*C.char)(unsafe.Pointer(h0))
	for i0 := range x {
		v0[i0], _ = unpackPCharString(x[i0])
	}
	h := (*sliceHeader)(unsafe.Pointer(&v0))
	unpacked = (**C.char)(h.Data)
	return
}

// packSString reads sliced Go data structure out from plain C format.
func packSString(v []string, ptr0 **C.char) {
	const m = 0x7fffffff
	for i0 := range v {
		ptr1 := (*(*[m / sizeOfPtr]*C.char)(unsafe.Pointer(ptr0)))[i0]
		v[i0] = packPCharString(ptr1)
	}
}

// unpackPByteString represents the data from Go string as *C.nk_byte and avoids copying.
func unpackPByteString(str string) (*C.nk_byte, *cgoAllocMap) {
	str = safeString(str)
	h := (*stringHeader)(unsafe.Pointer(&str))
	return (*C.nk_byte)(h.Data), cgoAllocsUnknown
}
