1 // Fallback implementation of clipboard access for Nasal. Copy and edit for
2 // implementing support of other platforms
4 // Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include "NasalClipboard.hxx"
22 #include <simgear/debug/logstream.hxx>
26 * Provide a basic clipboard whose contents are only available to FlightGear
29 class ClipboardFallback:
35 * Get clipboard contents as text
37 virtual std::string getText(Type type)
39 return type == CLIPBOARD ? _clipboard : _selection;
43 * Set clipboard contents as text
45 virtual bool setText(const std::string& text, Type type)
47 if( type == CLIPBOARD )
56 std::string _clipboard,
60 //------------------------------------------------------------------------------
61 NasalClipboard::Ptr NasalClipboard::create()
63 return NasalClipboard::Ptr(new ClipboardFallback);