diff options
| author | Grace Yoder <grace_yoder@outlook.com> | 2026-06-29 09:45:37 -0600 |
|---|---|---|
| committer | Grace Yoder <grace_yoder@outlook.com> | 2026-06-30 16:33:26 -0600 |
| commit | 565174c4b8c73e9e28524709060335a0b17ee3fb (patch) | |
| tree | 4e642c58ef4f4c227b29537be56183c73d9b5179 /src/Clip/NSPBBridge.m | |
| parent | 2f75723e16974bd21762fb64d5f6ce53984b115d (diff) | |
feat(NSPasteboard): added objective c bridge and build changes
Diffstat (limited to 'src/Clip/NSPBBridge.m')
| -rw-r--r-- | src/Clip/NSPBBridge.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Clip/NSPBBridge.m b/src/Clip/NSPBBridge.m new file mode 100644 index 0000000..e736c3f --- /dev/null +++ b/src/Clip/NSPBBridge.m @@ -0,0 +1,12 @@ +// Simple bridge to objective_c code +// https://nathancraddock.com/blog/writing-to-the-clipboard-the-hard-way/ +#import <Cocoa/Cocoa.h> +NSPasteboard *pboard; + +void initPB() { pboard = [NSPasteboard generalPasteboard]; } + +void sendPB(const char *text) { + [pboard clearContents]; + [pboard setString:[NSString stringWithUTF8String:text] + forType:NSPasteboardTypeString]; +} |
