17 Commits

Author SHA1 Message Date
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Allan Odgaard
26d4ebf302 Decompile .scpt files when generating QuickLook preview/thumbnail 2015-10-03 17:33:21 +07:00
Allan Odgaard
5738792b36 Refactor QuickLook generator
Generating a preview and a thumbnail now share the same code for loading the file and creating an attributed string from its content.
2015-10-03 17:33:21 +07:00
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