// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go.
// DO NOT EDIT.

package ImGuiColorTextEdit

import (
	"github.com/AllenDang/cimgui-go/imgui"
	"github.com/AllenDang/cimgui-go/internal"
)

// #include "structs_accessor.h"
// #include "wrapper.h"
// #include "../imgui/extra_types.h"
import "C"

func (self *TextEditor) AllCursorsHaveSelection() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_AllCursorsHaveSelection(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) AnyCursorHasSelection() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_AnyCursorHasSelection(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) CanRedo() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_CanRedo(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) CanUndo() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_CanUndo(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) ClearExtraCursors() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_ClearExtraCursors(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) ClearSelections() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_ClearSelections(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) Copy() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_Copy(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) Cut() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_Cut(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) CursorPosition(outLine, outColumn *int32) {
	selfArg, selfFin := self.Handle()
	outLineArg, outLineFin := internal.WrapNumberPtr[C.int, int32](outLine)
	outColumnArg, outColumnFin := internal.WrapNumberPtr[C.int, int32](outColumn)
	C.TextEditor_GetCursorPosition(internal.ReinterpretCast[*C.TextEditor](selfArg), outLineArg, outColumnArg)

	selfFin()
	outLineFin()
	outColumnFin()
}

func TextEditorGetDefaultPalette() PaletteId {
	return PaletteId(C.TextEditor_GetDefaultPalette())
}

func (self *TextEditor) FirstVisibleLine() int32 {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return int32(C.TextEditor_GetFirstVisibleLine(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) LanguageDefinition() LanguageDefinitionId {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return LanguageDefinitionId(C.TextEditor_GetLanguageDefinition(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) LanguageDefinitionName() string {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.GoString(C.TextEditor_GetLanguageDefinitionName(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) LastVisibleLine() int32 {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return int32(C.TextEditor_GetLastVisibleLine(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) LineCount() int32 {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return int32(C.TextEditor_GetLineCount(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) LineSpacing() float32 {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return float32(C.TextEditor_GetLineSpacing(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) Palette() PaletteId {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return PaletteId(C.TextEditor_GetPalette(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) TabSize() int32 {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return int32(C.TextEditor_GetTabSize(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) Text() string {
	selfArg, selfFin := self.Handle()

	result := C.TextEditor_GetText_alloc(internal.ReinterpretCast[*C.TextEditor](selfArg))

	defer func() {
		selfFin()
		C.TextEditor_GetText_free(result)
	}()
	return C.GoString(result)
}

func (self *TextEditor) UndoIndex() int32 {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return int32(C.TextEditor_GetUndoIndex(internal.ReinterpretCast[*C.TextEditor](selfArg)))
}

func (self *TextEditor) DebugPanel(panelName string) {
	selfArg, selfFin := self.Handle()
	panelNameArg, panelNameFin := internal.WrapString[C.char](panelName)
	C.TextEditor_ImGuiDebugPanel(internal.ReinterpretCast[*C.TextEditor](selfArg), panelNameArg)

	selfFin()
	panelNameFin()
}

func (self *TextEditor) IsAutoIndentEnabled() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_IsAutoIndentEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) IsReadOnlyEnabled() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_IsReadOnlyEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) IsShortTabsEnabled() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_IsShortTabsEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) IsShowLineNumbersEnabled() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_IsShowLineNumbersEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) IsShowWhitespacesEnabled() bool {
	selfArg, selfFin := self.Handle()

	defer func() {
		selfFin()
	}()
	return C.TextEditor_IsShowWhitespacesEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg)) == C.bool(true)
}

func (self *TextEditor) Paste() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_Paste(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

// RedoV parameter default value hint:
// aSteps: 1
func (self *TextEditor) RedoV(aSteps int32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_Redo(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aSteps))

	selfFin()
}

// RenderV parameter default value hint:
// aParentIsFocused: false
// aSize: ImVec2()
// aBorder: false
func (self *TextEditor) RenderV(aTitle string, aParentIsFocused bool, aSize imgui.Vec2, aBorder bool) bool {
	selfArg, selfFin := self.Handle()
	aTitleArg, aTitleFin := internal.WrapString[C.char](aTitle)

	defer func() {
		selfFin()
		aTitleFin()
	}()
	return C.TextEditor_Render(internal.ReinterpretCast[*C.TextEditor](selfArg), aTitleArg, C.bool(aParentIsFocused), internal.ReinterpretCast[C.ImVec2](aSize.ToC()), C.bool(aBorder)) == C.bool(true)
}

func (self *TextEditor) SelectAll() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SelectAll(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

// SelectAllOccurrencesOfV parameter default value hint:
// aCaseSensitive: true
func (self *TextEditor) SelectAllOccurrencesOfV(aText string, aTextSize int32, aCaseSensitive bool) {
	selfArg, selfFin := self.Handle()
	aTextArg, aTextFin := internal.WrapString[C.char](aText)
	C.TextEditor_SelectAllOccurrencesOf(internal.ReinterpretCast[*C.TextEditor](selfArg), aTextArg, C.int(aTextSize), C.bool(aCaseSensitive))

	selfFin()
	aTextFin()
}

func (self *TextEditor) SelectLine(aLine int32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SelectLine(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aLine))

	selfFin()
}

// SelectNextOccurrenceOfV parameter default value hint:
// aCaseSensitive: true
func (self *TextEditor) SelectNextOccurrenceOfV(aText string, aTextSize int32, aCaseSensitive bool) {
	selfArg, selfFin := self.Handle()
	aTextArg, aTextFin := internal.WrapString[C.char](aText)
	C.TextEditor_SelectNextOccurrenceOf(internal.ReinterpretCast[*C.TextEditor](selfArg), aTextArg, C.int(aTextSize), C.bool(aCaseSensitive))

	selfFin()
	aTextFin()
}

func (self *TextEditor) SelectRegion(aStartLine, aStartChar, aEndLine, aEndChar int32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SelectRegion(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aStartLine), C.int(aStartChar), C.int(aEndLine), C.int(aEndChar))

	selfFin()
}

func (self *TextEditor) SetAutoIndentEnabled(aValue bool) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetAutoIndentEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg), C.bool(aValue))

	selfFin()
}

func (self *TextEditor) SetCursorPosition(aLine, aCharIndex int32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetCursorPosition(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aLine), C.int(aCharIndex))

	selfFin()
}

func TextEditorSetDefaultPalette(aValue PaletteId) {
	C.TextEditor_SetDefaultPalette(C.PaletteId(aValue))
}

func (self *TextEditor) SetLanguageDefinition(aValue LanguageDefinitionId) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetLanguageDefinition(internal.ReinterpretCast[*C.TextEditor](selfArg), C.LanguageDefinitionId(aValue))

	selfFin()
}

func (self *TextEditor) SetLineSpacing(aValue float32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetLineSpacing(internal.ReinterpretCast[*C.TextEditor](selfArg), C.float(aValue))

	selfFin()
}

func (self *TextEditor) SetPalette(aValue PaletteId) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetPalette(internal.ReinterpretCast[*C.TextEditor](selfArg), C.PaletteId(aValue))

	selfFin()
}

func (self *TextEditor) SetReadOnlyEnabled(aValue bool) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetReadOnlyEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg), C.bool(aValue))

	selfFin()
}

func (self *TextEditor) SetShortTabsEnabled(aValue bool) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetShortTabsEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg), C.bool(aValue))

	selfFin()
}

func (self *TextEditor) SetShowLineNumbersEnabled(aValue bool) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetShowLineNumbersEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg), C.bool(aValue))

	selfFin()
}

func (self *TextEditor) SetShowWhitespacesEnabled(aValue bool) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetShowWhitespacesEnabled(internal.ReinterpretCast[*C.TextEditor](selfArg), C.bool(aValue))

	selfFin()
}

func (self *TextEditor) SetTabSize(aValue int32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetTabSize(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aValue))

	selfFin()
}

func (self *TextEditor) SetText(aText string) {
	selfArg, selfFin := self.Handle()
	aTextArg, aTextFin := internal.WrapString[C.char](aText)
	C.TextEditor_SetText(internal.ReinterpretCast[*C.TextEditor](selfArg), aTextArg)

	selfFin()
	aTextFin()
}

func (self *TextEditor) SetViewAtLine(aLine int32, aMode SetViewAtLineMode) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_SetViewAtLine(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aLine), C.SetViewAtLineMode(aMode))

	selfFin()
}

func NewTextEditor() *TextEditor {
	return NewTextEditorFromC(C.TextEditor_TextEditor())
}

// UndoV parameter default value hint:
// aSteps: 1
func (self *TextEditor) UndoV(aSteps int32) {
	selfArg, selfFin := self.Handle()
	C.TextEditor_Undo(internal.ReinterpretCast[*C.TextEditor](selfArg), C.int(aSteps))

	selfFin()
}

func (self *TextEditor) UnitTests() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_UnitTests(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) Destroy() {
	selfArg, selfFin := self.Handle()
	C.TextEditor_destroy(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) Redo() {
	selfArg, selfFin := self.Handle()
	C.wrap_TextEditor_Redo(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}

func (self *TextEditor) Render(aTitle string) bool {
	selfArg, selfFin := self.Handle()
	aTitleArg, aTitleFin := internal.WrapString[C.char](aTitle)

	defer func() {
		selfFin()
		aTitleFin()
	}()
	return C.wrap_TextEditor_Render(internal.ReinterpretCast[*C.TextEditor](selfArg), aTitleArg) == C.bool(true)
}

func (self *TextEditor) SelectAllOccurrencesOf(aText string, aTextSize int32) {
	selfArg, selfFin := self.Handle()
	aTextArg, aTextFin := internal.WrapString[C.char](aText)
	C.wrap_TextEditor_SelectAllOccurrencesOf(internal.ReinterpretCast[*C.TextEditor](selfArg), aTextArg, C.int(aTextSize))

	selfFin()
	aTextFin()
}

func (self *TextEditor) SelectNextOccurrenceOf(aText string, aTextSize int32) {
	selfArg, selfFin := self.Handle()
	aTextArg, aTextFin := internal.WrapString[C.char](aText)
	C.wrap_TextEditor_SelectNextOccurrenceOf(internal.ReinterpretCast[*C.TextEditor](selfArg), aTextArg, C.int(aTextSize))

	selfFin()
	aTextFin()
}

func (self *TextEditor) Undo() {
	selfArg, selfFin := self.Handle()
	C.wrap_TextEditor_Undo(internal.ReinterpretCast[*C.TextEditor](selfArg))

	selfFin()
}
