view dstep/coreservices/carboncore/FSEvents.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 21, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.coreservices.carboncore.FSEvents;

//import dstep.AvailabilityMacros;
import dstep.corefoundation.CFArray;
import dstep.corefoundation.CFBase;
import dstep.corefoundation.CFRunLoop;
import dstep.corefoundation.CFUUID;
//import dstep.sys.types;

struct __FSEventStream;

alias uint FSEventStreamCreateFlags;
alias uint FSEventStreamEventFlags;
alias ulong FSEventStreamEventId;
alias __FSEventStream* FSEventStreamRef;
alias __FSEventStream* ConstFSEventStreamRef;

extern (C)
{
	alias void function (ConstFSEventStreamRef, void*, uint, void*, FSEventStreamEventFlags*, FSEventStreamEventId*) FSEventStreamCallback;
}

enum
{
	kFSEventStreamCreateFlagNone = 0x00000000,
	kFSEventStreamCreateFlagUseCFTypes = 0x00000001,
	kFSEventStreamCreateFlagNoDefer = 0x00000002,
	kFSEventStreamCreateFlagWatchRoot = 0x00000004
}

enum
{
	kFSEventStreamEventFlagNone = 0x00000000,
	kFSEventStreamEventFlagMustScanSubDirs = 0x00000001,
	kFSEventStreamEventFlagUserDropped = 0x00000002,
	kFSEventStreamEventFlagKernelDropped = 0x00000004,
	kFSEventStreamEventFlagEventIdsWrapped = 0x00000008,
	kFSEventStreamEventFlagHistoryDone = 0x00000010,
	kFSEventStreamEventFlagRootChanged = 0x00000020,
	kFSEventStreamEventFlagMount = 0x00000040,
	kFSEventStreamEventFlagUnmount = 0x00000080
}

enum : ulong
{
	kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFUL
}

struct FSEventStreamContext
{
	int version_;
	void* info;
	CFAllocatorRetainCallBack retain;
	CFAllocatorReleaseCallBack release;
	CFAllocatorCopyDescriptionCallBack copyDescription;
}

extern (C)
{
	FSEventStreamRef FSEventStreamCreate (CFAllocatorRef allocator, FSEventStreamCallback callback, FSEventStreamContext* context, CFArrayRef pathsToWatch, ulong sinceWhen, double latency, uint flags);
	FSEventStreamRef FSEventStreamCreateRelativeToDevice (CFAllocatorRef allocator, FSEventStreamCallback callback, FSEventStreamContext* context, int deviceToWatch, CFArrayRef pathsToWatchRelativeToDevice, ulong sinceWhen, double latency, uint flags);
	ulong FSEventStreamGetLatestEventId (ConstFSEventStreamRef streamRef);
	int FSEventStreamGetDeviceBeingWatched (ConstFSEventStreamRef streamRef);
	CFArrayRef FSEventStreamCopyPathsBeingWatched (ConstFSEventStreamRef streamRef);
	ulong FSEventsGetCurrentEventId ();
	CFUUIDRef FSEventsCopyUUIDForDevice (int dev);
	ulong FSEventsGetLastEventIdForDeviceBeforeTime (int dev, double time);
	ubyte FSEventsPurgeEventsForDeviceUpToEventId (int dev, ulong eventId);
	void FSEventStreamRetain (FSEventStreamRef streamRef);
	void FSEventStreamRelease (FSEventStreamRef streamRef);
	void FSEventStreamScheduleWithRunLoop (FSEventStreamRef streamRef, CFRunLoopRef runLoop, CFStringRef runLoopMode);
	void FSEventStreamUnscheduleFromRunLoop (FSEventStreamRef streamRef, CFRunLoopRef runLoop, CFStringRef runLoopMode);
	void FSEventStreamInvalidate (FSEventStreamRef streamRef);
	ubyte FSEventStreamStart (FSEventStreamRef streamRef);
	ulong FSEventStreamFlushAsync (FSEventStreamRef streamRef);
	void FSEventStreamFlushSync (FSEventStreamRef streamRef);
	void FSEventStreamStop (FSEventStreamRef streamRef);
	void FSEventStreamShow (ConstFSEventStreamRef streamRef);
	CFStringRef FSEventStreamCopyDescription (ConstFSEventStreamRef streamRef);
}