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