From 441a9f7c09867cdb8fe069ec95292df531851778 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 13 Dec 2008 04:57:37 -0600 Subject: [PATCH] Move time-related words to core-foundation.time to remove number tower dependency from core-foundation; remove no longer used words from cocoa.application --- basis/core-foundation/core-foundation.factor | 11 +---------- basis/core-foundation/fsevents/fsevents.factor | 3 ++- basis/core-foundation/run-loop/run-loop.factor | 3 ++- basis/core-foundation/time/time.factor | 14 ++++++++++++++ basis/core-foundation/timers/timers.factor | 3 ++- 5 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 basis/core-foundation/time/time.factor diff --git a/basis/core-foundation/core-foundation.factor b/basis/core-foundation/core-foundation.factor index 51173aff21..6b7d81c862 100644 --- a/basis/core-foundation/core-foundation.factor +++ b/basis/core-foundation/core-foundation.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax destructors accessors kernel calendar ; +USING: alien.syntax destructors accessors kernel ; IN: core-foundation TYPEDEF: void* CFTypeRef @@ -14,8 +14,6 @@ TYPEDEF: int SInt32 TYPEDEF: uint UInt32 TYPEDEF: ulong CFTypeID TYPEDEF: UInt32 CFOptionFlags -TYPEDEF: double CFTimeInterval -TYPEDEF: double CFAbsoluteTime FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ; @@ -30,10 +28,3 @@ M: CFRelease-destructor dispose* alien>> CFRelease ; : |CFRelease ( alien -- alien ) dup f CFRelease-destructor boa |dispose drop ; inline - -: >CFTimeInterval ( duration -- interval ) - duration>seconds ; inline - -: >CFAbsoluteTime ( timestamp -- time ) - T{ timestamp { year 2001 } { month 1 } { day 1 } } time- - duration>seconds ; inline diff --git a/basis/core-foundation/fsevents/fsevents.factor b/basis/core-foundation/fsevents/fsevents.factor index 7ed040b455..b0c299a831 100644 --- a/basis/core-foundation/fsevents/fsevents.factor +++ b/basis/core-foundation/fsevents/fsevents.factor @@ -5,7 +5,8 @@ math sequences namespaces make assocs init accessors continuations combinators io.encodings.utf8 destructors locals arrays specialized-arrays.direct.alien specialized-arrays.direct.int specialized-arrays.direct.longlong -core-foundation core-foundation.run-loop core-foundation.strings ; +core-foundation core-foundation.run-loop core-foundation.strings +core-foundation.time ; IN: core-foundation.fsevents : kFSEventStreamCreateFlagUseCFTypes 2 ; inline diff --git a/basis/core-foundation/run-loop/run-loop.factor b/basis/core-foundation/run-loop/run-loop.factor index 5f2ff7bd53..8b2106685a 100644 --- a/basis/core-foundation/run-loop/run-loop.factor +++ b/basis/core-foundation/run-loop/run-loop.factor @@ -3,7 +3,8 @@ USING: accessors alien alien.syntax kernel math namespaces sequences destructors combinators threads heaps deques calendar core-foundation core-foundation.strings -core-foundation.file-descriptors core-foundation.timers ; +core-foundation.file-descriptors core-foundation.timers +core-foundation.time ; IN: core-foundation.run-loop : kCFRunLoopRunFinished 1 ; inline diff --git a/basis/core-foundation/time/time.factor b/basis/core-foundation/time/time.factor new file mode 100644 index 0000000000..15ad7bb1a1 --- /dev/null +++ b/basis/core-foundation/time/time.factor @@ -0,0 +1,14 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: calendar alien.syntax ; +IN: core-foundation.time + +TYPEDEF: double CFTimeInterval +TYPEDEF: double CFAbsoluteTime + +: >CFTimeInterval ( duration -- interval ) + duration>seconds ; inline + +: >CFAbsoluteTime ( timestamp -- time ) + T{ timestamp { year 2001 } { month 1 } { day 1 } } time- + duration>seconds ; inline diff --git a/basis/core-foundation/timers/timers.factor b/basis/core-foundation/timers/timers.factor index 0acd92ced1..51ee982592 100644 --- a/basis/core-foundation/timers/timers.factor +++ b/basis/core-foundation/timers/timers.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax system math kernel core-foundation calendar ; +USING: alien.syntax system math kernel calendar core-foundation +core-foundation.time ; IN: core-foundation.timers TYPEDEF: void* CFRunLoopTimerRef