/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */

#import "GlassHostView.h"

@implementation GlassHostView : NSView

- (void)dealloc
{
    [super dealloc];
}

- (BOOL)isOpaque
{
    return NO;
}

- (BOOL)becomeFirstResponder
{
    return NO;
}

- (BOOL)acceptsFirstResponder
{
    return NO;
}

- (BOOL)canBecomeKeyView
{
    return NO;
}

- (BOOL)postsBoundsChangedNotifications
{
    return YES;
}

- (BOOL)postsFrameChangedNotifications
{
    return NO;
}

- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
{
    return NO;
}

- (BOOL)mouseDownCanMoveWindow
{
    return NO;
}

- (void)addSubview:(NSView *)aView
{
    [super addSubview:aView];
    self->view = aView;
}

- (void)drawRect:(NSRect)rect
{
    //NSLog(@"Sparkle: drawRect: [%@] %.2f,%.2f %.2fx%.2f,", self, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
    //NSLog(@"Sparkle: frame: [%@] %.2f,%.2f %.2fx%.2f,", self, [self frame].origin.x, [self frame].origin.y, [self frame].size.width, [self frame].size.height);
    //NSLog(@"Sparkle: bounds: [%@] %.2f,%.2f %.2fx%.2f,", self, [self bounds].origin.x, [self bounds].origin.y, [self bounds].size.width, [self bounds].size.height);
    //[[NSColor redColor] set];
    //NSRectFill([self bounds]);
}

- (BOOL) isFlipped
{
    return YES;
}

@end
