git.y1.nz

SameBoy

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

QuickLook/GBPreviewProvider.m

      1 #import "GBPreviewProvider.h"
      2 
      3 extern OSStatus GBQuickLookRender(CGContextRef cgContext, CFURLRef url, bool showBorder);
      4 
      5 @implementation GBPreviewProvider
      6 
      7 - (void)providePreviewForFileRequest:(QLFilePreviewRequest *)request completionHandler:(void (^)(QLPreviewReply *reply, NSError *error))handler
      8 {
      9     QLPreviewReply* reply = [[QLPreviewReply alloc] initWithContextSize:CGSizeMake(640, 576)
     10                                                                isBitmap:true
     11                                                            drawingBlock:^BOOL (CGContextRef context, QLPreviewReply *reply, NSError **error) {
     12         return !GBQuickLookRender(context, (__bridge CFURLRef)request.fileURL, false);
     13 
     14     }];
     15         
     16     handler(reply, nil);
     17 }
     18 
     19 @end
     20 

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