33 Commits

Author SHA1 Message Date
Allan Odgaard
fa2077b3c8 Remove non-matching tests/resources definitions from build files
The resources directory was removed when we introduced CP_InfoPlist. The tests were removed in fcee7b38ab.
2021-02-04 09:35:27 +01:00
Allan Odgaard
ba1c99f7bc build: Introduce CP_InfoPlist and move Info.plist files out of resources
Previously we would automatically pick up an Info.plist file copied using any of the CP_* keys, and both move it to the correct location (when belonging to target built) or ignore it, if we were copying it from an imported target.

To simplify the logic in the build system, it is however better to be explicit about this, also because we could actually want an Info.plist file among our copied files.
2021-01-24 10:38:54 +01:00
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
1c5fc62f86 Do not include $APP_NAME in QuickLook generator’s bundle identifier
This was redundant as the final component is TextMateQL ($TARGET_NAME).
2019-06-26 23:32:54 +02: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
c1bb559a38 Revert "Add ‘public.data’ to list of supported file types for QuickLook plug-in"
This causes TextMate’s QL generator to take over thumbnail generation of all binary files (without a dedicated QuickLook plug-in), for example disk image files.

There does not seem to be any way to dynamically opt out of thumbnail generation, it’s all or nothing, therefor we would either need to completely remove support for thumbnail generation or not support QuickLook previews for files without extension.

For now it’s the latter.

This reverts commit fd827fb817.
2018-04-25 21:43:51 +07:00
Pravdomil
fd827fb817 Add ‘public.data’ to list of supported file types for QuickLook plug-in
This enables QuickLook preview for text files without extension such as README, LICENSE, etc.
2018-02-06 22:59:27 +07:00
Allan Odgaard
f47f8341fa Keep -dead_strip_dylibs linker setting for the QuickLook target 2016-11-06 16:49:47 +07:00
Allan Odgaard
2f7d55dfb8 Remove use of -rpath build setting
We no longer dynamically load any (custom) libraries or frameworks, so this setting is no longer needed.
2016-11-06 16:49:47 +07: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
78b528f299 Update LINK dependencies in target files 2016-06-29 11:37:27 +02:00
Allan Odgaard
383ac8c29d Remove tmColorWithCGColor: / tmCGColor (10.8) 2016-06-23 08:45:30 +02:00
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