From 367a7815f86103048d718c4ebbec7f393eac692a Mon Sep 17 00:00:00 2001 From: daa84 Date: Wed, 16 Aug 2017 12:41:22 +0300 Subject: [PATCH] Update to new lib versions, small cleanup --- Cargo.lock | 162 +++++++++++++++-------- src/shell.rs | 365 ++++++++++++++++++++++++++------------------------- src/ui.rs | 1 - 3 files changed, 294 insertions(+), 234 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8118d67..d5c7fac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,9 +20,9 @@ dependencies = [ "pangocairo 0.1.3 (git+https://github.com/RazrFalcon/pangocairo-rs)", "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -36,15 +36,20 @@ dependencies = [ [[package]] name = "atk-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bitflags" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "0.9.1" @@ -63,21 +68,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cairo-rs" version = "0.1.3" -source = "git+https://github.com/gtk-rs/cairo#ef0c3315a57b5cd7134801779c111c6b7d84a410" +source = "git+https://github.com/gtk-rs/cairo#7ab279c6393f87d86019671dda5206622e68fb7d" dependencies = [ "c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cairo-sys-rs" version = "0.3.4" -source = "git+https://github.com/gtk-rs/cairo#ef0c3315a57b5cd7134801779c111c6b7d84a410" +source = "git+https://github.com/gtk-rs/cairo#7ab279c6393f87d86019671dda5206622e68fb7d" dependencies = [ - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -87,6 +93,19 @@ name = "cfg-if" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "conv" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "custom_derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "env_logger" version = "0.4.3" @@ -99,7 +118,7 @@ dependencies = [ [[package]] name = "gdk" version = "0.5.3" -source = "git+https://github.com/gtk-rs/gdk#6f6487a46874be4e96659f6697b480a8345d2690" +source = "git+https://github.com/gtk-rs/gdk#cdb612c726c6b5e507534dcdd1dc549459b3869a" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)", @@ -110,37 +129,39 @@ dependencies = [ "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pango 0.1.3 (git+https://github.com/gtk-rs/pango)", ] [[package]] name = "gdk-pixbuf" version = "0.1.3" -source = "git+https://github.com/gtk-rs/gdk-pixbuf#1888102253747deda678d0ec99b7e4f018c8a6d0" +source = "git+https://github.com/gtk-rs/gdk-pixbuf#cc1c9ab464bcf58624c3969cbe080292f98a43cf" dependencies = [ "gdk-pixbuf-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gdk-pixbuf-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gdk-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", @@ -148,7 +169,7 @@ dependencies = [ "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -156,65 +177,65 @@ dependencies = [ [[package]] name = "gio" version = "0.1.3" -source = "git+https://github.com/gtk-rs/gio#795aafa2a0ade0bdaec86f96f1bc85b0363f6793" +source = "git+https://github.com/gtk-rs/gio#2b2b061baf5c9410b3faac0fff28650dc773e750" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gio-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "glib" version = "0.1.3" -source = "git+https://github.com/gtk-rs/glib#f874842c0a660165c08c2b522551cd6673431b39" +source = "git+https://github.com/gtk-rs/glib#dc304963b10e8950b71a73ab7c9620c931ef7950" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "glib-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gobject-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gtk" version = "0.1.3" -source = "git+https://github.com/gtk-rs/gtk#d2aa123e5d791affb681347e42b73cb383ab620b" +source = "git+https://github.com/gtk-rs/gtk#d3fb35605254f794c4cf669f49d0cdfe09dfc9dc" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)", @@ -229,14 +250,14 @@ dependencies = [ "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gtk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pango 0.1.3 (git+https://github.com/gtk-rs/pango)", ] [[package]] name = "gtk-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "atk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -246,7 +267,7 @@ dependencies = [ "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -263,7 +284,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.26" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -271,12 +292,29 @@ name = "log" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "magenta" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "magenta-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "memchr" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -292,39 +330,43 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pango" version = "0.1.3" -source = "git+https://github.com/gtk-rs/pango#6ab128152a174a84cf32bfedffa337792d0ca9e4" +source = "git+https://github.com/gtk-rs/pango#df1ed7040f41aba0266fabf1c000e36d77c75106" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", ] [[package]] name = "pango-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" +source = "git+https://github.com/gtk-rs/sys#af83826e0a31f68bcddee17d3791fb01453dc632" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pangocairo" version = "0.1.3" -source = "git+https://github.com/RazrFalcon/pangocairo-rs#55478cb05eb716e262d3a88777995d4aa33146a0" +source = "git+https://github.com/RazrFalcon/pangocairo-rs#ad91334f8a9a473b767c045d001d373038fd6db1" dependencies = [ "cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)", "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", + "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "pango 0.1.3 (git+https://github.com/gtk-rs/pango)", "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "pangocairo-sys 0.3.4 (git+https://github.com/RazrFalcon/pangocairo-rs)", @@ -333,11 +375,11 @@ dependencies = [ [[package]] name = "pangocairo-sys" version = "0.3.4" -source = "git+https://github.com/RazrFalcon/pangocairo-rs#55478cb05eb716e262d3a88777995d4aa33146a0" +source = "git+https://github.com/RazrFalcon/pangocairo-rs#ad91334f8a9a473b767c045d001d373038fd6db1" dependencies = [ "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -365,7 +407,7 @@ version = "0.7.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -388,10 +430,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rand" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -417,7 +460,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -425,18 +468,18 @@ name = "rmpv" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "rmp 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -487,10 +530,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.4.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -504,7 +547,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -533,12 +576,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum atk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" +"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d" "checksum c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6237ac5a4b1e81c213c24c6437964c61e646df910a914b4ab1487b46df20bd13" "checksum cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)" = "" "checksum cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)" = "" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" +"checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" +"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum gdk 0.5.3 (git+https://github.com/gtk-rs/gdk)" = "" "checksum gdk-pixbuf 0.1.3 (git+https://github.com/gtk-rs/gdk-pixbuf)" = "" @@ -553,11 +599,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gtk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" -"checksum libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "30885bcb161cf67054244d10d4a7f4835ffd58773bc72e07d35fecf472295503" +"checksum libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)" = "8a014d9226c2cc402676fbe9ea2e15dd5222cd1dd57f576b5b283178c944a264" "checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" +"checksum magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527" +"checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum neovim-lib 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cd81cd2140309fcbe61775ebe5901b0730e5fdae2558a6cd27539e6e730fa76a" -"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" +"checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0" "checksum pango 0.1.3 (git+https://github.com/gtk-rs/pango)" = "" "checksum pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum pangocairo 0.1.3 (git+https://github.com/RazrFalcon/pangocairo-rs)" = "" @@ -568,19 +616,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" +"checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf" "checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" "checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" "checksum rmp 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7ce560a5728f4eec697f07f8d7fa20608893d44b4f5b8f9f5f51a2987f3cffe2" "checksum rmpv 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "45368daa6c60116376d8813ec6a2556df640229709becb8f80df1651f882e7af" -"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" -"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" +"checksum serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f7726f29ddf9731b17ff113c461e362c381d9d69433f79de4f3dd572488823e9" +"checksum serde_derive 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cf823e706be268e73e7747b147aa31c8f633ab4ba31f115efb57e5047c3a76dd" "checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" -"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" +"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" diff --git a/src/shell.rs b/src/shell.rs index 2328f67..1f87a20 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -134,7 +134,8 @@ impl State { } pub fn set_detach_cb(&mut self, cb: Option) - where F: FnMut() + Send + 'static + where + F: FnMut() + Send + 'static, { if cb.is_some() { self.detach_cb = Some(Box::new(RefCell::new(cb.unwrap()))); @@ -227,7 +228,7 @@ impl State { let desc = self.create_pango_font(); layout.set_font_description(Some(&desc)); - layout.set_text("A", -1); + layout.set_text("A"); layout.get_pixel_size() } @@ -244,8 +245,10 @@ impl State { if let Some(line_height) = self.line_height { if let Some(char_width) = self.char_width { let alloc = self.drawing_area.get_allocation(); - return Some(((alloc.width as f64 / char_width).trunc() as usize, - (alloc.height as f64 / line_height).trunc() as usize)); + return Some(( + (alloc.width as f64 / char_width).trunc() as usize, + (alloc.height as f64 / line_height).trunc() as usize, + )); } } @@ -255,9 +258,9 @@ impl State { fn show_error_area(&self) { let stack = self.stack.clone(); gtk::idle_add(move || { - stack.set_visible_child_name("Error"); - Continue(false) - }); + stack.set_visible_child_name("Error"); + Continue(false) + }); } } @@ -332,114 +335,106 @@ impl Shell { self.widget.pack_start(&state.stack, true, true, 0); - state - .drawing_area - .set_events((gdk_sys::GDK_BUTTON_RELEASE_MASK | gdk_sys::GDK_BUTTON_PRESS_MASK | - gdk_sys::GDK_BUTTON_MOTION_MASK | - gdk_sys::GDK_SCROLL_MASK) - .bits() as i32); + state.drawing_area.set_events( + (gdk_sys::GDK_BUTTON_RELEASE_MASK | gdk_sys::GDK_BUTTON_PRESS_MASK | + gdk_sys::GDK_BUTTON_MOTION_MASK | + gdk_sys::GDK_SCROLL_MASK) + .bits() as i32, + ); let ref_state = self.state.clone(); let ref_ui_state = self.ui_state.clone(); - state - .drawing_area - .connect_button_press_event(move |_, ev| { - gtk_button_press(&mut *ref_state.borrow_mut(), - &mut *ref_ui_state.borrow_mut(), - ev) - }); + state.drawing_area.connect_button_press_event(move |_, ev| { + gtk_button_press( + &mut *ref_state.borrow_mut(), + &mut *ref_ui_state.borrow_mut(), + ev, + ) + }); let ref_ui_state = self.ui_state.clone(); - state - .drawing_area - .connect_button_release_event(move |_, _| { - gtk_button_release(&mut *ref_ui_state.borrow_mut()) - }); + state.drawing_area.connect_button_release_event( + move |_, _| { + gtk_button_release(&mut *ref_ui_state.borrow_mut()) + }, + ); let ref_state = self.state.clone(); let ref_ui_state = self.ui_state.clone(); - state - .drawing_area - .connect_motion_notify_event(move |_, ev| { - gtk_motion_notify(&mut *ref_state.borrow_mut(), - &mut *ref_ui_state.borrow_mut(), - ev) - }); + state.drawing_area.connect_motion_notify_event( + move |_, ev| { + gtk_motion_notify( + &mut *ref_state.borrow_mut(), + &mut *ref_ui_state.borrow_mut(), + ev, + ) + }, + ); let ref_state = self.state.clone(); - state - .drawing_area - .connect_draw(move |_, ctx| gtk_draw(&ref_state, ctx)); + state.drawing_area.connect_draw( + move |_, ctx| gtk_draw(&ref_state, ctx), + ); let ref_state = self.state.clone(); - state - .drawing_area - .connect_key_press_event(move |_, ev| { - let mut shell = ref_state.borrow_mut(); - shell.cursor.as_mut().unwrap().reset_state(); - // TODO: improve - // GtkIMContext will eat a Shift-Space and not tell us about shift. - // Also don't let IME eat any GDK_KEY_KP_ events - if !ev.get_state().contains(gdk::SHIFT_MASK) && - ev.get_keyval() < gdk_sys::GDK_KEY_KP_Space as u32 && - ev.get_keyval() > gdk_sys::GDK_KEY_KP_Divide as u32 && - shell.im_context.filter_keypress(ev) { - println!("Filter"); - Inhibit(true) + state.drawing_area.connect_key_press_event(move |_, ev| { + let mut shell = ref_state.borrow_mut(); + shell.cursor.as_mut().unwrap().reset_state(); + // GtkIMContext will eat a Shift-Space and not tell us about shift. + // Also don't let IME eat any GDK_KEY_KP_ events + if !ev.get_state().contains(gdk::SHIFT_MASK) && + ev.get_keyval() < gdk_sys::GDK_KEY_KP_Space as u32 && + ev.get_keyval() > gdk_sys::GDK_KEY_KP_Divide as u32 && + shell.im_context.filter_keypress(ev) + { + Inhibit(true) + } else { + if shell.nvim.borrow().is_initialized() { + input::gtk_key_press(&mut shell.nvim.borrow_mut(), ev) } else { - if shell.nvim.borrow().is_initialized() { - input::gtk_key_press(&mut shell.nvim.borrow_mut(), ev) - } else { - Inhibit(false) - } + Inhibit(false) } - }); + } + }); let ref_state = self.state.clone(); - state - .drawing_area - .connect_key_release_event(move |_, ev| { - ref_state.borrow().im_context.filter_keypress(ev); - Inhibit(false) - }); + state.drawing_area.connect_key_release_event(move |_, ev| { + ref_state.borrow().im_context.filter_keypress(ev); + Inhibit(false) + }); let ref_state = self.state.clone(); - state - .drawing_area - .connect_scroll_event(move |_, ev| gtk_scroll_event(&mut *ref_state.borrow_mut(), ev)); + state.drawing_area.connect_scroll_event(move |_, ev| { + gtk_scroll_event(&mut *ref_state.borrow_mut(), ev) + }); let ref_state = self.state.clone(); - state - .drawing_area - .connect_focus_in_event(move |_, _| gtk_focus_in(&mut *ref_state.borrow_mut())); + state.drawing_area.connect_focus_in_event(move |_, _| { + gtk_focus_in(&mut *ref_state.borrow_mut()) + }); let ref_state = self.state.clone(); - state - .drawing_area - .connect_focus_out_event(move |_, _| gtk_focus_out(&mut *ref_state.borrow_mut())); + state.drawing_area.connect_focus_out_event(move |_, _| { + gtk_focus_out(&mut *ref_state.borrow_mut()) + }); let ref_state = self.state.clone(); - state - .drawing_area - .connect_realize(move |w| { - ref_state - .borrow() - .im_context - .set_client_window(w.get_window().as_ref()) - }); + state.drawing_area.connect_realize(move |w| { + ref_state.borrow().im_context.set_client_window( + w.get_window().as_ref(), + ) + }); let ref_state = self.state.clone(); - state - .im_context - .connect_commit(move |_, ch| ref_state.borrow().im_commit(ch)); + state.im_context.connect_commit(move |_, ch| { + ref_state.borrow().im_commit(ch) + }); let ref_state = self.state.clone(); - state - .drawing_area - .connect_configure_event(move |_, _| { - try_nvim_resize(&ref_state); - false - }); + state.drawing_area.connect_configure_event(move |_, _| { + try_nvim_resize(&ref_state); + false + }); } #[cfg(unix)] @@ -488,7 +483,8 @@ impl Shell { } pub fn set_detach_cb(&self, cb: Option) - where F: FnMut() + Send + 'static + where + F: FnMut() + Send + 'static, { let mut state = self.state.borrow_mut(); state.set_detach_cb(cb); @@ -567,8 +563,9 @@ fn mouse_input(shell: &mut State, input: &str, state: ModifierType, position: (f let col = (x / char_width).trunc() as u64; let row = (y / line_height).trunc() as u64; let input_str = format!("{}<{},{}>", keyval_to_input_string(input, state), col, row); - nvim.input(&input_str) - .expect("Can't send mouse input event"); + nvim.input(&input_str).expect( + "Can't send mouse input event", + ); } } } @@ -619,32 +616,34 @@ fn show_nvim_start_error(err: nvim::NvimInitError, state_arc: Arc let cmd = err.cmd().unwrap().to_owned(); glib::idle_add(move || { - let state = state_arc.borrow(); - state.nvim.borrow_mut().set_error(); - state.error_area.show_nvim_start_error(&source, &cmd); - state.show_error_area(); + let state = state_arc.borrow(); + state.nvim.borrow_mut().set_error(); + state.error_area.show_nvim_start_error(&source, &cmd); + state.show_error_area(); - Continue(false) - }); + Continue(false) + }); } fn show_nvim_init_error(err: nvim::NvimInitError, state_arc: Arc>) { let source = err.source(); glib::idle_add(move || { - let state = state_arc.borrow(); - state.nvim.borrow_mut().set_error(); - state.error_area.show_nvim_init_error(&source); - state.show_error_area(); + let state = state_arc.borrow(); + state.nvim.borrow_mut().set_error(); + state.error_area.show_nvim_init_error(&source); + state.show_error_area(); - Continue(false) - }); + Continue(false) + }); } -fn init_nvim_async(state_arc: Arc>, - options: ShellOptions, - cols: usize, - rows: usize) { +fn init_nvim_async( + state_arc: Arc>, + options: ShellOptions, + cols: usize, + rows: usize, +) { // execute nvim let mut nvim = match nvim::start(state_arc.clone(), options.nvim_bin_path.as_ref()) { Ok(nvim) => nvim, @@ -658,19 +657,22 @@ fn init_nvim_async(state_arc: Arc>, let guard = nvim.session.take_dispatch_guard(); let state_ref = state_arc.clone(); thread::spawn(move || { - guard.join().expect("Can't join dispatch thread"); + guard.join().expect("Can't join dispatch thread"); - idle_cb_call!(state_ref.detach_cb()); - }); + idle_cb_call!(state_ref.detach_cb()); + }); // attach ui let mut nvim = Some(nvim); glib::idle_add(move || { let mut nvim = nvim.take().unwrap(); - if let Err(err) = nvim::post_start_init(&mut nvim, - options.open_path.as_ref(), - cols as u64, - rows as u64) { + if let Err(err) = nvim::post_start_init( + &mut nvim, + options.open_path.as_ref(), + cols as u64, + rows as u64, + ) + { show_nvim_init_error(err, state_arc.clone()); } else { let mut state = state_arc.borrow_mut(); @@ -698,11 +700,12 @@ fn init_nvim(state_arc: &Arc>) { } #[inline] -fn get_model_clip(state: &State, - line_height: f64, - char_width: f64, - clip: (f64, f64, f64, f64)) - -> ModelRect { +fn get_model_clip( + state: &State, + line_height: f64, + char_width: f64, + clip: (f64, f64, f64, f64), +) -> ModelRect { let mut model_clip = ModelRect::from_area(line_height, char_width, clip.0, clip.1, clip.2, clip.3); // in some cases symbols from previous row affect next row @@ -716,12 +719,14 @@ fn get_model_clip(state: &State, } #[inline] -fn draw_backgound(state: &State, - draw_bitmap: &ModelBitamp, - ctx: &cairo::Context, - line_height: f64, - char_width: f64, - model_clip: &ModelRect) { +fn draw_backgound( + state: &State, + draw_bitmap: &ModelBitamp, + ctx: &cairo::Context, + line_height: f64, + char_width: f64, + model_clip: &ModelRect, +) { let line_x = model_clip.left as f64 * char_width; let mut line_y: f64 = model_clip.top as f64 * line_height; @@ -759,7 +764,7 @@ fn draw_initializing(state: &State, ctx: &cairo::Context) { ctx.paint(); layout.set_font_description(&desc); - layout.set_text("Loading..", -1); + layout.set_text("Loading.."); let (width, height) = layout.get_pixel_size(); let x = alloc.width as f64 / 2.0 - width as f64 / 2.0; @@ -772,17 +777,15 @@ fn draw_initializing(state: &State, ctx: &cairo::Context) { ctx.move_to(x + width as f64, y); - state - .cursor - .as_ref() - .unwrap() - .draw(ctx, - state, - char_width, - line_height, - y, - false, - &state.bg_color); + state.cursor.as_ref().unwrap().draw( + ctx, + state, + char_width, + line_height, + y, + false, + &state.bg_color, + ); } fn draw(state: &State, ctx: &cairo::Context) { @@ -803,21 +806,24 @@ fn draw(state: &State, ctx: &cairo::Context) { for clip_idx in 0..clip_rects.len() { let clip = clip_rects.get(clip_idx).unwrap(); - let model_clip = - get_model_clip(state, - line_height, - char_width, - (clip.x, clip.y, clip.x + clip.width, clip.y + clip.height)); + let model_clip = get_model_clip(state, line_height, char_width, ( + clip.x, + clip.y, + clip.x + clip.width, + clip.y + clip.height, + )); let line_x = model_clip.left as f64 * char_width; let mut line_y: f64 = model_clip.top as f64 * line_height; - draw_backgound(state, - &draw_bitmap, - ctx, - line_height, - char_width, - &model_clip); + draw_backgound( + state, + &draw_bitmap, + ctx, + line_height, + char_width, + &model_clip, + ); for (line_idx, line) in state.model.clip_model(&model_clip) { @@ -832,17 +838,15 @@ fn draw(state: &State, ctx: &cairo::Context) { let (bg, fg) = state.colors(cell); if row == line_idx && col == col_idx { - state - .cursor - .as_ref() - .unwrap() - .draw(ctx, - state, - char_width, - line_height, - line_y, - double_width, - bg); + state.cursor.as_ref().unwrap().draw( + ctx, + state, + char_width, + line_height, + line_y, + double_width, + bg, + ); ctx.move_to(current_point.0, current_point.1); } @@ -854,7 +858,7 @@ fn draw(state: &State, ctx: &cairo::Context) { layout.set_font_description(&desc); buf.clear(); buf.push(cell.ch); - layout.set_text(&buf, -1); + layout.set_text(&buf); // correct layout for double_width chars if double_width { @@ -1111,19 +1115,26 @@ impl RedrawEvents for State { RepaintMode::Area(self.model.cur_point()) } - fn popupmenu_show(&mut self, - menu: &[Vec<&str>], - selected: i64, - row: u64, - col: u64) - -> RepaintMode { + fn popupmenu_show( + &mut self, + menu: &[Vec<&str>], + selected: i64, + row: u64, + col: u64, + ) -> RepaintMode { if let (&Some(line_height), &Some(char_width)) = (&self.line_height, &self.char_width) { let point = ModelRect::point(col as usize, row as usize); let (x, y, width, height) = point.to_area(line_height, char_width); - self.popup_menu - .borrow_mut() - .show(self, menu, selected, x, y, width, height); + self.popup_menu.borrow_mut().show( + self, + menu, + selected, + x, + y, + width, + height, + ); } RepaintMode::Nothing @@ -1140,19 +1151,21 @@ impl RedrawEvents for State { } - fn tabline_update(&mut self, - selected: Tabpage, - tabs: Vec<(Tabpage, Option)>) - -> RepaintMode { + fn tabline_update( + &mut self, + selected: Tabpage, + tabs: Vec<(Tabpage, Option)>, + ) -> RepaintMode { self.tabs.update_tabs(&self.nvim, &selected, &tabs); RepaintMode::Nothing } - fn mode_info_set(&mut self, - cursor_style_enabled: bool, - mode_info: Vec) - -> RepaintMode { + fn mode_info_set( + &mut self, + cursor_style_enabled: bool, + mode_info: Vec, + ) -> RepaintMode { self.mode.set_info(cursor_style_enabled, mode_info); RepaintMode::Nothing } diff --git a/src/ui.rs b/src/ui.rs index cd56965..eb418f6 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -6,7 +6,6 @@ use std::sync::Arc; use gtk; use gtk_sys; use gtk::prelude::*; -use gtk::ApplicationExt; use gtk::{ApplicationWindow, HeaderBar, ToolButton, Image, AboutDialog}; use gio::prelude::*; use gio::{Menu, MenuExt, MenuItem, MenuItemExt, SimpleAction};