Start adding marker methods to DisplayBuffer

Whereas marker methods on buffer take for granted that everything is
in buffer coordinates, methods on the DisplayBuffer offer both
screen and buffer coordinate versions of the marker API.
This commit is contained in:
Nathan Sobo
2013-01-30 22:46:52 -07:00
parent 1d1c613f5b
commit 074c1815d0
2 changed files with 69 additions and 7 deletions

View File

@@ -296,12 +296,51 @@ class DisplayBuffer
markBufferRange: (bufferRange) ->
@buffer.markRange(bufferRange)
markScreenPosition: (screenPosition) ->
@markBufferPosition(@bufferPositionForScreenPosition(screenPosition))
markBufferPosition: (bufferPosition) ->
@buffer.markPosition(bufferPosition)
getMarkerScreenRange: (id) ->
@screenRangeForBufferRange(@getMarkerBufferRange(id))
getMarkerBufferRange: (id) ->
@buffer.getMarkerRange(id)
getMarkerScreenPosition: (id) ->
@getMarkerHeadScreenPosition(id)
getMarkerBufferPosition: (id) ->
@getMarkerHeadBufferPosition(id)
getMarkerHeadScreenPosition: (id) ->
@screenPositionForBufferPosition(@getMarkerHeadBufferPosition(id))
setMarkerHeadScreenPosition: (id, screenPosition, options) ->
@setMarkerHeadBufferPosition(id, @bufferPositionForScreenPosition(screenPosition, options))
getMarkerHeadBufferPosition: (id) ->
@buffer.getMarkerHeadPosition(id)
setMarkerHeadBufferPosition: (id, bufferPosition) ->
@buffer.setMarkerHeadPosition(id, bufferPosition)
getMarkerTailScreenPosition: (id) ->
@screenPositionForBufferPosition(@getMarkerTailBufferPosition(id))
setMarkerTailScreenPosition: (id, screenPosition, options) ->
@setMarkerTailBufferPosition(id, @bufferPositionForScreenPosition(screenPosition, options))
getMarkerTailBufferPosition: (id) ->
@buffer.getMarkerTailPosition(id)
setMarkerTailBufferPosition: (id, bufferPosition) ->
@buffer.setMarkerTailPosition(id, bufferPosition)
isMarkerReversed: (id) ->
@buffer.isMarkerReversed(id)
destroy: ->
@tokenizedBuffer.destroy()