Changeset 1791 for code/trunk/src/util/Clipboard.cc
- Timestamp:
- Sep 16, 2008, 3:46:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/util/Clipboard.cc
r1505 r1791 29 29 */ 30 30 31 /** 32 @file Clipboard.cc 33 @brief OS-specific implementations of the clipboard functions. 34 */ 35 31 36 #include "Clipboard.h" 32 37 33 38 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 39 ///////////// 40 // Windows // 41 ///////////// 34 42 #include <windows.h> 43 #include "Debug.h" 35 44 36 bool toClipboard(std::string text) 45 /** 46 @brief Puts text into the windows-clipboard 47 @param text The text 48 @return True if the action was successful 49 */ 50 bool toClipboard(const std::string& text) 37 51 { 38 52 try … … 53 67 catch (...) 54 68 { 69 COUT(1) << "Error: Unable to copy the following text to the clipboard:" << std::endl; 70 COUT(1) << " \"" << text << "\"" << std::endl; 55 71 } 56 72 return false; 57 73 } 58 74 75 /** 76 @brief Gets text from the windows-clipboard if there is any text. 77 @return The retrieved text 78 */ 59 79 std::string fromClipboard() 60 80 { … … 73 93 catch (...) 74 94 { 95 COUT(1) << "Error: Unable to retrieve text from the clipboard." << std::endl; 75 96 } 76 97 return ""; 77 98 } 78 99 #else 79 std::string clipboard = ""; 100 ///////////// 101 // Default // 102 ///////////// 80 103 81 bool toClipboard(std::string text) 104 std::string clipboard = ""; //!< Keeps the text of our internal clipboard 105 106 /** 107 @brief Default implementation if there is no OS-specific implementation or no clipboard. Copies the text into an internal clipboard. 108 @param text The text 109 @return True 110 */ 111 bool toClipboard(const std::string& text) 82 112 { 83 113 clipboard = text; … … 85 115 } 86 116 117 /** 118 @brief Default implementation if there is no OS-specific implementation or no clipboard. Gets the text from the internal clipboard. 119 @return The text 120 */ 87 121 std::string fromClipboard() 88 122 {
Note: See TracChangeset
for help on using the changeset viewer.