/StarryEngine/starry_toolkit/src/widgets/ |
H A D | label.rs | 51 pub fn new() -> Arc<Self> { in new() method 52 let label = Arc::new(Label { in new() 53 rect: Cell::new(Rect::default()), in new() 54 pivot: Cell::new(PivotType::TopLeft), in new() 55 pivot_offset: Cell::new(Vector2::new(0, 0)), in new() 56 children: RefCell::new(vec![]), in new() 57 parent: RefCell::new(None), in new() 58 panel: RefCell::new(None), in new() 59 real_text: RefCell::new(String::new()), in new() 60 show_text: RefCell::new(String::new()), in new() [all …]
|
H A D | image.rs | 31 pub fn new(width: u32, height: u32) -> Arc<Self> { in new() method 32 Self::new_from_image(ImageResource::new(width as i32, height as i32)) in new() 44 let image = Arc::new(Image { in new_from_image() 45 self_ref: RefCell::new(Weak::default()), in new_from_image() 46 rect: Cell::new(Rect::new(0, 0, image.width() as u32, image.height() as u32)), in new_from_image() 47 pivot: Cell::new(PivotType::TopLeft), in new_from_image() 48 pivot_offset: Cell::new(Vector2::new(0, 0)), in new_from_image() 49 children: RefCell::new(vec![]), in new_from_image() 50 parent: RefCell::new(None), in new_from_image() 51 panel: RefCell::new(None), in new_from_image() [all …]
|
/StarryEngine/starry_toolkit/src/layout/ |
H A D | list.rs | 51 pub fn new() -> Arc<Self> { in new() method 52 let list = Arc::new(List { in new() 53 self_ref: RefCell::new(Weak::default()), in new() 54 rect: Cell::new(Rect::default()), in new() 55 pivot: Cell::new(PivotType::TopLeft), in new() 56 pivot_offset: Cell::new(Vector2::new(0, 0)), in new() 57 children: RefCell::new(vec![]), in new() 58 parent: RefCell::new(None), in new() 59 panel: RefCell::new(None), in new() 60 space: Cell::new(0), in new() [all …]
|
H A D | grid.rs | 61 pub fn new() -> Arc<Self> { in new() method 62 let grid = Arc::new(Grid { in new() 63 self_ref: RefCell::new(Weak::default()), in new() 64 rect: Cell::new(Rect::default()), in new() 65 pivot: Cell::new(PivotType::TopLeft), in new() 66 pivot_offset: Cell::new(Vector2::new(0, 0)), in new() 67 children: RefCell::new(vec![]), in new() 68 parent: RefCell::new(None), in new() 69 panel: RefCell::new(None), in new() 70 space_x: Cell::new(0), in new() [all …]
|
/StarryEngine/starry_applications/src/asset_manager/code/ |
H A D | asset_item_list.rs | 36 pub fn new(file_name: &str, is_dir: bool) -> Arc<Self> { in new() method 37 let item = Arc::new(AssetItemList { in new() 38 self_ref: RefCell::new(Weak::default()), in new() 39 rect: Cell::new(Rect::new(0, 0, Self::ITEM_WIDTH, Self::ITEM_HEIGHT)), in new() 40 pivot: Cell::new(PivotType::TopLeft), in new() 41 pivot_offset: Cell::new(Vector2::new(0, 0)), in new() 42 children: RefCell::new(Vec::new()), in new() 43 parent: RefCell::new(None), in new() 44 panel: RefCell::new(None), in new() 45 cache_focused: Cell::new(false), in new() [all …]
|
H A D | asset_item_grid.rs | 42 pub fn new(file_name: &str, is_dir: bool) -> Arc<Self> { in new() method 43 let item = Arc::new(AssetItemGrid { in new() 44 self_ref: RefCell::new(Weak::default()), in new() 45 rect: Cell::new(Rect::new(0, 0, Self::ITEM_WIDTH, Self::ITEM_HEIGHT)), in new() 46 pivot: Cell::new(PivotType::TopLeft), in new() 47 pivot_offset: Cell::new(Vector2::new(0, 0)), in new() 48 children: RefCell::new(Vec::new()), in new() 49 parent: RefCell::new(None), in new() 50 panel: RefCell::new(None), in new() 51 cache_focused: Cell::new(false), in new() [all …]
|
H A D | mod.rs | 35 pub fn new() -> Self { in new() method 38 asset_grid: Grid::new(), in new() 39 asset_list: List::new(), in new() 40 items: BTreeMap::new(), in new() 41 panel: Panel::new( in new() 42 Rect::new(0, 0, SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32), in new() 46 loading_panel: Panel::new( in new() 47 Rect::new(SCREEN_WIDTH as i32 - 64, SCREEN_HEIGHT as i32 - 64, 64, 64), in new() 191 let parent_asset_item = AssetItemGrid::new("..", true); in refresh_grid() 205 let asset_item = AssetItemGrid::new(item.file_name().to_str().unwrap(), is_dir); in refresh_grid() [all …]
|
/StarryEngine/starry_server/src/core/ |
H A D | window_manager.rs | 76 pub fn new() { in new() method 78 next_id: Cell::new(0), in new() 79 _hover: RefCell::new(None), in new() 80 order: RefCell::new(VecDeque::new()), in new() 81 zbuffer: RefCell::new(Vec::new()), in new() 82 windows: RefCell::new(BTreeMap::new()), in new() 83 cursor_x: Cell::new(SCREEN_WIDTH as i32 / 2), in new() 84 cursor_y: Cell::new(SCREEN_HEIGHT as i32 / 2), in new() 85 cursor_i: Cell::new(CursorKind::Normal), in new() 86 events: RefCell::new(Vec::new()), in new() [all …]
|
H A D | mod.rs | 43 pub fn new(config: Arc<Config>, displays: Vec<Display>) { in new() method 44 let mut cursors = BTreeMap::new(); in new() 45 cursors.insert(CursorKind::None, Image::new(0, 0)); in new() 48 Image::from_path(CURSOR_NORMAL).unwrap_or(Image::new(10, 10)), in new() 57 displays: RefCell::new(displays), in new() 58 config: RefCell::new(config), in new() 59 cursors: RefCell::new(cursors), in new() 63 STARRY_SERVER = Some(Arc::new(server)); in new() 71 WindowManager::new(); in run() 72 Compositor::new(); in run() [all …]
|
H A D | compositor.rs | 35 pub fn new() { in new() method 37 redraws: RefCell::new(Vec::new()), in new() 38 fb_file: RefCell::new( in new() 44 COMPOSITOR = Some(Arc::new(compositor)); in new()
|
/StarryEngine/starry_toolkit/src/util/ |
H A D | mod.rs | 25 PivotType::None => Vector2::new(0, 0), in align_rect() 42 PivotType::None => Vector2::new(0, 0), in align_rect() 43 PivotType::Bottom => Vector2::new(negative_width / 2, negative_height), in align_rect() 44 PivotType::BottomLeft => Vector2::new(0, negative_height), in align_rect() 45 PivotType::BottomRight => Vector2::new(negative_width, negative_height), in align_rect() 46 PivotType::Center => Vector2::new(negative_width / 2, negative_height / 2), in align_rect() 47 PivotType::Top => Vector2::new(negative_width / 2, 0), in align_rect() 48 PivotType::TopLeft => Vector2::new(0, 0), in align_rect() 49 PivotType::TopRight => Vector2::new(negative_width, 0), in align_rect() 50 PivotType::Left => Vector2::new(0, negative_height / 2), in align_rect() [all …]
|
/StarryEngine/starry_toolkit/src/base/ |
H A D | panel.rs | 42 pub fn new(window: &'a mut Window) -> Self { in new() method 103 pub fn new(rect: Rect, title: &str, color: Color) -> Arc<Panel> { in new() method 105 Window::new(rect.x, rect.y, rect.width, rect.height, title, color), in new() 111 let panel = Arc::new(Panel { in from_window() 112 self_ref: RefCell::new(Weak::default()), in from_window() 113 window: RefCell::new(window), in from_window() 114 rect: Cell::new(rect), in from_window() 115 widgets: RefCell::new(Vec::new()), in from_window() 116 running: Cell::new(true), in from_window() 117 focused_widget: RefCell::new(None), in from_window() [all …]
|
H A D | rect.rs | 17 pub fn new(x: i32, y: i32, width: u32, height: u32) -> Rect { in new() method 28 Vector2::new(self.x, self.y) in top_left_pos() 32 Vector2::new(self.x + self.width as i32 / 2, self.y) in top_pos() 36 Vector2::new(self.x + self.width as i32, self.y) in top_right_pos() 40 Vector2::new(self.x, self.y + self.height as i32 / 2) in left_pos() 44 Vector2::new( in center_pos() 51 Vector2::new(self.x + self.width as i32, self.y + self.height as i32 / 2) in right_pos() 55 Vector2::new(self.x, self.y + self.height as i32) in bottom_left_pos() 59 Vector2::new(self.x + self.width as i32 / 2, self.y + self.height as i32) in bottom_pos() 63 Vector2::new(self.x + self.width as i32, self.y + self.height as i32) in bottom_right_pos() [all …]
|
/StarryEngine/starry_server/src/base/ |
H A D | image.rs | 133 for (old, new) in self_row.iter_mut().zip(other_row.iter()) { in blend() 134 let alpha = (new.data >> 24) & 0xFF; in blend() 136 old.data = new.data; in blend() 138 let n_r = (((new.data >> 16) & 0xFF) * alpha) >> 8; in blend() 139 let n_g = (((new.data >> 8) & 0xFF) * alpha) >> 8; in blend() 140 let n_b = ((new.data & 0xFF) * alpha) >> 8; in blend() 180 mode: Cell::new(RenderMode::Blend), in from_data() 245 pub fn new(width: i32, height: i32) -> Self { in new() method 264 mode: Cell::new(RenderMode::Blend), in from_data() 282 let mut image = Image::new(img_width as i32, img_heigh as i32); in from_path() [all …]
|
H A D | display.rs | 20 pub fn new(x: i32, y: i32, width: i32, height: i32) -> Self { in new() method 24 image: Image::new(width, height), in new() 54 self.image.roi(&Rect::new( in roi() 64 self.image = Image::new(width, height) in resize() 69 Rect::new(self.x, self.y, self.image.width(), self.image.height()) in screen_rect()
|
H A D | window.rs | 50 pub fn new(x: i32, y: i32, _w: i32, _h: i32, scale: i32, image_path: &[u8]) -> Window { in new() method 55 title: String::new(), in new() 62 .unwrap_or(Image::new(SCREEN_HEIGHT as i32, SCREEN_HEIGHT as i32)), in new() 63 events: Vec::new(), in new() 80 Rect::new(self.x, self.y, self.width(), self.height()) in rect()
|
H A D | rect.rs | 19 pub fn new(x: i32, y: i32, w: i32, h: i32) -> Rect { in new() method 71 Rect::new(left, top, right - left, bottom - top) in container() 81 Rect::new(left, top, max(0, right - left), max(0, bottom - top)) in intersection() 105 Rect::new(self.x + x, self.y + y, self.w, self.h) in offset()
|
/StarryEngine/starry_server/src/core/input/ |
H A D | inputs.rs | 56 pub fn new() -> Box<MouseInputHandler> { in new() method 59 Box::new(MouseInputHandler { in new() 86 let mut events: Vec<Event> = Vec::new(); in handle() 92 events.push(ButtonEvent::new(packet).to_event()); in handle() 138 pub fn new() -> Box<KeyboardInputHandler> { in new() method 141 Box::new(KeyboardInputHandler { file: file }) in new() 155 Vec::new() in handle()
|
H A D | mod.rs | 26 pub fn new() { in new() method 27 let mut input_handlers = Vec::new(); in new() 28 input_handlers.push(MouseInputHandler::new() as Box<dyn InputHandler>); in new() 29 input_handlers.push(KeyboardInputHandler::new() as Box<dyn InputHandler>); in new() 31 handlers: RefCell::new(input_handlers), in new() 35 INPUT_MANAGER = Some(Arc::new(input_manager)); in new()
|
/StarryEngine/starry_server/src/ |
H A D | main.rs | 11 let mut displays: Vec<Display> = Vec::new(); in main() 12 displays.push(Display::new( in main() 20 let config: Arc<Config> = Arc::new(Config::default()); in main() 23 StarryServer::new(config, displays); in main()
|
/StarryEngine/starry_toolkit/src/ |
H A D | main.rs | 13 let panel = Panel::new( in main() 14 Rect::new(0, 0, SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32), in main() 27 let grid = Grid::new(); in main()
|
/StarryEngine/starry_client/src/base/ |
H A D | renderer.rs | 201 let new = image_data[i].data; in image_fast() localVariable 202 let alpha = (new >> 24) & 0xFF; in image_fast() 206 *old = new; in image_fast() 210 + (alpha * (new & 0x00FF00FF))) in image_fast() 213 + (alpha * (0x01000000 | ((new & 0x0000FF00) >> 8))); in image_fast()
|
H A D | graphicspath.rs | 19 pub fn new() -> GraphicsPath { in new() method 23 points: Vec::new(), in new()
|
H A D | event.rs | 36 pub fn new() -> Event { in new() method 129 pub fn new(byte: u8) -> Self { in new() method
|
/StarryEngine/starry_client/src/ |
H A D | window.rs | 96 pub fn new(x: i32, y: i32, w: u32, h: u32, title: &str, color: Color) -> Self { in new() method 105 mode: Cell::new(RenderMode::Blend), in new()
|