Skip to content

Commit

Permalink
Merge branch 'maddsV2' into bigUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Jan 13, 2024
2 parents 4753df4 + ee4db91 commit 5a61efb
Show file tree
Hide file tree
Showing 25 changed files with 574 additions and 614 deletions.
26 changes: 13 additions & 13 deletions Boxer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Boxer/Application Delegate/BXSampleGamesCopy.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


#import "BXSampleGamesCopy.h"
#import "BXCoverArt.h"
#import "Boxer-Swift.h"

@implementation BXSampleGamesCopy

Expand Down Expand Up @@ -58,9 +58,9 @@ - (void) main
NSImage *image = [[NSImage alloc] initWithContentsOfURL: iconURL];
if (image)
{
NSImage *iconForGame = [BXCoverArt coverArtWithImage: image];
NSImage *iconForGame = [CoverArt coverArtWithImage: image];

[[NSWorkspace sharedWorkspace] setIcon: iconForGame forFile: destinationURL.path options: 0];
[[NSWorkspace sharedWorkspace] setIcon: iconForGame forFile: destinationURL.path options: NSExcludeQuickDrawElementsIconCreationOption];
}
}
}
Expand Down
19 changes: 14 additions & 5 deletions Boxer/BXBezelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,29 @@ @implementation BXBezelController

+ (NSImage *) bezelIconForDrive: (BXDrive *)drive
{
NSString *iconName;
NSImage *icon;
switch (drive.type)
{
case BXDriveCDROM:
iconName = @"CDROMTemplate";
if (@available(macOS 13.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"opticaldisc.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"CDROMTemplate"];
}
break;
case BXDriveFloppyDisk:
iconName = @"DisketteTemplate";
icon = [NSImage imageNamed: @"DisketteTemplate"];
break;
default:
iconName = @"HardDiskTemplate";
if (@available(macOS 11.0, *)) {
icon = [NSImage imageWithSystemSymbolName: @"internaldrive.fill" accessibilityDescription: nil];
} else {
icon = [NSImage imageNamed: @"HardDiskTemplate"];
}
break;
}

return [NSImage imageNamed: iconName];
return icon;
}

+ (id) controller
Expand Down
6 changes: 3 additions & 3 deletions Boxer/BXBinCueImageImport.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ typedef NS_ENUM(NSInteger, BXDADiskOperationStatus)
BXDADiskOperationSucceeded = 1
};

BOOL _mountSynchronously(DASessionRef, DADiskRef disk, CFURLRef path, DADiskUnmountOptions options);
BOOL _unmountSynchronously(DASessionRef session, DADiskRef disk, DADiskMountOptions options);
void _mountCallback(DADiskRef disk, DADissenterRef dissenter, void *status);
static BOOL _mountSynchronously(DASessionRef, DADiskRef disk, CFURLRef path, DADiskUnmountOptions options);
static BOOL _unmountSynchronously(DASessionRef session, DADiskRef disk, DADiskMountOptions options);
static void _mountCallback(DADiskRef disk, DADissenterRef dissenter, void *status);

#pragma mark -
#pragma mark Implementation
Expand Down
45 changes: 5 additions & 40 deletions Boxer/BXBootlegCoverArt.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import <Cocoa/Cocoa.h>

NS_ASSUME_NONNULL_BEGIN

/// BXBootlegCoverArt is similar to BXCoverArt, but creates generic cover art based on a title string
/// rather than a box image. Implementing classes create artwork to resemble bootleg floppy disks and
/// CD-ROM jewel-cases.
Expand All @@ -22,8 +24,8 @@
/// Draws the source image as cover art into the specified frame in the current graphics context.
- (void) drawInRect: (NSRect)frame;

/// Returns a cover art image representation from the instance's title rendered at the specified size.
- (NSImageRep *) representationForSize: (NSSize)iconSize;
/// Returns a cover art image representation from the instance's title rendered at the specified size and scale.
- (NSImageRep *) representationForSize: (NSSize)iconSize scale: (CGFloat)scale;

/// Returns a cover art image rendered from the instance's title, suitable for use as an OS X icon.
- (NSImage *) coverArt;
Expand All @@ -33,41 +35,4 @@

@end


@interface BXJewelCase : NSObject <BXBootlegCoverArt>

/// The game title to display on this cover art.
@property (copy, nonatomic) NSString *title;

/// Returns the font family name used for printing the title.
@property (class, readonly, copy) NSString *fontName;

/// Returns the color used for printing the title.
@property (class, readonly, copy) NSColor *textColor;

/// Returns the line height used for printing the title.
+ (CGFloat) lineHeightForSize: (NSSize)size;
/// Returns the font size used for printing the title.
+ (CGFloat) fontSizeForSize: (NSSize)size;

/// Returns a dictionary of \c NSAttributedString text attributes used for printing the title.
/// This is a collection of the return values of the methods above.
+ (NSDictionary<NSAttributedStringKey,id> *) textAttributesForSize: (NSSize)size;

/// Returns the image to render underneath the text.
+ (NSImage *) baseLayerForSize: (NSSize)size;

/// Returns the image to render over the top of the text.
+ (NSImage *) topLayerForSize: (NSSize)size;

/// Returns the region of the image in which to print the text.
/// Will be \c NSZeroRect if text should not be printed at this size.
+ (NSRect) textRegionForRect: (NSRect)rect;

@end

@interface BX35Diskette : BXJewelCase
@end

@interface BX525Diskette : BXJewelCase
@end
NS_ASSUME_NONNULL_END
219 changes: 0 additions & 219 deletions Boxer/BXBootlegCoverArt.m

This file was deleted.

Loading

0 comments on commit 5a61efb

Please sign in to comment.