Struct Cx

Source
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

Source

pub fn begin_style(&mut self, style_id: StyleId)

Source

pub fn end_style(&mut self)

Source

pub fn get_mut_style_top(&mut self) -> &mut CxStyle

Source§

impl Cx

Source

pub fn add_shader(&mut self, sg: ShaderGen, name: &str) -> Shader

Source

pub fn process_tap_count(&mut self, digit: usize, pos: Vec2, time: f64) -> u32

Source

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

Source

pub fn get_delegated_dpi_factor(&mut self, pass_id: usize) -> f32

Source

pub fn compute_passes_to_repaint( &mut self, passes_todo: &mut Vec<usize>, windows_need_repaint: &mut usize, )

Source

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

Source

pub fn redraw_pass_and_dep_of_passes(&mut self, pass_id: usize)

Source

pub fn redraw_pass_and_sub_passes(&mut self, pass_id: usize)

Source

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

Source

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

Source

pub fn redraw_previous_areas(&mut self)

Source

pub fn view_will_redraw(&self, view_id: usize) -> bool

Source

pub fn check_ended_anim_areas(&mut self, time: f64)

Source

pub fn update_area_refs(&mut self, old_area: Area, new_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 process_key_down(&mut self, key_event: KeyEvent)

Source

pub fn process_key_up(&mut self, key_event: &KeyEvent)

Source

pub fn call_all_keys_up<F>(&mut self, event_handler: F)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn call_event_handler<F>(&mut self, event_handler: F, event: &mut Event)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn call_draw_event<F>(&mut self, event_handler: F)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn call_animation_event<F>(&mut self, event_handler: F, time: f64)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn call_frame_event<F>(&mut self, event_handler: F, time: f64)
where F: FnMut(&mut Cx, &mut Event),

Source

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

Source

pub fn new_signal(&mut self) -> Signal

Source

pub fn send_signal(&mut self, signal: Signal, status: StatusId)

Source

pub fn call_signals<F>(&mut self, event_handler: F)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn status_http_send_ok() -> StatusId

Source

pub fn status_http_send_fail() -> StatusId

Source§

impl Cx

Source

pub fn pick(&self, file: &str, line: usize, col: usize, inp: Color) -> Color

Source§

impl Cx

Source

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, )

Source

pub fn calc_dirty_bounds( &mut self, pass_id: usize, view_id: usize, view_bounds: &mut ViewBounds, )

Source

pub fn set_default_depth_and_blend_mode()

Source

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

Source

pub fn draw_pass_to_texture( &mut self, pass_id: usize, inherit_dpi_factor: f32, opengl_cx: &OpenglCx, )

Source

pub fn opengl_compile_all_shaders(&mut self, opengl_cx: &OpenglCx)

Source

pub fn opengl_has_shader_error( compile: bool, shader: usize, source: &str, ) -> Option<String>

Source

pub fn opengl_get_attributes( program: u32, prefix: &str, slots: usize, ) -> Vec<OpenglAttribute>

Source

pub fn opengl_get_uniforms( program: u32, sg: &ShaderGen, unis: &Vec<ShVar>, ) -> Vec<OpenglUniform>

Source

pub fn opengl_get_texture_slots( program: u32, texture_slots: &Vec<ShVar>, ) -> Vec<OpenglUniform>

Source

pub fn opengl_compile_shader( sh: &mut CxShader, opengl_cx: &OpenglCx, ) -> Result<(), SlErr>

Source§

impl Cx

Source

pub fn event_loop<F>(&mut self, event_handler: F)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn show_text_ime(&mut self, x: f32, y: f32)

Source

pub fn hide_text_ime(&mut self)

Source

pub fn set_window_outer_size(&mut self, size: Vec2)

Source

pub fn set_window_position(&mut self, pos: Vec2)

Source

pub fn start_timer(&mut self, interval: f64, repeats: bool) -> Timer

Source

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

Source

pub fn post_signal(signal: Signal, status: StatusId)

Source

pub fn update_menu(&mut self, _menu: &Menu)

Source§

impl Cx

Source

pub fn gl_assemble_uniforms(unis: &Vec<ShVar>) -> String

Source

pub fn ceil_div4(base: usize) -> usize

Source

pub fn gl_assemble_texture_slots(unis: &Vec<ShVar>) -> String

Source

pub fn gl_assemble_vartype(i: usize, total: usize, left: usize) -> String

Source

pub fn gl_assemble_varblock(thing: &str, base: &str, slots: usize) -> String

Source

pub fn gl_assemble_vardef(var: &ShVar) -> String

Source

pub fn gl_assemble_unpack( base: &str, slot: usize, total_slots: usize, sv: &ShVar, ) -> String

Source

pub fn gl_assemble_pack_chunk( base: &str, id: usize, chunk: &str, sv: &ShVar, ) -> String

Source

pub fn gl_assemble_pack( base: &str, slot: usize, total_slots: usize, sv: &ShVar, ) -> String

Source

pub fn gl_assemble_shader( sg: &ShaderGen, shtype: GLShaderType, ) -> Result<(String, String, CxShaderMapping), SlErr>

Source§

impl Cx

Source

pub fn get_default_window_size(&self) -> Vec2

Source

pub fn file_read(&mut self, path: &str) -> FileRead

Source

pub fn file_write(&mut self, path: &str, data: &[u8]) -> u64

Source

pub fn process_desktop_pre_event<F>( &mut self, event: &mut Event, event_handler: F, )
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn process_desktop_post_event(&mut self, event: &mut Event) -> bool

Source

pub fn process_desktop_paint_callbacks<F>( &mut self, time: f64, event_handler: F, ) -> bool
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn process_desktop_file_reads<F>(&mut self, event_handler: F)
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn process_to_wasm<F>(&mut self, _msg: u32, _event_handler: F) -> u32
where F: FnMut(&mut Cx, &mut Event),

Source

pub fn load_theme_fonts(&mut self)

Source

pub fn write_log(data: &str)

Source

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

Source

pub fn set_count_of_aligned_instance(&mut self, instance_count: usize) -> Area

Source

pub fn begin_turtle(&mut self, layout: Layout, guard_area: Area)

Source

pub fn end_turtle(&mut self, guard_area: Area) -> Rect

Source

pub fn walk_turtle(&mut self, walk: Walk) -> Rect

Source

pub fn walk_turtle_with_old( &mut self, walk: Walk, old_turtle: Option<&Turtle>, ) -> Rect

Source

pub fn walk_turtle_right_no_wrap( &mut self, w: f32, h: f32, scroll: Vec2, ) -> Option<Rect>

Source

pub fn turtle_new_line(&mut self)

Source

pub fn turtle_line_is_visible(&mut self, min_height: f32, scroll: Vec2) -> bool

Source

pub fn turtle_new_line_min_height(&mut self, min_height: f32)

Source

pub fn get_turtle_rect(&self) -> Rect

Source

pub fn get_turtle_biggest(&self) -> f32

Source

pub fn get_turtle_bounds(&self) -> Vec2

Source

pub fn set_turtle_bounds(&mut self, bound: Vec2)

Source

pub fn get_turtle_origin(&self) -> Vec2

Source

pub fn move_turtle(&mut self, dx: f32, dy: f32)

Source

pub fn get_turtle_pos(&self) -> Vec2

Source

pub fn set_turtle_pos(&mut self, pos: Vec2)

Source

pub fn get_rel_turtle_pos(&self) -> Vec2

Source

pub fn set_turtle_padding(&mut self, padding: Padding)

Source

pub fn visible_in_turtle(&self, geom: Rect, scroll: Vec2) -> bool

Source

pub fn compute_turtle_width(&mut self)

Source

pub fn compute_turtle_height(&mut self)

Source

pub fn change_turtle_align_x(&mut self, fx: f32)

Source

pub fn change_turtle_align_y(&mut self, fy: f32)

Source

pub fn turtle_align_y(&mut self)

Source

pub fn turtle_align_x(&mut self)

Source

pub fn reset_turtle_bounds(&mut self)

Source

pub fn reset_turtle_pos(&mut self)

Source

pub fn get_width_left(&self) -> f32

Source

pub fn get_width_total(&self) -> f32

Source

pub fn get_height_left(&self) -> f32

Source

pub fn get_height_total(&self) -> f32

Source

pub fn is_height_computed(&self) -> bool

Source

pub fn is_width_computed(&self) -> bool

Source§

impl Cx

Source

pub fn reset_font_atlas_and_redraw(&mut self)

Source

pub fn load_font(&mut self, path: &str) -> Font

Source§

impl Cx

Source

pub fn set_down_mouse_cursor(&mut self, mouse_cursor: MouseCursor)

Source

pub fn set_hover_mouse_cursor(&mut self, mouse_cursor: MouseCursor)

Source§

impl Cx

Source

pub fn new_instance_draw_call( &mut self, shader: &Shader, instance_count: usize, ) -> InstanceArea

Source

pub fn new_instance( &mut self, shader: &Shader, instance_count: usize, ) -> InstanceArea

Source

pub fn align_instance(&mut self, instance_area: InstanceArea) -> AlignedInstance

Source

pub fn update_aligned_instance_count( &mut self, aligned_instance: &AlignedInstance, )

Source

pub fn set_view_scroll_x(&mut self, view_id: usize, scroll_pos: f32)

Source

pub fn set_view_scroll_y(&mut self, view_id: usize, scroll_pos: f32)

Source§

impl Cx

Trait Implementations§

Source§

impl Default for Cx

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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