pub struct Cx {Show 64 fields
pub running: bool,
pub counter: usize,
pub platform_type: PlatformType,
pub windows: Vec<CxWindow>,
pub windows_free: Vec<usize>,
pub passes: Vec<CxPass>,
pub passes_free: Vec<usize>,
pub views: Vec<CxView>,
pub views_free: Vec<usize>,
pub fonts: Vec<CxFont>,
pub fonts_atlas: CxFontsAtlas,
pub textures: Vec<CxTexture>,
pub textures_free: Vec<usize>,
pub shaders: Vec<CxShader>,
pub shader_map: HashMap<ShaderGen, usize>,
pub shader_instance_id: usize,
pub str_to_id: RefCell<HashMap<String, usize>>,
pub id_to_str: RefCell<HashMap<usize, String>>,
pub is_in_redraw_cycle: bool,
pub vr_can_present: bool,
pub default_dpi_factor: f32,
pub current_dpi_factor: f32,
pub window_stack: Vec<usize>,
pub pass_stack: Vec<usize>,
pub view_stack: Vec<usize>,
pub turtles: Vec<Turtle>,
pub align_list: Vec<Area>,
pub redraw_child_areas: Vec<Area>,
pub redraw_parent_areas: Vec<Area>,
pub _redraw_child_areas: Vec<Area>,
pub _redraw_parent_areas: Vec<Area>,
pub redraw_id: u64,
pub repaint_id: u64,
pub event_id: u64,
pub timer_id: u64,
pub signal_id: usize,
pub theme_update_id: usize,
pub prev_key_focus: Area,
pub next_key_focus: Area,
pub key_focus: Area,
pub keys_down: Vec<KeyEvent>,
pub debug_area: Area,
pub down_mouse_cursor: Option<MouseCursor>,
pub hover_mouse_cursor: Option<MouseCursor>,
pub captured_fingers: Vec<Area>,
pub finger_tap_count: Vec<(Vec2, f64, u32)>,
pub finger_down_abs_start: Vec<Vec2>,
pub finger_down_rel_start: Vec<Vec2>,
pub finger_over_last_area: Area,
pub _finger_over_last_area: Area,
pub playing_anim_areas: Vec<AnimArea>,
pub ended_anim_areas: Vec<AnimArea>,
pub frame_callbacks: Vec<Area>,
pub _frame_callbacks: Vec<Area>,
pub signals: HashMap<Signal, Vec<StatusId>>,
pub style_base: CxStyle,
pub styles: Vec<CxStyle>,
pub style_map: HashMap<StyleId, usize>,
pub style_stack: Vec<usize>,
pub command_settings: HashMap<CommandId, CxCommandSetting>,
pub panic_now: bool,
pub panic_redraw: bool,
pub live_client: Option<LiveClient>,
pub platform: CxPlatform,
}
Fields§
§running: bool
§counter: usize
§platform_type: PlatformType
§windows: Vec<CxWindow>
§windows_free: Vec<usize>
§passes: Vec<CxPass>
§passes_free: Vec<usize>
§views: Vec<CxView>
§views_free: Vec<usize>
§fonts: Vec<CxFont>
§fonts_atlas: CxFontsAtlas
§textures: Vec<CxTexture>
§textures_free: Vec<usize>
§shaders: Vec<CxShader>
§shader_map: HashMap<ShaderGen, usize>
§shader_instance_id: usize
§str_to_id: RefCell<HashMap<String, usize>>
§id_to_str: RefCell<HashMap<usize, String>>
§is_in_redraw_cycle: bool
§vr_can_present: bool
§default_dpi_factor: f32
§current_dpi_factor: f32
§window_stack: Vec<usize>
§pass_stack: Vec<usize>
§view_stack: Vec<usize>
§turtles: Vec<Turtle>
§align_list: Vec<Area>
§redraw_child_areas: Vec<Area>
§redraw_parent_areas: Vec<Area>
§_redraw_child_areas: Vec<Area>
§_redraw_parent_areas: Vec<Area>
§redraw_id: u64
§repaint_id: u64
§event_id: u64
§timer_id: u64
§signal_id: usize
§theme_update_id: usize
§prev_key_focus: Area
§next_key_focus: Area
§key_focus: Area
§keys_down: Vec<KeyEvent>
§debug_area: Area
§down_mouse_cursor: Option<MouseCursor>
§hover_mouse_cursor: Option<MouseCursor>
§captured_fingers: Vec<Area>
§finger_tap_count: Vec<(Vec2, f64, u32)>
§finger_down_abs_start: Vec<Vec2>
§finger_down_rel_start: Vec<Vec2>
§finger_over_last_area: Area
§_finger_over_last_area: Area
§playing_anim_areas: Vec<AnimArea>
§ended_anim_areas: Vec<AnimArea>
§frame_callbacks: Vec<Area>
§_frame_callbacks: Vec<Area>
§signals: HashMap<Signal, Vec<StatusId>>
§style_base: CxStyle
§styles: Vec<CxStyle>
§style_map: HashMap<StyleId, usize>
§style_stack: Vec<usize>
§command_settings: HashMap<CommandId, CxCommandSetting>
§panic_now: bool
§panic_redraw: bool
§live_client: Option<LiveClient>
§platform: CxPlatform
Implementations§
Source§impl Cx
impl Cx
pub fn begin_style(&mut self, style_id: StyleId)
pub fn end_style(&mut self)
pub fn get_mut_style_top(&mut self) -> &mut CxStyle
Source§impl Cx
impl Cx
pub fn add_shader(&mut self, sg: ShaderGen, name: &str) -> Shader
pub fn process_tap_count(&mut self, digit: usize, pos: Vec2, time: f64) -> u32
pub fn get_dpi_factor_of(&mut self, area: &Area) -> f32
pub fn get_delegated_dpi_factor(&mut self, pass_id: usize) -> f32
pub fn compute_passes_to_repaint( &mut self, passes_todo: &mut Vec<usize>, windows_need_repaint: &mut usize, )
pub fn redraw_pass_of(&mut self, area: Area)
pub fn redraw_pass_and_dep_of_passes(&mut self, pass_id: usize)
pub fn redraw_pass_and_sub_passes(&mut self, pass_id: usize)
pub fn redraw_child_area(&mut self, area: Area)
pub fn redraw_parent_area(&mut self, area: Area)
pub fn redraw_previous_areas(&mut self)
pub fn view_will_redraw(&self, view_id: usize) -> bool
pub fn check_ended_anim_areas(&mut self, time: f64)
pub fn update_area_refs(&mut self, old_area: Area, new_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 process_key_down(&mut self, key_event: KeyEvent)
pub fn process_key_up(&mut self, key_event: &KeyEvent)
pub fn call_all_keys_up<F>(&mut self, event_handler: F)
pub fn call_event_handler<F>(&mut self, event_handler: F, event: &mut Event)
pub fn call_draw_event<F>(&mut self, event_handler: F)
pub fn call_animation_event<F>(&mut self, event_handler: F, time: f64)
pub fn call_frame_event<F>(&mut self, event_handler: F, time: f64)
pub fn next_frame(&mut self, area: Area)
pub fn new_signal(&mut self) -> Signal
pub fn send_signal(&mut self, signal: Signal, status: StatusId)
pub fn call_signals<F>(&mut self, event_handler: F)
pub fn status_http_send_ok() -> StatusId
pub fn status_http_send_fail() -> StatusId
Source§impl Cx
impl Cx
pub fn render_view( &mut self, pass_id: usize, view_id: usize, scroll: Vec2, clip: (Vec2, Vec2), full_repaint: bool, view_rect: &Rect, opengl_cx: &OpenglCx, zbias: &mut f32, zbias_step: f32, )
pub fn calc_dirty_bounds( &mut self, pass_id: usize, view_id: usize, view_bounds: &mut ViewBounds, )
pub fn set_default_depth_and_blend_mode()
pub fn draw_pass_to_window( &mut self, pass_id: usize, dpi_factor: f32, opengl_window: &mut OpenglWindow, opengl_cx: &OpenglCx, _force_full_repaint: bool, ) -> bool
pub fn draw_pass_to_texture( &mut self, pass_id: usize, inherit_dpi_factor: f32, opengl_cx: &OpenglCx, )
pub fn opengl_compile_all_shaders(&mut self, opengl_cx: &OpenglCx)
pub fn opengl_has_shader_error( compile: bool, shader: usize, source: &str, ) -> Option<String>
pub fn opengl_get_attributes( program: u32, prefix: &str, slots: usize, ) -> Vec<OpenglAttribute>
pub fn opengl_get_uniforms( program: u32, sg: &ShaderGen, unis: &Vec<ShVar>, ) -> Vec<OpenglUniform>
pub fn opengl_get_texture_slots( program: u32, texture_slots: &Vec<ShVar>, ) -> Vec<OpenglUniform>
pub fn opengl_compile_shader( sh: &mut CxShader, opengl_cx: &OpenglCx, ) -> Result<(), SlErr>
Source§impl Cx
impl Cx
pub fn event_loop<F>(&mut self, event_handler: F)
pub fn show_text_ime(&mut self, x: f32, y: f32)
pub fn hide_text_ime(&mut self)
pub fn set_window_outer_size(&mut self, size: Vec2)
pub fn set_window_position(&mut self, pos: Vec2)
pub fn start_timer(&mut self, interval: f64, repeats: bool) -> Timer
pub fn stop_timer(&mut self, timer: &mut Timer)
pub fn post_signal(signal: Signal, status: StatusId)
Source§impl Cx
impl Cx
pub fn gl_assemble_uniforms(unis: &Vec<ShVar>) -> String
pub fn ceil_div4(base: usize) -> usize
pub fn gl_assemble_texture_slots(unis: &Vec<ShVar>) -> String
pub fn gl_assemble_vartype(i: usize, total: usize, left: usize) -> String
pub fn gl_assemble_varblock(thing: &str, base: &str, slots: usize) -> String
pub fn gl_assemble_vardef(var: &ShVar) -> String
pub fn gl_assemble_unpack( base: &str, slot: usize, total_slots: usize, sv: &ShVar, ) -> String
pub fn gl_assemble_pack_chunk( base: &str, id: usize, chunk: &str, sv: &ShVar, ) -> String
pub fn gl_assemble_pack( base: &str, slot: usize, total_slots: usize, sv: &ShVar, ) -> String
pub fn gl_assemble_shader( sg: &ShaderGen, shtype: GLShaderType, ) -> Result<(String, String, CxShaderMapping), SlErr>
Source§impl Cx
impl Cx
pub fn get_default_window_size(&self) -> Vec2
pub fn file_read(&mut self, path: &str) -> FileRead
pub fn file_write(&mut self, path: &str, data: &[u8]) -> u64
pub fn process_desktop_pre_event<F>( &mut self, event: &mut Event, event_handler: F, )
pub fn process_desktop_post_event(&mut self, event: &mut Event) -> bool
pub fn process_desktop_paint_callbacks<F>( &mut self, time: f64, event_handler: F, ) -> bool
pub fn process_desktop_file_reads<F>(&mut self, event_handler: F)
pub fn process_to_wasm<F>(&mut self, _msg: u32, _event_handler: F) -> u32
pub fn load_theme_fonts(&mut self)
pub fn write_log(data: &str)
pub fn http_send( &self, verb: &str, path: &str, _proto: &str, domain: &str, port: u16, content_type: &str, body: &[u8], signal: Signal, )
Source§impl Cx
impl Cx
pub fn set_count_of_aligned_instance(&mut self, instance_count: usize) -> Area
pub fn begin_turtle(&mut self, layout: Layout, guard_area: Area)
pub fn end_turtle(&mut self, guard_area: Area) -> Rect
pub fn walk_turtle(&mut self, walk: Walk) -> Rect
pub fn walk_turtle_with_old( &mut self, walk: Walk, old_turtle: Option<&Turtle>, ) -> Rect
pub fn walk_turtle_right_no_wrap( &mut self, w: f32, h: f32, scroll: Vec2, ) -> Option<Rect>
pub fn turtle_new_line(&mut self)
pub fn turtle_line_is_visible(&mut self, min_height: f32, scroll: Vec2) -> bool
pub fn turtle_new_line_min_height(&mut self, min_height: f32)
pub fn get_turtle_rect(&self) -> Rect
pub fn get_turtle_biggest(&self) -> f32
pub fn get_turtle_bounds(&self) -> Vec2
pub fn set_turtle_bounds(&mut self, bound: Vec2)
pub fn get_turtle_origin(&self) -> Vec2
pub fn move_turtle(&mut self, dx: f32, dy: f32)
pub fn get_turtle_pos(&self) -> Vec2
pub fn set_turtle_pos(&mut self, pos: Vec2)
pub fn get_rel_turtle_pos(&self) -> Vec2
pub fn set_turtle_padding(&mut self, padding: Padding)
pub fn visible_in_turtle(&self, geom: Rect, scroll: Vec2) -> bool
pub fn compute_turtle_width(&mut self)
pub fn compute_turtle_height(&mut self)
pub fn change_turtle_align_x(&mut self, fx: f32)
pub fn change_turtle_align_y(&mut self, fy: f32)
pub fn turtle_align_y(&mut self)
pub fn turtle_align_x(&mut self)
pub fn reset_turtle_bounds(&mut self)
pub fn reset_turtle_pos(&mut self)
pub fn get_width_left(&self) -> f32
pub fn get_width_total(&self) -> f32
pub fn get_height_left(&self) -> f32
pub fn get_height_total(&self) -> f32
pub fn is_height_computed(&self) -> bool
pub fn is_width_computed(&self) -> bool
Source§impl Cx
impl Cx
pub fn set_down_mouse_cursor(&mut self, mouse_cursor: MouseCursor)
pub fn set_hover_mouse_cursor(&mut self, mouse_cursor: MouseCursor)
Source§impl Cx
impl Cx
pub fn new_instance_draw_call( &mut self, shader: &Shader, instance_count: usize, ) -> InstanceArea
pub fn new_instance( &mut self, shader: &Shader, instance_count: usize, ) -> InstanceArea
pub fn align_instance(&mut self, instance_area: InstanceArea) -> AlignedInstance
pub fn update_aligned_instance_count( &mut self, aligned_instance: &AlignedInstance, )
pub fn set_view_scroll_x(&mut self, view_id: usize, scroll_pos: f32)
pub fn set_view_scroll_y(&mut self, view_id: usize, scroll_pos: f32)
Source§impl Cx
impl Cx
pub fn command_quit() -> CommandId
pub fn command_undo() -> CommandId
pub fn command_redo() -> CommandId
pub fn command_cut() -> CommandId
pub fn command_copy() -> CommandId
pub fn command_paste() -> CommandId
pub fn command_zoom_in() -> CommandId
pub fn command_zoom_out() -> CommandId
pub fn command_minimize() -> CommandId
pub fn command_zoom() -> CommandId
pub fn command_select_all() -> CommandId
pub fn command_default_keymap(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Cx
impl !RefUnwindSafe for Cx
impl Send for Cx
impl !Sync for Cx
impl Unpin for Cx
impl UnwindSafe for Cx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more