2019-11-18 10:23:30 +00:00
|
|
|
/* Implementation of class NSDockTile
|
|
|
|
Copyright (C) 2019 Free Software Foundation, Inc.
|
|
|
|
|
2019-11-21 06:17:14 +00:00
|
|
|
By: Gregory John Casamento <greg.casamento@gmail.com>
|
2019-11-18 10:23:30 +00:00
|
|
|
Date: Sat Nov 16 21:11:06 EST 2019
|
|
|
|
|
|
|
|
This file is part of the GNUstep Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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
|
2019-12-09 23:45:15 +00:00
|
|
|
Lesser General Public License for more details.
|
2019-11-18 10:23:30 +00:00
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
2019-12-09 23:45:15 +00:00
|
|
|
Boston, MA 02110 USA.
|
2019-11-18 10:23:30 +00:00
|
|
|
*/
|
|
|
|
|
2019-12-04 17:02:49 +00:00
|
|
|
#import <AppKit/NSDockTile.h>
|
|
|
|
#import <AppKit/NSView.h>
|
2019-11-18 10:23:30 +00:00
|
|
|
|
|
|
|
@implementation NSDockTile
|
|
|
|
|
2019-11-21 06:17:14 +00:00
|
|
|
- (instancetype) init
|
|
|
|
{
|
|
|
|
self = [super init];
|
2019-12-03 23:47:36 +00:00
|
|
|
if (self != nil)
|
2019-11-21 06:17:14 +00:00
|
|
|
{
|
|
|
|
NSRect rect = NSMakeRect(0,0,48,48);
|
|
|
|
_size = rect.size;
|
|
|
|
_contentView = [[NSView alloc] initWithFrame: rect];
|
|
|
|
_badgeLabel = nil;
|
|
|
|
_owner = nil;
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (oneway void) release
|
|
|
|
{
|
|
|
|
RELEASE(_contentView);
|
|
|
|
RELEASE(_badgeLabel);
|
|
|
|
[super release];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSView *) contentView
|
|
|
|
{
|
|
|
|
return _contentView;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setContentView: (NSView *)contentView
|
|
|
|
{
|
|
|
|
ASSIGN(_contentView, contentView);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSSize) size
|
|
|
|
{
|
|
|
|
return _size;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) owner
|
|
|
|
{
|
|
|
|
return _owner;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setOwner: (id)owner
|
|
|
|
{
|
|
|
|
_owner = owner; // weak...
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) showsApplicationBadge
|
|
|
|
{
|
|
|
|
return _showsApplicationBadge;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setShowsApplicationBadge: (BOOL)flag
|
|
|
|
{
|
|
|
|
_showsApplicationBadge = flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) badgeLabel
|
|
|
|
{
|
|
|
|
return _badgeLabel;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setBadgeLabel: (NSString *)label
|
|
|
|
{
|
|
|
|
ASSIGNCOPY(_badgeLabel, label);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) display
|
|
|
|
{
|
|
|
|
[_contentView setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
2019-11-18 10:23:30 +00:00
|
|
|
@end
|
|
|
|
|