SUMO - Simulation of Urban MObility
GUIUserIO.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Some OS-dependant functions to ease cliboard manipulation
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include "GUIUserIO.h"
26 
27 
28 // ===========================================================================
29 // static member definitions
30 // ===========================================================================
31 std::string GUIUserIO::clipped = "";
32 
33 
34 // ===========================================================================
35 // method definitions
36 // ===========================================================================
37 void
38 GUIUserIO::copyToClipboard(const FXApp& app, const std::string& text) {
39  FXDragType types[] = {FXWindow::stringType, FXWindow::textType};
40  if (app.getActiveWindow()->acquireClipboard(types, 2)) {
41  clipped = text;
42  }
43 }
44 
45 std::string
46 GUIUserIO::copyFromClipboard(const FXApp& app) {
47  FXString string;
48  if (app.getActiveWindow()->getDNDData(FROM_CLIPBOARD,FXWindow::utf8Type,string)) {
49  return string.text();
50  };
51  return string.text();
52 }
53 
54 /****************************************************************************/
55 
static std::string clipped
Definition: GUIUserIO.h:61
static void copyToClipboard(const FXApp &app, const std::string &text)
Copies the given text to clipboard.
Definition: GUIUserIO.cpp:38
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
Definition: GUIUserIO.cpp:46