Commit Graph

14 Commits

Author SHA1 Message Date
Allan Odgaard
b20d7610ac Change (CGPoint){0.0, 0.0} → NSZeroPoint 2014-11-05 08:50:05 +01:00
Nyx0uf
8dbeabca23 QuickLook: Abort preview when type can't be determined 2014-07-22 23:07:59 +02:00
Nyx0uf
48ede9952b QuickLook: Check for cancellation
Add a bit of redundant code but it's useless to continue doing stuff if the request is cancelled by the user anyway.
2014-07-22 23:07:59 +02:00
Nyx0uf
3f716c27ad QuickLook: Handle thumbnail generation
Read at most 1 KiB or 50 lines of a file and render the attributed string in a bitmap context.

The theme is set to Mac Classic to ensure a white background for best look when the previews are used as icons in Finder.

The user’s default fixed width font in size 4 is used. With this font size only around 7 lines are shown, so we need to make it smaller, but we probably want to scale down the result to allow fractional line heights.

A lot of code is copy/pasted from the QuickLook preview generator.
2014-07-22 23:07:58 +02:00
Allan Odgaard
e4d92941ee Update QuickLook generator to use the new bundle item index
This should improve startup time significantly, since it would previously have to re-index all the bundle items.
2014-07-11 14:11:03 +02:00
Allan Odgaard
565d0b915e Limit QuickLook preview to the first 20 KiB of the file
This was suggested in pull request #1226. Ideally we would make the limit flexible, e.g. see how much we can generate in 1-2 seconds, but that is a non-trivial change, so the fixed limit will do for now, and while truncated data is suboptimal, it’s better than being killed due to QL manager’s timeout.
2014-07-08 17:49:42 +02:00
Michael Sheets
882597f9ab Remove high-level UTIs from Quick Look generator
This should allow Quick Look generators to function when they target a more specific UTI. Discussed in #1141 and #1168.
2013-10-31 03:48:58 -05:00
Allan Odgaard
9474a35f58 Remove QuickLook support for HTML, iCal, csv, and tsv files
All these types are already handled on a default system.

Related to issue #1141
2013-10-08 21:59:56 +02:00
Allan Odgaard
9db7613794 Use file::reader_t for QuickLook preview
This ensures the file gets transcoded into UTF-8.

Closes #1141
2013-10-08 21:59:56 +02:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Michael Sheets
c1bdbfa975 Use UTIs for both application and Quicklook generator
UTIs are taken from both the Apple supplied list and newly created for those that didn't exist. For those languages where no clear 'owner' existed to provide the reverse-DNS notation we use a com.macromates.* stand-in.
2013-09-03 12:10:18 +02:00
Allan Odgaard
36c5dbba6b Make dictionary map function optional for cache_t::load 2013-08-16 22:40:07 +02:00
Allan Odgaard
7a12fd1c41 Don’t define global macros that are only used in QuickLook target 2013-08-16 22:40:07 +02:00
Jacob Bandes-Storch
17e822896e Add Quick Look generator
Closes #1062
2013-07-30 23:11:49 +02:00