context menus, document refactoring, fixes

This commit is contained in:
2025-10-26 00:10:44 -04:00
parent 87c2db2a77
commit fe9366f9ef
62 changed files with 2138 additions and 793 deletions

25
src/clipboard.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "clipboard.h"
#include <SDL3/SDL.h>
namespace anm2ed::clipboard
{
std::string Clipboard::get()
{
auto text = SDL_GetClipboardText();
auto string = std::string(text);
SDL_free(text);
return string;
}
bool Clipboard::is_empty()
{
return get().empty();
}
void Clipboard::set(const std::string& string)
{
SDL_SetClipboardText(string.data());
}
}