Commit 61d99dbd authored by Florian Blasius's avatar Florian Blasius 🤘

[commit fix] pushed to wrong branch. reset manuel.

parent c0708608
Pipeline #2491 failed with stages
in 5 minutes and 22 seconds
......@@ -94,9 +94,6 @@ impl Widget for MainView {
}
fn main() {
let mut application = Application::default();
application
.create_window()
......
......@@ -8,7 +8,7 @@ use dces::{Entity, World};
use crate::{
application::{Application, Tree},
core::{target_backend, BackendRunner},
backend::{target_backend, BackendRunner},
event::EventHandler,
layout::{Layout, RootLayout},
properties::{Bounds, Point},
......
......@@ -97,8 +97,5 @@ pub trait FontMeasure {
pub use self::target::target_backend;
pub use self::target::FONT_MEASURE;
pub use self::render_context_2d::*;
#[path = "orbital/mod.rs"]
mod target;
mod render_context_2d;
......@@ -6,7 +6,7 @@ use orbclient::{self, Color, Mode, Renderer as OrbRenderer, Window as OrbWindow}
use dces::World;
use crate::application::Tree;
use crate::core::{Backend, BackendRunner, EventContext, LayoutContext, RenderContext, StateContext};
use crate::backend::{Backend, BackendRunner, EventContext, LayoutContext, RenderContext, StateContext};
use crate::event::{
EventQueue, Key, KeyDownEvent, KeyUpEvent, MouseButton, MouseDownEvent, MouseUpEvent,
SystemEvent,
......
......@@ -7,13 +7,13 @@ use std::sync::Arc;
use orbclient::Window as OrbWindow;
use self::backend::{OrbitalBackend, OrbitalBackendRunner};
use self::render_context_2d::FONT_RENDERER;
use crate::core::{Backend, FontMeasure};
use self::renderer::FONT_RENDERER;
use crate::backend::{Backend, FontMeasure};
use crate::properties::Bounds;
use crate::theme::Theme;
mod backend;
mod render_context_2d;
mod renderer;
pub fn target_backend(
title: &str,
......
This diff is collapsed.
use super::Instruction;
pub use self::rectangle::Rectangle;
mod rectangle;
pub trait Shape2D {
fn instructions(&self) -> &[Instruction];
}
\ No newline at end of file
use crate::{Instruction, FillRule, Shape2D};
pub struct Rectangle {
instructions: Vec<Instruction>,
// todo: option instruction without border /
}
impl Rectangle {
pub fn new() -> Self {
Rectangle {
instructions: vec![
Instruction::SetFillStyleColor(String::from("")),
Instruction::BeginPath(),
Instruction::ArcTo(0.0, 0.0),
Instruction::ArcTo(0.0, 0.0),
Instruction::ArcTo(0.0, 0.0),
Instruction::ArcTo(0.0, 0.0),
Instruction::ClosePath(),
Instruction::Fill(FillRule::default()),
],
}
}
pub fn set_size(&mut self, width: f64, height: f64) {
self.instructions[2] = Instruction::ArcTo(0.0, 0.0);
}
}
impl Shape2D for Rectangle {
fn instructions(&self) -> &[Instruction] {
&self.instructions
}
}
\ No newline at end of file
#[derive(Default, Copy, Clone, PartialEq, Debug)]
pub struct Gradient {
}
// impl Default for Gradient {
// fn default() -> Self {
// Gradient {
// color_stops: BTreeMap::new()
// }
// }
// }
// impl Gradient {
// pub fn new() -> Self {
// Gradient::default()
// }
// pub fn add_color_stop(&mut self)
// }
pub enum Brush {
SolidColor(String),
// Gradient([i32])
}
\ No newline at end of file
pub struct TextMetrics {
pub width: f64
}
impl TextMetrics {
pub fn get_width(&self) -> f64 {
self.width
}
}
\ No newline at end of file
#[derive(Clone, PartialEq, Debug)]
pub struct ImageElement {
pub path: String
}
\ No newline at end of file
pub use self::brush::Gradient;
pub use self::font::TextMetrics;
pub use self::image_element::ImageElement;
mod brush;
mod font;
mod image_element;
\ No newline at end of file
use dces::{Entity, EntityComponentManager};
use crate::{
core::{FontMeasure, FONT_MEASURE},
backend::{FontMeasure, FONT_MEASURE},
layout::Layout,
properties::{Constraint, FontIcon, PrimaryFontIcon, SecondaryFontIcon},
theme::{Selector, Theme},
......
use dces::{Entity, EntityComponentManager};
use crate::{
core::{FontMeasure, FONT_MEASURE},
backend::{FontMeasure, FONT_MEASURE},
layout::Layout,
properties::{Bounds, Constraint, Label, Offset, TextSelection},
theme::{Selector, Theme},
......
use dces::{Entity, EntityComponentManager};
use crate::{
core::{FontMeasure, FONT_MEASURE},
backend::{FontMeasure, FONT_MEASURE},
layout::Layout,
properties::{Constraint, Label},
theme::{Selector, Theme},
......
......@@ -7,7 +7,7 @@ pub use dces::prelude::*;
extern crate lazy_static;
pub use crate::application::*;
pub use crate::core::*;
pub use crate::backend::*;
pub use crate::enums::*;
pub use crate::event::*;
pub use crate::layout::*;
......@@ -18,7 +18,7 @@ pub use crate::theme::{Selector, Theme, DEFAULT_THEME_CSS, LIGHT_THEME_CSS};
pub use crate::widget::*;
pub mod application;
pub mod core;
pub mod backend;
pub mod enums;
pub mod event;
pub mod layout;
......
use crate::{
core::Renderer,
backend::Renderer,
properties::{Bounds, FontIcon, Point, PrimaryFontIcon, SecondaryFontIcon},
render_object::RenderObject,
theme::Selector,
......
use orbclient::Renderer as OrbRenderer;
use crate::{
core::Renderer,
backend::Renderer,
properties::{Bounds, Canvas, Image, Point},
render_object::RenderObject,
widget::Context,
......
//! This module contains all render objects used in OrbTk. Render objects are used to define how to draw parts of a widget.
use std::collections::BTreeMap;
use crate::core::Renderer;
use crate::properties::Point;
use crate::backend::Renderer;
use crate::widget::Context;
use crate::properties::Point;
pub use self::font_icon::FontIconRenderObject;
pub use self::image::ImageRenderObject;
......@@ -16,76 +14,6 @@ mod image;
mod rectangle;
mod text;
use crate::core::{FillRule, Instruction};
// todos
//
// Step One Render Object refactoring
//
// *[*] Rename backend to core
// *[*] Add render context sub module to core (enums, traits, basis struct)
// *[*] Move Render Context related stuff to render context module
// *[ ] Move render shapes to folders
// *[ ] Implement render shapes: Rectangle, Text, Image, Canvas
// *[ ] Canvas widgets needs something like instruction builder for the user
// *[ ] Think about how to implement shadows
// *[ ] Adjust Template to work with new render objects e.g. .with_render_shape(RectangleBuilder::new())
// *[ ] Store render shapes in ecs
// *[ ] Implement RenderContext for OrbClient
// *[ ] Cache images
// *[ ] Remove old Renderer trait
// *[ ] Adjust Render system to work with render context trait
// *[ ] Write tests for e.g. render shapes
// *[ ] Test everthing
// *[ ] MR
//
// Step Two Expand Window
//
// *[ ] is_resizable
// *[ ] min_size
// *[ ] max_size
// *[ ] fix position on windows
// *[ ] Eventuelly refactor backend struct
// *[ ] Test everything
// *[ ] MR
//
// Step Three Web backend
//
// *[ ] implement web backend
// *[ ] Test everything
// *[ ] MR
//
// Step Four switch to OrbGL for OrbClient backend
//
// *[ ] convert more drawing functions to OrbGl in OrbClient backend
// *[ ] Test everything
// *[ ] MR
//
// Optional
//
// *[ ] Switch to winit for default client
pub struct Text {
instructions: Vec<Instruction>,
}
pub struct Rectangle {
instructions: Vec<Instruction>,
// todo: option instruction without border /
}
// pub trait Shape2DBuilder {
// fn build(&self) -> Box<Shape2D>;
// }
pub struct RectangleBuilder {}
// zoom, rotate, ...
pub struct CCanvas {}
pub trait RenderObject {
fn render(
&self,
......
use crate::{
core::Renderer,
backend::Renderer,
properties::{Bounds, Point},
render_object::RenderObject,
theme::Selector,
......
use crate::{
core::Renderer,
backend::Renderer,
properties::{Bounds, Label, Point, WaterMark},
render_object::RenderObject,
theme::Selector,
......
......@@ -9,7 +9,7 @@ use dces::{Entity, EntityComponentManager, System};
use crate::{
application::Tree,
core::Backend,
backend::Backend,
event::{
check_mouse_condition, ClickEvent, EventBox, EventHandler, EventStrategy, MouseDownEvent,
MouseUpEvent,
......
......@@ -8,7 +8,7 @@ use dces::{Entity, EntityComponentManager, System};
use crate::{
application::Tree,
core::Backend,
backend::Backend,
enums::Visibility,
layout::Layout,
properties::{Bounds, Constraint},
......
......@@ -8,7 +8,7 @@ use dces::{Entity, EntityComponentManager, System};
use crate::{
application::Tree,
core::Backend,
backend::Backend,
enums::Visibility,
properties::{Bounds, Point},
render_object::RenderObject,
......
......@@ -8,7 +8,7 @@ use dces::{Entity, EntityComponentManager, System};
use crate::{
application::{Global, Tree},
core::Backend,
backend::Backend,
properties::{Enabled, Focused, Pressed, Selected},
theme::Selector,
widget::{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment