godot.gen.godot.TextServerManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of godot-library-release Show documentation
Show all versions of godot-library-release Show documentation
Contains godot api as kotlin classes and jvm cpp interaction code.
// THIS FILE IS GENERATED! DO NOT EDIT IT MANUALLY!
@file:Suppress("PackageDirectoryMismatch", "unused", "FunctionName", "RedundantModalityModifier",
"UNCHECKED_CAST", "JoinDeclarationAndAssignment", "USELESS_CAST",
"RemoveRedundantQualifierName", "NOTHING_TO_INLINE", "NON_FINAL_MEMBER_IN_OBJECT",
"RedundantVisibilityModifier", "RedundantUnitReturnType", "MemberVisibilityCanBePrivate")
package godot
import godot.`annotation`.GodotBaseType
import godot.core.Dictionary
import godot.core.StringName
import godot.core.TypeManager
import godot.core.VariantArray
import godot.core.VariantType.ARRAY
import godot.core.VariantType.LONG
import godot.core.VariantType.NIL
import godot.core.VariantType.OBJECT
import godot.core.VariantType.STRING
import godot.core.memory.TransferContext
import godot.signals.Signal1
import godot.signals.signal
import godot.util.VoidPtr
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* A singleton for managing [godot.TextServer] implementations.
*
* [godot.TextServerManager] is the API backend for loading, enumerating, and switching [godot.TextServer]s.
*
* **Note:** Switching text server at runtime is possible, but will invalidate all fonts and text buffers. Make sure to unload all controls, fonts, and themes before doing so.
*/
@GodotBaseType
public object TextServerManager : Object() {
/**
* Emitted when a new interface has been added.
*/
public val interfaceAdded: Signal1 by signal("interfaceName")
/**
* Emitted when an interface is removed.
*/
public val interfaceRemoved: Signal1 by signal("interfaceName")
public override fun new(scriptIndex: Int): Boolean {
getSingleton(ENGINECLASS_TEXTSERVERMANAGER)
return false
}
/**
* Registers a [godot.TextServer] interface.
*/
public fun addInterface(_interface: TextServer): Unit {
TransferContext.writeArguments(OBJECT to _interface)
TransferContext.callMethod(rawPtr, MethodBindings.addInterfacePtr, NIL)
}
/**
* Returns the number of interfaces currently registered.
*/
public fun getInterfaceCount(): Int {
TransferContext.writeArguments()
TransferContext.callMethod(rawPtr, MethodBindings.getInterfaceCountPtr, LONG)
return (TransferContext.readReturnValue(LONG, false) as Long).toInt()
}
/**
* Removes an interface. All fonts and shaped text caches should be freed before removing an interface.
*/
public fun removeInterface(_interface: TextServer): Unit {
TransferContext.writeArguments(OBJECT to _interface)
TransferContext.callMethod(rawPtr, MethodBindings.removeInterfacePtr, NIL)
}
/**
* Returns the interface registered at a given index.
*/
public fun getInterface(idx: Int): TextServer? {
TransferContext.writeArguments(LONG to idx.toLong())
TransferContext.callMethod(rawPtr, MethodBindings.getInterfacePtr, OBJECT)
return (TransferContext.readReturnValue(OBJECT, true) as TextServer?)
}
/**
* Returns a list of available interfaces, with the index and name of each interface.
*/
public fun getInterfaces(): VariantArray> {
TransferContext.writeArguments()
TransferContext.callMethod(rawPtr, MethodBindings.getInterfacesPtr, ARRAY)
return (TransferContext.readReturnValue(ARRAY, false) as VariantArray>)
}
/**
* Finds an interface by its [name].
*/
public fun findInterface(name: String): TextServer? {
TransferContext.writeArguments(STRING to name)
TransferContext.callMethod(rawPtr, MethodBindings.findInterfacePtr, OBJECT)
return (TransferContext.readReturnValue(OBJECT, true) as TextServer?)
}
/**
* Sets the primary [godot.TextServer] interface.
*/
public fun setPrimaryInterface(index: TextServer): Unit {
TransferContext.writeArguments(OBJECT to index)
TransferContext.callMethod(rawPtr, MethodBindings.setPrimaryInterfacePtr, NIL)
}
/**
* Returns the primary [godot.TextServer] interface currently in use.
*/
public fun getPrimaryInterface(): TextServer? {
TransferContext.writeArguments()
TransferContext.callMethod(rawPtr, MethodBindings.getPrimaryInterfacePtr, OBJECT)
return (TransferContext.readReturnValue(OBJECT, true) as TextServer?)
}
internal object MethodBindings {
public val addInterfacePtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "add_interface")
public val getInterfaceCountPtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "get_interface_count")
public val removeInterfacePtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "remove_interface")
public val getInterfacePtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "get_interface")
public val getInterfacesPtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "get_interfaces")
public val findInterfacePtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "find_interface")
public val setPrimaryInterfacePtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "set_primary_interface")
public val getPrimaryInterfacePtr: VoidPtr =
TypeManager.getMethodBindPtr("TextServerManager", "get_primary_interface")
}
}