Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BridJ: add support for Objective-C blocks (closures) #9

Open
ochafik opened this issue Mar 16, 2015 · 6 comments
Open

BridJ: add support for Objective-C blocks (closures) #9

ochafik opened this issue Mar 16, 2015 · 6 comments
Labels

Comments

@ochafik
Copy link
Member

ochafik commented Mar 16, 2015

From @ochafik on October 22, 2011 11:48

See example use case provided by Andrei Sochirca in issue #188 :

NSEvent.addGlobalMonitorForEventsMatchingMask(mask, block)

Copied from original issue: nativelibs4java/nativelibs4java#192

@ochafik ochafik added the BridJ label Mar 16, 2015
@ochafik
Copy link
Member Author

ochafik commented Mar 16, 2015

Hi Andrei,

I've reached a first stable state for Objective-C 2.0 blocks support : it's very similar to callbacks, except you inherit from org.bridj.objc.ObjCBlock instead of org.bridj.Callback (please see ObjectiveCTest in the commit diff to see an example of usage).
Please feel free to open issues on this feature if you find any (the way BridJ supports blocks is... a hack, as usual :-)).
(I'm uploading a new 0.6-SNAPSHOT right now)

Cheers

@ochafik
Copy link
Member Author

ochafik commented Mar 16, 2015

From @AndreiSochirca on November 6, 2011 13:51

Hi Olivier,

Great! Thank you very much!
I will check it during next week.
Are there any news regarding Objective-C delegate support? :)

Regards, Andrei.

@ochafik
Copy link
Member Author

ochafik commented Mar 16, 2015

Hi Andrei,

Have limited time resources here unfortunately, so issue #188 hasn't progressed much (although its automated tests run fine : you can help improve them to point me to the right direction).

Cheers

@ochafik
Copy link
Member Author

ochafik commented Mar 16, 2015

From @AndreiSochirca on November 7, 2011 13:14

Hi Olivier,

I understand.
As to #188, I've mentioned QTKit - based example (http://download.smaxe.com/bridj_test-111020.zip (class TestQT)).

In this example, video capture is started but delegate class is not notified about next video frame.
I will check the latest bridj version.. may be something did change :)

Regards, Andrei.

@ochafik
Copy link
Member Author

ochafik commented Mar 16, 2015

From @AndreiSochirca on January 24, 2012 16:39

Hi Olivier,

Does ObjectiveCTest#testGlobalNSEventHook() work in your environment?

Regards, Andrei.

@umjammer
Copy link

hi,

how is this issue?

i'm now implementing about obj-c blocks on my forked rococoa project.
somehow i could implement working obj-c block mechanism.
but it works only for methods which i made. it doesn't work for methods which are apple provided.

here is my stuck summary
and code

could you tell me why do you currently stop releasing about obj-c block
and your insight about my stuck would be much appreciated.

and also it's sad that pyobjc can do it but java can't.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants