Package org.gtk.glib

Types

CArray
Link copied to clipboard
typealias CArray<T> = CPointer<CPointerVar<T>>

Kotlin typealias for a C Array

CompareDataFunction
Link copied to clipboard
typealias CompareDataFunction = (a: VoidPointer?, b: VoidPointer?) -> Int
CopyFunction
Link copied to clipboard
typealias CopyFunction = (VoidPointer) -> VoidPointer
CStringList
Link copied to clipboard
typealias CStringList = CPointer<CPointerVar<ByteVar>>

Shorthand for C's representation of a list of strings (a pointer to a list of char pointers).

CStringPointer
Link copied to clipboard
typealias CStringPointer = CPointer<ByteVar>

Shorthand for C's representation of a string.

DateTime
Link copied to clipboard
class DateTime(pointer: GDateTime_autoptr)

kotlinx-gtk

DestroyNotify
Link copied to clipboard
typealias DestroyNotify = CPointer<CFunction<(gpointer?) -> Unit>>
FreeMe
Link copied to clipboard
interface FreeMe

gtk-kt

KeyFile
Link copied to clipboard
class KeyFile(structPointer: CPointer<GKeyFile>)

05 / 01 / 2022

KFunc
Link copied to clipboard
typealias KFunc = (VoidPointer) -> Unit
KGByteArray
Link copied to clipboard
class KGByteArray(struct: GByteArray_autoptr) : UnrefMe

15 / 01 / 2022

KGBytes
Link copied to clipboard
class KGBytes(pointer: GBytes_autoptr) : Comparable<KGBytes> , UnrefMe
KGError
Link copied to clipboard
open class KGError(pointer: CPointer<GError>) : Exception

kotlinx-gtk

KList
Link copied to clipboard
class KList(listPointer: CPointer<GList>) : FreeMe

kotlinx-gtk

OptionArg
Link copied to clipboard
enum OptionArg : Enum<OptionArg>

kotlinx-gtk 23 / 03 / 2021

OptionEntry
Link copied to clipboard
class OptionEntry(struct: CPointer<GOptionEntry>)

kotlinx-gtk 15 / 04 / 2021 TODO

OptionFlags
Link copied to clipboard
enum OptionFlags : Enum<OptionFlags>

kotlinx-gtk 23 / 03 / 2021

OptionGroup
Link copied to clipboard
class OptionGroup(optionPointer: CPointer<GOptionGroup>)

kotlinx-gtk 15 / 04 / 2021 TODO

OSInfoKey
Link copied to clipboard
enum OSInfoKey : Enum<OSInfoKey>
PollFD
Link copied to clipboard
class PollFD(pollFDPointer: CPointer<GPollFD>)

kotlinx-gtk

PtrArray
Link copied to clipboard
open class PtrArray(ptrArrayPointer: GPtrArray_autoptr)

18 / 12 / 2021

SList
Link copied to clipboard
class SList(listPointer: CPointer<GSList>) : FreeMe

kotlinx-gtk

Source
Link copied to clipboard
class Source(pointer: GSource_autoptr)

gtk-kt

SourceFunction
Link copied to clipboard
typealias SourceFunction = () -> Boolean
StringPtrArray
Link copied to clipboard
class StringPtrArray(ptrArrayPointer: GPtrArray_autoptr) : PtrArray

18 / 12 / 2021

UnrefMe
Link copied to clipboard
interface UnrefMe

gtk-kt

Variant
Link copied to clipboard
open class Variant(variantPointer: CPointer<GVariant>) : Comparable<Variant> , UnrefMe

kotlinx-gtk

VariantClass
Link copied to clipboard
enum VariantClass : Enum<VariantClass>

gtk-kt

VariantDictionary
Link copied to clipboard
open class VariantDictionary(variantDictPointer: CPointer<GVariantDict>) : UnrefMe

gtk-kt

VariantIter
Link copied to clipboard
class VariantIter(pointer: GVariantIter_autoptr) : FreeMe

gtk-kt

VariantType
Link copied to clipboard
sealed class VariantType

kotlinx-gtk 23 / 03 / 2021

VoidPointer
Link copied to clipboard
typealias VoidPointer = COpaquePointer
WrappedKList
Link copied to clipboard
class WrappedKList<T>(kList: KList, wrapPointer: VoidPointer.() -> T, getPointer: T.() -> VoidPointer) : FreeMe

kotlinx-gtk

WrappedSList
Link copied to clipboard
class WrappedSList<T>(sList: SList, wrapPointer: VoidPointer.() -> T, getPointer: T.() -> VoidPointer) : FreeMe

gtk-kt

Functions

allocateGErrorPtr
Link copied to clipboard
inline fun NativePlacement.allocateGErrorPtr(): CPointer<CPointerVar<GError>>
asIterable
Link copied to clipboard
inline fun <T : CPointed> CPointer<CPointerVar<T>>.asIterable(): Iterator<CPointer<T>>

For null terminated C arrays

asKSequence
Link copied to clipboard
inline fun CStringList?.asKSequence(): Sequence<String>

Null termination accepting sequence

inline fun <I : CPointed, O> CPointer<GList>?.asKSequence(crossinline wrap: (CPointer<I>) -> O): Sequence<O>
inline fun <I : CPointed, O> CPointer<GSList>?.asKSequence(crossinline wrap: (CPointer<I>) -> O): Sequence<O>
asSequence
Link copied to clipboard
fun <T : CPointed> CPointer<GList>?.asSequence(): Sequence<CPointer<T>>
fun <T : CPointed> CPointer<GSList>?.asSequence(): Sequence<CPointer<T>>
fun CPointer<gintVar>?.asSequence(length: Int): Sequence<Int>

inline fun <T : CPointed> CPointer<CPointerVar<T>>?.asSequence(): Sequence<CPointer<T>>

For null terminated C arrays

asStablePointer
Link copied to clipboard
inline fun Any.asStablePointer(): COpaquePointer

Turns anything into a stable ref pointer

free
Link copied to clipboard
fun CPointer<GList>?.free()
fun CPointer<GSList>?.free()
inline fun gpointer.free()
inline fun CStringList.free()
freeToArray
Link copied to clipboard
inline fun CStringList.freeToArray(): Array<String>

Like the toArray version, except frees the pointer

inline fun CPointer<IntVar>.freeToArray(): Array<Int>
getOSInfo
Link copied to clipboard
fun getOSInfo(key: String): String?

gtk-kt

fun getOSInfo(key: OSInfoKey): String?
inline fun stringListFromNullTerminatedCStringListAndFree(cList: CStringList?): List<String>

Create a list of strings from a CStringList, then free it with g_strfreev

timeoutAdd
Link copied to clipboard
fun timeoutAdd(interval: UInt, function: SourceFunction): UInt
toArray
Link copied to clipboard
inline fun <T : CPointed> CArray<T>.toArray(): Array<CPointer<T>>

Turn a NULL terminated C Array into a Kotlin Array

inline fun CStringList.toArray(): Array<String>
inline fun CPointer<IntVar>.toArray(): Array<Int>

inline fun <T : CPointed> CArray<T>.toArray(size: Int): Array<CPointer<T>>

Turn a C Array into a Kotlin Array with a known size

toCArray
Link copied to clipboard
fun Array<Int>.toCArray(scope: MemScope): CPointer<IntVar>
fun Array<ULong>.toCArray(scope: MemScope): CPointer<ULongVar>
toCPointerArray
Link copied to clipboard
fun Array<Int>.toCPointerArray(scope: MemScope): CPointer<CPointerVar<IntVar>>
fun Array<ULong>.toCPointerArray(scope: MemScope): CPointer<CPointerVar<ULongVar>>
toKArray
Link copied to clipboard
fun CStringList.toKArray(): Array<String>
toList
Link copied to clipboard
inline fun CStringList.toList(): List<String>
inline fun CArray<UIntVar>.toList(): List<UInt>
inline fun CArray<UIntVar>.toList(size: Int): List<UInt>
toNullTermCArray
Link copied to clipboard
fun <T, O : CPointed> Array<T>.toNullTermCArray(map: T.() -> CPointer<O>): CPointer<CPointerVarOf<CPointer<O>>>
toNullTermCStringArray
Link copied to clipboard
fun Array<String>.toNullTermCStringArray(): CStringList
fun Array<out String>.toNullTermCStringArray(): CStringList
fun List<String>.toNullTermCStringArray(): CStringList
toStringList
Link copied to clipboard
fun CStringList?.toStringList(length: Int): List<String?>
toStringListFillNulls
Link copied to clipboard
fun CStringList?.toStringListFillNulls(length: Int): List<String>

Will simply replace null with "null"

toStringListFilterNulls
Link copied to clipboard
fun CStringList?.toStringListFilterNulls(length: Int): List<String>

Will filter out nulls

toStringListNoNulls
Link copied to clipboard
fun CStringList?.toStringListNoNulls(length: Int): List<String>

Will throw an exception on a nullable

toWrappedList
Link copied to clipboard
inline fun <T : CPointed, O> CArray<T>.toWrappedList(wrap: (CPointer<T>) -> O): List<O>

Turn a NULL terminated C Array into a Kotlin List, with action to wrap each index

inline fun <T : CPointed, O> CArray<T>.toWrappedList(size: Int, wrap: (CPointer<T>) -> O): List<O>

Turn a C Array into a Kotlin List with a known size, with action to wrap each index

unwrap
Link copied to clipboard
fun CPointer<CPointerVar<GError>>.unwrap(throwException: Boolean = true, extraMapping: Map<UInt, (CPointer<GError>) -> KGError> = mapOf()): Exception?

kotlinx-gtk 08 / 04 / 2021

use
Link copied to clipboard
inline fun <T : FreeMe, R> T.use(use: (T) -> R): R
inline fun <T : UnrefMe, R> T.use(use: (T) -> R): R

inline fun <I : CPointed, O> CPointer<I>.use(action: (CPointer<I>) -> O): O

Use a pointer, then the pointer will be freed afterwards

inline fun <I : Any, O> StableRef<I>.use(action: (StableRef<I>) -> O): O

Use a StableRef, disposing of it afterwards

usePointer
Link copied to clipboard
inline fun <I : Any, O> StableRef<I>.usePointer(action: (COpaquePointer) -> O): O

Use a StableRef (as a CPointer), disposing of it afterwards

Properties

bool
Link copied to clipboard
val gboolean.bool: Boolean
gtk
Link copied to clipboard
val Boolean?.gtk: gboolean
gtk
Link copied to clipboard
val Boolean.gtk: gboolean
staticCompareDataFunction
Link copied to clipboard
val staticCompareDataFunction: GCompareDataFunc
staticCopyFunction
Link copied to clipboard
val staticCopyFunction: GCopyFunc
staticForeachFunction
Link copied to clipboard
val staticForeachFunction: GFunc