Struct CxDraw

Source
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§nav_tree_rc: CxNavTreeRc§rustybuzz_buffer: Option<UnicodeBuffer>

Implementations§

Source§

impl<'a> CxDraw<'a>

Source

pub fn new_draw_call(&mut self, draw_vars: &DrawVars) -> Option<&mut CxDrawItem>

Source

pub fn append_to_draw_call( &mut self, draw_vars: &DrawVars, ) -> Option<&mut CxDrawItem>

Source

pub fn get_current_draw_list_id(&self) -> Option<DrawListId>

Source

pub fn get_draw_call( &mut self, append: bool, draw_vars: &DrawVars, ) -> Option<&mut CxDrawItem>

Source

pub fn begin_many_instances( &mut self, draw_vars: &DrawVars, ) -> Option<ManyInstances>

Source

pub fn end_many_instances(&mut self, many_instances: ManyInstances) -> Area

Source

pub fn add_instance(&mut self, draw_vars: &DrawVars) -> Area

Source§

impl<'a> CxDraw<'a>

Source

pub fn new(cx: &'a mut Cx, draw_event: &'a DrawEvent) -> CxDraw<'a>

Source§

impl<'a> CxDraw<'a>

Source

pub fn lazy_construct_fonts(cx: &mut Cx) -> bool

Source

pub fn get_current_window_id(&self) -> Option<WindowId>

Source

pub fn current_dpi_factor(&self) -> f64

Source

pub fn inside_pass(&self) -> bool

Source

pub fn make_child_pass(&mut self, pass: &Pass)

Source

pub fn begin_pass(&mut self, pass: &Pass, dpi_override: Option<f64>)

Source

pub fn end_pass(&mut self, pass: &Pass)

Source

pub fn set_pass_area(&mut self, pass: &Pass, area: Area)

Source

pub fn set_pass_area_with_origin( &mut self, pass: &Pass, area: Area, origin: DVec2, )

Source

pub fn set_pass_shift_scale(&mut self, pass: &Pass, shift: DVec2, scale: DVec2)

Source

pub fn current_pass_size(&self) -> DVec2

Source

pub fn append_sub_draw_list(&mut self, draw_list_2d: &DrawList2d)

Source§

impl<'a> CxDraw<'a>

Source

pub fn lazy_construct_nav_tree(cx: &mut Cx)

Source

pub fn iterate_nav_stops<F>( cx: &mut Cx, root: DrawListId, callback: F, ) -> Option<(Area, Vec<Area>)>
where F: FnMut(&Cx, &NavStop) -> Option<Area>,

Source

pub fn nav_list_clear(&mut self, draw_list_id: DrawListId)

Source

pub fn nav_list_item_push(&mut self, draw_list_id: DrawListId, item: NavItem)

Source

pub fn add_nav_stop(&mut self, area: Area, role: NavRole, margin: Margin)

Source

pub fn add_begin_scroll(&mut self) -> NavScrollIndex

Source

pub fn add_end_scroll(&mut self, index: NavScrollIndex, area: Area)

Source§

impl<'a> CxDraw<'a>

Source

pub fn lazy_construct_icon_atlas(cx: &mut Cx)

Source

pub fn reset_icon_atlas(cx: &mut Cx)

Source

pub fn draw_icon_atlas(&mut self)

Methods from Deref<Target = Cx>§

Source

pub fn native_load_dependencies(&mut self)

Source

pub fn handle_triggers(&mut self)

Source

pub fn handle_actions(&mut self)

Source

pub fn draw_pass_to_window( &mut self, pass_id: PassId, opengl_window: &mut OpenglWindow, )

Source

pub fn share_texture_for_presentable_image( &mut self, texture: &Texture, ) -> Image<OwnedFd>

Source

pub fn stdin_event_loop(&mut self)

Source

pub fn setup_render_pass(&mut self, pass_id: PassId) -> Option<(DVec2, f64)>

Source

pub fn draw_pass_to_texture( &mut self, pass_id: PassId, override_pass_texture: Option<&Texture>, )

Source

pub fn opengl_compile_shaders(&mut self)

Source

pub fn in_draw_event(&self) -> bool

Source

pub fn xr_capabilities(&self) -> &XrCapabilities

Source

pub fn get_ref(&self) -> CxRef

Source

pub fn take_dependency(&mut self, path: &str) -> Result<Rc<Vec<u8>>, String>

Source

pub fn get_dependency(&self, path: &str) -> Result<Rc<Vec<u8>>, String>

Source

pub fn null_texture(&self) -> Texture

Source

pub fn redraw_id(&self) -> u64

Source

pub fn os_type(&self) -> &OsType

Source

pub fn in_makepad_studio(&self) -> bool

Source

pub fn cpu_cores(&self) -> usize

Source

pub fn gpu_info(&self) -> &GpuInfo

Source

pub fn update_macos_menu(&mut self, menu: MacosMenu)

Source

pub fn xr_start_presenting(&mut self)

Source

pub fn xr_advertise_anchor(&mut self, anchor: XrAnchor)

Source

pub fn xr_set_local_anchor(&mut self, anchor: XrAnchor)

Source

pub fn xr_discover_anchor(&mut self, id: u8)

Source

pub fn quit(&mut self)

Source

pub fn show_in_dock(&mut self, show: bool)

Source

pub fn push_unique_platform_op(&mut self, op: CxOsOp)

Source

pub fn show_text_ime(&mut self, area: Area, pos: DVec2)

Source

pub fn hide_text_ime(&mut self)

Source

pub fn text_ime_was_dismissed(&mut self)

Source

pub fn show_clipboard_actions(&mut self, selected: String)

Source

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.

Source

pub fn start_dragging(&mut self, items: Vec<DragItem>)

Source

pub fn set_cursor(&mut self, cursor: MouseCursor)

Source

pub fn sweep_lock(&mut self, value: Area)

Source

pub fn sweep_unlock(&mut self, value: Area)

Source

pub fn start_timeout(&mut self, interval: f64) -> Timer

Source

pub fn start_interval(&mut self, interval: f64) -> Timer

Source

pub fn stop_timer(&mut self, timer: Timer)

Source

pub fn get_dpi_factor_of(&mut self, area: &Area) -> f64

Source

pub fn get_pass_window_id(&self, pass_id: PassId) -> Option<WindowId>

Source

pub fn get_delegated_dpi_factor(&mut self, pass_id: PassId) -> f64

Source

pub fn redraw_pass_and_parent_passes(&mut self, pass_id: PassId)

Source

pub fn get_pass_rect(&self, pass_id: PassId, dpi: f64) -> Option<Rect>

Source

pub fn get_pass_name(&self, pass_id: PassId) -> &str

Source

pub fn repaint_pass(&mut self, pass_id: PassId)

Source

pub fn repaint_pass_and_child_passes(&mut self, pass_id: PassId)

Source

pub fn redraw_pass_and_child_passes(&mut self, pass_id: PassId)

Source

pub fn redraw_all(&mut self)

Source

pub fn redraw_area(&mut self, area: Area)

Source

pub fn redraw_area_in_draw(&mut self, area: Area)

Source

pub fn redraw_area_and_children(&mut self, area: Area)

Source

pub fn redraw_list(&mut self, draw_list_id: DrawListId)

Source

pub fn redraw_list_in_draw(&mut self, draw_list_id: DrawListId)

Source

pub fn redraw_list_and_children(&mut self, draw_list_id: DrawListId)

Source

pub fn get_ime_area_rect(&self) -> Rect

Source

pub fn update_area_refs(&mut self, old_area: Area, new_area: Area) -> Area

Source

pub fn set_key_focus(&mut self, focus_area: Area)

Source

pub fn revert_key_focus(&mut self)

Source

pub fn has_key_focus(&self, focus_area: Area) -> bool

Source

pub fn new_next_frame(&mut self) -> NextFrame

Source

pub fn send_trigger(&mut self, area: Area, trigger: Trigger)

Source

pub fn set_global<T>(&mut self, value: T)
where T: 'static + Any,

Source

pub fn get_global<T>(&mut self) -> &mut T
where T: 'static + Any,

Source

pub fn has_global<T>(&mut self) -> bool
where T: 'static + Any,

Source

pub fn global<T>(&mut self) -> &mut T
where T: 'static + Any + Default,

Source

pub fn spawner(&self) -> &Spawner

Source

pub fn http_request(&mut self, request_id: LiveId, request: HttpRequest)

Source

pub fn cancel_http_request(&mut self, request_id: LiveId)

Source

pub fn prepare_video_playback( &mut self, video_id: LiveId, source: VideoSource, external_texture_id: u32, autoplay: bool, should_loop: bool, )

Source

pub fn begin_video_playback(&mut self, video_id: LiveId)

Source

pub fn pause_video_playback(&mut self, video_id: LiveId)

Source

pub fn resume_video_playback(&mut self, video_id: LiveId)

Source

pub fn mute_video_playback(&mut self, video_id: LiveId)

Source

pub fn unmute_video_playback(&mut self, video_id: LiveId)

Source

pub fn cleanup_video_playback_resources(&mut self, video_id: LiveId)

Source

pub fn println_resources(&self)

Source

pub fn open_system_savefile_dialog(&mut self)

Source

pub fn open_system_openfile_dialog(&mut self)

Source

pub fn open_system_savefolder_dialog(&mut self)

Source

pub fn open_system_openfolder_dialog(&mut self)

Source

pub fn event_id(&self) -> u64

Source

pub fn handle_action_receiver(&mut self)

Source

pub fn action(&mut self, action: impl ActionTrait)

Source

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().

Source

pub fn map_actions<F, G, R>(&mut self, f: F, g: G) -> R
where F: FnOnce(&mut Cx) -> R, G: FnOnce(&mut Cx, Vec<Box<dyn ActionTrait>>) -> Vec<Box<dyn ActionTrait>>,

Source

pub fn mutate_actions<F, G, R>(&mut self, f: F, g: G) -> R
where F: FnOnce(&mut Cx) -> R, G: FnOnce(&mut [Box<dyn ActionTrait>]),

Source

pub fn capture_actions<F>(&mut self, f: F) -> Vec<Box<dyn ActionTrait>>
where F: FnOnce(&mut Cx),

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.

Source

pub fn apply_error_tuple_enum_arg_not_found( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], enum_id: LiveId, base: LiveId, arg: usize, )

Source

pub fn apply_error_named_enum_invalid_prop( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], enum_id: LiveId, base: LiveId, prop: LiveId, )

Source

pub fn apply_error_wrong_enum_base( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], enum_id: LiveId, base: LiveId, )

Source

pub fn apply_error_wrong_struct_name( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], struct_id: LiveId, got_id: LiveId, )

Source

pub fn apply_error_wrong_type_for_struct( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], struct_id: LiveId, )

Source

pub fn apply_error_wrong_enum_variant( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], enum_id: LiveId, variant: LiveId, )

Source

pub fn apply_error_expected_enum( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], )

Source

pub fn apply_error_expected_array( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], )

Source

pub fn apply_error_no_matching_field( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], )

Source

pub fn apply_error_wrong_type_for_value( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], )

Source

pub fn apply_error_component_not_found( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], id: LiveId, )

Source

pub fn apply_error_wrong_value_type_for_primitive( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], prim: &str, )

Source

pub fn apply_error_animation_missing_state( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], track: LiveId, state_id: LiveId, ids: &[LiveProp], )

Source

pub fn apply_error_wrong_animation_track_used( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], id: LiveId, expect: LiveId, got: LiveId, )

Source

pub fn apply_error_animate_to_unknown_track( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], id: LiveId, state_id: LiveId, )

Source

pub fn apply_error_empty_object( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], )

Source

pub fn apply_key_frame_cannot_be_interpolated( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], a: &LiveValue, b: &LiveValue, )

Source

pub fn apply_animate_missing_apply_block( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], )

Source

pub fn apply_error_cant_find_target( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], id: LiveId, )

Source

pub fn apply_image_type_not_supported( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], path: &str, )

Source

pub fn apply_image_decoding_failed( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], path: &str, msg: &str, )

Source

pub fn apply_resource_not_loaded( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], path: &str, msg: &str, )

Source

pub fn apply_error_eval(&mut self, err: LiveError)

Source

pub fn apply_error_resource_not_found( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], path: &str, )

Source

pub fn apply_error( &mut self, origin: LiveErrorOrigin, index: usize, nodes: &[LiveNode], message: String, )

Source

pub fn start_disk_live_file_watcher(&mut self, milis: u64)

Source

pub fn reload_ui_dsl(&mut self)

Source

pub fn set_dsl_value( &self, crate_id: LiveId, file: LiveId, node: LiveId, value: LiveValue, )

Source

pub fn handle_live_edit(&mut self) -> bool

Source

pub fn live_expand(&mut self)

Source

pub fn live_scan_dependencies(&mut self)

Source

pub fn register_live_body(&mut self, live_body: LiveBody)

Source

pub fn get_nodes_from_live_ptr<CB>(&mut self, live_ptr: LivePtr, cb: CB)
where CB: FnOnce(&mut Cx, LiveFileId, usize, &[LiveNode]) -> usize,

Source

pub fn flush_draw_shaders(&mut self)

Source

pub fn get_geometry_ref( &mut self, fingerprint: GeometryFingerprint, ) -> GeometryRef

Source

pub fn debug_draw_tree(&self, dump_instances: bool, draw_list_id: DrawListId)

Source

pub fn stop_studio_websocket(&mut self)

Source

pub fn init_websockets(&mut self, studio_http: &str)

Trait Implementations§

Source§

impl<'a> Deref for CxDraw<'a>

Source§

type Target = Cx

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<CxDraw<'a> as Deref>::Target

Dereferences the value.
Source§

impl<'a> DerefMut for CxDraw<'a>

Source§

fn deref_mut(&mut self) -> &mut <CxDraw<'a> as Deref>::Target

Mutably dereferences the value.
Source§

impl<'a> Drop for CxDraw<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CxDraw<'a>

§

impl<'a> !RefUnwindSafe for CxDraw<'a>

§

impl<'a> !Send for CxDraw<'a>

§

impl<'a> !Sync for CxDraw<'a>

§

impl<'a> Unpin for CxDraw<'a>

§

impl<'a> !UnwindSafe for CxDraw<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.