Mercurial > projects > dstep
view dstep/corefoundation/CFDate.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 12, 2009 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) */ module dstep.corefoundation.CFDate; import dstep.corefoundation.CFBase; import dstep.objc.bridge.Bridge; import dstep.objc.objc : id; alias double CFTimeInterval; alias double CFAbsoluteTime; struct __CFDate; alias __CFDate* CFDateRef; struct __CFTimeZone; alias __CFTimeZone* CFTimeZoneRef; alias uint CFGregorianUnitFlags; extern (C) { extern { const double kCFAbsoluteTimeIntervalSince1970; const double kCFAbsoluteTimeIntervalSince1904; } } enum { kCFGregorianUnitsYears = (1 << 0), kCFGregorianUnitsMonths = (1 << 1), kCFGregorianUnitsDays = (1 << 2), kCFGregorianUnitsHours = (1 << 3), kCFGregorianUnitsMinutes = (1 << 4), kCFGregorianUnitsSeconds = (1 << 5), kCFGregorianAllUnits = 0x00FFFFFF } struct CFGregorianDate { int year; byte month; byte day; byte hour; byte minute; double second; } struct CFGregorianUnits { int years; int months; int days; int hours; int minutes; double seconds; } extern (C) { double CFAbsoluteTimeGetCurrent (); uint CFDateGetTypeID (); CFDateRef CFDateCreate (CFAllocatorRef allocator, double at); double CFDateGetAbsoluteTime (CFDateRef theDate); double CFDateGetTimeIntervalSinceDate (CFDateRef theDate, CFDateRef otherDate); int CFDateCompare (CFDateRef theDate, CFDateRef otherDate, void* context); ubyte CFGregorianDateIsValid (CFGregorianDate gdate, uint unitFlags); double CFGregorianDateGetAbsoluteTime (CFGregorianDate gdate, CFTimeZoneRef tz); CFGregorianDate CFAbsoluteTimeGetGregorianDate (double at, CFTimeZoneRef tz); double CFAbsoluteTimeAddGregorianUnits (double at, CFTimeZoneRef tz, CFGregorianUnits units); CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits (double at1, double at2, CFTimeZoneRef tz, uint unitFlags); int CFAbsoluteTimeGetDayOfWeek (double at, CFTimeZoneRef tz); int CFAbsoluteTimeGetDayOfYear (double at, CFTimeZoneRef tz); int CFAbsoluteTimeGetWeekOfYear (double at, CFTimeZoneRef tz); }