libt3widget
clipboard.h
1 /* Copyright (C) 2011 G.P. Halkes
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License version 3, as
4  published by the Free Software Foundation.
5 
6  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  GNU General Public License for more details.
10 
11  You should have received a copy of the GNU General Public License
12  along with this program. If not, see <http://www.gnu.org/licenses/>.
13 */
14 #ifndef T3_WIDGET_CLIPBOARD_H
15 #define T3_WIDGET_CLIPBOARD_H
16 
17 #include <t3widget/widget_api.h>
18 #include <t3widget/ptr.h>
19 #include <string>
20 
21 #define WITH_CLIPBOARD_LOCK(code) { t3_widget::ensure_clipboard_lock_t _lock; code }
22 
23 namespace t3_widget {
24 
25 T3_WIDGET_API linked_ptr<std::string>::t get_clipboard(void);
26 T3_WIDGET_API linked_ptr<std::string>::t get_primary(void);
27 
28 T3_WIDGET_API void set_clipboard(std::string *str);
29 T3_WIDGET_API void set_primary(std::string *str);
30 T3_WIDGET_API void release_selections(void);
31 T3_WIDGET_API void lock_clipboard(void);
32 T3_WIDGET_API void unlock_clipboard(void);
33 
34 class T3_WIDGET_API ensure_clipboard_lock_t {
35  public:
36  ensure_clipboard_lock_t(void) { lock_clipboard(); }
37  ~ensure_clipboard_lock_t(void) { unlock_clipboard(); }
38 };
39 
40 }; // namespace
41 #endif
The t3_widget namespace is contains all classes, functions and global variables in the libt3widget li...
Definition: autocompleter.cc:18
Definition: clipboard.h:34
linked_ptr< string >::t get_primary(void)
Get the primary selection data.
Definition: clipboard.cc:65
linked_ptr< string >::t get_clipboard(void)
Get the clipboard data.
Definition: clipboard.cc:54