Commit 181247c0 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Port to latest gtk-rs crates

parent 95892ed1
...@@ -48,22 +48,23 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" ...@@ -48,22 +48,23 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
[[package]] [[package]]
name = "cairo-rs" name = "cairo-rs"
version = "0.15.12" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" checksum = "bd6d010ad1f8103b579afac7713f061e3fc99d101f23928a432e2d42e9bdf249"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cairo-sys-rs", "cairo-sys-rs",
"glib", "glib",
"libc", "libc",
"once_cell",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "cairo-sys-rs" name = "cairo-sys-rs"
version = "0.15.1" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" checksum = "5119ea655ec777b523f0b57279e70f8a4542f61b0e98a48f892b4ef043fd4c5d"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
...@@ -78,9 +79,9 @@ checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" ...@@ -78,9 +79,9 @@ checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]] [[package]]
name = "cfg-expr" name = "cfg-expr"
version = "0.10.3" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa"
dependencies = [ dependencies = [
"smallvec", "smallvec",
] ]
...@@ -147,6 +148,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -147,6 +148,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68"
[[package]] [[package]]
name = "futures-macro"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "futures-task" name = "futures-task"
version = "0.3.24" version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -159,6 +171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -159,6 +171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-macro",
"futures-task", "futures-task",
"pin-project-lite", "pin-project-lite",
"pin-utils", "pin-utils",
...@@ -167,9 +180,9 @@ dependencies = [ ...@@ -167,9 +180,9 @@ dependencies = [
[[package]] [[package]]
name = "gdk-pixbuf" name = "gdk-pixbuf"
version = "0.15.11" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" checksum = "c0fb526c8c3a075eda15f961820edf3e15fe18576ac4fbabbb324e4cc6c421e6"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
...@@ -180,9 +193,9 @@ dependencies = [ ...@@ -180,9 +193,9 @@ dependencies = [
[[package]] [[package]]
name = "gdk-pixbuf-sys" name = "gdk-pixbuf-sys"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" checksum = "7df12d15c10c3c5a84d9fb4ba0e27659f6a2bdee4f27f8b17126da15d5ddd3f2"
dependencies = [ dependencies = [
"gio-sys", "gio-sys",
"glib-sys", "glib-sys",
...@@ -193,9 +206,9 @@ dependencies = [ ...@@ -193,9 +206,9 @@ dependencies = [
[[package]] [[package]]
name = "gdk4" name = "gdk4"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fabb7cf843c26b085a5d68abb95d0c0bf27a9ae2eeff9c4adb503a1eb580876" checksum = "66fe07f362c977c4684d1136a29f097208b3ccb2013ab6f441a3c60a046fd358"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cairo-rs", "cairo-rs",
...@@ -209,9 +222,9 @@ dependencies = [ ...@@ -209,9 +222,9 @@ dependencies = [
[[package]] [[package]]
name = "gdk4-sys" name = "gdk4-sys"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efe7dcb44f5c00aeabff3f69abfc5673de46559070f89bd3fbb7b66485d9cef2" checksum = "ddcf9e3ab5f237bb641e7f2fccc4b26d5b86f111f0d62e27d452dc24964541c2"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
...@@ -246,26 +259,29 @@ dependencies = [ ...@@ -246,26 +259,29 @@ dependencies = [
[[package]] [[package]]
name = "gio" name = "gio"
version = "0.15.12" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" checksum = "3025f17aab38ebbb40d785806cf36c292c4dd6755b05584fc52d34fb87533263"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-io", "futures-io",
"futures-util",
"gio-sys", "gio-sys",
"glib", "glib",
"libc", "libc",
"once_cell", "once_cell",
"pin-project-lite",
"smallvec",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "gio-sys" name = "gio-sys"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" checksum = "6da1bba9d3f2ab13a6e9932c40f240dc99ebc9f0bdc35cfb130d1a3df36f374c"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
...@@ -276,15 +292,17 @@ dependencies = [ ...@@ -276,15 +292,17 @@ dependencies = [
[[package]] [[package]]
name = "glib" name = "glib"
version = "0.15.12" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" checksum = "9d9d01334b55e33e9189fa956dde9885e5439dfa6c448f4d724e222addbf06f2"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"futures-channel", "futures-channel",
"futures-core", "futures-core",
"futures-executor", "futures-executor",
"futures-task", "futures-task",
"futures-util",
"gio-sys",
"glib-macros", "glib-macros",
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
...@@ -296,9 +314,9 @@ dependencies = [ ...@@ -296,9 +314,9 @@ dependencies = [
[[package]] [[package]]
name = "glib-macros" name = "glib-macros"
version = "0.15.11" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" checksum = "e195c1311fa6b04d7b896ea39385f6bd60ef5d25bf74a7c11c8c3f94f6c1a572"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"heck", "heck",
...@@ -311,9 +329,9 @@ dependencies = [ ...@@ -311,9 +329,9 @@ dependencies = [
[[package]] [[package]]
name = "glib-sys" name = "glib-sys"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" checksum = "b33357bb421a77bd849f6a0bfcaf3b4b256a2577802971bb5dd522d530f27021"
dependencies = [ dependencies = [
"libc", "libc",
"system-deps", "system-deps",
...@@ -333,9 +351,9 @@ dependencies = [ ...@@ -333,9 +351,9 @@ dependencies = [
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" checksum = "63ca11a57400f3d4fda594e002844be47900c9fb8b29e2155c6e37a1f24e51b3"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
...@@ -344,9 +362,9 @@ dependencies = [ ...@@ -344,9 +362,9 @@ dependencies = [
[[package]] [[package]]
name = "graphene-rs" name = "graphene-rs"
version = "0.15.1" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c54f9fbbeefdb62c99f892dfca35f83991e2cb5b46a8dc2a715e58612f85570" checksum = "95a8de4506a64776d90fedf9c28fdca5a7127f8cc9c78976e8184ac6f42685d8"
dependencies = [ dependencies = [
"glib", "glib",
"graphene-sys", "graphene-sys",
...@@ -355,9 +373,9 @@ dependencies = [ ...@@ -355,9 +373,9 @@ dependencies = [
[[package]] [[package]]
name = "graphene-sys" name = "graphene-sys"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa691fc7337ba1df599afb55c3bcb85c04f1b3f17362570e9bb0ff0d1bc3028a" checksum = "f2c952f764f02f8546fcc5d014bc78aa704c6d453c828c8b429121f704349163"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
...@@ -367,9 +385,9 @@ dependencies = [ ...@@ -367,9 +385,9 @@ dependencies = [
[[package]] [[package]]
name = "gsk4" name = "gsk4"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05e9020d333280b3aa38d496495bfa9b50712eebf1ad63f0ec5bcddb5eb61be4" checksum = "d4fc2b86c751a7fe9aad0fdba85937a6aace3a8453e0e2a08d2a31ce4bb8ae55"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cairo-rs", "cairo-rs",
...@@ -383,9 +401,9 @@ dependencies = [ ...@@ -383,9 +401,9 @@ dependencies = [
[[package]] [[package]]
name = "gsk4-sys" name = "gsk4-sys"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7add39ccf60078508c838643a2dcc91f045c46ed63b5ea6ab701b2e25bda3fea" checksum = "2cb53e25cbbe3fa8e3e9db7c06d65085086fadbec4cd0aa567b2e2a4917db83d"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"gdk4-sys", "gdk4-sys",
...@@ -399,9 +417,9 @@ dependencies = [ ...@@ -399,9 +417,9 @@ dependencies = [
[[package]] [[package]]
name = "gtk4" name = "gtk4"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c64f0c2a3d80e899dc3febddad5bac193ffcf74a0fd7e31037f30dd34d6f7396" checksum = "954e5a318221d69301c80f71cc2d2c15d0d4e259b1b253cad762e93f251bf6d6"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cairo-rs", "cairo-rs",
...@@ -422,24 +440,23 @@ dependencies = [ ...@@ -422,24 +440,23 @@ dependencies = [
[[package]] [[package]]
name = "gtk4-macros" name = "gtk4-macros"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fafbcc920af4eb677d7d164853e7040b9de5a22379c596f570190c675d45f7a7" checksum = "ce5eb86364b216ee8c497b1121831168fb25130d3378495a135f8e5c1972db7b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"proc-macro-crate", "proc-macro-crate",
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quick-xml",
"quote", "quote",
"syn", "syn",
] ]
[[package]] [[package]]
name = "gtk4-sys" name = "gtk4-sys"
version = "0.4.8" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bc8006eea634b7c72da3ff79e24606e45f21b3b832a3c5a1f543f5f97eb0f63" checksum = "0f04bd0b63d999a36ae53a916ee4b20ea64a3ef4732ca8a98b1fde4a22c1476c"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
...@@ -486,10 +503,12 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ...@@ -486,10 +503,12 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libadwaita" name = "libadwaita"
version = "0.1.1" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2ae453d28e3b91f03749f02b1531e8cfe315a1d0762b77a61797d2ab80bb87d" checksum = "ed92f031cf7f3d501b84f41e4d05aed6ebfd8eed59a8fc0cccbf51359e92c8e3"
dependencies = [ dependencies = [
"bitflags",
"futures-channel",
"gdk-pixbuf", "gdk-pixbuf",
"gdk4", "gdk4",
"gio", "gio",
...@@ -503,9 +522,9 @@ dependencies = [ ...@@ -503,9 +522,9 @@ dependencies = [
[[package]] [[package]]
name = "libadwaita-sys" name = "libadwaita-sys"
version = "0.1.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f18b6ac4cadd252a89f5cba0a5a4e99836131795d6fad37b859ac79e8cb7d2c8" checksum = "9ec4243e86fb53d06df2461d543529a640c9a0fba2d4cc850b70e11a85f9d952"
dependencies = [ dependencies = [
"gdk4-sys", "gdk4-sys",
"gio-sys", "gio-sys",
...@@ -513,14 +532,15 @@ dependencies = [ ...@@ -513,14 +532,15 @@ dependencies = [
"gobject-sys", "gobject-sys",
"gtk4-sys", "gtk4-sys",
"libc", "libc",
"pango-sys",
"system-deps", "system-deps",
] ]
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.133" version = "0.2.135"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
[[package]] [[package]]
name = "locale_config" name = "locale_config"
...@@ -599,17 +619,18 @@ dependencies = [ ...@@ -599,17 +619,18 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.14.0" version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1"
[[package]] [[package]]
name = "pango" name = "pango"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" checksum = "7208c60f224cf6e44c551df5ee2ef38f9da0fd29d7c5a0402000b8ab0520e798"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"gio",
"glib", "glib",
"libc", "libc",
"once_cell", "once_cell",
...@@ -618,9 +639,9 @@ dependencies = [ ...@@ -618,9 +639,9 @@ dependencies = [
[[package]] [[package]]
name = "pango-sys" name = "pango-sys"
version = "0.15.10" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" checksum = "922441c228366ed98d3534b87bc7c987c50564094c3abbc3513717786419252d"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
...@@ -630,9 +651,9 @@ dependencies = [ ...@@ -630,9 +651,9 @@ dependencies = [
[[package]] [[package]]
name = "pest" name = "pest"
version = "2.3.1" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a"
dependencies = [ dependencies = [
"thiserror", "thiserror",
"ucd-trie", "ucd-trie",
...@@ -703,9 +724,9 @@ dependencies = [ ...@@ -703,9 +724,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.43" version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
...@@ -717,15 +738,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -717,15 +738,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]] [[package]]
name = "quick-xml"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b"
dependencies = [
"memchr",
]
[[package]]
name = "quote" name = "quote"
version = "1.0.21" version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -780,9 +792,9 @@ dependencies = [ ...@@ -780,9 +792,9 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.144" version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b"
[[package]] [[package]]
name = "slab" name = "slab"
...@@ -795,15 +807,15 @@ dependencies = [ ...@@ -795,15 +807,15 @@ dependencies = [
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.9.0" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.100" version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
...@@ -812,9 +824,9 @@ dependencies = [ ...@@ -812,9 +824,9 @@ dependencies = [
[[package]] [[package]]
name = "system-deps" name = "system-deps"
version = "6.0.2" version = "6.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1a45a1c4c9015217e12347f2a411b57ce2c4fc543913b14b6fe40483328e709" checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff"
dependencies = [ dependencies = [
"cfg-expr", "cfg-expr",
"heck", "heck",
...@@ -840,18 +852,18 @@ dependencies = [ ...@@ -840,18 +852,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.35" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.35" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
...@@ -875,9 +887,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" ...@@ -875,9 +887,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.4" version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
[[package]] [[package]]
name = "version-compare" name = "version-compare"
......
...@@ -6,9 +6,9 @@ edition = "2021" ...@@ -6,9 +6,9 @@ edition = "2021"
[dependencies] [dependencies]
gtk = { package = "gtk4", version = "0.4", features= ["v4_2"]} gtk = { package = "gtk4", version = "0.5", features= ["v4_2"]}
log = "0.4" log = "0.4"
gettext-rs = { version = "0.7", features = ["gettext-system"] } gettext-rs = { version = "0.7", features = ["gettext-system"] }
adw = {package = "libadwaita", version = "0.1"} adw = {package = "libadwaita", version = "0.2"}
pretty_env_logger = "0.4" pretty_env_logger = "0.4"
regex = "1.5" regex = "1.5"
use crate::config; use crate::config;
use crate::utils;
use crate::widgets::Window; use crate::widgets::Window;
use adw::prelude::*; use adw::prelude::*;
use gtk::{ use gtk::{gio, glib, subclass::prelude::*};
gio,
glib::{self, clone},
subclass::prelude::*,
};
use log::info;
mod imp { mod imp {
use super::*; use super::*;
...@@ -28,66 +22,55 @@ mod imp { ...@@ -28,66 +22,55 @@ mod imp {
impl ObjectImpl for Application {} impl ObjectImpl for Application {}
impl ApplicationImpl for Application { impl ApplicationImpl for Application {
fn activate(&self, application: &Self::Type) { fn activate(&self) {
let window = Window::new(application); self.parent_activate();
let application = self.instance();
let window = Window::new(&application);
application.add_window(&window); application.add_window(&window);
window.present(); window.present();
self.window.set(window.downgrade()).unwrap(); self.window.set(window.downgrade()).unwrap();
self.parent_activate(application);
} }
fn startup(&self, application: &Self::Type) { fn startup(&self) {
self.parent_startup();
let application = self.instance();
// Quit // Quit
utils::action( let quit = gio::ActionEntry::builder("quit")
application, .activate(move |app: &Self::Type, _, _| app.quit())
"quit", .build();
clone!(@weak application => move |_, _| {
application.quit();
}),
);
// Start Tour // Start Tour
utils::action( let start_tour = gio::ActionEntry::builder("start-tour")
application, .activate(move |app: &Self::Type, _, _| app.window().start_tour())
"start-tour", .build();
clone!(@weak application => move |_, _| {
application.window().start_tour();
}),
);
// Skip Tour // Skip Tour
utils::action( let skip_tour = gio::ActionEntry::builder("skip-tour")
application, .activate(move |app: &Self::Type, _, _| app.quit())
"skip-tour", .build();
clone!(@weak application => move |_, _| { // Next page
application.quit(); let next_page = gio::ActionEntry::builder("next-page")
}), .activate(move |app: &Self::Type, _, _| {
); let window = app.window();
utils::action(
application,
"next-page",
clone!(@weak application => move |_, _| {
let window = application.window();
if window.paginator().try_next().is_none() { if window.paginator().try_next().is_none() {
window.close(); window.close();
} }
}), })
); .build();
// Previous page
utils::action( let previous_page = gio::ActionEntry::builder("previous-page")
application, .activate(move |app: &Self::Type, _, _| {
"previous-page", let window = app.window();
clone!(@weak application => move |_, _| {
let window = application.window();
if window.paginator().try_previous().is_none() { if window.paginator().try_previous().is_none() {
window.reset_tour(); window.reset_tour();
} }
}), })
); .build();
application
.add_action_entries([quit, start_tour, skip_tour, next_page, previous_page])
.unwrap();
application.set_accels_for_action("app.quit", &["<Control>q"]); application.set_accels_for_action("app.quit", &["<Control>q"]);
application.set_accels_for_action("app.skip-tour", &["Escape"]); application.set_accels_for_action("app.skip-tour", &["Escape"]);
self.parent_startup(application);
} }
} }
impl GtkApplicationImpl for Application {} impl GtkApplicationImpl for Application {}
...@@ -107,7 +90,6 @@ impl Application { ...@@ -107,7 +90,6 @@ impl Application {
("application-id", &config::APP_ID), ("application-id", &config::APP_ID),
("resource-base-path", &Some("/org/gnome/Tour")), ("resource-base-path", &Some("/org/gnome/Tour")),
]) ])
.unwrap()
} }
fn window(&self) -> Window { fn window(&self) -> Window {
...@@ -115,9 +97,9 @@ impl Application { ...@@ -115,9 +97,9 @@ impl Application {
} }
pub fn run() { pub fn run() {
info!("GNOME Tour ({})", config::APP_ID); log::info!("GNOME Tour ({})", config::APP_ID);
info!("Version: {} ({})", config::VERSION, config::PROFILE); log::info!("Version: {} ({})", config::VERSION, config::PROFILE);
info!("Datadir: {}", config::PKGDATADIR); log::info!("Datadir: {}", config::PKGDATADIR);
let app = Self::new(); let app = Self::new();
gtk::prelude::ApplicationExtManual::run(&app); gtk::prelude::ApplicationExtManual::run(&app);
} }
......
// based on https://gitlab.gnome.org/World/podcasts/-/blob/master/podcasts-gtk/src/i18n|utils.rs // based on https://gitlab.gnome.org/World/podcasts/-/blob/master/podcasts-gtk/src/i18n|utils.rs
use gettextrs::gettext; use gettextrs::gettext;
use gtk::{gio, glib};
use regex::{Captures, Regex}; use regex::{Captures, Regex};
pub fn action<T, F>(thing: &T, name: &str, action: F)
where
T: gio::traits::ActionMapExt,
for<'r, 's> F: Fn(&'r gio::SimpleAction, Option<&glib::Variant>) + 'static,
{
// Create a stateless, parameterless action
let act = gio::SimpleAction::new(name, None);
// Connect the handler
act.connect_activate(action);
// Add it to the map
thing.add_action(&act);
}
pub fn i18n_f(format: &str, kwargs: &[(&str, &str)]) -> String { pub fn i18n_f(format: &str, kwargs: &[(&str, &str)]) -> String {
let mut s = gettext(format); let mut s = gettext(format);
for (k, v) in kwargs { for (k, v) in kwargs {
......
...@@ -5,7 +5,7 @@ use gtk::subclass::prelude::*; ...@@ -5,7 +5,7 @@ use gtk::subclass::prelude::*;
mod imp { mod imp {
use super::*; use super::*;
use glib::once_cell::sync::Lazy; use glib::once_cell::sync::Lazy;
use glib::{ParamFlags, ParamSpec, ParamSpecString, Value}; use glib::{ParamSpec, ParamSpecString, Value};
use gtk::glib::once_cell::sync::OnceCell; use gtk::glib::once_cell::sync::OnceCell;
use std::cell::RefCell; use std::cell::RefCell;
...@@ -25,7 +25,9 @@ mod imp { ...@@ -25,7 +25,9 @@ mod imp {
} }
impl ObjectImpl for ImagePageWidget { impl ObjectImpl for ImagePageWidget {
fn constructed(&self, obj: &Self::Type) { fn constructed(&self) {
self.parent_constructed();
let obj = self.instance();
let layout_manager = obj let layout_manager = obj
.layout_manager() .layout_manager()
.map(|l| l.downcast::<gtk::BoxLayout>().unwrap()) .map(|l| l.downcast::<gtk::BoxLayout>().unwrap())
...@@ -81,27 +83,22 @@ mod imp { ...@@ -81,27 +83,22 @@ mod imp {
container.append(&body_label); container.append(&body_label);
obj.append(&clamp); obj.append(&clamp);
self.parent_constructed(obj);
} }
fn properties() -> &'static [ParamSpec] { fn properties() -> &'static [ParamSpec] {
static PROPERTIES: Lazy<Vec<ParamSpec>> = Lazy::new(|| { static PROPERTIES: Lazy<Vec<ParamSpec>> = Lazy::new(|| {
vec![ vec![
ParamSpecString::builder("resource-uri") ParamSpecString::builder("resource-uri")
.flags(ParamFlags::READWRITE | ParamFlags::CONSTRUCT_ONLY) .construct_only()
.build(),
ParamSpecString::builder("head")
.flags(ParamFlags::READWRITE | ParamFlags::CONSTRUCT_ONLY)
.build(),
ParamSpecString::builder("body")
.flags(ParamFlags::READWRITE | ParamFlags::CONSTRUCT)
.build(), .build(),
ParamSpecString::builder("head").construct_only().build(),
ParamSpecString::builder("body").construct().build(),
] ]
}); });
PROPERTIES.as_ref() PROPERTIES.as_ref()
} }
fn set_property(&self, _obj: &Self::Type, _id: usize, value: &Value, pspec: &ParamSpec) { fn set_property(&self, _id: usize, value: &Value, pspec: &ParamSpec) {
match pspec.name() { match pspec.name() {
"resource-uri" => { "resource-uri" => {
let resource_uri: String = value.get().unwrap(); let resource_uri: String = value.get().unwrap();
...@@ -121,7 +118,7 @@ mod imp { ...@@ -121,7 +118,7 @@ mod imp {
} }
} }
fn property(&self, _obj: &Self::Type, _id: usize, pspec: &ParamSpec) -> Value { fn property(&self, _id: usize, pspec: &ParamSpec) -> Value {
match pspec.name() { match pspec.name() {
"resource-uri" => self.resource_uri.get().to_value(), "resource-uri" => self.resource_uri.get().to_value(),
"head" => self.head.get().to_value(), "head" => self.head.get().to_value(),
...@@ -146,7 +143,6 @@ impl ImagePageWidget { ...@@ -146,7 +143,6 @@ impl ImagePageWidget {
("head", &head), ("head", &head),
("body", &body), ("body", &body),
]) ])
.unwrap()
} }
pub fn set_body(&self, body: &str) { pub fn set_body(&self, body: &str) {
......
...@@ -42,7 +42,9 @@ mod imp { ...@@ -42,7 +42,9 @@ mod imp {
} }
impl ObjectImpl for PaginatorWidget { impl ObjectImpl for PaginatorWidget {
fn constructed(&self, obj: &Self::Type) { fn constructed(&self) {
self.parent_constructed();
let obj = self.instance();
let layout_manager = obj let layout_manager = obj
.layout_manager() .layout_manager()
.map(|l| l.downcast::<gtk::BoxLayout>().unwrap()) .map(|l| l.downcast::<gtk::BoxLayout>().unwrap())
...@@ -66,24 +68,17 @@ mod imp { ...@@ -66,24 +68,17 @@ mod imp {
})); }));
obj.add_controller(&controller); obj.add_controller(&controller);
self.parent_constructed(obj);
} }
} }
impl WidgetImpl for PaginatorWidget {} impl WidgetImpl for PaginatorWidget {}
impl BoxImpl for PaginatorWidget {} impl BoxImpl for PaginatorWidget {}
impl BuildableImpl for PaginatorWidget { impl BuildableImpl for PaginatorWidget {
fn add_child( fn add_child(&self, builder: &gtk::Builder, child: &glib::Object, type_: Option<&str>) {
&self,
buildable: &Self::Type,
builder: &gtk::Builder,
child: &glib::Object,
type_: Option<&str>,
) {
if !self.carousel.is_bound() { if !self.carousel.is_bound() {
self.parent_add_child(buildable, builder, child, type_); self.parent_add_child(builder, child, type_);
} else { } else {
buildable.add_page(child.clone().downcast::<gtk::Widget>().unwrap()); self.instance()
.add_page(child.clone().downcast::<gtk::Widget>().unwrap());
} }
} }
} }
...@@ -97,7 +92,7 @@ glib::wrapper! { ...@@ -97,7 +92,7 @@ glib::wrapper! {
impl PaginatorWidget { impl PaginatorWidget {
pub fn new() -> Self { pub fn new() -> Self {
glib::Object::new(&[]).unwrap() glib::Object::new(&[])
} }
pub fn try_next(&self) -> Option<()> { pub fn try_next(&self) -> Option<()> {
......
...@@ -37,7 +37,9 @@ mod imp { ...@@ -37,7 +37,9 @@ mod imp {
} }
impl ObjectImpl for Window { impl ObjectImpl for Window {
fn constructed(&self, widget: &Self::Type) { fn constructed(&self) {
self.parent_constructed();
let widget = self.instance();
widget.set_icon_name(Some(config::APP_ID)); widget.set_icon_name(Some(config::APP_ID));
// Devel Profile // Devel Profile
...@@ -53,7 +55,6 @@ mod imp { ...@@ -53,7 +55,6 @@ mod imp {
&[("name", &name), ("version", &version)], &[("name", &name), ("version", &version)],
); );
self.welcome_page.set_body(&body); self.welcome_page.set_body(&body);
self.parent_constructed(widget);
} }
} }
impl WidgetImpl for Window {} impl WidgetImpl for Window {}
...@@ -70,7 +71,7 @@ glib::wrapper! { ...@@ -70,7 +71,7 @@ glib::wrapper! {
impl Window { impl Window {
pub fn new(app: &Application) -> Self { pub fn new(app: &Application) -> Self {
glib::Object::new(&[("application", app)]).unwrap() glib::Object::new(&[("application", app)])
} }
pub fn paginator(&self) -> PaginatorWidget { pub fn paginator(&self) -> PaginatorWidget {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment