Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Update the decoration API - #2819

Merged
benogle merged 6 commits into
masterfrom
bo-decoration-api
Jul 8, 2014
Merged

benogle merged 6 commits into
masterfrom
bo-decoration-api

Conversation

@benogle

@benogle benogle commented Jul 4, 2014

Copy link
Copy Markdown
Contributor

Starting this PR super early. I want to layout what I am thinking before getting into it.

Editor / DisplayBuffer

The API is designed to be consistent with the marker API. The marker API has a markBufferRange function that returns a Marker object. Removal of the marker is done through a destroy method. The Decorations API takes on the same form:

  • (Decoration) decorateMarker(marker, decorationParams)

These remain unchanged:

  • (Decoration) decorationForId(decorationId)
  • (Object) decorationsForScreenRowRange(startScreenRow, endScreenRow)

Decoration

New:

  • (void) destroy() - this just calls displayBuffer::removeDecoration(this)
  • (void) update(newParams) - update the params with newParams. Lets the displayBuffer know there was an update, which will notify the EditorComponent.

Unchanged:

  • flash

TODO

  • Decoration::destroy()
  • Decoration::update()
  • DisplayBuffer / Editor::decorateMarker()
  • Update packages using decorations

@probablycorey

Copy link
Copy Markdown

I like it!

One inconsistency, that might not matter, is addDecoration takes a marker but removeDecoration doesn't take a marker. So using addDecorationToMarker instead of addDecoration be more intuitive.

@probablycorey probablycorey mentioned this pull request Jul 7, 2014
34 of 35 tasks
@benogle benogle changed the title WIP: Update the decoration API Update the decoration API Jul 7, 2014
benogle added a commit that referenced this pull request Jul 8, 2014
@benogle
benogle merged commit eda5515 into master Jul 8, 2014
@benogle
benogle deleted the bo-decoration-api branch July 9, 2014 21:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants