grace/tpb

Tee your Paste Board

git clone https://git.gae.moe/grace/tpb

Grace Yoderfeat(NSPasteboard): added objective c bridge and build changes565174c

0.1.1
382 B12 linesraw
1// Simple bridge to objective_c code
2// https://nathancraddock.com/blog/writing-to-the-clipboard-the-hard-way/
3#import <Cocoa/Cocoa.h>
4NSPasteboard *pboard;
5
6void initPB() { pboard = [NSPasteboard generalPasteboard]; }
7
8void sendPB(const char *text) {
9  [pboard clearContents];
10  [pboard setString:[NSString stringWithUTF8String:text]
11            forType:NSPasteboardTypeString];
12}