Disabling AppNap from java

Steve Hannah steve at weblite.ca
Sat Feb 22 17:13:51 PST 2014


For doing simple Objective-C things like this, I wrote an objective-c
bridge.  It uses JNA and allows you to access any OS X SDK without having
to generate stub classes for them (like you do with rococoa).
https://github.com/shannah/Java-Objective-C-Bridge

Some sample code to give you an idea:
WebView :
https://github.com/shannah/Java-Objective-C-Bridge/blob/master/java/test/ca/weblite/objc/TestWebView.java
NSOpenPanel :
https://github.com/shannah/Java-Objective-C-Bridge/blob/master/java/test/ca/weblite/objc/NSOpenPanelSample.java
Loading a nib file:
https://github.com/shannah/Java-Objective-C-Bridge/blob/master/java/test/ca/weblite/objc/LoadNibSample.java



Steve




On Sat, Feb 22, 2014 at 4:53 PM, Michael Hall <mik3hall at gmail.com> wrote:

> On Feb 22, 2014, at 6:23 PM, Scott Palmer <swpalmer at gmail.com> wrote:
>
> > On Sat, Feb 22, 2014 at 4:49 PM, Paul Taylor <paul_t100 at fastmail.fm>
> wrote:
> >
> >> On 22/02/2014 20:43, Eirik Bakke wrote:
> >>
> >>> JNA might be a simpler way to call native functions:
> >>> https://github.com/twall/jna
> >>>
> >>> ...
> >>
> >>
>
> Not that more native choices are whats needed but if we are tossing out
> different options for that then...
>
> For my HalfPipe application I set up a simple jNI interface to the command
> line interface for FScript
> http://www.fscript.org
> Which is supposed to be a smalltalk-like Cocoa interface.
>
> I think I had some fairly simple ObjectiveC runtime interface code in
> place for JRuby using FFI
>
> This was sort of like JNIDirect which was something Patrick Beard came up
> with a while back when JDirect was going away, or shortly after it had gone
> away.
>
> Michael Hall
>
> trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz
>
> HalfPipe Java 6/7 shell app
> http://www195.pair.com/mik3hall/index.html#halfpipe
>
> AppConverter convert Apple jvm to openjdk apps
> http://www195.pair.com/mik3hall/index.html#appconverter
>
>
>
>
> >
> >> I think JNA or its own is Wndows only isnt it, but there is something
> >> called rococoa.
> >> To be honest I was hoping someone else had encountered this particular
> >> problem with AppNap and had something to share.
> >>
> >> Paul
> >>
> >
> > JNA works on Windows, OS X, Linux, and more.  However, it is based on C
> > interfaces and calling conventions. Rococoa  (
> > https://code.google.com/p/rococoa/) implements a similar thing for
> > interacting with Objective-C interfaces.
> >
> > Scott
>
>


-- 
Steve Hannah
Web Lite Solutions Corp.


More information about the macosx-port-dev mailing list