objective c - Ported OSX Obj-C/CG Screenshot Code to js-ctypes - crash on final line -


i ported objective-c/coregraphics code takes screenshot of multiple monitors it's not working. jsctypes guys won't able because section me answering questions lol

the objc/cg code here: https://stackoverflow.com/a/28247749/1828637

my jsctypes type/struct/declares here: https://github.com/noitidart/nativeshot/blob/mac-troubleshooting/modules/ostypes_mac.jsm

the jsctypes port here: https://github.com/noitidart/nativeshot/blob/mac-troubleshooting/modules/workers/mainworker.js#l443-656

and last line line 643 causes crash:

var rez_writetofile = ostypes.api('objc_msgsend')(data, ostypes.helper.sel('writetofile:atomically:'), mynsstrings.get(os.path.join(os.constants.path.desktopdir, 'full_ss.png')), ostypes.const.yes); 

this coincides objectivec of

[data writetofile:@"/tmp/screenshot.png" atomically:yes]; 

except changed path ...desktop/...png

i wrote sepearte gists, align lines in text diff software make sure did everything.

i dont think missed dont know why crashes on final line

do of objc/cg people see type definition wrong or missed (for example objc code uses compound statments i'm not sure understood/translated them correctly in port).

wowww after struggling hours posting realize right away haha

casing typo in selector!! had writetofile:atomically instead of writetofile:atomically!

if test out, it's simple firefox addon test case.

  1. install addon allows installing addons github repos here: https://addons.mozilla.org/en-us/firefox/addon/github-extension-installer/
  2. go commit on branch works here: https://github.com/noitidart/nativeshot/tree/f5f2e8606d3c5c657e901239d3ceb8c8c79a4494
  3. then click "add firefox" button @ bottom right, below "download zip" button
  4. click on toolbar button icon gets added firefox, seen in screenshot: http://i.imgur.com/n7lsxje.png
  5. check desktop have single png file screenshot of monitors, huge props @kenthomas!

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -