Trying out some XCB in kotlin with cinterop, and i am struggling to set a window atom.
xcb_change_property(
this.connection,
XCB_PROP_MODE_REPLACE.toUByte(),
window,
windowTypeReply.pointed.atom,
XCB_ATOM_ATOM,
32,
2,
windowTypeDockReply.pointed.atom // THIS needs to be a CValuesRef
)
The windowTypeDockReply is of the type CPointer<xcb_intern_atom_reply_t>, which has a property atom of the type xcb_atom_t which can be accessed through the .pointed property.
The function xcb_change_property in c requires a const void *data as its last parameter. In Kotlin however it requires a kotlinx.cinterop.CValuesRef<*>? .
So i am wondering how i can make windowTypeDockReply.pointed.atom into a CValuesRef?
Documentation states:
The
.pointedproperty forCPointer<T>returns the lvalue of typeT, pointed by this pointer. The reverse operation is.ptr: it takes the lvalue and returns the pointer to it.
But windowTypeReply.pointed.atom does not have a .ptr property.
Edit: or in other words, how to get the pointer to a field of the structure xcb_intern_atom_reply_t?