aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/clipboard/clipboard.v
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/vlib/clipboard/clipboard.v
downloadcli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.gz
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.bz2
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'v_windows/v/vlib/clipboard/clipboard.v')
-rw-r--r--v_windows/v/vlib/clipboard/clipboard.v37
1 files changed, 37 insertions, 0 deletions
diff --git a/v_windows/v/vlib/clipboard/clipboard.v b/v_windows/v/vlib/clipboard/clipboard.v
new file mode 100644
index 0000000..d82289b
--- /dev/null
+++ b/v_windows/v/vlib/clipboard/clipboard.v
@@ -0,0 +1,37 @@
+module clipboard
+
+// new returns a new `Clipboard` instance allocated on the heap.
+// The `Clipboard` resources can be released with `free()`
+pub fn new() &Clipboard {
+ return new_clipboard()
+}
+
+// copy copies `text` into the clipboard.
+pub fn (mut cb Clipboard) copy(text string) bool {
+ return cb.set_text(text)
+}
+
+// paste returns current entry as a `string` from the clipboard.
+pub fn (mut cb Clipboard) paste() string {
+ return cb.get_text()
+}
+
+// clear_all clears the clipboard.
+pub fn (mut cb Clipboard) clear_all() {
+ cb.clear()
+}
+
+// destroy destroys the clipboard and free it's resources.
+pub fn (mut cb Clipboard) destroy() {
+ cb.free()
+}
+
+// check_ownership returns `true` if the `Clipboard` has the content ownership.
+pub fn (cb Clipboard) check_ownership() bool {
+ return cb.has_ownership()
+}
+
+// is_available returns `true` if the clipboard is available for use.
+pub fn (cb &Clipboard) is_available() bool {
+ return cb.check_availability()
+}