mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: it can now be used for _platform.v files too, no matter the host os
This commit is contained in:
committed by
Alexander Medvednikov
parent
84fbd5b3d0
commit
6c16bac908
@@ -34,12 +34,3 @@ pub fn (cb Clipboard) check_ownership() bool {
|
||||
pub fn (cb &Clipboard) is_available() bool {
|
||||
return cb.check_availability()
|
||||
}
|
||||
|
||||
// create a new PRIMARY clipboard (only supported on Linux)
|
||||
pub fn new_primary() &Clipboard {
|
||||
$if linux {
|
||||
return new_x11_clipboard(.primary)
|
||||
} $else {
|
||||
panic("Primary clipboard is not supported on non-Linux systems.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,3 +72,7 @@ fn (cb mut Clipboard) get_text() string {
|
||||
#utf8_clip = [ns_clip UTF8String];
|
||||
return string(utf8_clip)
|
||||
}
|
||||
|
||||
pub fn new_primary() &Clipboard {
|
||||
panic('Primary clipboard is not supported on non-Linux systems.')
|
||||
}
|
||||
|
||||
@@ -423,3 +423,7 @@ fn new_display() &Display {
|
||||
return XOpenDisplay(C.NULL)
|
||||
}
|
||||
|
||||
// create a new PRIMARY clipboard (only supported on Linux)
|
||||
pub fn new_primary() &Clipboard {
|
||||
return new_x11_clipboard(.primary)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import time
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
type HANDLE voidptr
|
||||
|
||||
struct C.HWND
|
||||
struct C.WPARAM
|
||||
struct C.LPARAM
|
||||
@@ -153,3 +155,7 @@ fn (cb mut Clipboard) get_text() string {
|
||||
GlobalUnlock(h_data)
|
||||
return str
|
||||
}
|
||||
|
||||
pub fn new_primary() &Clipboard {
|
||||
panic('Primary clipboard is not supported on non-Linux systems.')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user