Commit Graph

143 Commits

Author SHA1 Message Date
Allan Odgaard
11d67f3a22 Avoid NSString’s deprecated percent encoding methods 2019-06-30 10:32:45 +02:00
Allan Odgaard
1ef78b3af7 Rename symbols to what’s expected by the 10.14 SDK 2019-06-29 20:14:15 +02:00
Allan Odgaard
5aa58e5543 Do not include $APP_NAME in framework’s bundle identifier
Since we have multiple application targets, it doesn’t make sense with a global APP_NAME variable.

Though if building the frameworks as standalone bundles and embedding them in different applications, we may need some sort of unique component in the bundle identifier, but we currently do not do this (they are all statically linked, so the Info.plist is currently unused).
2019-06-26 23:32:54 +02:00
Allan Odgaard
b8017b9f22 Do not set NSBackgroundStyleRaised for controls and text in status bars
It appears to be ignored on 10.14 but earlier versions of macOS rendered the elements with a shadow, which is probably not a good fit for our current design.
2018-12-06 22:00:22 +07:00
Allan Odgaard
9e3b1d6028 Set wantsLayer to YES for all NSVisualEffectView subclasses
This is required when using NSVisualEffectBlendingModeWithinWindow although on macOS 10.13 and later a view is layer backed by default.
2018-12-04 15:43:15 +07:00
Allan Odgaard
930619d6e7 Make NSVisualEffectView the superview of our status bars
The result is the same though with the NSVisualEffectView being a superview, a subview can query the interiorBackgroundStyle to affect rendering.
2018-11-15 12:58:06 +07:00
Allan Odgaard
7f794f618d Remove drawRect: overload as we no longer change contentBorderThickness 2018-11-15 12:58:06 +07:00
Allan Odgaard
4e5f5f71a2 Use beginSheetModalForWindow:completionHandler: over deprecated API 2018-10-31 23:10:31 +07:00
Ronald Wampler
e64b09b688 Introduce overloads for the new divider styles
Also, switch to use the new divider styles in most places. The remaining usage of the old "OakCreateLine" functions are in the OakChooser windows. These will be refactor for better dark mode support next.
2018-10-28 11:07:03 +07:00
Ronald Wampler
9198c496b0 OakBackgroundFillView: Add support of Mojave Dark mode
This introduces the `OakBackgroundFillViewStyle` enum with styles that are dark mode aware and should lead to more consistent use between UI elements in the future. Also, convert OTVStatusBar and OFBHeaderView to use the new style enum.
2018-10-07 11:28:52 +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
40a14995f6 Call fileSystemRepresentation directly on NSURL (10.9) 2018-06-17 17:14:47 +02:00
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
Allan Odgaard
ffd6271a69 Allow disabling TextMate’s JavaScript API for commands with HTML output
This is done by setting the ‘disableJavaScriptAPI’ key to ‘true’ in the tmCommand file.

The rationale behind this is that a command like “HTML → Show Preview” is using the HTML output view with user data which should not have access to the special TextMate JavaScript object, for example a user may have a `<script>` tag that loads JavaScript from a CDN, and such script would effectively have shell access to the user’s machine.
2017-07-12 10:35:31 +02:00
Ronald Wampler
f3cd0b0797 Resolve ambiguous autolayout issues
Most of these layout changes are related to the common pattern we used to set constraints for "dividers", where one of the dividers is specified to be connected to both edges of its superview then setting the other dividers' constraints to have equal widths (e.g., @"H:|[divider(==divider2,==divider3)]"). On 10.12, this now appears to result in ambiguous layout. We can resolve it by connecting at least one of the edges for each divider to its superview.
2017-05-31 21:58:31 +02:00
Ronald Wampler
038acacca9 Avoid use of NSRunAlertPanel (10.9)
Although this is actually deprecated in 10.10, new APIs are available in 10.9 and it will make addressing deprecation warnings when upgrading to 10.10 easier.
2017-05-31 21:58:31 +02:00
Ronald Wampler
903d34338d Remove remaining 10.9 LEGACY markers 2017-05-31 10:03:41 +02:00
Ronald Wampler
42654ff283 Use appropriate enum case for NSSavePanel and NSOpenPanel result (10.9) 2017-05-31 10:03:41 +02:00
Ronald Wampler
33167c8c52 Update to modern sheet API (10.9) 2017-05-31 10:03:41 +02:00
Ronald Wampler
30891b1a62 Remove OakShowAlertForWindow wrapper (10.9) 2017-05-31 10:03:41 +02:00
Ronald Wampler
dfc9db4413 Use our NSAlert category method for creating NSAlert objects 2017-05-31 10:03:41 +02:00
Allan Odgaard
9d980a07df Remove NSPrincipalClass from framework bundles’s Info.plist
This is not something which is used anywhere and a few of the frameworks does not have a principal class.
2016-10-31 17:30:30 +07:00
Allan Odgaard
95b8c58c4e Avoid typecasting our delegate 2016-10-24 02:21:29 +07:00
Allan Odgaard
7bbcc93c34 Update busy property to match (updated) status bar API
This would throw an exception when changing busy status from JavaScript.

This issue was introduced in f0a2a70998.

Closes textmate/latex.tmbundle#155.
2016-10-24 02:21:29 +07:00
Allan Odgaard
6245fa17d5 Introduce ‘reusable’ property to OakHTMLOutputView
This defaults to YES but can be set to NO if an output view should not be re-used (even though no command is currently running).
2016-10-03 22:05:39 +02:00
Allan Odgaard
a83912489c Require the 10.11 SDK to build TextMate 2016-09-30 12:46:59 +02:00
Allan Odgaard
010bb72375 Add ‘visible’ property to OakHTMLOutputView
This can be observed to learn when the view is hidden, either because the window it is in closes or when it is removed from its superview.
2016-09-27 21:51:55 +02:00
Allan Odgaard
406a804a3e Remove redundant intrinsicContentSize overload 2016-09-27 21:49:32 +02:00
Allan Odgaard
f0a2a70998 Change ‘isBusy’ setter to just ‘busy’
The getter is still ‘isBusy’.
2016-09-27 21:49:32 +02:00
Allan Odgaard
3cf916cf49 Rename loadHTMLString: method to setContent:
The previous name was inspired by WebView’s default API but it sounds like it is just the default implementation with a default baseURL: parameter, hence why I prefer to name it something different.
2016-09-27 21:36:26 +02:00
Allan Odgaard
9389fd9fc0 View Source now uses the frame title as document’s display name 2016-09-24 08:33:33 +02:00
Allan Odgaard
30f53b43f9 Let HTML output use OakDocumentController API 2016-09-24 08:33:33 +02:00
Allan Odgaard
51faf0ed3c Remove WebKit workaround that no longer seems necessary
The workaround was introduced in May 2005, so the underlying issue was probably addressed a long time ago :)
2016-09-17 07:22:41 +02:00
Allan Odgaard
553e89ceb6 Update include statements and link declarations 2016-09-11 12:47:39 +02:00
Allan Odgaard
6959ca68f3 Dismiss “Stop Command?” HTML output dialog if command exits by itself 2016-08-28 13:40:56 +02:00
Allan Odgaard
14782c0aea Remove old custom URL protocol 2016-08-28 13:32:49 +02:00
Allan Odgaard
1da89cc5a0 Check for ‘x-txmt’ prefix in URL scheme instead of exact match 2016-08-28 13:32:48 +02:00
Allan Odgaard
974db67258 Read isRunningCommand property instead of looking at URL scheme 2016-08-28 13:32:48 +02:00
Allan Odgaard
fce09a3edf Add mainFrameTitle property to OakHTMLOutputView 2016-08-28 13:32:48 +02:00
Allan Odgaard
b598252c58 Add commandIdentifier property to OakHTMLOutputView 2016-08-28 13:32:48 +02:00
Allan Odgaard
c99e65b17c Let OakHTMLOutputView handle the “Stop Task?” warning sheet
This also allows for the sheet to automatically close, should the command exit before the user selects an action.
2016-08-28 13:32:47 +02:00
Allan Odgaard
2c41cf8fa0 Remove unnecessary code 2016-08-28 13:32:47 +02:00
Allan Odgaard
926786c36c Use NSURLProtocol’s setProperty:forKey:inRequest: for associated data
This simplifies our code though it seems like the lifetime of the data is much longer than the request it is associated with.
2016-08-28 13:32:47 +02:00
Allan Odgaard
0319186e89 Introduce a pipe when writing to the HTML output view
This removes the command::runner_t dependency from our custom URL protocol.
2016-08-28 13:32:47 +02:00
Allan Odgaard
89c19eff61 Change ‘runningCommand’ getter to ‘isRunningCommand’ 2016-08-21 12:23:40 +02:00
Allan Odgaard
8679b5b869 Redirect protocol-relative URLs in HTML output to https
The problem is that HTML output is loaded from the x-txmt-command protocol, possibly with the “base URL” set to file://$TM_FILEPATH, so protocol-relative URLs like //example.org/main.css would be resolved as file://example.org/main.css.

We now try to detect these URLs (heuristically, since we only see the resolved URL) and (by default) redirect to https.

This commit checks for the presence of NSURLComponents which was introduced in Mac OS X 10.9. On 10.8 this commit has no effect.
2016-08-21 12:09:32 +02:00
Allan Odgaard
dbdfa3c6af Add identifying information to perror output 2016-08-21 12:09:30 +02:00
Allan Odgaard
383ac8c29d Remove tmColorWithCGColor: / tmCGColor (10.8) 2016-06-23 08:45:30 +02:00
Allan Odgaard
469fd74a7b Rely on ARC to manage GCD types (10.8) 2016-06-22 20:43:28 +02:00
Allan Odgaard
f5832c975f Add missing include statements 2016-06-22 18:31:49 +02:00