1995-04-03 20:49:14 +00:00
|
|
|
/* Declarations for NSTimer for GNUStep
|
1999-06-03 12:36:10 +00:00
|
|
|
Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
1996-04-17 20:17:45 +00:00
|
|
|
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
1995-07-01 19:01:11 +00:00
|
|
|
Date: 1995
|
1995-04-03 20:49:14 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-04-03 20:49:14 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1995-04-03 20:49:14 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
1995-04-03 20:49:14 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1995-04-03 20:49:14 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
1995-04-03 20:49:14 +00:00
|
|
|
*/
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#ifndef __NSTimer_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSTimer_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1995-04-03 20:49:14 +00:00
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <Foundation/NSDate.h>
|
1996-03-12 14:44:22 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1999-04-20 16:28:04 +00:00
|
|
|
/*
|
|
|
|
* NB. NSRunLoop is optimised using a hack that knows about the
|
|
|
|
* class layout for the fire date and invialidation flag in NSTimer.
|
|
|
|
* These MUST remain the first two items in the class.
|
2007-12-07 08:35:16 +00:00
|
|
|
* Other classes must not attempt to use instance variables as
|
|
|
|
* they are subject to change.
|
1999-04-20 16:28:04 +00:00
|
|
|
*/
|
1996-03-12 14:44:22 +00:00
|
|
|
@interface NSTimer : NSObject
|
|
|
|
{
|
2010-02-14 10:48:10 +00:00
|
|
|
#if GS_EXPOSE(NSTimer)
|
|
|
|
@public
|
1999-04-22 11:24:57 +00:00
|
|
|
NSDate *_date; /* Must be first - for NSRunLoop optimisation */
|
1999-04-20 16:28:04 +00:00
|
|
|
BOOL _invalidated; /* Must be 2nd - for NSRunLoop optimisation */
|
|
|
|
BOOL _repeats;
|
1996-03-12 14:44:22 +00:00
|
|
|
NSTimeInterval _interval;
|
2002-01-16 14:00:59 +00:00
|
|
|
id _target;
|
|
|
|
SEL _selector;
|
|
|
|
id _info;
|
2010-03-02 09:51:12 +00:00
|
|
|
#endif
|
2011-02-16 05:49:45 +00:00
|
|
|
#if GS_NONFRAGILE
|
|
|
|
#else
|
2011-02-14 06:37:45 +00:00
|
|
|
/* Pointer to private additional data used to avoid breaking ABI
|
|
|
|
* when we don't have the non-fragile ABI available.
|
2011-02-16 05:49:45 +00:00
|
|
|
* Use this mechanism rather than changing the instance variable
|
|
|
|
* layout (see Source/GSInternal.h for details).
|
2011-02-14 06:37:45 +00:00
|
|
|
*/
|
2011-03-05 18:12:55 +00:00
|
|
|
@private id _internal GS_UNUSED_IVAR;
|
2011-02-14 06:37:45 +00:00
|
|
|
#endif
|
1996-03-12 14:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Creating timer objects. */
|
|
|
|
|
1999-06-03 12:36:10 +00:00
|
|
|
+ (NSTimer*) scheduledTimerWithTimeInterval: (NSTimeInterval)ti
|
2001-12-17 14:31:42 +00:00
|
|
|
invocation: (NSInvocation*)invocation
|
1999-06-03 12:36:10 +00:00
|
|
|
repeats: (BOOL)f;
|
|
|
|
+ (NSTimer*) scheduledTimerWithTimeInterval: (NSTimeInterval)ti
|
2002-01-16 14:00:59 +00:00
|
|
|
target: (id)object
|
1999-06-03 12:36:10 +00:00
|
|
|
selector: (SEL)selector
|
2002-01-16 14:00:59 +00:00
|
|
|
userInfo: (id)info
|
1999-06-03 12:36:10 +00:00
|
|
|
repeats: (BOOL)f;
|
1996-03-12 14:44:22 +00:00
|
|
|
|
1999-06-03 12:36:10 +00:00
|
|
|
+ (NSTimer*) timerWithTimeInterval: (NSTimeInterval)ti
|
2001-12-17 14:31:42 +00:00
|
|
|
invocation: (NSInvocation*)invocation
|
1999-06-03 12:36:10 +00:00
|
|
|
repeats: (BOOL)f;
|
|
|
|
+ (NSTimer*) timerWithTimeInterval: (NSTimeInterval)ti
|
2002-01-16 14:00:59 +00:00
|
|
|
target: (id)object
|
1999-06-03 12:36:10 +00:00
|
|
|
selector: (SEL)selector
|
2002-01-16 14:00:59 +00:00
|
|
|
userInfo: (id)info
|
1999-06-03 12:36:10 +00:00
|
|
|
repeats: (BOOL)f;
|
1996-03-12 14:44:22 +00:00
|
|
|
|
|
|
|
- (void) fire;
|
2002-08-27 13:40:42 +00:00
|
|
|
- (NSDate*) fireDate;
|
1996-03-12 14:44:22 +00:00
|
|
|
- (void) invalidate;
|
2002-08-27 13:40:42 +00:00
|
|
|
- (id) userInfo;
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2007-12-07 08:35:16 +00:00
|
|
|
- (BOOL) isValid;
|
|
|
|
- (NSTimeInterval) timeInterval;
|
|
|
|
#endif
|
|
|
|
|
2013-07-01 07:08:55 +00:00
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
2002-08-27 13:40:42 +00:00
|
|
|
- (id) initWithFireDate: (NSDate*)fd
|
|
|
|
interval: (NSTimeInterval)ti
|
|
|
|
target: (id)object
|
|
|
|
selector: (SEL)selector
|
|
|
|
userInfo: (id)info
|
|
|
|
repeats: (BOOL)f;
|
|
|
|
- (void) setFireDate: (NSDate*)fireDate;
|
1999-06-03 12:36:10 +00:00
|
|
|
#endif
|
1996-03-12 14:44:22 +00:00
|
|
|
|
|
|
|
@end
|
1995-04-03 20:49:14 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#endif /* __NSTimer_h_GNUSTEP_BASE_INCLUDE */
|