Mercurial > projects > dstep
comparison 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 |
comparison
equal
deleted
inserted
replaced
10:27e00625790b | 11:07194b026fa4 |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Jul 12, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.corefoundation.CFDate; | |
8 | |
9 import dstep.corefoundation.CFBase; | |
10 import dstep.objc.bridge.Bridge; | |
11 import dstep.objc.objc : id; | |
12 | |
13 alias double CFTimeInterval; | |
14 alias double CFAbsoluteTime; | |
15 struct __CFDate; | |
16 alias __CFDate* CFDateRef; | |
17 struct __CFTimeZone; | |
18 alias __CFTimeZone* CFTimeZoneRef; | |
19 alias uint CFGregorianUnitFlags; | |
20 | |
21 extern (C) | |
22 { | |
23 extern | |
24 { | |
25 const double kCFAbsoluteTimeIntervalSince1970; | |
26 const double kCFAbsoluteTimeIntervalSince1904; | |
27 } | |
28 } | |
29 | |
30 enum | |
31 { | |
32 kCFGregorianUnitsYears = (1 << 0), | |
33 kCFGregorianUnitsMonths = (1 << 1), | |
34 kCFGregorianUnitsDays = (1 << 2), | |
35 kCFGregorianUnitsHours = (1 << 3), | |
36 kCFGregorianUnitsMinutes = (1 << 4), | |
37 kCFGregorianUnitsSeconds = (1 << 5), | |
38 kCFGregorianAllUnits = 0x00FFFFFF | |
39 } | |
40 | |
41 struct CFGregorianDate | |
42 { | |
43 int year; | |
44 byte month; | |
45 byte day; | |
46 byte hour; | |
47 byte minute; | |
48 double second; | |
49 } | |
50 | |
51 | |
52 struct CFGregorianUnits | |
53 { | |
54 int years; | |
55 int months; | |
56 int days; | |
57 int hours; | |
58 int minutes; | |
59 double seconds; | |
60 } | |
61 | |
62 extern (C) | |
63 { | |
64 double CFAbsoluteTimeGetCurrent (); | |
65 uint CFDateGetTypeID (); | |
66 CFDateRef CFDateCreate (CFAllocatorRef allocator, double at); | |
67 double CFDateGetAbsoluteTime (CFDateRef theDate); | |
68 double CFDateGetTimeIntervalSinceDate (CFDateRef theDate, CFDateRef otherDate); | |
69 int CFDateCompare (CFDateRef theDate, CFDateRef otherDate, void* context); | |
70 ubyte CFGregorianDateIsValid (CFGregorianDate gdate, uint unitFlags); | |
71 double CFGregorianDateGetAbsoluteTime (CFGregorianDate gdate, CFTimeZoneRef tz); | |
72 CFGregorianDate CFAbsoluteTimeGetGregorianDate (double at, CFTimeZoneRef tz); | |
73 double CFAbsoluteTimeAddGregorianUnits (double at, CFTimeZoneRef tz, CFGregorianUnits units); | |
74 CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits (double at1, double at2, CFTimeZoneRef tz, uint unitFlags); | |
75 int CFAbsoluteTimeGetDayOfWeek (double at, CFTimeZoneRef tz); | |
76 int CFAbsoluteTimeGetDayOfYear (double at, CFTimeZoneRef tz); | |
77 int CFAbsoluteTimeGetWeekOfYear (double at, CFTimeZoneRef tz); | |
78 } |