pub struct Cx2d<'a, 'b> {
pub cx: &'b mut CxDraw<'a>,
/* private fields */
}Fields§
§cx: &'b mut CxDraw<'a>Implementations§
Source§impl<'a, 'b> Cx2d<'a, 'b>
impl<'a, 'b> Cx2d<'a, 'b>
pub fn new(cx: &'b mut CxDraw<'a>) -> Cx2d<'a, 'b>
pub fn will_redraw(&self, draw_list_2d: &mut DrawList2d, walk: Walk) -> bool
pub fn will_redraw_check_axis( &self, draw_list_2d: &mut DrawList2d, size: f64, axis: Vec2Index, ) -> bool
Source§impl<'a, 'b> Cx2d<'a, 'b>
impl<'a, 'b> Cx2d<'a, 'b>
pub fn begin_many_aligned_instances( &mut self, draw_vars: &DrawVars, ) -> Option<ManyInstances>
pub fn end_many_instances(&mut self, many_instances: ManyInstances) -> Area
pub fn add_aligned_instance(&mut self, draw_vars: &DrawVars) -> Area
pub fn add_aligned_rect_area(&mut self, area: &mut Area, rect: Rect)
Source§impl<'a, 'b> Cx2d<'a, 'b>
impl<'a, 'b> Cx2d<'a, 'b>
pub fn turtle(&self) -> &Turtle
pub fn turtle_mut(&mut self) -> &mut Turtle
pub fn begin_turtle(&mut self, walk: Walk, layout: Layout)
pub fn defer_walk(&mut self, walk: Walk) -> Option<DeferWalk>
pub fn begin_pass_sized_turtle_no_clip(&mut self, layout: Layout)
pub fn begin_pass_sized_turtle(&mut self, layout: Layout)
pub fn begin_sized_turtle_no_clip(&mut self, size: DVec2, layout: Layout)
pub fn begin_sized_turtle(&mut self, size: DVec2, layout: Layout)
pub fn end_pass_sized_turtle_no_clip(&mut self)
pub fn end_pass_sized_turtle(&mut self)
pub fn end_pass_sized_turtle_with_shift(&mut self, area: Area, shift: DVec2)
pub fn begin_turtle_with_guard( &mut self, walk: Walk, layout: Layout, guard_area: Area, )
pub fn turtle_has_align_items(&mut self) -> bool
pub fn end_turtle(&mut self) -> Rect
pub fn end_turtle_with_area(&mut self, area: &mut Area) -> Rect
pub fn end_turtle_with_guard(&mut self, guard_area: Area) -> Rect
pub fn walk_turtle(&mut self, walk: Walk) -> Rect
pub fn set_turtle_wrap_spacing(&mut self, spacing: f64)
pub fn walk_turtle_with_area(&mut self, area: &mut Area, walk: Walk) -> Rect
pub fn walk_turtle_with_align(&mut self, walk: Walk, align_start: usize) -> Rect
pub fn peek_walk_turtle(&self, walk: Walk) -> Rect
pub fn walk_turtle_would_be_visible(&mut self, walk: Walk) -> bool
pub fn peek_walk_pos(&self, walk: Walk) -> DVec2
pub fn emit_turtle_walk(&mut self, rect: Rect)
pub fn turtle_new_line(&mut self)
pub fn turtle_new_line_with_spacing(&mut self, spacing: f64)
pub fn get_turtle_align_range(&self) -> TurtleAlignRange
pub fn shift_align_range(&mut self, range: &TurtleAlignRange, shift: DVec2)
pub fn add_rect_area(&mut self, area: &mut Area, rect: Rect)
Methods from Deref<Target = CxDraw<'a>>§
pub fn new_draw_call(&mut self, draw_vars: &DrawVars) -> Option<&mut CxDrawItem>
pub fn append_to_draw_call( &mut self, draw_vars: &DrawVars, ) -> Option<&mut CxDrawItem>
pub fn get_current_draw_list_id(&self) -> Option<DrawListId>
pub fn get_draw_call( &mut self, append: bool, draw_vars: &DrawVars, ) -> Option<&mut CxDrawItem>
pub fn begin_many_instances( &mut self, draw_vars: &DrawVars, ) -> Option<ManyInstances>
pub fn end_many_instances(&mut self, many_instances: ManyInstances) -> Area
pub fn add_instance(&mut self, draw_vars: &DrawVars) -> Area
pub fn get_current_window_id(&self) -> Option<WindowId>
pub fn current_dpi_factor(&self) -> f64
pub fn inside_pass(&self) -> bool
pub fn make_child_pass(&mut self, pass: &Pass)
pub fn begin_pass(&mut self, pass: &Pass, dpi_override: Option<f64>)
pub fn end_pass(&mut self, pass: &Pass)
pub fn set_pass_area(&mut self, pass: &Pass, area: Area)
pub fn set_pass_area_with_origin( &mut self, pass: &Pass, area: Area, origin: DVec2, )
pub fn set_pass_shift_scale(&mut self, pass: &Pass, shift: DVec2, scale: DVec2)
pub fn current_pass_size(&self) -> DVec2
pub fn append_sub_draw_list(&mut self, draw_list_2d: &DrawList2d)
pub fn add_begin_scroll(&mut self) -> NavScrollIndex
pub fn add_end_scroll(&mut self, index: NavScrollIndex, area: Area)
pub fn draw_icon_atlas(&mut self)
Methods from Deref<Target = Cx>§
pub fn native_load_dependencies(&mut self)
pub fn handle_triggers(&mut self)
pub fn handle_actions(&mut self)
pub fn draw_pass_to_window( &mut self, pass_id: PassId, opengl_window: &mut OpenglWindow, )
pub fn stdin_event_loop(&mut self)
pub fn setup_render_pass(&mut self, pass_id: PassId) -> Option<(DVec2, f64)>
pub fn draw_pass_to_texture( &mut self, pass_id: PassId, override_pass_texture: Option<&Texture>, )
pub fn opengl_compile_shaders(&mut self)
pub fn in_draw_event(&self) -> bool
pub fn xr_capabilities(&self) -> &XrCapabilities
pub fn get_ref(&self) -> CxRef
pub fn take_dependency(&mut self, path: &str) -> Result<Rc<Vec<u8>>, String>
pub fn get_dependency(&self, path: &str) -> Result<Rc<Vec<u8>>, String>
pub fn null_texture(&self) -> Texture
pub fn redraw_id(&self) -> u64
pub fn os_type(&self) -> &OsType
pub fn in_makepad_studio(&self) -> bool
pub fn cpu_cores(&self) -> usize
pub fn gpu_info(&self) -> &GpuInfo
pub fn xr_start_presenting(&mut self)
pub fn xr_advertise_anchor(&mut self, anchor: XrAnchor)
pub fn xr_set_local_anchor(&mut self, anchor: XrAnchor)
pub fn xr_discover_anchor(&mut self, id: u8)
pub fn quit(&mut self)
pub fn show_in_dock(&mut self, show: bool)
pub fn push_unique_platform_op(&mut self, op: CxOsOp)
pub fn show_text_ime(&mut self, area: Area, pos: DVec2)
pub fn hide_text_ime(&mut self)
pub fn text_ime_was_dismissed(&mut self)
pub fn show_clipboard_actions(&mut self, selected: String)
Sourcepub fn copy_to_clipboard(&mut self, content: &str)
pub fn copy_to_clipboard(&mut self, content: &str)
Copies the given string to the clipboard.
Due to lack of platform clipboard support, it does not work on Web or tvOS.
pub fn start_dragging(&mut self, items: Vec<DragItem>)
pub fn set_cursor(&mut self, cursor: MouseCursor)
pub fn sweep_lock(&mut self, value: Area)
pub fn sweep_unlock(&mut self, value: Area)
pub fn start_timeout(&mut self, interval: f64) -> Timer
pub fn start_interval(&mut self, interval: f64) -> Timer
pub fn stop_timer(&mut self, timer: Timer)
pub fn get_dpi_factor_of(&mut self, area: &Area) -> f64
pub fn get_pass_window_id(&self, pass_id: PassId) -> Option<WindowId>
pub fn get_delegated_dpi_factor(&mut self, pass_id: PassId) -> f64
pub fn redraw_pass_and_parent_passes(&mut self, pass_id: PassId)
pub fn get_pass_rect(&self, pass_id: PassId, dpi: f64) -> Option<Rect>
pub fn get_pass_name(&self, pass_id: PassId) -> &str
pub fn repaint_pass(&mut self, pass_id: PassId)
pub fn repaint_pass_and_child_passes(&mut self, pass_id: PassId)
pub fn redraw_pass_and_child_passes(&mut self, pass_id: PassId)
pub fn redraw_all(&mut self)
pub fn redraw_area(&mut self, area: Area)
pub fn redraw_area_in_draw(&mut self, area: Area)
pub fn redraw_area_and_children(&mut self, area: Area)
pub fn redraw_list(&mut self, draw_list_id: DrawListId)
pub fn redraw_list_in_draw(&mut self, draw_list_id: DrawListId)
pub fn redraw_list_and_children(&mut self, draw_list_id: DrawListId)
pub fn get_ime_area_rect(&self) -> Rect
pub fn update_area_refs(&mut self, old_area: Area, new_area: Area) -> Area
pub fn set_key_focus(&mut self, focus_area: Area)
pub fn revert_key_focus(&mut self)
pub fn has_key_focus(&self, focus_area: Area) -> bool
pub fn new_next_frame(&mut self) -> NextFrame
pub fn send_trigger(&mut self, area: Area, trigger: Trigger)
pub fn set_global<T>(&mut self, value: T)where
T: 'static + Any,
pub fn get_global<T>(&mut self) -> &mut Twhere
T: 'static + Any,
pub fn has_global<T>(&mut self) -> boolwhere
T: 'static + Any,
pub fn global<T>(&mut self) -> &mut T
pub fn spawner(&self) -> &Spawner
pub fn http_request(&mut self, request_id: LiveId, request: HttpRequest)
pub fn cancel_http_request(&mut self, request_id: LiveId)
pub fn prepare_video_playback( &mut self, video_id: LiveId, source: VideoSource, external_texture_id: u32, autoplay: bool, should_loop: bool, )
pub fn begin_video_playback(&mut self, video_id: LiveId)
pub fn pause_video_playback(&mut self, video_id: LiveId)
pub fn resume_video_playback(&mut self, video_id: LiveId)
pub fn mute_video_playback(&mut self, video_id: LiveId)
pub fn unmute_video_playback(&mut self, video_id: LiveId)
pub fn cleanup_video_playback_resources(&mut self, video_id: LiveId)
pub fn println_resources(&self)
pub fn open_system_savefile_dialog(&mut self)
pub fn open_system_openfile_dialog(&mut self)
pub fn open_system_savefolder_dialog(&mut self)
pub fn open_system_openfolder_dialog(&mut self)
pub fn event_id(&self) -> u64
pub fn handle_action_receiver(&mut self)
pub fn action(&mut self, action: impl ActionTrait)
Sourcepub fn extend_actions(&mut self, actions: Vec<Box<dyn ActionTrait>>)
pub fn extend_actions(&mut self, actions: Vec<Box<dyn ActionTrait>>)
Adds the given actions back into the set of existing queued actions.
This is useful when you want to allow other widgets elsewhere in the UI tree
to receive the given actions, e.g., after you have previously captured them
using capture_actions().
pub fn map_actions<F, G, R>(&mut self, f: F, g: G) -> Rwhere
F: FnOnce(&mut Cx) -> R,
G: FnOnce(&mut Cx, Vec<Box<dyn ActionTrait>>) -> Vec<Box<dyn ActionTrait>>,
pub fn mutate_actions<F, G, R>(&mut self, f: F, g: G) -> R
Sourcepub fn capture_actions<F>(&mut self, f: F) -> Vec<Box<dyn ActionTrait>>
pub fn capture_actions<F>(&mut self, f: F) -> Vec<Box<dyn ActionTrait>>
Captures the actions emitted by the given closure f and returns them.
This allows you to handle the actions directly before they are delivered to other widgets in the UI tree, enabling you to optionally prevent some or all of the actions from being delivered to all other widgets.
If you do want some or all of the returned actions to be delivered
to other widgets in the UI tree, you can call extend_actions() to enqueue them
back into the set of existing actions.