File tree 3 files changed +18
-0
lines changed
3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ pub trait InputBackend: Downcast {
17
17
/// Changes the mouse cursor image.
18
18
fn set_mouse_cursor ( & mut self , cursor : MouseCursor ) ;
19
19
20
+ /// Get the clipboard content
21
+ fn clipboard_content ( & mut self ) -> String ;
22
+
20
23
/// Set the clipboard to the given content
21
24
fn set_clipboard_content ( & mut self , content : String ) ;
22
25
}
@@ -54,6 +57,10 @@ impl InputBackend for NullInputBackend {
54
57
55
58
fn set_mouse_cursor ( & mut self , _cursor : MouseCursor ) { }
56
59
60
+ fn clipboard_content ( & mut self ) -> String {
61
+ "" . to_string ( )
62
+ }
63
+
57
64
fn set_clipboard_content ( & mut self , _content : String ) { }
58
65
}
59
66
Original file line number Diff line number Diff line change @@ -212,6 +212,12 @@ impl InputBackend for WinitInputBackend {
212
212
self . window . set_cursor_icon ( icon) ;
213
213
}
214
214
215
+ fn clipboard_content ( & mut self ) -> String {
216
+ self . clipboard
217
+ . get_contents ( )
218
+ . unwrap_or_else ( |_| "" . to_string ( ) )
219
+ }
220
+
215
221
fn set_clipboard_content ( & mut self , content : String ) {
216
222
self . clipboard . set_contents ( content) . unwrap ( ) ;
217
223
}
Original file line number Diff line number Diff line change @@ -195,6 +195,11 @@ impl InputBackend for WebInputBackend {
195
195
self . update_mouse_cursor ( ) ;
196
196
}
197
197
198
+ fn clipboard_content ( & mut self ) -> String {
199
+ log:: warn!( "get clipboard not implemented" ) ;
200
+ "" . to_string ( )
201
+ }
202
+
198
203
fn set_clipboard_content ( & mut self , _content : String ) {
199
204
log:: warn!( "set clipboard not implemented" ) ;
200
205
}
You can’t perform that action at this time.
0 commit comments