/*	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;
}


