JFLib

plat/web_screen.rs#

Source: lib/plat/web_screen.rs

web_screen -- (screen.rs) the monitors the browser / Android host reports, the browser's
EyeDropper

  jfgui_screens(len) -> count      the host's monitors from the inbox: one line per monitor,
                                   "x y w h wx wy ww wh dpi refresh_mhz primary name" (name:
                                   the rest of the line, may be empty); sent at start and on
                                   every change (then E_SETTINGS with SET_MONITORS).  Browser
                                   (web/loader.js): window.screen (CSS pixels, availLeft /
                                   availTop / availWidth / availHeight, devicePixelRatio) or,
                                   where the page may already (permission "window-management"
                                   granted), getScreenDetails() with every screen; Android
                                   (android/GalleryActivity.java): DisplayManager.getDisplays()
                                   with their bounds, density and refresh rate
  monitors()                       that list; before it arrives one monitor of the viewport
  pick_start()                     REQUEST_PICK_COLOR: the browser's EyeDropper (Chromium,
                                   from the user's gesture), answered by jfgui_color(id, status,
                                   rgb); without EyeDropper (the host's capability bit
                                   HOST_EYEDROPPER) and on Android Unavailable
  capture_*                        Unavailable (no picture of the screen here)
/// (browser) open the EyeDropper; no payload; answered by jfgui_color
REQUEST_PICK_COLOR: u32 = 21
  • extern "C" fn jfgui_screens(len: u32) -> u32 The host's monitors (inbox: one line per monitor, see the module header) -> how many were taken; a different list once the app runs is a change (E_SETTINGS with SET_MONITORS; the first one after the start too: the app saw the viewport until then).

  • extern "C" fn jfgui_color(id: u32, status: i32, rgb: u32) -> u32 The EyeDropper's answer to the pick request id: status 2 = picked (rgb 0xRRGGBB), -4 cancelled, -1 refused, -3 not supported, else failed. 1 = taken.

Source: docs/API.md in the JFLib repository.