-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sample.hx
23 lines (22 loc) · 986 Bytes
/
Sample.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import haxe.extension.*;
class Sample {
public static function main():Void {
var count = Clipboard.count_formats();
trace('count ${count}');
trace("formats ", ${Clipboard.list_available_format().split(",")});
trace('---');
trace('text: ${Clipboard.get_text()}');
trace('image: ${Clipboard.get_image()}');
trace('html: ${Clipboard.get_data(EClipboard.HTML)}');
trace('svg: ${Clipboard.get_data("image/x-inkscape-svg")}');
trace('pdf: ${Clipboard.get_bytes("Portable Document Format")}');
trace('image2: ${Clipboard.get_bytes("PNG")}');
trace('list: ${Clipboard.get_bytes("DataObject")}');
trace('clear: ${Clipboard.clear()}');
trace('text: ${Clipboard.get_text()}');
trace('set text: ${Clipboard.set_text('test write')}');
trace('text: ${Clipboard.get_text()}');
trace('set html: ${Clipboard.set_data(EClipboard.HTML, ClipboardUtils.formatHTML('<p>test html : this is <b>bold</b></p>'))}');
trace('html: ${Clipboard.get_data(EClipboard.HTML)}');
}
}