glfwGetClipboardString

Function glfwGetClipboardString 

Source
pub unsafe extern "C" fn glfwGetClipboardString(
    window: *mut GLFWwindow,
) -> *const i8
Expand description

@brief Returns the contents of the clipboard as a string.

This function returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string. If the clipboard is empty or if its contents cannot be converted, NULL is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.

@param[in] window Deprecated. Any valid window or NULL. @return The contents of the clipboard as a UTF-8 encoded string, or NULL if an [error](@ref error_handling) occurred.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.

@remark @win32 The clipboard on Windows has a single global lock for reading and writing. GLFW tries to acquire it a few times, which is almost always enough. If it cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns. It is safe to try this multiple times.

@pointer_lifetime The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to @ref glfwGetClipboardString or @ref glfwSetClipboardString, or until the library is terminated.

@thread_safety This function must only be called from the main thread.

@sa @ref clipboard @sa @ref glfwSetClipboardString

@since Added in version 3.0.

@ingroup input