ftp.nice.ch/Attic/openStep/developer/resources/MiscKit.2.0.5.s.gnutar.gz#/MiscKit2/Frameworks/MiscAppKit/MiscTreeDiagram.subproj/MiscTDViewUtils.m

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

/*	MiscTDViewUtils.m

	Copyright 1996 Uwe Hoffmann.

	This notice may not be removed from this source code.
	The use and distribution of this software is governed by the
	terms of the MiscKit license agreement.  Refer to the license
	document included with the MiscKit distribution for the terms.

	Version 2 (August 1996)
*/

#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>

NSString *MiscTreeDiagramPboardType = @"MiscTreeDiagramPboardType";
NSString *MiscTreeDiagramStylePboardType = @"MiscTreeDiagramStylePboardType";

const float miscTD_LargeNumberForText = 1.0e7;

BOOL miscTD_includesType(NSArray *types, NSString *type)
{
	return types ? ([types indexOfObject:type] != NSNotFound) : NO;
}

NSRect miscTD_calcCanvas(NSPrintInfo *printInfo)
{
    	NSRect calcRect;
	NSSize paperSize;
	//float scale;

    	calcRect.origin.x = calcRect.origin.y = 0.0;
    	paperSize = [printInfo paperSize];
	//scale = 1 / [[[printInfo dictionary] objectForKey:NSPrintScalingFactor] floatValue];
    	calcRect.size = paperSize;
    	calcRect.size.width -= [printInfo leftMargin] + [printInfo rightMargin];
    	calcRect.size.height -= [printInfo topMargin] + [printInfo bottomMargin];
    	//calcRect.size.width *= scale;
	//calcRect.size.height *= scale;
        return calcRect;
}


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