Skip to content

Commit

Permalink
added tui and deps to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Redhawk18 committed Sep 20, 2023
1 parent e8e6df0 commit 11e6687
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
name = "blaze"
version = "0.1.0"
edition = "2021"
description = "Hybrid integrated development environment"
description = "Hybrid UI integrated development environment"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
blaze-core = { path = "core" }
blaze-gui = { path = "gui" }
blaze-tui = { path = "tui" }
clap = { version = "4.4.4", features = ["cargo"] }
log = "0.4.20"
pretty_env_logger = "0.5.0"
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
[![Builds](https://img.shields.io/github/actions/workflow/status/Redhawk18/code-editor/build.yml)](https:/Redhawk18/code-editor/actions/workflows/build.yml)
[![License](https://img.shields.io/github/license/Redhawk18/code-editor)](https:/Redhawk18/code-editor/blob/main/LICENSE)

The programmable hybrid GUI and TUI plugin based IDE.
Hybrid UI integrated development environment

</div>
<a href="https:/iced-rs/iced">
<img src="https://gist.githubusercontent.com/hecrj/ad7ecd38f6e47ff3688a38c79fd108f0/raw/74384875ecbad02ae2a926425e9bcafd0695bade/color.svg" width="130px">
</a>

## Installation
Proper Windows and MacOs installs have not been made, nor for Linux.
No package has been created, at this time, packaging is massively helpful to the project.

Currently to install

Expand All @@ -28,23 +28,16 @@ Currently to install
3. Add given path to your `$PATH`

## Building
Blaze is hardware accelerated, so have the proper drivers installed. Rustup is used, and because of that you will need a c linker.

### Known System Dependencies
Arch Linux
```
sudo pacman -S atkmm cmake fontconfig gcc gdk-3.0 make pkg-config rustup
```

Debian
```
sudo apt install build-essential cmake libgtk-3-dev pkg-config
```

OpenSuse
```
sudo zypper install atkmm-devel gdk-pixbuf-devel gdk-pixbuf-xlib-devel glib2-devel gtk3-devel harfbuzz-devel pkg-config rustup
```
If youre operating system needs additional packages please create a pull request with them listed. Please raise a issue if the list is wrong or outdated or has unneeded dependencies.
<details>
<summary>OpenSuse</summary>

```
sudo zypper install atkmm-devel gdk-pixbuf-devel gdk-pixbuf-xlib-devel glib2-devel gtk3-devel harfbuzz-devel ncurses5-devel pkg-config rustup
```
</details>

1. Clone the repository

Expand Down
6 changes: 4 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ To add some order to this project these objectives need to be completed.

[ x ] gui theme

### Panel grid
Using the panel grid like the halloy project will give the program a more module feeling, with how windows within the program can be managed and moved.
[ x ] pane grid

### Tui
Being a hybrid editor this has to come soon. But after I finish the gui for the program to have one frontend finished at least.

### Explore: system shell in gui
A shell widget within iced seems the most simple out of the first few widgets and it is very helpful to users.
13 changes: 12 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use blaze_gui::start_gui;
use blaze_tui::start_tui;
use clap::{crate_authors, crate_description, crate_name, crate_version, Command};

pub fn create_command() {
pub fn cli() {
let matches = Command::new(crate_name!())
.about(crate_description!())
.author(crate_authors!())
Expand All @@ -11,6 +12,12 @@ pub fn create_command() {
.long_flag("gui")
.short_flag('g'),
)
.subcommand(
Command::new("tui")
.about("Start the tui frontend")
.long_flag("tui")
.short_flag('t'),
)
.subcommand_required(true)
.version(crate_version!())
.get_matches();
Expand All @@ -19,6 +26,10 @@ pub fn create_command() {
Some(("gui", _)) => {
let _ = start_gui();
}

Some(("tui", _)) => {
start_tui();
}
_ => unreachable!(), // If all subcommands are defined above, anything else is unreachable
}
}
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//use blaze_gui::start_gui;

mod cli;
use cli::cli;

fn main() {
pretty_env_logger::init();

cli::create_command();
cli();
}
11 changes: 11 additions & 0 deletions tui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "blaze-tui"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
blaze-core = { path = "../core" }
cursive = "0.20.0"
log = "0.4.20"
23 changes: 23 additions & 0 deletions tui/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use cursive::{Cursive, views::TextView};

pub(crate) struct Blaze {}

pub fn start_tui() {
tui()
}

fn tui () {
let mut siv = cursive::default();

// We can quit by pressing `q`
siv.add_global_callback('q', Cursive::quit);

// Add a simple view
siv.add_layer(TextView::new(
"Hello World!\n\
Press q to quit the application.",
));

// Run the event loop
siv.run();
}

0 comments on commit 11e6687

Please sign in to comment.