pub struct TestingWindow {
pub ime_requests: RefCell<Vec<InputMethodRequest>>,
pub open_url: Rc<RefCell<Option<SharedString>>>,
pub debug_logs: Rc<RefCell<Vec<String>>>,
/* private fields */
}Fields§
§ime_requests: RefCell<Vec<InputMethodRequest>>§open_url: Rc<RefCell<Option<SharedString>>>§debug_logs: Rc<RefCell<Vec<String>>>Implementations§
Source§impl TestingWindow
impl TestingWindow
pub fn use_native_popup(&self, native: bool)
pub fn mouse_cursor(&self) -> MouseCursorInner
Sourcepub fn window_move_request_count(&self) -> usize
pub fn window_move_request_count(&self) -> usize
Number of interactive window moves requested via WindowMoveArea.
pub fn open_url(&self) -> Option<SharedString>
Sourcepub fn take_debug_log(&self) -> Vec<String>
pub fn take_debug_log(&self) -> Vec<String>
Drain and return all debug_log messages captured since the last call.
Sourcepub fn set_simulate_native_drag(&self, enabled: bool)
pub fn set_simulate_native_drag(&self, enabled: bool)
Enable simulating native (OS-level) drag-and-drop. Once enabled, start_drag takes the
drag over as a real backend does (instead of declining it and using the in-window
fallback), recording the payload so Self::simulate_native_drag_move and
Self::simulate_native_drop can drive the receive side.
Sourcepub fn simulate_native_drag_move(
&self,
target: &Window,
position: LogicalPosition,
) -> DragAction
pub fn simulate_native_drag_move( &self, target: &Window, position: LogicalPosition, ) -> DragAction
Move the in-flight simulated native drag over target at position, as a backend does
when the OS drags across a window. Returns the action the target’s DropArea proposes.
Sourcepub fn simulate_native_drop(
&self,
target: &Window,
position: LogicalPosition,
) -> DragAction
pub fn simulate_native_drop( &self, target: &Window, position: LogicalPosition, ) -> DragAction
Drop the in-flight simulated native drag onto target at position, then report
completion back to this source window, as a backend does when the OS drag ends. Returns
the final negotiated action.
Trait Implementations§
Source§impl RendererSealed for TestingWindow
impl RendererSealed for TestingWindow
Source§fn text_size(
&self,
text_item: Pin<&dyn RenderString>,
item_rc: &ItemRc,
max_width: Option<LogicalLength>,
text_wrap: TextWrap,
) -> LogicalSize
fn text_size( &self, text_item: Pin<&dyn RenderString>, item_rc: &ItemRc, max_width: Option<LogicalLength>, text_wrap: TextWrap, ) -> LogicalSize
max_width means that one need to wrap the text, so it does not go further than that,
using the wrapping type passed by text_wrap. Read moreSource§fn text_content_widths(
&self,
text_item: Pin<&dyn RenderString>,
item_rc: &ItemRc,
) -> Option<ContentWidths>
fn text_content_widths( &self, text_item: Pin<&dyn RenderString>, item_rc: &ItemRc, ) -> Option<ContentWidths>
text_size without a lower bound. Read moreSource§fn char_size(
&self,
text_item: Pin<&dyn HasFont>,
item_rc: &ItemRc,
ch: char,
) -> LogicalSize
fn char_size( &self, text_item: Pin<&dyn HasFont>, item_rc: &ItemRc, ch: char, ) -> LogicalSize
Source§fn font_metrics(&self, font_request: FontRequest) -> FontMetrics
fn font_metrics(&self, font_request: FontRequest) -> FontMetrics
Source§fn text_input_byte_offset_for_position(
&self,
text_input: Pin<&TextInput>,
item_rc: &ItemRc,
pos: LogicalPoint,
) -> usize
fn text_input_byte_offset_for_position( &self, text_input: Pin<&TextInput>, item_rc: &ItemRc, pos: LogicalPoint, ) -> usize
Source§fn text_input_cursor_rect_for_byte_offset(
&self,
text_input: Pin<&TextInput>,
item_rc: &ItemRc,
byte_offset: usize,
) -> LogicalRect
fn text_input_cursor_rect_for_byte_offset( &self, text_input: Pin<&TextInput>, item_rc: &ItemRc, byte_offset: usize, ) -> LogicalRect
Self::text_input_byte_offset_for_position]
It takes a (UTF-8) byte offset in the text property, and returns a Rectangle
left to the char. It is one logical pixel wide and ends at the baseline. Read morefn set_window_adapter(&self, _window_adapter: &Rc<dyn WindowAdapter>)
fn window_adapter(&self) -> Option<Rc<dyn WindowAdapter>>
Source§fn supports_transformations(&self) -> bool
fn supports_transformations(&self) -> bool
§fn text_layout_cache(&self) -> Option<&TextLayoutCache>
fn text_layout_cache(&self) -> Option<&TextLayoutCache>
crate::textlayout::sharedparley]. Renderers using
those default implementations return their cache here; with the default None,
text layouts are computed without caching.§fn free_graphics_resources(
&self,
_component: VRef<'_, ItemTreeVTable>,
_items: &mut dyn Iterator<Item = Pin<VRef<'_, ItemVTable>>>,
) -> Result<(), PlatformError>
fn free_graphics_resources( &self, _component: VRef<'_, ItemTreeVTable>, _items: &mut dyn Iterator<Item = Pin<VRef<'_, ItemVTable>>>, ) -> Result<(), PlatformError>
§fn mark_dirty_region(&self, _region: DirtyRegion)
fn mark_dirty_region(&self, _region: DirtyRegion)
§fn register_font_from_memory(
&self,
data: &'static [u8],
) -> Result<(), Box<dyn Error>>
fn register_font_from_memory( &self, data: &'static [u8], ) -> Result<(), Box<dyn Error>>
font-family property. The provided slice must be a valid TrueType
font. Read more§fn register_font_from_path(&self, path: &Path) -> Result<(), Box<dyn Error>>
fn register_font_from_path(&self, path: &Path) -> Result<(), Box<dyn Error>>
font-family property. The provided path must refer to a valid TrueType
font. Read more