[Mono-osx] Quick Look support in MonoMac

Frank Krueger fak at kruegersystems.com
Thu Jan 20 00:46:01 EST 2011


Hello,

I am writing to inquire into the inclusion of QuickLook bundles into MonoMac
apps.

QuickLook bundles are little plugins loaded by the Quick Look daemon in OS X
to generate thumbnails and previews of documents. The are little Mach-O
executables that implement 4 functions. These functions are supposed to be
written in a re-entrant fashion since they will be used over and over on
possibly 1 thread. (This behavior can be prevented, but it would be best if
we support it.)

Thread safety:
http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Articles/QLImplementationOverview.html%23//apple_ref/doc/uid/TP40005020-CH6-SW1

It would be a wonderful dream world if I could create an assembly that
contains a class that implements those 4 functions and have that packaged up
into a bundle and included in my MonoMac app.

Any thoughts on how much work it would be to create such a packager?

Below are some notes I gathered while looking into what exactly the
generator bundle is composed of.


Create Quick Look Plug-in
=========================
1. Xcode -> New Project -> System Plug-in -> Quick Look Plug-in
2. Name it "Alpha"


Output
======

http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Articles/QLProjectConfig.html%23//apple_ref/doc/uid/TP40005020-CH5-SW7

Alpha.qlgenerator
Contents
Info.plist
MacOS
Alpha
Resources
English.lproj
InfoPlist.strings


Alpha
=====

Architectures:          Standard (32/64-bit Universal)
Base SDK:               Mac OS X 10.6
Valid Architectures:    i386 ppc ppc64 ppc7400 ppc970 x86_64

File Type: MH_BUNDLE
Flags: MH_NOUNDEFS | MH_DYLDLINK | MH_TWOLEVEL

Implements the following functions:

OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef
preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options)
{
    return noErr;
}

void CancelPreviewGeneration(void* thisInterface, QLPreviewRequestRef
preview)
{
}

OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef
thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef
options, CGSize maxSize)
{
    return noErr;
}

void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef
thumbnail)
{
}


Installation
============

You can store a Quick Look generator in an application bundle (in
MyApp.app/Contents/Library/QuickLook/) or in one of the standard file-system
locations:

* ~/Library/QuickLook—third party generators, accessible only to logged-in
user
* /Library/QuickLook—third party generators, accessible to all users of the
system
* /System/Library/QuickLook—Apple-provided generators, accessible to all
users of the system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110119/bcfafc8c/attachment.html 


More information about the Mono-osx mailing list