NSDockTile implemented

This commit is contained in:
Gregory John Casamento 2019-11-21 01:17:14 -05:00
parent efa86f1d11
commit bd8d45d9ff
6 changed files with 113 additions and 5 deletions

View file

@ -137,6 +137,7 @@
#import <AppKit/NSComboBox.h>
#import <AppKit/NSComboBoxCell.h>
#import <AppKit/NSController.h>
#import <AppKit/NSDockTile.h>
#import <AppKit/NSDocument.h>
#import <AppKit/NSDocumentController.h>
#import <AppKit/NSDrawer.h>

View file

@ -25,16 +25,42 @@
#ifndef _NSDockTile_h_GNUSTEP_GUI_INCLUDE
#define _NSDockTile_h_GNUSTEP_GUI_INCLUDE
#include <AppKit/NSObject.h>
#include <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSDockTile : NSObject
@class NSView, NSString;
@interface NSDockTile : NSObject
{
NSView *_contentView;
NSSize _size;
id _owner;
BOOL _showsApplicationBadge;
NSString *_badgeLabel;
}
- (NSView *) contentView;
- (void) setContentView: (NSView *)contentView;
- (NSSize) size;
- (id) owner;
- (void) setOwner: (id)owner;
- (BOOL) showsApplicationBadge;
- (void) setShowsApplicationBadge: (BOOL)flag;
- (NSString *) badgeLabel;
- (void) setBadgeLabel: (NSString *)label;
- (void) display;
@end
#if defined(__cplusplus)

View file

@ -34,7 +34,13 @@ extern "C" {
#endif
@interface NSPDFImageRep : NSImageRep
{
NSData *_data;
NSRect _bounds;
NSInteger _pageCount;
NSData *_pdfRepresentation;
}
+ (instancetype) imageRepWithData: (NSData *)imageData;
- (instancetype) initWithData: (NSData *)imageData;

View file

@ -86,6 +86,7 @@ NSCustomImageRep.m \
NSDataLink.m \
NSDataLinkManager.m \
NSDataLinkPanel.m \
NSDockTile.m \
NSDocument.m \
NSDocumentController.m \
NSDrawer.m \
@ -321,6 +322,7 @@ NSCustomImageRep.h \
NSDataLink.h \
NSDataLinkManager.h \
NSDataLinkPanel.h \
NSDockTile.h \
NSDocument.h \
NSDocumentController.h \
NSDrawer.h \

View file

@ -1,7 +1,7 @@
/* Implementation of class NSDockTile
Copyright (C) 2019 Free Software Foundation, Inc.
By: heron
By: Gregory John Casamento <greg.casamento@gmail.com>
Date: Sat Nov 16 21:11:06 EST 2019
This file is part of the GNUstep Library.
@ -23,8 +23,80 @@
*/
#include <AppKit/NSDockTile.h>
#include <AppKit/NSView.h>
@implementation NSDockTile
- (instancetype) init
{
self = [super init];
if(self != nil)
{
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];
}
@end

View file

@ -27,6 +27,7 @@
@implementation NSPDFImageRep
+ (instancetype) imageRepWithData: (NSData *)imageData
{
return AUTORELEASE([[self alloc] initWithData: imageData]);
}
- (instancetype) initWithData: (NSData *)imageData