/
CarbonAPI.java
50 lines (35 loc) · 1.54 KB
/
CarbonAPI.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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);
}
}