//
//  Window.m
//  Hootenanny
//
//  Created by Noah Sorscher on Sun Mar 21 2004.
//  Copyright (c) 2004 __MyCompanyName__. All rights reserved.
//

#import "Window.h"
#import "OverlayView.h"


@implementation NSWindow (flagsChangedAddition)

- (void) flagsChanged:(NSEvent *)event
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"flagsChangedNotification" object:event];
}

-(NSView *)overlayViewWithRect:(NSRect)rect
{
    NSWindow *newWindow = [[NSWindow alloc] initWithContentRect:rect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO screen:[self screen]];
    [newWindow setLevel:[self level]];
    [newWindow setBackgroundColor:[NSColor clearColor]];
    [newWindow setAlphaValue:1.0];
    [newWindow setOpaque:NO];
    [newWindow setHasShadow:NO];
    [newWindow setContentView:[[OverlayView alloc] initWithFrame:[[newWindow contentView] frame]]];
    //[newWindow setIgnoresMouseEvents:YES];
    [self addChildWindow:newWindow ordered:NSWindowAbove];
    return [newWindow contentView];
}

@end
