pub struct CxDraw<'a> {
pub cx: &'a mut Cx,
pub draw_event: &'a DrawEvent,
pub draw_list_stack: Vec<DrawListId>,
pub fonts: Rc<RefCell<Fonts>>,
pub icon_atlas_rc: CxIconAtlasRc,
pub nav_tree_rc: CxNavTreeRc,
pub rustybuzz_buffer: Option<UnicodeBuffer>,
/* private fields */
}
Fields§
§cx: &'a mut Cx
§draw_event: &'a DrawEvent
§draw_list_stack: Vec<DrawListId>
§fonts: Rc<RefCell<Fonts>>
§icon_atlas_rc: CxIconAtlasRc
§rustybuzz_buffer: Option<UnicodeBuffer>
Implementations§
Source§impl<'a> CxDraw<'a>
impl<'a> 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
Source§impl<'a> CxDraw<'a>
impl<'a> CxDraw<'a>
pub fn lazy_construct_fonts(cx: &mut Cx) -> bool
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)
Source§impl<'a> CxDraw<'a>
impl<'a> CxDraw<'a>
pub fn add_begin_scroll(&mut self) -> NavScrollIndex
pub fn add_end_scroll(&mut self, index: NavScrollIndex, area: Area)
Source§impl<'a> CxDraw<'a>
impl<'a> CxDraw<'a>
pub fn lazy_construct_icon_atlas(cx: &mut Cx)
pub fn reset_icon_atlas(cx: &mut Cx)
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.