// BWSwoopView.h -- draw a cheesy swoopy trangular effect for BorkPad page turns

// Copyright (C) 2003 Borkware
// We use the BSD License.  Check out http://borkware.com/license

// this is a self-contaned class.  Create one, stick it in a window somewhere,
// and it'll draw the swoop effect.  afterwards it kills itself and sends
// out a notification.

// It works marginally better if you put it in its own transparent
// window over whatever surface it is you're animating over.

#import <Cocoa/Cocoa.h>


// the notification posted to the default notification center when the 
// swoop effect has completed.  Once the effect has completed, the app
// should do something, like move to a new page in the BorkPad

extern NSString *BWSwoopViewCompletedNotification;


@interface BWSwoopView : NSView
{
    int		 swoopCount;
    int		 currentSwoop;

    // these are arrays of coordinates of all the triangles that will
    // be drawn.  They're all 'swoopCount' large, and 'currentSwoop'
    // is the index of the most recently drawn triangle

    NSPoint	*upperLeft;
    NSPoint	*upperRight;
    NSPoint	*lowerRight;

    // the path re-used to draw the triangles
    NSBezierPath	*path;

    NSTimer	*timer;
}

// 'forwards' means to swoop starting from the bottom-left (The page controller
// area) to the upper right.

- (id) initWithFrame: (NSRect) frame  swoopForwards: (BOOL) swoopForwards;

@end // BWSwoopView


/* $Id: BWSwoopView.h,v 1.4 2003/01/02 21:29:21 markd Exp $ */

