Permalink
Browse files

first commit

  • Loading branch information...
whomwah committed Jan 14, 2009
0 parents commit f40dbf66c58a6e7605ac51560597bf5d33bc823f
Showing with 2,623 additions and 0 deletions.
  1. +3 −0 CHANGELOG
  2. BIN QuickLookStephenProject/English.lproj/InfoPlist.strings
  3. +45 −0 QuickLookStephenProject/GeneratePreviewForURL.m
  4. +22 −0 QuickLookStephenProject/GenerateThumbnailForURL.m
  5. +67 −0 QuickLookStephenProject/Info.plist
  6. +348 −0 QuickLookStephenProject/QuickLookStephen.xcodeproj/duncan.pbxuser
  7. +1,513 −0 QuickLookStephenProject/QuickLookStephen.xcodeproj/duncan.perspectivev3
  8. +290 −0 QuickLookStephenProject/QuickLookStephen.xcodeproj/project.pbxproj
  9. +65 −0 QuickLookStephenProject/build/Debug/QuickLookStephen.qlgenerator/Contents/Info.plist
  10. BIN QuickLookStephenProject/build/Debug/QuickLookStephen.qlgenerator/Contents/MacOS/QuickLookStephen
  11. BIN ...oject/build/Debug/QuickLookStephen.qlgenerator/Contents/Resources/English.lproj/InfoPlist.strings
  12. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/categories.pbxbtree
  13. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/cdecls.pbxbtree
  14. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/decls.pbxbtree
  15. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/files.pbxbtree
  16. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/imports.pbxbtree
  17. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/pbxindex.header
  18. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/protocols.pbxbtree
  19. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/refs.pbxbtree
  20. BIN ...kStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/strings.pbxstrings/control
  21. BIN ...kStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/strings.pbxstrings/strings
  22. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/subclasses.pbxbtree
  23. BIN QuickLookStephenProject/build/QuickLookStephen.build/QuickLookStephen.pbxindex/symbols0.pbxsymbols
  24. +218 −0 QuickLookStephenProject/main.c
  25. +26 −0 README
  26. +26 −0 releases/1.0/INSTALL
  27. BIN releases/1.0/QLStephen.dmg
@@ -0,0 +1,3 @@
+*1.0* (Nov 11th, 2008)
+
+* initial release
Binary file not shown.
@@ -0,0 +1,45 @@
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreServices/CoreServices.h>
+#include <QuickLook/QuickLook.h>
+#import <Foundation/Foundation.h>
+
+/* -----------------------------------------------------------------------------
+ Generate a preview for file
+
+ This function's job is to create preview for designated file
+ ----------------------------------------------------------------------------- */
+
+OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
+ CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options)
+{
+ if (QLPreviewRequestIsCancelled(preview))
+ return noErr;
+
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
+ [props setObject:@"UTF-8" forKey:(NSString *)kQLPreviewPropertyTextEncodingNameKey];
+ [props setObject:@"text/plain" forKey:(NSString *)kQLPreviewPropertyMIMETypeKey];
+ [props setObject:[NSNumber numberWithInt:700] forKey:(NSString *)kQLPreviewPropertyWidthKey];
+ [props setObject:[NSNumber numberWithInt:500] forKey:(NSString *)kQLPreviewPropertyHeightKey];
+
+ NSString *text = [NSString stringWithContentsOfURL:(NSURL *)url
+ encoding:NSUTF8StringEncoding
+ error:nil];
+
+ QLPreviewRequestSetDataRepresentation(
+ preview,
+ (CFDataRef)[text dataUsingEncoding:NSUTF8StringEncoding],
+ kUTTypeHTML,
+ (CFDictionaryRef)props);
+
+
+ [pool release];
+
+ return noErr;
+}
+
+void CancelPreviewGeneration(void* thisInterface, QLPreviewRequestRef preview)
+{
+ // implement only if supported
+}
@@ -0,0 +1,22 @@
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreServices/CoreServices.h>
+#include <QuickLook/QuickLook.h>
+
+/* -----------------------------------------------------------------------------
+ Generate a thumbnail for file
+
+ This function's job is to create thumbnail for designated file as fast as possible
+ ----------------------------------------------------------------------------- */
+
+OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail,
+ CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize)
+{
+ // not implimented yet
+
+ return noErr;
+}
+
+void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail)
+{
+ // implement only if supported
+}
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>PlainText</string>
+ <key>CFBundleTypeRole</key>
+ <string>QLGenerator</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>LSTypeIsPackage</key>
+ <false/>
+ <key>NSPersistentStoreTypeKey</key>
+ <string>XML</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.whomwah.quicklookstephen</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFPlugInDynamicRegisterFunction</key>
+ <string></string>
+ <key>CFPlugInDynamicRegistration</key>
+ <string>NO</string>
+ <key>CFPlugInFactories</key>
+ <dict>
+ <key>0CCF41BD-5E94-487C-B19D-FAADBD387609</key>
+ <string>QuickLookGeneratorPluginFactory</string>
+ </dict>
+ <key>CFPlugInTypes</key>
+ <dict>
+ <key>5E2D9680-5022-40FA-B806-43349622E5B9</key>
+ <array>
+ <string>0CCF41BD-5E94-487C-B19D-FAADBD387609</string>
+ </array>
+ </dict>
+ <key>CFPlugInUnloadFunction</key>
+ <string></string>
+ <key>QLNeedsToBeRunInMainThread</key>
+ <false/>
+ <key>QLPreviewHeight</key>
+ <real>600</real>
+ <key>QLPreviewWidth</key>
+ <real>800</real>
+ <key>QLSupportsConcurrentRequests</key>
+ <false/>
+ <key>QLThumbnailMinimumSize</key>
+ <real>17</real>
+</dict>
+</plist>
Oops, something went wrong.

0 comments on commit f40dbf6

Please sign in to comment.