feat: get text from the clipboard

This commit is contained in:
Sale Djenic 2022-03-29 11:11:28 +02:00 committed by saledjenic
parent d1b79f8a4c
commit 7baaeee7b9
2 changed files with 6 additions and 0 deletions

View File

@ -138,6 +138,7 @@ proc dos_qguiapplication_icon(filename: cstring) {.cdecl, dynlib: dynLibName, im
proc dos_qguiapplication_delete() {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_clipboard_setText(content: cstring) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_clipboard_getText(): cstring {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_installEventFilter(engine: DosStatusEvent) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_clipboard_setImage(content: cstring) {.cdecl, dynlib: dynLibName, importc.}
proc dos_qguiapplication_download_image(imageSource: cstring, filePath: cstring) {.cdecl, dynlib: dynLibName, importc.}

View File

@ -35,6 +35,11 @@ proc quit*(self: QGuiApplication) =
proc setClipboardText*(text: string = "") =
dos_qguiapplication_clipboard_setText(text.cstring)
proc getClipboardText*(): string =
let str = dos_qguiapplication_clipboard_getText()
result = $str
dos_chararray_delete(str)
proc installSelfSignedCertificate*(certificate: string) =
dos_add_self_signed_certificate(certificate.cstring)