Skip to main content

Display

Trait Display 

Source
pub trait Display: Send {
Show 34 methods // Required methods fn win_create( &mut self, title: &str, w_dip: i32, h_dip: i32, flags: u32, owner: i32, x: i32, y: i32, ) -> i32; fn win_destroy(&mut self, w: i32); fn win_show(&mut self, w: i32, mode: u32); fn win_activate(&mut self, w: i32); fn win_enable(&mut self, w: i32, on: bool); fn win_set_rect(&mut self, w: i32, x: i32, y: i32, cw: i32, ch: i32); fn win_get_rect(&mut self, w: i32) -> Option<[i32; 4]>; fn win_work_area(&mut self, w: i32) -> Option<[i32; 4]>; fn win_set_title(&mut self, w: i32, title: &str); fn win_state(&mut self, w: i32) -> u32; fn win_cmd(&mut self, w: i32, cmd: u32); fn win_begin_move(&mut self, w: i32); fn win_begin_resize(&mut self, w: i32, edges: u32); fn win_size(&mut self, w: i32) -> (i32, i32); fn win_dpi(&mut self, w: i32) -> i32; fn win_set_min_size(&mut self, w: i32, w_dip: i32, h_dip: i32); fn win_present(&mut self, w: i32, f: &Frame<'_>, rects: Option<&[[i32; 4]]>); fn win_set_cursor(&mut self, w: i32, shape: u32); fn set_refresh(&mut self, f: Option<fn()>); fn wait(&mut self, deadline_us: u64) -> u32; fn popup( &mut self, slot: u32, owner: i32, rect: Option<[i32; 4]>, f: Option<&Frame<'_>>, ); fn cursor_create( &mut self, px: &[u8], w: i32, h: i32, hot_x: i32, hot_y: i32, dpi: i32, ) -> i32; fn cursor_destroy(&mut self, id: i32); fn cursor_dpi(&mut self, dpi: i32) -> i32; fn clip_set(&mut self, fmt: u32, data: &[u8]) -> bool; fn clip_set_many(&mut self, entries: &[(u32, &[u8])]) -> bool; fn clip_get(&mut self, fmt: u32) -> Option<Vec<u8>>; fn clip_has(&mut self, fmt: u32) -> bool; // Provided methods fn ime_pos(&mut self, _x: i32, _y: i32, _h: i32) { ... } fn win_show_menu(&mut self, _w: i32, _x: i32, _y: i32) { ... } fn popup_anchor( &mut self, _slot: u32, _anchor: [i32; 4], _kind: u32, _nat: [i32; 2], ) { ... } fn popup_placed(&mut self, _slot: u32) -> Option<[i32; 2]> { ... } fn pen_devices(&mut self) -> i32 { ... } fn drag_start(&mut self, _data: DragData) -> bool { ... }
}
Expand description

a display backend (window-indexed; see the free functions below for the semantics)

Required Methods§

Source

fn win_create( &mut self, title: &str, w_dip: i32, h_dip: i32, flags: u32, owner: i32, x: i32, y: i32, ) -> i32

Source

fn win_destroy(&mut self, w: i32)

Source

fn win_show(&mut self, w: i32, mode: u32)

Source

fn win_activate(&mut self, w: i32)

Source

fn win_enable(&mut self, w: i32, on: bool)

Source

fn win_set_rect(&mut self, w: i32, x: i32, y: i32, cw: i32, ch: i32)

Source

fn win_get_rect(&mut self, w: i32) -> Option<[i32; 4]>

Source

fn win_work_area(&mut self, w: i32) -> Option<[i32; 4]>

Source

fn win_set_title(&mut self, w: i32, title: &str)

Source

fn win_state(&mut self, w: i32) -> u32

Source

fn win_cmd(&mut self, w: i32, cmd: u32)

Source

fn win_begin_move(&mut self, w: i32)

Source

fn win_begin_resize(&mut self, w: i32, edges: u32)

Source

fn win_size(&mut self, w: i32) -> (i32, i32)

Source

fn win_dpi(&mut self, w: i32) -> i32

Source

fn win_set_min_size(&mut self, w: i32, w_dip: i32, h_dip: i32)

Source

fn win_present(&mut self, w: i32, f: &Frame<'_>, rects: Option<&[[i32; 4]]>)

Source

fn win_set_cursor(&mut self, w: i32, shape: u32)

Source

fn set_refresh(&mut self, f: Option<fn()>)

Source

fn wait(&mut self, deadline_us: u64) -> u32

Source

fn popup( &mut self, slot: u32, owner: i32, rect: Option<[i32; 4]>, f: Option<&Frame<'_>>, )

Source

fn cursor_create( &mut self, px: &[u8], w: i32, h: i32, hot_x: i32, hot_y: i32, dpi: i32, ) -> i32

Source

fn cursor_destroy(&mut self, id: i32)

Source

fn cursor_dpi(&mut self, dpi: i32) -> i32

Source

fn clip_set(&mut self, fmt: u32, data: &[u8]) -> bool

Source

fn clip_set_many(&mut self, entries: &[(u32, &[u8])]) -> bool

Source

fn clip_get(&mut self, fmt: u32) -> Option<Vec<u8>>

Source

fn clip_has(&mut self, fmt: u32) -> bool

Provided Methods§

Source

fn ime_pos(&mut self, _x: i32, _y: i32, _h: i32)

Source

fn win_show_menu(&mut self, _w: i32, _x: i32, _y: i32)

the window manager’s window menu at x, y (px of the window) on a button press; default none (X11)

Source

fn popup_anchor( &mut self, _slot: u32, _anchor: [i32; 4], _kind: u32, _nat: [i32; 2], )

(§6) how the next popup() of the slot hangs at its anchor – a backend that places popups itself (Wayland) builds its positioner from it; the others show them where popup() says

Source

fn popup_placed(&mut self, _slot: u32) -> Option<[i32; 2]>

where the backend put the slot’s popup when it is not where the UI asked (Wayland)

Source

fn pen_devices(&mut self) -> i32

pens / pen tablets the backend sees, -1 = unknown (plat_pen_devices: wl_pen_devices / x11_pen_devices) – plat-x11: added with a default, the Wayland backend overrides it

Source

fn drag_start(&mut self, _data: DragData) -> bool

drag data out of the app (dnd.rs drag_start; the left button is held) -> started; E_DRAG_END follows – added with a default for the drag and drop work (X11, Wayland)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§