ftp.nice.ch/pub/next/connectivity/protocol/GateKeeper.3.0.Beta.4.s.tar.gz#/GateKeeper.3.0.Beta.4.s/DLRecord.m

This is DLRecord.m in view mode; [Download] [Up]

//*****************************************************************************
//
//	DLRecord.m  
//
//		Document Record objects, this is what the document list is made of
//
//		by	Felipe A. Rodriguez		
//
//	This code is supplied "as is" the author makes no warranty as to its 
//	suitability for any purpose.  This code is free and may be distributed 
//	in accordance with the terms of the:
//		
//			GNU GENERAL PUBLIC LICENSE
//			Version 2, June 1991
//			copyright (C) 1989, 1991 Free Software Foundation, Inc.
// 			675 Mass Ave, Cambridge, MA 02139, USA
//
//*****************************************************************************

#import <appkit/appkit.h>

#import "DLRecord.h"
#import "GKdefs.h"




@implementation DLRecord

//*****************************************************************************
//
// 		set to a Gate doc contained in the doc list directory 
//
//*****************************************************************************

- setGateDocName:(const char *)gateDocName 
{
	GateDocName = NXCopyStringBuffer(gateDocName);
	strcpy(Path, NXGetDefaultValue([NXApp appName], LIBPATH));
	if(Path[strlen(Path)-1] != '/')
		strcat(Path, "/");
	strcat(Path, GateDocName);
	GateDocPath = NXCopyStringBuffer(Path);			// save path to Gate doc
	strcat(Path, "/Icon.tiff");
	IconImage = [[NXImage alloc] initFromFile:Path];

    return self;
}
//*****************************************************************************
//
// 		set path to a virtual Gate doc (when storing app wrapper defaults) 
//
//*****************************************************************************

- setRecordPath:(const char *)aPath 
{
char *ptr;

	GateDocName = NXCopyStringBuffer("GateKeeper app default");
	strcpy(Path, aPath);
	ptr = Path + strlen(Path);		// point to end of name str
	ptr -= 8;						
	*ptr = '\0';						
	GateDocPath = NXCopyStringBuffer(Path);			// save path to Gate doc
	strcat(Path, "/Icon.tiff");
	IconImage = [[NXImage alloc] initFromFile:Path];

    return self;
}
- (char *)gateDocName 
{
    return GateDocName;
}
- (char *)gateDocPath 
{
    return GateDocPath;
}
- gateIcon 
{
	if([IconImage lockFocus])
		{
		[IconImage unlockFocus];
    	return IconImage;
		}
	return nil;
}
//*****************************************************************************
//
// 	free simply gets rid of everything we created
// 	This is how nice objects clean up.
//
//*****************************************************************************

- free
{
	if(GateDocName)
		free(GateDocName);
	if(GateDocPath)
		free(GateDocPath);
	if(IconImage)
		[IconImage free];

    return [super free];
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.