Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to barbarywatchservice, an implemention of Java 7's WatchServi…
…ce for Java 6 on Mac OS X.
- Loading branch information
Showing
22 changed files
with
1,705 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.ptr.PointerByReference; | ||
|
||
public class CFAllocatorRef extends PointerByReference { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.ptr.PointerByReference; | ||
|
||
public class CFArrayRef extends PointerByReference { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.NativeLong; | ||
|
||
public class CFIndex extends NativeLong { | ||
private static final long serialVersionUID = 0; | ||
|
||
public static CFIndex valueOf(int i) { | ||
CFIndex idx = new CFIndex(); | ||
idx.setValue(i); | ||
return idx; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.ptr.PointerByReference; | ||
|
||
public class CFRunLoopRef extends PointerByReference { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.ptr.PointerByReference; | ||
|
||
public class CFStringRef extends PointerByReference { | ||
|
||
public static CFStringRef toCFString(String s) { | ||
final char[] chars = s.toCharArray(); | ||
int length = chars.length; | ||
return CarbonAPI.INSTANCE.CFStringCreateWithCharacters(null, chars, CFIndex.valueOf(length)); | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.*; | ||
|
||
public interface CarbonAPI extends Library { | ||
CarbonAPI INSTANCE = (CarbonAPI) Native.loadLibrary("Carbon", CarbonAPI.class); | ||
|
||
CFArrayRef CFArrayCreate( | ||
CFAllocatorRef allocator, // always set to Pointer.NULL | ||
Pointer[] values, | ||
CFIndex numValues, | ||
Void callBacks // always set to Pointer.NULL | ||
); | ||
|
||
CFStringRef CFStringCreateWithCharacters( | ||
Void alloc, // always pass NULL | ||
char[] chars, | ||
CFIndex numChars | ||
); | ||
|
||
public FSEventStreamRef FSEventStreamCreate( | ||
Pointer v, // always use Pointer.NULL | ||
FSEventStreamCallback callback, | ||
Pointer context, // always use Pointer.NULL | ||
CFArrayRef pathsToWatch, | ||
long sinceWhen, // use -1 for events since now | ||
double latency, // in seconds | ||
int flags // 0 is good for now | ||
|
||
); | ||
|
||
boolean FSEventStreamStart(FSEventStreamRef streamRef); | ||
|
||
void FSEventStreamStop(FSEventStreamRef streamRef); | ||
|
||
void FSEventStreamScheduleWithRunLoop(FSEventStreamRef streamRef, CFRunLoopRef runLoop, CFStringRef runLoopMode); | ||
|
||
CFRunLoopRef CFRunLoopGetCurrent(); | ||
|
||
void CFRunLoopRun(); | ||
|
||
void CFRunLoopStop(CFRunLoopRef rl); | ||
|
||
public interface FSEventStreamCallback extends Callback { | ||
@SuppressWarnings({"UnusedDeclaration"}) | ||
void invoke(FSEventStreamRef streamRef, Pointer clientCallBackInfo, NativeLong numEvents, Pointer eventPaths, Pointer eventFlags, Pointer eventIds); | ||
} | ||
|
||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.barbarysoftware.jna; | ||
|
||
import com.sun.jna.ptr.PointerByReference; | ||
|
||
public class FSEventStreamRef extends PointerByReference { | ||
|
||
} |
Oops, something went wrong.