git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

HexFiend/HFPasteboardOwner.h

      1 //
      2 //  HFPasteboardOwner.h
      3 //  HexFiend_2
      4 //
      5 //  Copyright 2008 ridiculous_fish. All rights reserved.
      6 //
      7 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 @class HFByteArray;
     11 
     12 extern NSString *const HFPrivateByteArrayPboardType;
     13 
     14 @interface HFPasteboardOwner : NSObject {
     15     @private
     16     HFByteArray *byteArray;
     17     NSPasteboard *pasteboard; //not retained
     18     unsigned long long dataAmountToCopy;
     19     NSUInteger bytesPerLine;
     20     BOOL retainedSelfOnBehalfOfPboard;
     21     BOOL backgroundCopyOperationFinished;
     22     BOOL didStartModalSessionForBackgroundCopyOperation;
     23 }
     24 
     25 /* Creates an HFPasteboardOwner to own the given pasteboard with the given types.  Note that the NSPasteboard retains its owner. */
     26 + (id)ownPasteboard:(NSPasteboard *)pboard forByteArray:(HFByteArray *)array withTypes:(NSArray *)types;
     27 - (HFByteArray *)byteArray;
     28 
     29 /* Performs a copy to pasteboard with progress reporting. This must be overridden if you support types other than the private pboard type. */
     30 - (void)writeDataInBackgroundToPasteboard:(NSPasteboard *)pboard ofLength:(unsigned long long)length forType:(NSString *)type trackingProgress:(id)tracker;
     31 
     32 /* NSPasteboard delegate methods, declared here to indicate that subclasses should call super */
     33 - (void)pasteboard:(NSPasteboard *)sender provideDataForType:(NSString *)type;
     34 - (void)pasteboardChangedOwner:(NSPasteboard *)pboard;
     35 
     36 /* Useful property that several pasteboard types want to know */
     37 @property (nonatomic) NSUInteger bytesPerLine;
     38 
     39 /* For efficiency, Hex Fiend writes pointers to HFByteArrays into pasteboards.  In the case that the user quits and relaunches Hex Fiend, we don't want to read a pointer from the old process, so each process we generate a UUID.  This is constant for the lifetime of the process. */
     40 + (NSString *)uuid;
     41 
     42 /* Unpacks a byte array from a pasteboard, preferring HFPrivateByteArrayPboardType */
     43 + (HFByteArray *)unpackByteArrayFromPasteboard:(NSPasteboard *)pasteboard;
     44 
     45 /* Used to handle the case where copying data will require a lot of memory and give the user a chance to confirm. */
     46 - (unsigned long long)amountToCopyForDataLength:(unsigned long long)numBytes stringLength:(unsigned long long)stringLength;
     47 
     48 /* Must be overridden to return the length of a string containing this number of bytes. */
     49 - (unsigned long long)stringLengthForDataLength:(unsigned long long)dataLength;
     50 
     51 @end

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.