Skip to content
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

Add images, use unicode, rework paragraphs and runs #32

Merged
merged 29 commits into from
Sep 10, 2022
Merged

Conversation

mjakeman
Copy link
Owner

@mjakeman mjakeman commented Sep 5, 2022

Massive refactoring to allow us to support images. This touches just about every part of the engine, from implementing Unicode string handling to reworking how we treat paragraphs and their children.

  • Rework paragraphs to contain 'inline' elements
  • Rework editor to deal with inlines instead of runs
  • Add scrolling to inspector
  • Add refresh to inspector
  • Add styling information to inspector
  • Add tags for different content types to inspector
  • Add image element with src property
  • Render placeholder in layout
  • Fix selections to work with non-run items
  • Fix picking to work with non-run items
  • Remove existing run requirement (i.e. editor will insert a run on-demand)
  • Add command to insert an image
  • Handle sizing Postpone actual bitmap rendering to future PR
  • Proper inline layout of images (text will break for the image)
    • Make index respect unicode
    • Represent opaque elements with a replacement character in the paragraph, then use PangoAttrShape to leave a space in the text layout. The size of the space will be determined by InlineLayout.
    • Add BoxLayout for boxes, which also account for text content
    • Generic InlineLayout for inline elements
    • Layout should be completely abstract and model-independent
      • Factory for creating layout items (webkit "renderers") for a given model
  • Render selection for images
  • Rename inline to fragment
  • Fix tests
  • Fix multi-paragraph operations

Part of #30

In subsequent PRs:

  • Implement widgets (i.e. resize handles for images)
  • Allow interacting with widgets via the keyboard (through selections? or callbacks)
  • Cleanup editor to deal with non-text objects generally
  • Stop using LayoutBox for things which are neither layout related nor boxes
  • Create a LayoutImage renderer (and preferably drop the 'layout' prefix from renderers)
  • Move any special casing of images into the image class and associated renderer
  • Fix the importer so it doesn't spew new lines everywhere

@mjakeman mjakeman changed the title Add images, rework paragraphs and runs Add images, use unicode, rework paragraphs and runs Sep 6, 2022
@mjakeman mjakeman marked this pull request as ready for review September 10, 2022 19:22
@mjakeman mjakeman enabled auto-merge September 10, 2022 19:22
@mjakeman mjakeman merged commit 7c448f0 into master Sep 10, 2022
@mjakeman mjakeman deleted the inline-rework branch September 10, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant