/* * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. */ #include #include #include #include "context.hpp" namespace turbine { ox::String getClipboardText(Context &ctx) noexcept { auto &gctx = static_cast(ctx); return glfwGetClipboardString(gctx.window); } void setClipboardText(Context &ctx, ox::CRStringView text) noexcept { auto &gctx = static_cast(ctx); auto cstr = ox_malloca(text.bytes() + 1, char); ox_strncpy(cstr.get(), text.data(), text.bytes()); glfwSetClipboardString(gctx.window, cstr); } }