1996-05-30 20:03:15 +00:00
|
|
|
/*
|
1998-12-09 01:26:37 +00:00
|
|
|
GSTrackingRect.m
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
Tracking rectangle class
|
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Date: 1996
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
1996-10-18 17:14:13 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1996-05-30 20:03:15 +00:00
|
|
|
*/
|
|
|
|
|
1997-09-23 22:43:24 +00:00
|
|
|
#include <gnustep/gui/config.h>
|
1998-12-09 01:26:37 +00:00
|
|
|
#include <gnustep/gui/GSTrackingRect.h>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-09 01:26:37 +00:00
|
|
|
@implementation GSTrackingRect
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Class methods
|
|
|
|
//
|
|
|
|
+ (void)initialize
|
|
|
|
{
|
1998-12-09 01:26:37 +00:00
|
|
|
if (self == [GSTrackingRect class])
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
|
|
|
// Initial version
|
|
|
|
[self setVersion:1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Instance methods
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Initialization
|
|
|
|
//
|
|
|
|
- initWithRect:(NSRect)aRect
|
|
|
|
tag:(NSTrackingRectTag)aTag
|
|
|
|
owner:anObject
|
|
|
|
userData:(void *)theData
|
|
|
|
inside:(BOOL)flag
|
|
|
|
{
|
|
|
|
rectangle = aRect;
|
|
|
|
tag = aTag;
|
|
|
|
owner = anObject;
|
|
|
|
[owner retain];
|
|
|
|
user_data = theData;
|
|
|
|
inside = flag;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
1999-03-02 08:58:30 +00:00
|
|
|
- (void) dealloc
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-03-02 08:58:30 +00:00
|
|
|
[owner release];
|
|
|
|
[super dealloc];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-02 08:58:30 +00:00
|
|
|
- (NSRect) rectangle
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-03-02 08:58:30 +00:00
|
|
|
return rectangle;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSTrackingRectTag)tag
|
|
|
|
{
|
1999-03-02 08:58:30 +00:00
|
|
|
return tag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- owner
|
|
|
|
{
|
|
|
|
return owner;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void *)userData
|
|
|
|
{
|
|
|
|
return user_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)inside
|
|
|
|
{
|
|
|
|
return inside;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// NSCoding protocol
|
|
|
|
//
|
1999-03-02 08:58:30 +00:00
|
|
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-03-02 08:58:30 +00:00
|
|
|
[aCoder encodeRect: rectangle];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(NSTrackingRectTag) at: &tag];
|
|
|
|
[aCoder encodeObject: owner];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &inside];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-02 08:58:30 +00:00
|
|
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-03-02 08:58:30 +00:00
|
|
|
rectangle = [aDecoder decodeRect];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(NSTrackingRectTag) at: &tag];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &owner];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &inside];
|
|
|
|
return self;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|