//
//  MSBrush.h
//  MSGraphicsEngineFramework
//
//  Created by Raleigh Ledet on Sat Oct 25 2003.
//  Copyright (c) 2003 MageSW. All rights reserved.
//

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

// The biggest thing to know about brushes are thier attributes. Most brushes respect the following attributes. Some brushes respect other attributes. See the individual brush's header.
extern NSString *kMSBrushAttributeIdentifier;
extern NSString *kMSBrushAttributeSize;
extern NSString *kMSBrushAttributeColor;
extern NSString *kMSBrushAttributeMinSize;

extern const double kPI;
extern const double kPIdiv2;

@interface MSBrush : NSObject {
}

+(NSString*)brushIdentifier;
-(NSString*)brushIdentifier;
-(NSString*)brushLabel;

-(NSImage*)brushIcon;
-(NSCursor*)brushCursor;

-(NSView*)brushAttributesView;

-(void)setBrushAttributes:(NSDictionary*)attributes;
-(NSDictionary*)brushAttributes;
-(NSDictionary*)defaultAttributes;

-(NSRect)drawLineFromPoint:(NSPoint)fromPt withTabletRec:(const TabletPointRec*)fromTab
				   toPoint:(NSPoint)toPt withTabletRec:(const TabletPointRec*)toTab;

-(NSRect)drawStokeFromPointsBuffer:(const NSPoint*)pointsBuffer
		 withTabletRecsBuffer:(const TabletPointRec*)tabletRecsBuffer
		 withBufferLength:(UInt32)bufferLength
		 withAttributes:(NSDictionary*)attributes;

// Note: This function returns a unit vector. Thus if the returned point
// is {0.0, 0.0} then something when wrong. Probably toPoint == fromPoint.		 
+(NSPoint)unitVectorFromPoint:(NSPoint)fromPt toPoint:(NSPoint)toPoint;
+(NSPoint)bisectorVectorFromPoint:(NSPoint)fromPt
		  toPoint:(NSPoint)toPoint
		  withMidPoint:(NSPoint)midPoint;
+(double)radianAnglebetweenPoint:(NSPoint)ptA
		 andPoint:(NSPoint)ptB
		 withOrigin:(NSPoint)origin;
@end

#import "MSInkableView.h"

@interface MSBrush (InkingAdditions)
-(BOOL)allowGestureRecognition;
-(UInt32)allowedInkingModes;
-(MSInkableViewMode)preferredInkingMode;
@end
