Skip to content

Commit

Permalink
Documentation pokes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Jan 12, 2025
1 parent 91b6947 commit 66f3b1d
Show file tree
Hide file tree
Showing 59 changed files with 198 additions and 189 deletions.
6 changes: 3 additions & 3 deletions Boxer/BXAboutController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

#import <Cocoa/Cocoa.h>

/// \c BXAboutController is a simple window controller which styles and displays the About Boxer panel.
/// `BXAboutController` is a simple window controller which styles and displays the About Boxer panel.
@interface BXAboutController : NSWindowController

@property (strong, nonatomic) IBOutlet NSTextField *version;

/// Provides a singleton instance of the window controller which stays retained for the lifetime
/// of the application. BXAboutController should always be accessed from this singleton.
/// of the application. `BXAboutController` should always be accessed from this singleton.
@property (class, readonly, strong) id controller;

//Display the credits and acknowledgements help page
/// Display the credits and acknowledgements help page.
- (IBAction) showAcknowledgements: (id)sender;

@end
Expand Down
2 changes: 1 addition & 1 deletion Boxer/BXBezelController.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ NS_ENUM(NSInteger) {
#pragma mark Methods

/// Whether to show or suppress drive notifications.
/// This will return NO if the Drives Inspector panel is open.
/// This will return `NO` if the Drives Inspector panel is open.
- (BOOL) shouldShowDriveNotifications;

- (void) showDriveAddedBezelForDrive: (BXDrive *)drive;
Expand Down
4 changes: 2 additions & 2 deletions Boxer/BXBinCueImageImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import "BXCDImageImport.h"

/// \c BXBinCueImageImport rips CD-ROM discs to BIN/CUE images that are bundled into a .cdmedia bundle,
/// using the cdrdao utility.
/// `BXBinCueImageImport` rips CD-ROM discs to BIN/CUE images that are bundled into a .cdmedia bundle,
/// using the *cdrdao* utility.
@interface BXBinCueImageImport : BXCDImageImport

/// Enables/disables cdrdao's error-correction when reading audio tracks.
Expand Down
2 changes: 1 addition & 1 deletion Boxer/BXBlueprintBackgroundView.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import "BXDOSWindowBackgroundView.h"

/// BXBlueprintBackgroundView draws the custom blueprint background and watermark for the DOS window
/// `BXBlueprintBackgroundView` draws the custom blueprint background and watermark for the DOS window
/// while importing a game.
@interface BXBlueprintBackgroundView : BXDOSWindowBackgroundView
@end
2 changes: 1 addition & 1 deletion Boxer/BXBlueprintPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import <Cocoa/Cocoa.h>
#import "BXHUDSpinningProgressIndicator.h"

/// \c BXBlueprintPanel and friends render a custom blueprint appearance for views in the import process.
/// `BXBlueprintPanel` and friends render a custom blueprint appearance for views in the import process.
@interface BXBlueprintPanel : NSView
@end

Expand Down
4 changes: 2 additions & 2 deletions Boxer/BXBootlegCoverArt.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

NS_ASSUME_NONNULL_BEGIN

/// BXBootlegCoverArt is similar to BXCoverArt, but creates generic cover art based on a title string
/// `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.
@protocol BXBootlegCoverArt <NSObject>

/// Return a new BXBootlegCoverArt implementor using the specified title.
/// Return a new `BXBootlegCoverArt` implementor using the specified title.
- (instancetype) initWithTitle: (NSString *)coverTitle;

/// The game title to display on this cover art.
Expand Down
2 changes: 1 addition & 1 deletion Boxer/BXCDImageImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ typedef NS_ERROR_ENUM(BXCDImageImportErrorDomain, BXCDImageImportErrors) {
};


/// BXCDImageImport rips physical CDs to (CDR-format) ISO disc images using OS X's hdiutil.
/// `BXCDImageImport` rips physical CDs to (CDR-format) ISO disc images using macOS' hdiutil.
@interface BXCDImageImport : ADBTaskOperation <BXDriveImport>

@property (atomic) unsigned long long numBytes;
Expand Down
4 changes: 2 additions & 2 deletions Boxer/BXDockTileController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

@class BXSession;

/// \c BXDockTileController is a standalone class that listens for changes to the active DOS session
/// `BXDockTileController` is a standalone class that listens for changes to the active DOS session
/// and changes the Boxer dock icon to match the current session's gamebox icon (if any).
/// This class is instantiated in MainMenu.xib.
@interface BXDockTileController : NSObject

/// Called whenever the current session or its icon changes.
/// This calls \c coverArtForSession: with the current session and sets NSApplication's icon to the result.
/// This calls `coverArtForSession:` with the current session and sets NSApplication's icon to the result.
- (void) syncIconWithActiveSession;

@end
2 changes: 1 addition & 1 deletion Boxer/BXDrive+BXDriveArchiving.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "BXDrive.h"

/// \c BXDriveSerialization extends BXDrive with support for encoding and decoding from keyed archives.
/// \c BXDriveSerialization extends `BXDrive` with support for encoding and decoding from keyed archives.
/// This is used for remembering mounted drives across sessions.
@interface BXDrive (BXDriveArchiving) <NSSecureCoding>

Expand Down
42 changes: 22 additions & 20 deletions Boxer/BXDrive.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
BXDriveVirtual = 3
};

/// Setting freeSpace to @c BXDefaultFreeSpace indicates that the drive should use whatever free space DOSBox thinks is best.
/// Setting `freeSpace` to `BXDefaultFreeSpace` indicates that the drive should use whatever free space DOSBox thinks is best.
#define BXDefaultFreeSpace -1l


Expand All @@ -31,35 +31,35 @@ typedef NS_ENUM(NSInteger, BXDriveType) {

@protocol ADBFilesystemPathAccess, ADBFilesystemLogicalURLAccess;

/// \c BXDrive represents a single DOS drive and encapsulates all the data needed to mount the drive
/// and locate it on the OS X filesystem. BXDrives are mounted via ADBFilesystem's @c mountDrive: method.
/// `BXDrive` represents a single DOS drive and encapsulates all the data needed to mount the drive
/// and locate it on the OS X filesystem. BXDrives are mounted via ADBFilesystem's `mountDrive:` method.
@interface BXDrive : NSObject

#pragma mark - Properties

/// The location on the OS X filesystem of this drive's contents.
/// The location on the macOS filesystem of this drive's contents.
/// This is the canonical location of the drive and is used when resolving absolute
/// URLs to DOS filesystem paths. It may or may not be the same as the location that
/// actually gets mounted in DOSBox: see @c mountPointURL below.
/// actually gets mounted in DOSBox: see `-mountPointURL` below.
///
/// Several properties are derived automatically from the source URL: Changing the
/// source URL will recalculate mountPointURL, letter, title, volumeLabel and type
/// unless these have been explicitly overridden.
@property (copy, nonatomic, nullable) NSURL *sourceURL;

/// The OS X filesystem location that will be mounted in DOSBox.
/// The macOS filesystem location that will be mounted in DOSBox.
/// Usually this is the same as the source URL, but differs for e.g. CD-ROM bundles.
@property (copy, nonatomic, nullable) NSURL *mountPointURL;

/// An optional location on the OS X filesystem to which we will perform
/// An optional location on the macOS filesystem to which we will perform
/// shadow write operations for this drive. That is, any files that are
/// opened for modification on this drive will be silently written to this
/// location instead of creating/modifying files in the original location.
@property (copy, nonatomic, nullable) NSURL *shadowURL;


/// The DOS drive letter under which this drive will be mounted.
/// If nil, @c BXEmulator will choose an appropriate drive letter at mount time
/// If `nil`, `BXEmulator` will choose an appropriate drive letter at mount time
/// (and update this property with the chosen letter).
@property (copy, nonatomic, nullable) NSString *letter;

Expand All @@ -73,18 +73,18 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
@property (copy, nonatomic, nullable) NSString *volumeLabel;

/// The volume label that the drive ended up with after mounting in DOS.
/// This is populated by BXEmulator when the drive is first mounted and will be a munged
/// This is populated by `BXEmulator` when the drive is first mounted and will be a munged
/// version of the above: cropped to 11 characters and uppercased for most drive types.
@property (copy, nonatomic, nullable) NSString *DOSVolumeLabel;

/// The amount of free disk space to report for the drive, in bytes. Defaults to
/// BXDefaultFreeSpace: which is ~250MB for hard disks, 1.44MB for floppies and 0B for CDROMs.
/// `BXDefaultFreeSpace`: which is ~250MB for hard disks, 1.44MB for floppies and 0B for CDROMs.
/// Note that this is not an enforced limit: it only affects how much free space is reported
/// to DOS programs.
@property (nonatomic) NSInteger freeSpace;

/// Whether to use SDL CD-ROM audio: only relevant for folders mounted as CD-ROM drives.
/// If YES, DOS emulation will read CD audio for this drive from the first audio CD volume mounted in OS X.
/// If `YES`, DOS emulation will read CD audio for this drive from the first audio CD volume mounted in OS X.
@property (nonatomic) BOOL usesCDAudio;

/// Whether to prevent DOS from writing to the OS X filesystem representing this drive. Defaults to NO.
Expand All @@ -101,7 +101,7 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
@property (nonatomic, getter=isHidden) BOOL hidden;

/// Whether this drive is currently mounted in an emulation session.
/// This is merely a flag to make displaying the state of a drive easier; setting it to @c YES
/// This is merely a flag to make displaying the state of a drive easier; setting it to `YES`
/// will not actually mount the drive, just indicate that it is mounted somewhere.
@property (nonatomic, getter=isMounted) BOOL mounted;

Expand Down Expand Up @@ -132,8 +132,9 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
/// Returns a localised descriptive name for the specified drive type. e.g. @"hard disk", @"CD-ROM" etc.
+ (NSString *) localizedDescriptionForType: (BXDriveType)driveType;

/// Determines the most appropriate drive type for the specified file or folder. This is based on:
/// Determines the most appropriate drive type for the specified file or folder.
///
/// This is based on:
/// 1. the file's type identifier: e.g. disk images will be treated as CD-ROM or floppy drives;
/// 2. the filesystem of the URL's volume: e.g. folders located on a CD-ROM volume will be detected as CD-ROMs.
+ (BXDriveType) preferredTypeForContentsOfURL: (NSURL *)URL;
Expand All @@ -142,15 +143,15 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
///
/// For regular folders and CD-ROM volumes, this will be their filename;
/// For .floppy, .cdrom, .cdmedia and .harddisk folders, this will be their filename
/// minus extension and parsed drive letter (see @c preferredDriveLetterForContentsOfURL: below.)
/// minus extension and parsed drive letter (see `-preferredDriveLetterForContentsOfURL:` below.)
+ (NSString *) preferredVolumeLabelForContentsOfURL: (NSURL *)URL;

/// Determines a suitable display title for the specified location.
/// This is currently the base filename of the path including file extension.
+ (NSString *) preferredTitleForContentsOfURL: (NSURL *)URL;

/// Determines a recommended drive letter from the specified location,
/// or @c nil if no specific drive letter is appropriate.
/// or `nil` if no specific drive letter is appropriate.
///
/// If the location is a disk image or a Boxer mountable folder, and the filename starts with a single
/// letter followed by a space, this will be parsed out and used as the drive letter.
Expand All @@ -164,9 +165,10 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
#pragma mark - Constructors

/// Returns a newly-minted drive instance representing the contents of the specified URL.
/// If driveLetter is specified, this will be used; if it is left nil, an appropriate drive
///
/// If `driveLetter` is specified, this will be used; if it is left `nil`, an appropriate drive
/// letter will be determined when the drive is first mounted.
/// If driveType is specified, a drive of that type will be created; if it is BXDriveTypeAuto,
/// If `driveType` is specified, a drive of that type will be created; if it is `BXDriveTypeAuto`,
/// the most appropriate type will be determined from the contents of the URL.
- (instancetype) initWithContentsOfURL: (nullable NSURL *)sourceURL
letter: (nullable NSString *)driveLetter
Expand All @@ -191,8 +193,8 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
- (BOOL) exposesLogicalURL: (NSURL *)URL;

/// Returns the location of the specified logical URL relative to the filesystem of the drive:
/// or @c nil if the specified location is not contained on this drive.
/// Used by @c BXDOSFileSystem for matching OS X filesystem paths with DOS filesystem paths.
/// or `nil` if the specified location is not contained on this drive.
/// Used by `BXDOSFileSystem` for matching macOS filesystem paths with DOS filesystem paths.
- (nullable NSString *) relativeLocationOfLogicalURL: (NSURL *)URL;

/// Returns a logical URL representing the specified DOS path, as constructed by the drive's filesystem.
Expand All @@ -202,7 +204,7 @@ typedef NS_ENUM(NSInteger, BXDriveType) {
/// Indicates that the specified URL represents the same resource as the contents of this drive.
/// This is used by the drive's filesystem to correctly resolve URLs to resources in different apparent locations.
/// Mainly this is of use for drives representing disk images: so that if the image is mounted
/// as a folder in OS X, the drive will treat locations within the mounted folder as being contained
/// as a folder in macOS, the drive will treat locations within the mounted folder as being contained
/// within the drive.
- (void) addEquivalentURL: (NSURL *)URL;

Expand Down
2 changes: 1 addition & 1 deletion Boxer/BXDriveBundleImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NS_ERROR_ENUM(BXDriveBundleErrorDomain) {
};


/// BXDriveBundleImport wraps BIN/CUE images and any associated audio tracks into a .cdmedia bundle,
/// `BXDriveBundleImport` wraps BIN/CUE images and any associated audio tracks into a .cdmedia bundle,
/// rewriting cue paths as necessary.
@interface BXDriveBundleImport : ADBFileTransferSet <BXDriveImport>
@end
Expand Down
10 changes: 6 additions & 4 deletions Boxer/BXDriveImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ extern NSString * const BXUniqueDriveNameFormat;

@class BXDrive;

/// The \c BXDriveImport protocol defines the public interface for drive import operations,
/// which are expected to descend from NSOperation. BXDriveImport is also a class that defines a number
/// The `BXDriveImport` protocol defines the public interface for drive import operations,
/// which are expected to descend from `NSOperation`. `BXDriveImport` is also a class that defines a number
/// of helper methods and factory methods for use by concrete import operations.
@protocol BXDriveImport <NSObject, ADBFileTransfer>

Expand Down Expand Up @@ -50,7 +50,7 @@ extern NSString * const BXUniqueDriveNameFormat;
@property (class, readonly) BOOL driveUnavailableDuringImport;


/// Return a suitably initialized BXOperation subclass for transferring the drive.
/// Return a suitably initialized `BXOperation` subclass for transferring the drive.
- (instancetype) initForDrive: (BXDrive *)drive
destinationFolderURL: (NSURL *)destinationFolderURL
copyFiles: (BOOL)copyFiles;
Expand All @@ -71,9 +71,11 @@ extern NSString * const BXUniqueDriveNameFormat;
+ (nullable Class) importClassForDrive: (BXDrive *)drive;

/// Returns a safe replacement import operation for the specified failed import,
/// or nil if no fallback was available.
/// or `nil` if no fallback was available.
///
/// The replacement will have the same source drive and destination folder as
/// the original import.
///
/// Used when e.g. a disc-ripping import fails because of a driver-related issue:
/// this will fall back on a safer method of importing.
+ (nullable id <BXDriveImport>) fallbackForFailedImport: (id <BXDriveImport>)failedImport;
Expand Down
2 changes: 1 addition & 1 deletion Boxer/BXDrivesInUseAlert.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@class BXSession;
@class BXDrive;

/// \c BXDrivesInUseAlert is shown when a user tries to unmount one or more drives that are currently
/// `BXDrivesInUseAlert` is shown when a user tries to unmount one or more drives that are currently
/// being accessed by the DOS process. It displays a warning and confirmation.
@interface BXDrivesInUseAlert : NSAlert

Expand Down
4 changes: 2 additions & 2 deletions Boxer/BXEventConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/// Used as the arbitrary length for arrays of key mappings.
#define BXMaxSystemKeyCode 256

/// These correspond to NSEvent's mouse button numbers
/// These correspond to `NSEvent`'s mouse button numbers
typedef NS_ENUM(NSInteger, BXMouseButton) {
BXMouseButtonLeft = 0,
BXMouseButtonRight = 1,
Expand All @@ -41,7 +41,7 @@ typedef NS_ENUM(NSInteger, BXMouseButton) {
};


/// These correspond to NSEvent's pressedMouseButton masks
/// These correspond to `NSEvent`'s pressedMouseButton masks
typedef NS_OPTIONS(NSUInteger, BXMouseButtonMask) {
BXNoMouseButtonsMask = 0,
BXMouseButtonLeftMask = 1U << BXMouseButtonLeft,
Expand Down
4 changes: 2 additions & 2 deletions Boxer/BXFilterGallery.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import <Cocoa/Cocoa.h>

/// \c BXFilterGallery draws Boxer's rendering filter gallery in the preferences pane. It consists of
/// the \c BXFilterGallery view that renders a graphical background, containing BXFilterPortrait
/// `BXFilterGallery` draws Boxer's rendering filter gallery in the preferences pane. It consists of
/// the `BXFilterGallery` view that renders a graphical background, containing BXFilterPortrait
/// buttons for each option.
@interface BXFilterGallery : NSView
@end
Expand Down
2 changes: 1 addition & 1 deletion Boxer/BXGamesFolderPanelController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <Cocoa/Cocoa.h>

/// BXGamesFolderPanelController displays the choose-a-game-folder open panel, and manages its
/// `BXGamesFolderPanelController` displays the choose-a-game-folder open panel, and manages its
/// accessory view. It is also responsible for adding sample games to the chosen folder, if requested.
@interface BXGamesFolderPanelController : NSViewController <NSOpenSavePanelDelegate>

Expand Down
12 changes: 6 additions & 6 deletions Boxer/BXHIDControllerProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@protocol BXEmulatedJoystick;
@protocol BXHIDInputBinding;

/// Constants used by BXHIDControllerProfile.controllerStyle.
/// Constants used by `BXHIDControllerProfile.controllerStyle`.
typedef NS_ENUM(NSInteger, BXControllerStyle) {
BXControllerStyleUnknown,
BXControllerStyleJoystick,
Expand All @@ -25,13 +25,13 @@ typedef NS_ENUM(NSInteger, BXControllerStyle) {
};


/// @c BXControllerProfile is paired with a @c DDHidDevice and maps actual HID events from that
/// `BXControllerProfile` is paired with a `DDHidDevice` and maps actual HID events from that
/// device into inputs on emulated input devices.
/// The class can programmatically design a suitable control mapping for a specified HID device
/// based on the device's elements; it is also intended to be subclassed for devices that require
/// more specific translation.

/// @c BXControllerProfile is controller- and joystick-specific and each emulation session maintains
/// `BXControllerProfile` is controller- and joystick-specific and each emulation session maintains
/// its own set of active controller profiles.
@interface BXHIDControllerProfile : NSObject

Expand All @@ -42,19 +42,19 @@ typedef NS_ENUM(NSInteger, BXControllerStyle) {
@property (strong, nonatomic) id <BXEmulatedJoystick> emulatedJoystick;
@property (strong, nonatomic) BXEmulatedKeyboard *emulatedKeyboard;

/// A dictionary of @c DDHidUsage -> @c BXHIDInputBinding mappings.
/// A dictionary of `DDHidUsage` -> `BXHIDInputBinding` mappings.
@property (readonly, strong, nonatomic) NSMutableDictionary *bindings;

/// The style of this controller. Used for tweaking certain mapping behaviours.
@property (readonly, nonatomic) BXControllerStyle controllerStyle;

/// Returns a @c BXControllerProfile that maps the specified HID controller
/// Returns a `BXControllerProfile` that maps the specified HID controller
/// to the specified emulated joystick.
+ (instancetype) profileForHIDDevice: (DDHidJoystick *)device
emulatedJoystick: (id <BXEmulatedJoystick>)joystick
keyboard: (BXEmulatedKeyboard *)keyboard;

/// Returns a @c BXControllerProfile that maps the specified HID controller
/// Returns a `BXControllerProfile` that maps the specified HID controller
/// to the specified emulated joystick.
- (instancetype) initWithHIDDevice: (DDHidJoystick *)device
emulatedJoystick: (id <BXEmulatedJoystick>)joystick
Expand Down
Loading

0 comments on commit 66f3b1d

Please sign in to comment.