Commit 4f7522b5 authored by Florian Blasius's avatar Florian Blasius 🤘

Moved api stuff to api crate.

parent 5b9dd9b4
......@@ -470,6 +470,7 @@ dependencies = [
"dces 0.1.7 (git+https://gitlab.redox-os.org/redox-os/dces-rust.git)",
"orbclient 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"orbgl_api 0.1.0 (git+https://gitlab.redox-os.org/redox-os/orbgl.git)",
"orbtk-api 0.1.0",
"orbtk-css-engine 0.1.0",
"orbtk-shell 0.1.0",
"orbtk-theme 0.1.0",
......@@ -477,6 +478,19 @@ dependencies = [
"orbtk-utils 0.1.0",
]
[[package]]
name = "orbtk-api"
version = "0.1.0"
dependencies = [
"dces 0.1.7 (git+https://gitlab.redox-os.org/redox-os/dces-rust.git)",
"orbclient 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"orbgl_api 0.1.0 (git+https://gitlab.redox-os.org/redox-os/orbgl.git)",
"orbtk-css-engine 0.1.0",
"orbtk-shell 0.1.0",
"orbtk-tree 0.1.0",
"orbtk-utils 0.1.0",
]
[[package]]
name = "orbtk-css-engine"
version = "0.1.0"
......
......@@ -25,6 +25,7 @@ path = "src/lib.rs"
orbclient = "0.3.22"
[dependencies]
orbtk-api = { version = "0.1.0", path = "crates/api" }
orbtk-css-engine = { version = "0.1.0", path = "crates/css-engine" }
orbtk-shell = { version = "0.1.0", path = "crates/shell" }
orbtk-theme = { version = "0.1.0", path="crates/theme" }
......
[package]
name = "orbtk-api"
version = "0.1.0"
authors = ["Florian Blasius <flovanpt@posteo.de>"]
description = "API crate that provides base api and elements for OrbTk like widgets basis."
repository = "https://gitlab.redox-os.org/redox-os/orbtk"
license = "MIT"
keywords = ["ui", "api"]
edition = "2018"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
orbclient = "0.3.22"
[dependencies]
dces = { git = "https://gitlab.redox-os.org/redox-os/dces-rust.git" }
orbgl_api = { git = "https://gitlab.redox-os.org/redox-os/orbgl.git" }
orbtk-css-engine = { version = "0.1.0", path = "../css-engine" }
orbtk-shell = { version = "0.1.0", path = "../shell" }
orbtk-utils = { version = "0.1.0", path = "../utils" }
orbtk-tree = { version = "0.1.0", path= "../tree" }
\ No newline at end of file
......@@ -2,7 +2,7 @@ use std::collections::HashMap;
use dces::prelude::Entity;
use crate::prelude::*;
use crate::{shell::Key, prelude::*};
#[derive(Default)]
/// The `Global` struct is used to define global `properties` that could be access application width.
......@@ -21,7 +21,7 @@ pub struct Global {
#[derive(Default)]
/// Contains the state information for the keyboard.
///
/// This currently tracks whick keys are currently pressed.
/// This currently tracks which keys are currently pressed.
///
/// The key state is stored in a lazy-loaded HashMap.
///
......
......@@ -8,9 +8,7 @@ use std::{
use dces::prelude::{Entity, World};
use crate::prelude::*;
use crate::shell::{ShellRunner, WindowBuilder};
use crate::systems::*;
use crate::{shell::{ShellRunner, WindowBuilder}, tree::*, utils::*, prelude::*};
pub use self::global::*;
pub use self::window::*;
......
......@@ -2,8 +2,7 @@ use std::{cell::RefCell, collections::BTreeMap, rc::Rc};
use dces::prelude::{Entity, World};
use crate::prelude::*;
use crate::shell;
use crate::{utils::Point, shell, tree::Tree, prelude::*};
/// Represents a window. Each window has its own tree, event pipeline and shell.
#[derive(Default)]
......@@ -17,14 +16,6 @@ pub struct WindowAdapter {
pub root: Entity,
}
// todo: remove all render_objects etc. from system, handle all with window adapter
// todo: remove rc refcell..
// impl WindowAdapter {
// pub fn context_provider(&mut self) -> &mut ContextProvider {
// &mut self.context_provider
// }
// }
pub struct WorldWrapper {
pub world: World<Tree>,
}
......@@ -96,6 +87,3 @@ impl Into<Box<shell::WindowAdapter>> for WindowAdapter {
Box::new(self)
}
}
#[derive(Default, Debug)]
pub struct ContextProvider {}
......@@ -2,7 +2,7 @@ use std::any::{Any, TypeId};
use dces::prelude::Entity;
use crate::{Event, EventStrategy};
use super::{Event, EventStrategy};
#[derive(Debug)]
pub enum EventError {
......
use std::rc::Rc;
use crate::{Event, EventBox, EventHandler, shell::Key, Widget};
use crate::shell::Key;
use super::{Event, EventBox, EventHandler};
pub struct KeyDownEvent {
pub key: Key,
......
use std::rc::Rc;
use crate::{prelude::*, shell::MouseButton};
use crate::{utils::*, shell::MouseButton};
/// Checks if the given point is inside of a widget.
pub fn check_mouse_condition(mouse_position: Point, widget: &WidgetContainer<'_>) -> bool {
......
use crate::Event;
use crate::event::Event;
pub enum SystemEvent {
Quit,
......
use crate::Event;
use crate::event::Event;
pub enum WindowEvent {
Resize { width: f64, height: f64 },
......
......@@ -6,7 +6,7 @@ use std::{
use dces::prelude::{Entity, EntityComponentManager};
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*, tree::Tree};
use crate::shell::{FONT_MEASURE, FontMeasure};
use super::Layout;
......
......@@ -6,7 +6,7 @@ use std::{
use dces::prelude::{Entity, EntityComponentManager};
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*, tree::Tree};
use super::Layout;
......
......@@ -6,7 +6,7 @@ use std::{
use dces::prelude::{Entity, EntityComponentManager};
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*, tree::Tree};
use super::Layout;
......
......@@ -7,7 +7,7 @@ use std::{
use dces::prelude::{Entity, EntityComponentManager};
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*, tree::Tree};
use super::Layout;
......
......@@ -6,7 +6,7 @@ use std::{
use dces::prelude::{Entity, EntityComponentManager};
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*, tree::Tree};
use super::Layout;
......
......@@ -6,7 +6,7 @@ use std::{
use dces::prelude::{Entity, EntityComponentManager};
use crate::{prelude::*, shell::FontMeasure};
use crate::{prelude::*, utils::prelude::*, tree::Tree, shell::FontMeasure};
use super::Layout;
......
pub use dces::prelude::*;
pub use orbtk_css_engine::prelude as css_engine;
pub use orbtk_shell::prelude as shell;
pub use orbtk_utils::prelude as utils;
pub use orbtk_tree::prelude as tree;
pub mod application;
pub mod event;
pub mod layout;
pub mod properties;
pub mod render_object;
pub mod systems;
pub mod widget;
pub mod prelude;
#[macro_use]
pub mod macros;
pub use crate::{
application::*,
event::*,
layout::*,
properties::*,
render_object::*,
systems::*,
widget::*
};
\ No newline at end of file
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `Bounds` describes the actual bounds (position and size) of a widget.
......
use std::slice::{Iter, IterMut};
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
/// Used to build a column, specifying additional details.
#[derive(Default)]
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `ColumnSpan` describes the column span of a widget on the `Grid`.
......
use std::f64;
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
/// Used to build a constraint, specifying additional details.
#[derive(Default)]
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `GridColumn` describes the column position of a widget on the `Grid`.
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `GridRow` describes the row position of a widget on the `Grid`.
......
use crate::prelude::*;
use super::Margin;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `HorizontalAlignment` describes the vertical alignment of a widget.
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `Margin` describes the outer widget space.
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `Offset` describes the x- and y-axis offset of a widget.
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `Padding` describes the inner widget space.
......
use crate::prelude::*;
use crate::{prelude::*, utils::prelude::*};
property!(
/// `Pos` describes the position of an element.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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