1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

solaris: make 'v test-compiler' pass (stage 2)

This commit is contained in:
Delyan Angelov
2020-03-21 10:48:02 +02:00
committed by GitHub
parent a5c0d89c71
commit ba088056ed
15 changed files with 236 additions and 9 deletions

View File

@@ -0,0 +1,47 @@
module clipboard
pub struct Clipboard {
mut:
text string // text data sent or received
got_text bool // used to confirm that we have got the text
is_owner bool // to save selection owner state
}
fn new_clipboard() &Clipboard {
eprintln('TODO: support clipboard on solaris')
return &Clipboard{}
}
pub fn new_primary() &Clipboard {
eprintln('TODO: support clipboard on solaris')
return &Clipboard{}
}
fn (cb mut Clipboard) set_text(text string) bool {
cb.text = text
cb.is_owner = true
cb.got_text = true
return true
}
fn (cb mut Clipboard) get_text() string {
return cb.text
}
fn (cb mut Clipboard) clear(){
cb.text = ''
cb.is_owner = false
}
fn (cb mut Clipboard) free(){
}
fn (cb &Clipboard) has_ownership() bool {
return cb.is_owner
}
fn (cb &Clipboard) check_availability() bool {
// This is a dummy clipboard implementation,
// which can be always used, although it does not do much...
return true
}