157 Commits

Author SHA1 Message Date
Allan Odgaard
09e5d88437 Refactor OakHTMLOutputView 2014-03-09 10:01:51 +07:00
Allan Odgaard
1e11a30a53 Remove redundant storage keywords for @property
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00
Allan Odgaard
57e8e37313 Rename NSReplacePboard → OakReplacePboard
We shouldn’t use Apple’s prefix for our own constants. The actual value of the constant hasn’t been renamed yet as this requires “migration” (renaming the key in user defaults).
2014-02-18 12:41:47 +07:00
Allan Odgaard
8ebbb338c2 Disallow creating OakPasteboardEntry outside OakPasteboard.mm
This is in preparation of adopting CoreData which will require a managed object context to create pasteboard entry objects.
2014-02-18 11:53:41 +07:00
Allan Odgaard
30802bf4c7 Guard against fileSystemRepresentation returning nil 2013-11-04 14:00:55 +01:00
Allan Odgaard
e4a5db0f3b Only first call to window.close() would have an effect
This is a workaround for https://bugs.webkit.org/show_bug.cgi?id=121232
2013-09-12 23:46:04 +02:00
Allan Odgaard
776a8d46d9 Fix window.close() for HTML output embedded in main window 2013-09-12 23:46:04 +02:00
Allan Odgaard
2f72f84ae5 Add leak watcher and some debug output 2013-09-12 23:46:04 +02:00
Allan Odgaard
3f055aa318 Clear all web view delegates during dealloc 2013-09-12 23:46:04 +02:00
Allan Odgaard
1c308c810d Use map::emplace instead of inserting std::pair (C++11) 2013-09-05 20:59:11 +02:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
06f349507a Add a “did wrap” boolean to the OakFindProtocol API
This informs the “server” that searching wrapped around to find the match.
2013-07-23 22:45:52 +02:00
Jacob Bandes-Storch
b533df1a40 Bar button positioning tweaks 2013-07-21 13:42:43 +02:00
Allan Odgaard
3198a8cdb1 Use weak pointer for block-accessed run loop
I am seeing some crashes related to this code. My best guess is that a command execution (with exit handler) is created and then cancelled from JavaScript, which would invoke the cleanup block that uses the (now destroyed, but non-nilled) run loop.
2013-07-02 18:43:46 +02:00
Allan Odgaard
6b64f38053 Update dialog text 2013-06-19 11:55:32 +07:00
Allan Odgaard
1f893b5543 Stopping long lived TextMate.system() executions would crash 2013-06-19 11:55:32 +07:00
Allan Odgaard
4586bc2024 Fix async mode for TextMate.system (JS bridge)
In commit 03aea09148 we switched to properties for the mapped instance variables which meant they all got an underscore prefix and wasn’t seen from JavaScript.
2013-06-15 16:13:22 +07:00
Allan Odgaard
03aea09148 Use io::spawn instead of oak::command_t for TextMate.system
Like with snippets, we no longer support executing a shebang-script given “inline” — though this was never a documented feature and I am not aware of anything having made use of it.
2013-05-16 21:36:49 +07:00
Allan Odgaard
d7e54f88ea Use trackSwipeEventWithOptions:… for swipe gestures 2013-04-26 20:45:52 +07:00
Allan Odgaard
0bf02dbeff Move divider line functions to OakUIConstructionFunctions.h 2013-04-02 04:11:32 +07:00
Allan Odgaard
d72baacff4 Move divider image creation to OakUIConstructionFunctions.h 2013-04-02 04:11:32 +07:00
Jacob Bandes-Storch
98a7cd1e08 Add an etched effect to the status/action bar dividers 2013-03-21 04:59:14 -05:00
Allan Odgaard
2c2ef93521 Don’t keep mutex locked longer than required 2013-03-20 11:30:41 +01:00
Allan Odgaard
d8cf1e3591 Gather UI construction code and harmonize fonts 2013-03-13 12:38:11 +01:00
Allan Odgaard
c3e9fc1b0e Change oak::mutex_t → std::mutex (C++11) 2013-03-13 12:37:21 +01:00
Allan Odgaard
2c6504b82f Use symbolic constants for binding properties 2013-03-03 15:53:05 +01:00
Allan Odgaard
4e3d31e09c Improve heuristic for swipe gestures
We now try to find a scrollable view under the mouse, and if any scrolling was done, we reject the gesture as a “go back/forward” event.

Additionally we reject gestures with a duration of more than 0.2 seconds.

Maybe fixes #854.
2013-03-02 11:26:30 +01:00
Allan Odgaard
2190b14ee2 Disable swipes if not at min/max X 2013-02-21 21:46:58 +01:00
Allan Odgaard
01f39b77a6 HTML view status bar divider now match the others 2013-02-18 15:38:26 +01:00
Allan Odgaard
84b71c7640 Add swiping gesture support for 10.8
I am not sure what Apple’s thinking is here. We have swipeWithEvent: which worked on 10.7 but seems to no longer work, yet there is a global preference for configuring a swipe gesture and Safari supports that config option, but it appears other apps have to role their own implementation.
2013-02-15 15:27:55 +01:00
Allan Odgaard
c456d7e035 Handle linking to directories in HTML output
We now check for an ‘index.html’ when a file:-link points to a directory. If no such file exist then we show the “Not Found” error page.

This is to work with offline docs that doesn’t include the ‘index.html’ in the URL.
2013-02-15 15:27:54 +01:00
Allan Odgaard
e96dc916ef Remove commented code 2013-02-14 11:31:20 +01:00
Allan Odgaard
c46070f9ff Omit background fill if we have a border 2013-02-12 15:49:52 +01:00
Allan Odgaard
83d0df4b2c Don’t set HTML output views as opaque 2013-02-12 15:49:52 +01:00
Michael Sheets
9e56b73797 Restyle html view status bar to match others 2013-02-12 15:49:34 +01:00
Allan Odgaard
32fcb52c68 Workaround for clang linker warning
Using instances with static storage in Objective-C files result in the following warning (starting with clang 425.0.24):

ld: warning: direct access in […] to global weak symbol […] means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
2013-02-02 08:52:12 +01:00
Allan Odgaard
2d9eef5baa Fix variable name in debug output
This was broken during the update to ARC and synthesized properties.
2013-01-29 15:28:22 +01:00
Allan Odgaard
adb2ed7b64 Use sel_getName() instead of typecast 2013-01-29 15:28:22 +01:00
Allan Odgaard
7d02a67870 Remove unused graphics 2013-01-25 11:01:57 +01:00
Allan Odgaard
d178263cca ARC: Update HTMLOutput framework 2013-01-16 04:42:50 +01:00
Allan Odgaard
53bd39b636 Rework HTML output toolbar
The toolbar now uses standard system controls for better accessibility.
2013-01-16 04:41:27 +01:00
Allan Odgaard
538ba8220d Update to auto-generated instance variables 2013-01-14 00:50:12 +01:00
Allan Odgaard
bccaee4be6 Simplify document open API
Removed the ability to specify wether documents should open in current window or a new window — all documents opened via this API will go through the same algorithm to find where the documents should end up (more choice is just adding confusion and complexity).
2013-01-10 06:46:44 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
8e937a7141 Require explicit import of OakFindProtocol.h 2013-01-02 01:46:48 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
ebab500ba3 Use std::map/set instead of C arrays
These types come with a find() method and avoids having to use helper functions to get the begin/end of the array (for linear search).
2012-09-20 12:22:20 +02:00
Allan Odgaard
2b9c27263d Auto-layout: Update file browser and HTML output 2012-09-14 17:14:55 +02:00
Allan Odgaard
4d95db8f66 Auto-layout: Implement intrinsicContentSize 2012-09-14 17:14:55 +02:00