Browser-event translation and the CSS-pixel ↔ root-coordinate mapping used by the Emscripten BrowserWindowHost (core/view/platform/web/).
More...
|
| Point | pulp::view::web::css_to_root (const ViewportMapping &mapping, Point css) |
| | CSS-pixel point → root-view point. Identity without a design viewport.
|
| Point | pulp::view::web::root_to_css (const ViewportMapping &mapping, Point root) |
| | Root-view point → CSS-pixel point. The exact inverse of css_to_root().
|
| BackingStore | pulp::view::web::compute_backing_store (float css_width, float css_height, float device_pixel_ratio) |
| | The one place the HiDPI factor is applied.
|
| uint16_t | pulp::view::web::translate_modifiers (const BrowserModifiers &mods) |
| | metaKey is Command on a Mac browser and the Super/Windows key elsewhere, so it sets both kModMeta and kModCmd.
|
| MouseButton | pulp::view::web::translate_button (int w3c_button) |
| PointerType | pulp::view::web::translate_pointer_type (BrowserPointerType type) |
| MouseEvent | pulp::view::web::translate_pointer (const BrowserPointerEvent &event, const ViewportMapping &mapping) |
| | Browser pointer event → Pulp MouseEvent in ROOT coordinates.
|
| MouseEvent | pulp::view::web::translate_wheel (const BrowserWheelEvent &event, const ViewportMapping &mapping) |
| | Browser wheel event → Pulp wheel MouseEvent in ROOT coordinates.
|
| KeyCode | pulp::view::web::translate_key_code (const std::string &key) |
| | KeyboardEvent.key → KeyCode.
|
| KeyEvent | pulp::view::web::translate_key (const BrowserKeyEvent &event) |
| std::string | pulp::view::web::text_for_key (const BrowserKeyEvent &event) |
| | The text a key-down should also deliver as a TextInputEvent, or "" when the key produces no character.
|
| void | pulp::view::web::install_browser_window_host (std::string canvas_selector="#canvas") |
| | Register the Emscripten BrowserWindowHost factory so WindowHost::create() returns a canvas-backed host.
|
| void | pulp::view::web::install_web_input_listeners (const std::string &canvas_selector, WebInputRouter &router) |
| | Attach/detach the DOM listeners (pointer, wheel, key, resize) that feed router.
|
| void | pulp::view::web::remove_web_input_listeners (const std::string &canvas_selector) |
| void | pulp::view::web::notify_browser_host_resized (float css_width, float css_height) |
| | The canvas element's CSS size changed.
|
| bool | pulp::view::web::browser_host_gpu_available () |
| | Is the live browser host's GPU surface renderable RIGHT NOW?
|
| float | pulp::view::web::device_pixel_ratio () |
| | Current devicePixelRatio, and the canvas element's CSS size. Emscripten only.
|
| bool | pulp::view::web::canvas_css_size (const std::string &canvas_selector, float &css_width, float &css_height) |
| void | pulp::view::web::set_canvas_size (const std::string &canvas_selector, const BackingStore &backing, float css_width, float css_height) |
| | Size the canvas element: backing store in device pixels, CSS box in CSS pixels.
|
| void | pulp::view::web::set_canvas_visible (const std::string &canvas_selector, bool visible) |
| | Show/hide the canvas element (style.display). Emscripten only.
|
Browser-event translation and the CSS-pixel ↔ root-coordinate mapping used by the Emscripten BrowserWindowHost (core/view/platform/web/).
Nothing here depends on Emscripten. The coordinate math, the event-shape mapping, and the View-tree routing are plain C++ so they compile and are unit-testable on a native host (test/test_window_host_web.cpp); web_input.cpp only owns the DOM listener plumbing that feeds them.