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

Improve libservo API (WindowMethods and WindowEvent) #15645

Closed
paulrouget opened this issue Feb 19, 2017 · 1 comment
Closed

Improve libservo API (WindowMethods and WindowEvent) #15645

paulrouget opened this issue Feb 19, 2017 · 1 comment

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Feb 19, 2017

This issue is part of an effort to improve Servo's embedding story. See https://github.com/paulrouget/servoshell/projects/2

As of now, the embedder must implement the WindowMethods trait.

I would split these methods in 4 groups:

  • asking the embedder to perform an action
    • prepare_for_composite
    • create_compositor_channel
    • present
  • asking the embedder about the geometry of the viewport
    • scale_factor
    • framebuffer_size
    • size
    • client_window
  • asking the embedder about capabilities
    • supports_clipboard
  • events. Notifying the embedder of a change. Up to the embedder to honour them:
    • set_inner_size
    • set_position
    • set_fullscreen_state
    • set_page_title
    • set_page_url
    • status
    • load_start
    • load_end
    • load_error
    • head_parsed
    • set_cursor
    • set_favicon
    • handle_key

I think we can offer a better API:

  • create_compositor_channel: this could be a clonable object passed to Browser::new()
  • geometry related methods could be removed, and instead, the browser object would have a updateGeometry(AGeometryStruct) method. AGeometryStruct would include the scale factor, the inner size and the window position.
  • capability methods would be regular callbacks
  • present and prepare_for_composite, and all the other events as events. (browser.getEvents()).

As for browser.handle_events, it accepts WindowEvent. Not everything is a window event. We need a better semantic here. Maybe ServoCommand.

@paulrouget paulrouget changed the title Improve libservo API Improve libservo API (WindowMethods) Feb 19, 2017
@paulrouget paulrouget changed the title Improve libservo API (WindowMethods) Improve libservo API (WindowMethods and WindowEvent) Feb 23, 2017
@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Mar 14, 2017

Superseded by #15934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.