wayland.client.util

Members

Aliases

wl_dispatcher_func_t
alias wl_dispatcher_func_t = int function(const(void*), void*, uint, const(wl_message*), wl_argument*)

\brief A function pointer type for a dispatcher. * A dispatcher is a function that handles the emitting of callbacks in client code. For programs directly using the C library, this is done by using libffi to call function pointers. When binding to languages other than C, dispatchers provide a way to abstract the function calling process to be friendlier to other function calling systems. * A dispatcher takes five arguments: The first is the dispatcher-specific implementation data associated with the target object. The second is the object on which the callback is being invoked (either wl_proxy or wl_resource). The third and fourth arguments are the opcode the wl_messsage structure corresponding to the callback being emitted. The final argument is an array of arguments received from the other process via the wire protocol.

Structs

wl_list
struct wl_list

\class wl_list * \brief doubly-linked list * The list head is of "struct wl_list" type, and must be initialized using wl_list_init(). All entries in the list must be of the same type. The item type must have a "struct wl_list" member. This member will be initialized by wl_list_insert(). There is no need to call wl_list_init() on the individual item. To query if the list is empty in O(1), use wl_list_empty(). * Let's call the list reference "struct wl_list foo_list", the item type as "item_t", and the item member as "struct wl_list link". * The following code will initialize a list: \code struct wl_list foo_list; * struct item_t { int foo; struct wl_list link; }; struct item_t item1, item2, item3; * wl_list_init(&foo_list); wl_list_insert(&foo_list, &item1.link); // Pushes item1 at the head wl_list_insert(&foo_list, &item2.link); // Pushes item2 at the head wl_list_insert(&item2.link, &item3.link); // Pushes item3 after item2 \endcode * The list now looks like [item2, item3, item1] * Iterate the list in ascending order: \code item_t *item; wl_list_for_each(item, foo_list, link) { Do_something_with_item(item); } \endcode

Templates

wl_container_of
template wl_container_of(alias member)

Retrieves a pointer to the containing struct of a given member item. * This macro allows conversion from a pointer to a item to its containing struct. This is useful if you have a contained item like a wl_list, wl_listener, or wl_signal, provided via a callback or other means and would like to retrieve the struct that contains it. * To demonstrate, the following example retrieves a pointer to example_container given only its destroy_listener member: * \code struct example_container { struct wl_listener destroy_listener; // other members... }; * void example_container_destroy(struct wl_listener *listener, void *data) { struct example_container *ctr; * ctr = wl_container_of(listener, ctr, destroy_listener); // destroy ctr... } \endcode * \param ptr A valid pointer to the contained item. * \param sample A pointer to the type of content that the list item stores. Sample does not need be a valid pointer; a null or an uninitialised pointer will suffice. * \param member The named location of ptr within the sample type. * \return The container for the specified pointer.

Unions

wl_argument
union wl_argument

\brief A union representing all of the basic data types that can be passed along the wayland wire format. * This union represents all of the basic data types that can be passed in the wayland wire format. It is used by dispatchers and runtime-friendly versions of the event and request marshaling functions.

Meta