21 Commits

Author SHA1 Message Date
Allan Odgaard
4ec10c0923 Don’t annotate types and classes with PUBLIC
This was required when we linked each framework as its own thing, which we do not do anymore, and if we do go back to this system, we can simply have symbols public by default.
2020-06-05 21:22:50 +07:00
Allan Odgaard
d04c76b15b QuickLook plug-in selects theme the same as TextMate (supporting auto) 2020-05-16 07:12:01 +07:00
Allan Odgaard
f6fa273912 Update coding style for where to place colon after dictionary keys
This follows the Swift style and also makes it possible to align dictionary values using TextMate’s Align Assignments command.
2018-10-07 09:54:45 +02:00
Allan Odgaard
f78a3b2ce4 Use kCFAllocatorDefault instead of NULL 2016-10-22 16:29:19 +07:00
Allan Odgaard
e6ed50c107 Introduce kMacClassicThemeUUID since we reference it in multiple places 2016-09-26 11:09:32 +02:00
Allan Odgaard
c488d25555 Add support for rendering strikethrough text 2016-08-24 21:22:26 +02:00
Allan Odgaard
793a23cda7 QuickLook generator would fail for users with no font configured
We now fallback to the system’s fixed width font.
2016-08-04 18:13:18 +02:00
Allan Odgaard
383ac8c29d Remove tmColorWithCGColor: / tmCGColor (10.8) 2016-06-23 08:45:30 +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
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
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