New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define object selection API. #37
Comments
jackjennings
changed the title
Define object selection API.
Define object selection API
Jun 16, 2016
jackjennings
changed the title
Define object selection API
Define object selection API.
Jun 16, 2016
This needs to be decided so that |
Here’s a proposed API. The only thing that would be required for environments to implement is the object specific Any thoughts? cc @benkiel @typemytype # -------------------------------
# Object Selection Flag (boolean)
# -------------------------------
state = foo.selected
foo.selected = True
The `selected` attribute is supported by:
- font
- layer
- glyph
- contour
- segment
- bPoint
- point
- component
- anchor
- image
- guideline
# ----------------------------------
# Sub-Object Selected Objects (list)
# ----------------------------------
bars = foo.selectedBars
foo.selectedBars = bars
# Font
font.selectedLayers # list of layer objects
font.selectedLayerNames # list of strings
font.selectedGlyphs # list of glyph objects
font.selectedGlyphNames # list of strings
font.selectedGuidelines # list of guideline objects
font.selection # alias for font.selectedGlyphNames, deprecated
# Layer
layer.selectedGlyphs # list of glyph objects
layer.selectedGlyphNames # list of strings
# Glyph
glyph.selectedContours # list of contour objects
glyph.selectedComponents # list of component objects
glyph.selectedAnchors # list of anchor objects
glyph.selectedGuidelines # list of guideline objects
# Contour
contour.selectedSegments # list of segment objects
contour.selectedPoints # list of point objects
contour.selectedBPoints # list of bPoint objects
# Segment
segment.selectedPoints # list of point objects
# ---------------------
# Convenience Functions
# ---------------------
CurrentLayers()
CurrentFontGuidelines()
CurrentContours()
CurrentComponents()
CurrentAnchors()
CurrentGlyphGuidelines()
CurrentSegments()
CurrentPoints() |
@typesupply thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to look at how RoboFab handled this and build on that without breaking anything.
The text was updated successfully, but these errors were encountered: