Skip to content

Commit

Permalink
add workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem V. Ageev committed Mar 31, 2024
1 parent c4d37c3 commit 070f864
Show file tree
Hide file tree
Showing 110 changed files with 1,542 additions and 182 deletions.
46 changes: 46 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[workspace]

members = [
"cairo-demo",
"cairo_shadow_button",
"calendar",
"egui-demo",
"ffmpeg",
"flcalculator",
"flcsv",
"fldialect",
"flfemtovg",
"flglium",
"flglow",
"flimage",
"fllibmpv",
"flpixels",
"flplotters",
"flraqote",
"flspeedy2d",
"flresters",
"fltext",
"flwgpu",
"framebuffer",
"glut",
"glyphmap",
"gst",
"libvlc",
"mpv",
"musicplayer",
"opengl",
"rounded-svg",
"systray",
"terminal",
"tinyskia",
"web-todo",
"web-todo2",
"webview",
"xterm",
]

[profile.release]
strip = true
opt-level = "z"
lto = true
panic = "abort"
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,37 @@ This repository is licensed under the MIT license. You can get more information
---

The current demos include:
- <a href="#web-todo">🌐 web-todo: </a>Creating an async web todo app using fltk, reqwest, serde and tokio.
- <a href="#web-todo2">🌐 web-todo2: </a>Creating an async web todo app using fltk, surf, serde and async-std.
- <a href="#libvlc">📺 libvlc: </a>Creating a media player using fltk and the vlc crate.
- <a href="#musicplayer">🎶 musicplayer: </a>Creating a music player using custom widgets and the soloud crate.
- <a href="#opengl">🎨 opengl: </a>Raw OpenGL drawing in an fltk GlWindow.
- <a href="#glut">🖌️ glut: </a>Use the gl crate (An OpenGL function pointer loader) to do OpenGL drawing.
- <a href="#wgpu">🖊️ wgpu: </a>Use wgpu-rs for gpu accelerated drawing.
- <a href="#pixels">🎞️ pixels: </a>Use the pixels crate to draw a wgpu accelerated framebuffer.
- <a href="#framebuffer">✒️ framebuffer: </a>Using fltk for framebuffer drawing.
- <a href="#plotters">🌌 plotters: </a>Use plotters for live plotting (drawing animations) with fltk.
- <a href="#raqote">🌈 raqote: </a>Use raqote for custom drawing (paint example).
- <a href="#tinyskia">🖼️ tinyskia: </a>Use tiny-skia for custom drawing.
- <a href="#systray">🖥️ systray: </a>Use nwg to create an fltk app with systray functionalities on Windows
- <a href="#glow">✨ glow: </a>Use the glow crate to do OpengGL drawing.
- <a href="#glium">🎇 glium: </a>Use the glium crate for OpenGL drawing.
- <a href="#calendar">🗓️ calendar: </a>Uses the chrono crate to create an fltk calendar dialog.
- <a href="#image">🏞️ image: </a>Uses rust-embed and the image crates to load images into fltk.
- <a href="#speedy2d">🌚 speedy2d: </a>Uses speedy2D crate to do 2D drawings of a circle and an RGB image in a GlWindow.
- <a href="#femtovg">🪐 femtovg: </a>Uses femtovg for 2D drawing in a GlWindow.
- <a href="#ffmpeg">📽️ ffmpeg: </a>Uses ffmpeg for software video rendering.
- <a href="#webview">💻 webview: </a>Embeds a webview inside an fltk app.
- <a href="#csv">🖍️ csv: </a>Uses serde and csv to perform custom drawing of data.
- <a href="#rounded-svg">🔘 rounded-svg: </a>Use the svg crate along with fltk to create images with rounded borders.
- <a href="#libmpv">🔦 libmpv: </a>use libmpv to play a video inside an fltk GlWindow.
- <a href="#mpv"> 🧥 mpv: </a>mpv: Use mpv (the command line app) to play a video inside an fltk window.
- <a href="#xterm">📲 xterm: </a>embed an xterm window inside an fltk window.
- <a href="#egui-demo">🎛️ egui-demo: </a>Use fltk as a backend for egui
- <a href="#gst">🎞️ gst: </a>Use libgstreamer to play a video inside an fltk window
- <a href="#cairo-demo">🏜️ cairo-demo: </a>Use cairo for custom drawing inside fltk widgets
- <a href="#glyphmap">📍 glyphmap: </a>Maps glyphs (specifically font icons) to their unicode codepoint.
* [🌐  web-todo:]("#web-todo") Creating an async web todo app using fltk, reqwest, serde and tokio.
* [🌐  web-todo2:](#web-todo2) Creating an async web todo app using fltk, surf, serde and async-std.
* [📺  libvlc:](#libvlc)" Creating a media player using fltk and the vlc crate.
* [🎶 musicplayer:](#musicplayer) Creating a music player using custom widgets and the soloud crate.
* [🎨  opengl:](#opengl) Raw OpenGL drawing in an fltk GlWindow.
* [🖌️  glut:](#glut) Use the gl crate (An OpenGL function pointer loader) to do OpenGL drawing.
* [🖊️ flwgpu:](#flwgpu) Use wgpu-rs for gpu accelerated drawing.
* [🎞️ flpixels:](#flpixels) Use the pixels crate to draw a wgpu accelerated framebuffer.
* [✒️ framebuffer:](#framebuffer) Using fltk for framebuffer drawing.
* [🌌 flplotters:](#flplotters) Use plotters for live plotting (drawing animations) with fltk.
* [🌈  flraqote:](#flraqote) Use raqote for custom drawing (paint example).
* [🖼️  tinyskia:](#tinyskia) Use tiny-skia for custom drawing.
* [🖥️ systray:](#systray) Use nwg to create an fltk app with systray functionalities on Windows
* [✨ fl glow:](#flglow) Use the glow crate to do OpengGL drawing.
* [🎇 flglium:](#flglium) Use the glium crate for OpenGL drawing.
* [🗓️  calendar:](#calendar) Uses the chrono crate to create an fltk calendar dialog.
* [🏞️ flimage:](#flimage) Uses rust-embed and the image crates to load images into fltk.
* [🌚 flspeedy2d:](#flspeedy2d) Uses speedy2D crate to do 2D drawings of a circle and an RGB image in a GlWindow.
* [🪐 flfemtovg:](#flfemtovg) Uses femtovg for 2D drawing in a GlWindow.
* [📽️ ffmpeg:](#ffmpeg) Uses ffmpeg for software video rendering.
* [💻 webview:](#webview) Embeds a webview inside an fltk app.
* [🖍️  flcsv:](#flcsv) Uses serde and csv to perform custom drawing of data.
* [🔘 rounded-svg:](#rounded-svg) Use the svg crate along with fltk to create images with rounded borders.
* [🔦  fllibmpv:](#libmpv) use libmpv to play a video inside an fltk GlWindow.
* [ 🧥  mpv:](#mpv) Use mpv (the command line app) to play a video inside an fltk window.
* [📲 xterm:](#xterm) embed an xterm window inside an fltk window.
* [🎛️ egui-demo:](#egui-demo) Use fltk as a backend for egui
* [🎞️ gst:](#gst) Use libgstreamer to play a video inside an fltk window
* [🏜️ cairo-demo:](#cairo-demo) Use cairo for custom drawing inside fltk widgets
* [📍 glyphmap:](#glyphmap) Maps glyphs (specifically font icons) to their unicode codepoint.
- <a href="#terminal">📟 terminal: </a>A minimal terminal emulator.
</div>

---

Expand Down Expand Up @@ -195,4 +194,4 @@ The current demos include:

![cairo](cairo_shadow_button/ex1.jpg)

</div>
</div>
2 changes: 1 addition & 1 deletion cairo-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fltk = { version = "1.4.9", features = ["cairoext"] }
fltk = { version = "^1.4", features = ["cairoext"] }
cairo-rs = "0.18"
4 changes: 2 additions & 2 deletions cairo_shadow_button/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2021"

[dependencies]
fltk = "1.4"
fltk = "^1.4"
cairo-rs = "0.18"
cairo-blur = "0.1.0"
cairo-blur = "0.1.0"
4 changes: 2 additions & 2 deletions calendar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fltk = "1"
chrono = "0.4"
fltk = "^1.4"
chrono = "0.4"
9 changes: 3 additions & 6 deletions calendar/src/calendar.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use chrono::DateTime;
use chrono::Datelike;
use chrono::Local;
use chrono::NaiveDate;
use chrono::{DateTime, Datelike, Local, NaiveDate};
use fltk::{app, draw, enums::*, menu, prelude::*, table, window};
use std::{cell::RefCell, rc::Rc};

Expand Down Expand Up @@ -93,14 +90,14 @@ impl Calendar {
_ => (),
});

let curr_rc = curr.clone();
let curr_rc = curr;
// redraw table when the month changes
month_choice.set_callback(move |c| {
*curr_rc.borrow_mut() = c.value() + 1;
c.parent().unwrap().redraw();
});

let curr_year_rc = curr_year.clone();
let curr_year_rc = curr_year;
// redraw table when the year changes
year_choice.set_callback(move |c| {
*curr_year_rc.borrow_mut() = c.value() + 1900;
Expand Down
7 changes: 3 additions & 4 deletions egui-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use egui_backend::{
gl, DpiScaling,
};
use fltk_egui as egui_backend;
use std::rc::Rc;
use std::{cell::RefCell, time::Instant};
use std::{cell::RefCell, rc::Rc, time::Instant};

const SCREEN_WIDTH: u32 = 800;
const SCREEN_HEIGHT: u32 = 600;
Expand All @@ -31,7 +30,7 @@ fn main() {
slider.set_slider_size(0.20);
slider.set_color(Color::Blue.inactive());
slider.set_selection_color(Color::Red);
col.set_size(&mut slider, 20);
col.fixed(&slider, 20);
col.end();
main_win.end();
main_win.make_resizable(true);
Expand Down Expand Up @@ -111,7 +110,7 @@ fn main() {
let paint_jobs = egui_ctx.tessellate(paint_cmds);

//Draw egui texture
painter.paint_jobs(None, paint_jobs, &egui_ctx.texture());
painter.paint_jobs(None, paint_jobs, &egui_ctx.font_image());

glut_win.swap_buffers();
glut_win.flush();
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fltk = "1"
fltk = "^1.4"
signal-hook = "0.3"
lazy_static = "1.4"
6 changes: 3 additions & 3 deletions csv/Cargo.toml → flcsv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "csv"
name = "flcsv"
version = "0.1.0"
authors = ["MoAlyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = "1"
fltk = "^1.4"
csv = "1.1.6"
serde = { version = "1", features = ["derive"] }
lazy_static = "1.4"
image = { version = "0.24.5", default-features = false, features = ["jpeg"] }
image = { version = "0.24.5", default-features = false, features = ["jpeg"] }
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added flcsv/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions csv/src/main.rs → flcsv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ extern crate lazy_static;

#[derive(Debug, Deserialize)]
pub struct Price {
#[serde(rename = "Date")]
date: String,
#[serde(rename = "Open")]
open: f64,
#[serde(rename = "High")]
Expand All @@ -18,8 +16,6 @@ pub struct Price {
low: f64,
#[serde(rename = "Close")]
close: f64,
#[serde(rename = "Volume")]
volume: usize,
}

lazy_static! {
Expand Down Expand Up @@ -50,7 +46,7 @@ fn main() {
for file in files {
let entry = file.unwrap().file_name().into_string().unwrap();
if entry.ends_with(".csv") {
browser.add(&entry.strip_suffix(".csv").unwrap());
browser.add(entry.strip_suffix(".csv").unwrap());
}
}

Expand All @@ -65,7 +61,7 @@ fn main() {
.collect::<Vec<f64>>()
.iter()
.cloned()
.fold(0. / 0., f64::max);
.fold(f64::NAN, f64::max);
highest += (highest.to_string().len() * 10) as f64 / 3.;
let factor = f.h() as f64 / highest;
if data.len() != 0 {
Expand Down
4 changes: 2 additions & 2 deletions femtovg/Cargo.toml → flfemtovg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "femtovg"
name = "flfemtovg"
version = "0.1.0"
authors = ["Mohammed Alyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = { version = "1", features = ["enable-glwindow"] }
fltk = { version = "^1.4", features = ["enable-glwindow"] }
femtovg = "0.1.1"
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
4 changes: 2 additions & 2 deletions glium/Cargo.toml → flglium/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "glium"
name = "flglium"
version = "0.1.0"
authors = ["Mohammed Alyousef <[email protected]>"]
edition = "2021"
Expand All @@ -8,4 +8,4 @@ edition = "2021"

[dependencies]
glium = { version = "0.29", default-features = false } # no need for glutin
fltk = { version = "1", features = ["enable-glwindow"] }
fltk = { version = "^1.4", features = ["enable-glwindow"] }
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
6 changes: 3 additions & 3 deletions glow/Cargo.toml → flglow/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "glow"
name = "flglow"
version = "0.1.0"
authors = ["MoAlyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = { version = "1", features = ["enable-glwindow"] }
glow = "0.7"
fltk = { version = "^1.4", features = ["enable-glwindow"] }
glow = "^0.13"
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
4 changes: 2 additions & 2 deletions image/Cargo.toml → flimage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "image"
name = "flimage"
version = "0.1.0"
authors = ["MoAlyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = "1"
fltk = "^1.4"
image = "0.24"
rust-embed = "6.6.1"
File renamed without changes.
File renamed without changes
File renamed without changes.
4 changes: 2 additions & 2 deletions libmpv/Cargo.toml → fllibmpv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "libmpv"
name = "fllibmpv"
version = "0.1.0"
authors = ["Mohammed Alyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = {version = "1.1", features=["enable-glwindow", "no-pango"]}
fltk = {version = "^1.4", features=["enable-glwindow", "no-pango"]}
libmpv = { git = "https://github.com/anlumo/libmpv-rs" }
File renamed without changes.
2 changes: 1 addition & 1 deletion libmpv/src/main.rs → fllibmpv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() {
w.swap_buffers();
});

app::add_idle(move || {
app::add_idle3(move |_| {
mpv_win.redraw();
});

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions pixels/Cargo.toml → flpixels/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pixels"
name = "flpixels"
version = "0.1.0"
authors = ["Mohammed Alyousef <[email protected]>"]
edition = "2021"
Expand All @@ -8,5 +8,5 @@ resolver = "2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fltk = { version = "^1", features = ["raw-window-handle"] }
pixels = "0.9.0"
fltk = { version = "^1.4", features = ["raw-window-handle"] }
pixels = "^0.13"
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
4 changes: 2 additions & 2 deletions plotters/Cargo.toml → flplotters/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "plotters"
name = "flplotters"
version = "0.1.0"
authors = ["Mohammed Alyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = "1"
fltk = "^1.4"
plotters = "0.3.0"
plotters-bitmap = "0.3.0"
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
6 changes: 3 additions & 3 deletions raqote/Cargo.toml → flraqote/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "raqote"
name = "flraqote"
version = "0.1.0"
authors = ["Mohammed Alyousef <[email protected]>"]
edition = "2021"

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

[dependencies]
fltk = "1"
raqote = "0.8"
fltk = "^1.4"
raqote = "0.8"
File renamed without changes.
File renamed without changes
File renamed without changes
Loading

0 comments on commit 070f864

Please sign in to comment.