Skip to content

Commit a34d8cd

Browse files
authored
Renames, directory structure, and README update (#22)
* Renames, directory reorg, and README update - vsvg-sketch -> whiskers - vsvg-multi -> msvg - all crates in crates/ - better readmes * Update README.md
1 parent 2e74e68 commit a34d8cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+130
-104
lines changed

Cargo.lock

+47-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
[workspace]
22

33
members = [
4-
"vsvg",
5-
"vsvg-cli",
6-
"vsvg-viewer",
7-
"vsvg-sketch",
8-
"vsvg-sketch-derive",
9-
"vsvg-multi",
10-
"whiskers-web-demo",
4+
"crates/*"
115
]
126

137
resolver = "2"

README.md

+14-23

vsvg-multi/Cargo.toml crates/msvg/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "vsvg-multi"
2+
name = "msvg"
33
version = "0.1.0"
44
edition = "2021"
55

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

vsvg-viewer/README.md crates/vsvg-viewer/README.md

+2-2
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

vsvg/README.md crates/vsvg/README.md

+8-1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

vsvg-sketch-derive/Cargo.toml crates/whiskers-derive/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "vsvg-sketch-derive"
2+
name = "whiskers-derive"
33
version = "0.1.0-alpha.0"
44
edition = "2021"
55

vsvg-sketch-derive/src/lib.rs crates/whiskers-derive/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn sketch_derive(input: TokenStream) -> TokenStream {
6262
let formatted_label = format_label(&label);
6363

6464
ui_func_tokens.extend(quote! {
65-
changed = <#field_type as ::vsvg_sketch::widgets::WidgetMapper<#field_type>>::Type::default()
65+
changed = <#field_type as ::whiskers::widgets::WidgetMapper<#field_type>>::Type::default()
6666
#chained_calls
6767
.ui(ui, #formatted_label, &mut self.#field_name).changed() || changed;
6868
ui.end_row();
@@ -75,14 +75,14 @@ pub fn sketch_derive(input: TokenStream) -> TokenStream {
7575
}
7676

7777
TokenStream::from(quote! {
78-
impl ::vsvg_sketch::SketchApp for #name {
78+
impl ::whiskers::SketchApp for #name {
7979
fn name(&self) -> String {
8080
stringify!(#name).to_string()
8181
}
8282
}
8383

84-
impl ::vsvg_sketch::SketchUI for #name {
85-
fn ui(&mut self, ui: &mut ::vsvg_sketch::prelude::egui::Ui) -> bool {
84+
impl ::whiskers::SketchUI for #name {
85+
fn ui(&mut self, ui: &mut ::whiskers::prelude::egui::Ui) -> bool {
8686
let mut changed = false;
8787
#ui_func_tokens
8888
changed
File renamed without changes.

whiskers-web-demo/Cargo.toml crates/whiskers-web-demo/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["cdylib", "rlib"]
88

99
[dependencies]
10-
vsvg-sketch = { path = "../vsvg-sketch", features = ["viewer"] }
10+
whiskers = { path = "../whiskers", features = ["viewer"] }

whiskers-web-demo/src/lib.rs crates/whiskers-web-demo/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Asteroid design kindly contributed by @[email protected] for my
22
//! [Rusteroïds](https://github.com/abey79/rusteroids) game.
33
4-
use vsvg_sketch::prelude::*;
4+
use whiskers::prelude::*;
55

66
#[derive(Sketch)]
77
pub struct WhiskersDemoSketch {
File renamed without changes.

vsvg-sketch/Cargo.toml crates/whiskers/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "vsvg-sketch"
2+
name = "whiskers"
33
version = "0.1.0-alpha.0"
44
edition = "2021"
55

66
[dependencies]
77
vsvg = { path = "../vsvg", features = ["geo"] }
88
vsvg-viewer = { path = "../vsvg-viewer", optional = true }
9-
vsvg-sketch-derive = { path = "../vsvg-sketch-derive" }
9+
whiskers-derive = { path = "../whiskers-derive" }
1010
log.workspace = true
1111
rand.workspace = true
1212
rand_chacha.workspace = true

vsvg-sketch/examples/app_demo.rs crates/whiskers/examples/app_demo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use vsvg_sketch::prelude::*;
1+
use whiskers::prelude::*;
22

33
#[derive(Sketch)]
44
struct MySketch {

vsvg-sketch/examples/asteroid.rs crates/whiskers/examples/asteroid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rand_distr::{Distribution, Normal};
1010

1111
use std::f64::consts::PI;
1212
use vsvg::Color;
13-
use vsvg_sketch::prelude::*;
13+
use whiskers::prelude::*;
1414

1515
#[derive(Sketch)]
1616
struct AsteroidSketch {

vsvg-sketch/examples/bezpath.rs crates/whiskers/examples/bezpath.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This example demonstrates how to build complex shapes by building [`kurbo::BezPath`] instances
44
//! manually.
55
6-
use vsvg_sketch::prelude::*;
6+
use whiskers::prelude::*;
77

88
#[derive(Sketch)]
99
struct BezpathSketch {

vsvg-sketch/examples/custom_ui.rs crates/whiskers/examples/custom_ui.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use egui::Ui;
2-
use vsvg_sketch::prelude::*;
2+
use whiskers::prelude::*;
33

44
/// Very custom data structure that is not supported by default
55
#[derive(Debug, Clone, Copy)]
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
use whiskers::prelude::*;
2+
3+
#[derive(Sketch)]
4+
struct HelloWorldSketch {
5+
width: f64,
6+
height: f64,
7+
}
8+
9+
impl Default for HelloWorldSketch {
10+
fn default() -> Self {
11+
Self {
12+
width: 400.0,
13+
height: 300.0,
14+
}
15+
}
16+
}
17+
18+
impl App for HelloWorldSketch {
19+
fn update(&mut self, sketch: &mut Sketch, _ctx: &mut Context) -> anyhow::Result<()> {
20+
sketch.color(Color::DARK_RED).stroke_width(3.0);
21+
22+
sketch
23+
.translate(sketch.width() / 2.0, sketch.height() / 2.0)
24+
.rect(0., 0., self.width, self.height);
25+
26+
Ok(())
27+
}
28+
}
29+
30+
fn main() -> Result {
31+
Runner::new(HelloWorldSketch::default())
32+
.with_page_size(PageSize::A5H)
33+
.run()
34+
}

vsvg-sketch/examples/basic.rs crates/whiskers/examples/sketch_only.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! This example demonstrates how to directly use [`Sketch`] without using the [`run`]/[`App`] API.
2-
use vsvg_sketch::prelude::*;
2+
use whiskers::prelude::*;
33

44
fn main() -> Result {
55
Sketch::new()
File renamed without changes.

vsvg-sketch/src/lib.rs crates/whiskers/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub trait SketchApp: App + SketchUI {
3434

3535
/// Declare the main entry point for wasm builds.
3636
///
37-
/// Note: this macro requires `use vsvg_sketch::prelude::*;` to be present in the module.
37+
/// Note: this macro requires `use whiskers::prelude::*;` to be present in the module.
3838
#[macro_export]
3939
macro_rules! wasm_sketch {
4040
($t: expr) => {
@@ -62,7 +62,7 @@ macro_rules! wasm_sketch {
6262
#[macro_export]
6363
macro_rules! wasm_main {
6464
($lib: ident) => {
65-
fn main() -> vsvg_sketch::prelude::anyhow::Result<()> {
65+
fn main() -> whiskers::prelude::anyhow::Result<()> {
6666
$lib::main_func()
6767
}
6868
};

0 commit comments

Comments
 (0)