25#include <simgear/nasal/cppbind/NasalCallContext.hxx>
37 if( ctx.isNumeric(
i) )
45 ctx.runtimeError(
"clipboard: invalid arg "
46 "(expected clipboard.CLIPBOARD or clipboard.SELECTION)");
55 if( ctx.argc < 1 || ctx.argc > 2 )
56 ctx.runtimeError(
"clipboard.setText() expects 1 or 2 arguments: "
57 "text, [, type = clipboard.CLIPBOARD]");
71 ctx.runtimeError(
"clipboard.getText() accepts max 1 arg: "
72 "[type = clipboard.CLIPBOARD]");
94 nasal::Hash clipboard =
nasal->getGlobals().createHash(
"clipboard");
static naRef f_setClipboardText(const nasal::CallContext &ctx)
static NasalClipboard::Type parseType(const nasal::CallContext &ctx, size_t i)
static naRef f_getClipboardText(const nasal::CallContext &ctx)
static Ptr create()
Implementation supplied by actual platform implementation.
@ PRIMARY
X11 platforms support also a mode called PRIMARY selection which contains the current (mouse) selecti...
@ CLIPBOARD
Standard clipboard as supported by nearly all operating systems.
virtual ~NasalClipboard()=0
static Ptr getInstance()
Get clipboard platform specific instance.
std::shared_ptr< NasalClipboard > Ptr
static void init(FGNasalSys *nasal)
Sets up the clipboard and puts all the extension functions into a new "clipboard" namespace.