pasteboard

How to copy to clipboard with X11?

偶尔善良 提交于 2019-11-30 19:21:59
Using the frameworks on OS X, I can use the following to copy a PNG to the pasteboard (in C — obviously I could use NSPasteboard with Cocoa): #include <ApplicationServices/ApplicationServices.h> int copyThatThing(void) { PasteboardRef clipboard; if (PasteboardCreate(kPasteboardClipboard, &clipboard) != noErr) { return -1; } if (PasteboardClear(clipboard) != noErr) { CFRelease(clipboard); return -1; } size_t len; char *pngbuf = createMyPNGBuffer(&len); /* Defined somewhere else */ if (pngbuf == NULL) { CFRelease(clipboard); return -1; } CFDataRef data = CFDataCreateWithBytesNoCopy

How to copy to clipboard with X11?

久未见 提交于 2019-11-30 03:53:23
问题 Using the frameworks on OS X, I can use the following to copy a PNG to the pasteboard (in C — obviously I could use NSPasteboard with Cocoa): #include <ApplicationServices/ApplicationServices.h> int copyThatThing(void) { PasteboardRef clipboard; if (PasteboardCreate(kPasteboardClipboard, &clipboard) != noErr) { return -1; } if (PasteboardClear(clipboard) != noErr) { CFRelease(clipboard); return -1; } size_t len; char *pngbuf = createMyPNGBuffer(&len); /* Defined somewhere else */ if (pngbuf =

Getting RTF data out of Mac OS X pasteboard (clipboard)

旧街凉风 提交于 2019-11-28 23:25:11
According to the man page for pbpaste , -Prefer {txt | rtf | ps} tells pbpaste what type of data to look for in the pasteboard first. As stated above, pbpaste normally looks first for plain text data; however, by specifying -Prefer ps you can tell pbpaste to look first for Encapsulated PostScript. If you spec- ify -Prefer rtf, pbpaste looks first for Rich Text format. In any case, pbpaste looks for the other formats if the preferred one is not found. The txt option replaces the deprecated ascii option, which continues to function as before. Both indicate a preference for plain text. However

Simple way to show the 'Copy' popup on UITableViewCells like the address book App

夙愿已清 提交于 2019-11-28 15:39:56
Is there a simple way for subclasses of UITableViewCell to show the 'Copy' UIMenuController popup like in the Address book app (see screenshot), after the selection is held for a while? The method before iOS 5 is to get the UIMenuController's shared instance, set the target rect and view and call -setMenuVisible:animated: . Remeber to implement -canPerformAction:withSender: in your responder. The method after iOS 5 (previously available as undocumented feature) is to implement these 3 methods in your data source (see https://developer.apple.com/reference/uikit/uitableviewdelegate#1653389 ). -

Getting RTF data out of Mac OS X pasteboard (clipboard)

纵饮孤独 提交于 2019-11-27 14:44:11
问题 According to the man page for pbpaste , -Prefer {txt | rtf | ps} tells pbpaste what type of data to look for in the pasteboard first. As stated above, pbpaste normally looks first for plain text data; however, by specifying -Prefer ps you can tell pbpaste to look first for Encapsulated PostScript. If you spec- ify -Prefer rtf, pbpaste looks first for Rich Text format. In any case, pbpaste looks for the other formats if the preferred one is not found. The txt option replaces the deprecated

Simple way to show the 'Copy' popup on UITableViewCells like the address book App

非 Y 不嫁゛ 提交于 2019-11-27 09:19:12
问题 Is there a simple way for subclasses of UITableViewCell to show the 'Copy' UIMenuController popup like in the Address book app (see screenshot), after the selection is held for a while? 回答1: The method before iOS 5 is to get the UIMenuController's shared instance, set the target rect and view and call -setMenuVisible:animated: . Remeber to implement -canPerformAction:withSender: in your responder. The method after iOS 5 (previously available as undocumented feature) is to implement these 3