pub struct Cx {Show 21 fields
pub in_makepad_studio: bool,
pub demo_time_repaint: bool,
pub null_texture: Texture,
pub windows: CxWindowPool,
pub passes: CxPassPool,
pub draw_lists: CxDrawListPool,
pub draw_matrices: CxDrawMatrixPool,
pub textures: CxTexturePool,
pub draw_shaders: CxDrawShaders,
pub new_draw_event: DrawEvent,
pub redraw_id: u64,
pub keyboard: CxKeyboard,
pub fingers: CxFingers,
pub new_actions: ActionsBuf,
pub live_registry: Rc<RefCell<LiveRegistry>>,
pub shader_registry: ShaderRegistry,
pub os: CxOs,
pub display_context: DisplayContext,
pub debug: Debug,
pub performance_stats: PerformanceStats,
pub widget_query_invalidation_event: Option<u64>,
/* private fields */
}
Fields§
§in_makepad_studio: bool
§demo_time_repaint: bool
§null_texture: Texture
§windows: CxWindowPool
§passes: CxPassPool
§draw_lists: CxDrawListPool
§draw_matrices: CxDrawMatrixPool
§textures: CxTexturePool
§draw_shaders: CxDrawShaders
§new_draw_event: DrawEvent
§redraw_id: u64
§keyboard: CxKeyboard
§fingers: CxFingers
§new_actions: ActionsBuf
§live_registry: Rc<RefCell<LiveRegistry>>
§shader_registry: ShaderRegistry
§os: CxOs
§display_context: DisplayContext
§debug: Debug
§performance_stats: PerformanceStats
§widget_query_invalidation_event: Option<u64>
Event ID that triggered a widget query cache invalidation. When Some(event_id), indicates that widgets should clear their query caches on the next event loop cycle. This ensures all views process the cache clear before it’s reset to None.
This is primarily used when adaptive views change their active variant, as the widget hierarchy changes require parent views to rebuild their widget queries.
Implementations§
Source§impl Cx
impl Cx
pub fn handle_triggers(&mut self)
pub fn handle_actions(&mut self)
Source§impl Cx
impl Cx
pub fn draw_pass_to_window( &mut self, pass_id: PassId, opengl_window: &mut OpenglWindow, )
Source§impl Cx
impl Cx
pub fn stdin_event_loop(&mut self)
Source§impl Cx
impl Cx
pub fn set_default_depth_and_blend_mode(gl: &LibGl)
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)
Source§impl Cx
impl Cx
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: 'static + Any + Sized>(&mut self, value: T)
pub fn get_global<T: 'static + Any>(&mut self) -> &mut T
pub fn has_global<T: 'static + Any>(&mut self) -> bool
pub fn global<T: 'static + Any + Default>(&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
Source§impl Cx
impl Cx
pub fn handle_action_receiver(&mut self)
Sourcepub fn post_action(action: impl ActionTrait + Send)
pub fn post_action(action: impl ActionTrait + Send)
Enqueues an action from a background thread context.
This will produce a bare action, not a widget action,
so you cannot use as_widget_action()
when handling this action.
pub fn action(&mut self, action: impl ActionTrait)
Sourcepub fn extend_actions(&mut self, actions: ActionsBuf)
pub fn extend_actions(&mut self, actions: ActionsBuf)
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) -> R
pub fn mutate_actions<F, G, R>(&mut self, f: F, g: G) -> R
Sourcepub fn capture_actions<F>(&mut self, f: F) -> ActionsBuf
pub fn capture_actions<F>(&mut self, f: F) -> ActionsBuf
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.