Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update piet, cairo, gtk based deps, switch to new glib::clone macro syntax #1218

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
529 changes: 242 additions & 287 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ version = "0.11.0"
rnote-compose = { version = "0.11.0", path = "crates/rnote-compose" }
rnote-engine = { version = "0.11.0", path = "crates/rnote-engine" }

adw = { version = "0.6.0", package = "libadwaita", features = ["v1_5"] }
adw = { version = "0.7.0", package = "libadwaita", features = ["v1_5"] }
anyhow = "1.0"
approx = "0.5.1"
async-fs = "2.1"
base64 = "0.22.1"
cairo-rs = { version = "0.19.4", features = ["v1_18", "png", "svg", "pdf"] }
cairo-rs = { version = "0.20.1", features = ["v1_18", "png", "svg", "pdf"] }
chrono = "0.4.38"
clap = { version = "4.5", features = ["derive"] }
dialoguer = "0.11.0"
Expand All @@ -34,17 +34,17 @@ fs_extra = "1.3"
futures = "0.3.30"
geo = "0.28.0"
gettext-rs = { version = "0.7.1", features = ["gettext-system"] }
gio = "0.19.5"
glib = "0.19.7"
glib-build-tools = "0.19.0"
gtk4 = { version = "0.8.2", features = ["v4_12"] }
gio = "0.20.1"
glib = "0.20.3"
glib-build-tools = "0.20.0"
gtk4 = { version = "0.9.1", features = ["v4_14"] }
ijson = "0.1.3"
image = "0.25.2"
indicatif = "0.17.8"
ink-stroke-modeler-rs = { git = "https://github.com/flxzt/ink-stroke-modeler-rs", rev = "84d311e9b0d034dcd955a1f353d37f54b2bda70f" }
itertools = "0.13.0"
kurbo = "0.10.4"
librsvg = "2.58.2"
kurbo = "0.11.1"
librsvg = "2.59.0"
nalgebra = { version = "0.33.0", features = ["serde-serialize"] }
notify-debouncer-full = "0.3.1"
num-derive = "0.4.2"
Expand Down Expand Up @@ -84,12 +84,15 @@ usvg = "0.43.0"
winresource = "0.1.17"
xmlwriter = "0.1.0"
# Enabling feature > v20_9 causes linker errors on mingw
poppler-rs = { version = "0.23.0", features = ["v20_9"] }
poppler-rs = { version = "0.24.1", features = ["v20_9"] }

[patch.crates-io]
# once a new piet (current v0.6.2) is released with updated cairo and kurbo deps, this can be removed.
piet = { git = "https://github.com/linebender/piet", rev = "02eb5f0152e893626c43980bf37eeb0ccb1acb46" }
piet-cairo = { git = "https://github.com/linebender/piet", rev = "02eb5f0152e893626c43980bf37eeb0ccb1acb46" }
piet = { git = "https://github.com/flxzt/piet", rev = "17fd59f260db3c54029a8288178e32f9f1742be2" }
piet-cairo = { git = "https://github.com/flxzt/piet", rev = "17fd59f260db3c54029a8288178e32f9f1742be2" }
# the latest commit in rough depends on nightly-only features
roughr = { git = "https://github.com/orhanbalci/rough-rs", rev = "0701ce0b874061707ef726533b43e1806af8b666" }
rough_piet = { git = "https://github.com/orhanbalci/rough-rs", rev = "0701ce0b874061707ef726533b43e1806af8b666" }

[profile.dev]
debug = true
Expand Down
2 changes: 1 addition & 1 deletion crates/rnote-compose/src/shapes/ellipse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl Ellipse {
let mut lines = Vec::new();
let mut prev = kurbo::Point::new(0.0, 0.0);

self.outline_path().flatten(0.25, |el| match el {
kurbo::flatten(self.outline_path(), 0.25, |el| match el {
kurbo::PathEl::MoveTo(point) => prev = point,
kurbo::PathEl::LineTo(next) => {
lines.push(Line {
Expand Down
30 changes: 19 additions & 11 deletions crates/rnote-ui/src/app/appactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,28 @@ impl RnApp {
.build();

// Quit App
action_quit.connect_activate(clone!(@weak self as app => move |_, _| {
// Request closing all windows. They then get the chance to display a save dialog on unsaved changes
for appwindow in app.windows() {
appwindow.close();
}
action_quit.connect_activate(clone!(
#[weak(rename_to = app)]
self,
move |_, _| {
// Request closing all windows. They then get the chance to display a save dialog on unsaved changes
for appwindow in app.windows() {
appwindow.close();
}

if app.windows().is_empty() {
app.quit();
if app.windows().is_empty() {
app.quit();
}
}
}));
));

action_new_window.connect_activate(clone!(@weak self as app => move |_, _| {
app.new_appwindow_init_show();
}));
action_new_window.connect_activate(clone!(
#[weak(rename_to = app)]
self,
move |_, _| {
app.new_appwindow_init_show();
}
));
}

// Accelerators / Keyboard Shortcuts
Expand Down
20 changes: 14 additions & 6 deletions crates/rnote-ui/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ mod imp {
.map(|w| w.downcast::<RnAppWindow>().unwrap())
{
if let Some(input_file) = input_file {
glib::spawn_future_local(clone!(@weak appwindow => async move {
appwindow.open_file_w_dialogs(input_file, None, true).await;
}));
glib::spawn_future_local(clone!(
#[weak]
appwindow,
async move {
appwindow.open_file_w_dialogs(input_file, None, true).await;
}
));
}
} else {
self.new_appwindow_init_show(input_file);
Expand Down Expand Up @@ -133,9 +137,13 @@ mod imp {

// Loading in input file in the first tab, if Some
if let Some(input_file) = input_file {
glib::spawn_future_local(clone!(@weak appwindow => async move {
appwindow.open_file_w_dialogs(input_file, None, false).await;
}));
glib::spawn_future_local(clone!(
#[weak]
appwindow,
async move {
appwindow.open_file_w_dialogs(input_file, None, false).await;
}
));
}
}
}
Expand Down
Loading