Last active
October 19, 2016 18:57
-
-
Save Kureev/dd02b01ebb14897753b717b45a48b059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JsValueRef render(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState) { | |
NSString *type = [NSString stringWithUTF8String:ChakraUtils::toString(arguments[1])]; | |
float w {ChakraUtils::toFloat(arguments[2])}; | |
float h {ChakraUtils::toFloat(arguments[3])}; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
id delegate = [[NSApplication sharedApplication] delegate]; | |
[delegate renderElementOfType:type size:NSMakeSize((CGFloat)w, (CGFloat)h)]; | |
}); | |
return JS_INVALID_REFERENCE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment