/****************************************************************************
 *   Copyright (C) 2004 by Arboretum Systems, Inc.                          *
 *   Technical administrator: Alain Mazy, hav@mazy.be                       *
 *   Lead program designer: Georges Jaroslaw, gjaro@arboretum.com           *
 *                                                                          *
 *   HyperEngine-AV is a video, audio and text editor that can be used to   *
 *   record, import, edit, process and arrange together video, sound and    *
 *   text. These are all achieved in the program's free-form document       *
 *   window, with no limitations to the number of tracks.                   *
 *   The purpose of this program is to provide to users at all levels of    *
 *   expertise a readily accessible tool enabling them to create movies,    *
 *   slide shows or presentations.                                          *
 *                                                                          *
 *   HyperEngine-AV itself is free software. However, plug-ins that can be  *
 *   used as add-ons to HyperEngine-AV may or may not be free software, at  *
 *   the discretion of each plug-in developer and as specified by these     *
 *   plug-ins' respective licenses.                                         *
 *   You can redistribute HyperEngine-AV itself and/or modify it under the  *
 *   terms of the GNU General Public License as published by the Free       *
 *   Software Foundation; either version 2 of the License, or (at your      *
 *   option) any later version.                                             *
 *                                                                          *
 *   HyperEngine-AV is distributed in the hope that it will be useful, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of             *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *   GNU General Public License for all applicable details.                 *
 *                                                                          *
 *   You should have received a copy of the GNU General Public License      *
 *   along with this program; if not, write to:                             *
 *   Free Software Foundation, Inc.,                                        *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
 ****************************************************************************/
#import "MITimePaletteView.h"
#import "MIImageController.h"
#import "MITimePaletteController.h"

@implementation MITimePaletteView

- (void)drawRect:(NSRect)rect
{
	[super drawRect:rect];
	
/*
	[self drawBoxAround:fController->fDFrame];
    [self drawBoxAround:fController->fDHour];
    [self drawBoxAround:fController->fDMilisecond];
    [self drawBoxAround:fController->fDMinute];
    [self drawBoxAround:fController->fDSecond];

    [self drawBoxAround:fController->fEFrame];
    [self drawBoxAround:fController->fEHour];
    [self drawBoxAround:fController->fEMilisecond];
    [self drawBoxAround:fController->fEMinute];
    [self drawBoxAround:fController->fESecond];

    [self drawBoxAround:fController->fSFrame];
    [self drawBoxAround:fController->fSHour];
    [self drawBoxAround:fController->fSMilisecond];
    [self drawBoxAround:fController->fSMinute];
    [self drawBoxAround:fController->fSSecond];

 	[self drawBoxAround:fController->fBigTextView];
*/
/*
	[self drawBoxAround:fController->fBigFrame];
	[self drawBoxAround:fController->fBigHour];
	[self drawBoxAround:fController->fBigMinute];
	[self drawBoxAround:fController->fBigSecond];
	[self drawBoxAround:fController->fBigMilisecond];
*/

}

- (void)drawBoxAround:(id)item
{
	NSRect		itemFrame;
	NSSize		imgSize;
	itemFrame = [item frame];
	
	imgSize = [mainImageController->fHyperprismTextBoxLeft size];
	[mainImageController->fHyperprismTextBoxLeft
			drawInRect:
		NSMakeRect(	NSMinX(itemFrame)-imgSize.width, NSMinY(itemFrame)-5, imgSize.width, NSHeight(itemFrame)+10)
			fromRect:
		NSMakeRect(0,0,imgSize.width, imgSize.height)
			operation:NSCompositeSourceAtop fraction:1.0f];

/*	[mainImageController->fHyperprismTextBoxLeft compositeToPoint:
		NSMakePoint(NSMinX(itemFrame)-[mainImageController->fHyperprismTextBoxLeft size].width,NSMinY(itemFrame)-5)
		operation:NSCompositeSourceAtop];
*/

	imgSize = [mainImageController->fHyperprismTextBoxRight size];
	[mainImageController->fHyperprismTextBoxRight
			drawInRect:
		NSMakeRect(	NSMaxX(itemFrame), NSMinY(itemFrame)-5, imgSize.width, NSHeight(itemFrame)+10)
			fromRect:
		NSMakeRect(0,0,imgSize.width, imgSize.height)
			operation:NSCompositeSourceAtop fraction:1.0f];

/*	[mainImageController->fHyperprismTextBoxRight compositeToPoint:
		NSMakePoint(NSMaxX(itemFrame),NSMinY(itemFrame)-5) operation:NSCompositeSourceAtop];
*/

	[mainImageController->fHyperprismTextBoxCenter
			drawInRect:
		NSMakeRect(NSMinX(itemFrame), NSMinY(itemFrame)-5, NSWidth(itemFrame), NSHeight(itemFrame)+10)
			fromRect:
		NSMakeRect(0,0,1,[mainImageController->fHyperprismTextBoxCenter size].height)
			operation:NSCompositeSourceAtop fraction:1];
}
@end
