mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2025-01-29 18:18:21 +00:00
graphmanager: update and fix for gtk4-rs 0.6.1
This commit is contained in:
parent
17a81a52a6
commit
9e6ee57fee
5 changed files with 172 additions and 144 deletions
160
Cargo.lock
generated
160
Cargo.lock
generated
|
@ -95,9 +95,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
|||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "247e1183fa769ac22121f92276dae52f89acaf297f24b1320019f439b6e3b46f"
|
||||
checksum = "a8af54f5d48af1226928adc1f57edd22f5df1349e7da1fc96ae15cf43db0e871"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-sys-rs",
|
||||
|
@ -109,9 +109,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cairo-sys-rs"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c48f4af05fabdcfa9658178e1326efa061853f040ce7d72e33af6885196f421"
|
||||
checksum = "f55382a01d30e5e53f185eee269124f5e21ab526595b872751278dfbb463594e"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -199,12 +199,6 @@ dependencies = [
|
|||
"rustc_version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fragile"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa"
|
||||
|
||||
[[package]]
|
||||
name = "futures-channel"
|
||||
version = "0.3.17"
|
||||
|
@ -275,22 +269,23 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf"
|
||||
version = "0.16.4"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3094f2b8578136d1929cade4e0fff82f573521b579e96cfc24af2458431f176"
|
||||
checksum = "b023fbe0c6b407bd3d9805d107d9800da3829dc5a676653210f1d5f16d7f59bf"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"gdk-pixbuf-sys",
|
||||
"gio",
|
||||
"glib",
|
||||
"libc",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf-sys"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3092cf797a5f1210479ea38070d9ae8a5b8e9f8f1be9f32f4643c529c7d70016"
|
||||
checksum = "7b41bd2b44ed49d99277d3925652a163038bd5ed943ec9809338ffb2f4391e3b"
|
||||
dependencies = [
|
||||
"gio-sys",
|
||||
"glib-sys",
|
||||
|
@ -301,9 +296,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk4"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc7fc4b05be1159056c57a08102ea494892f75ff8517f5518b0401e466f77c69"
|
||||
checksum = "6e4887e17b6926db51f1e538d871a8b1f5ceb5dfa3bd0034dc42ec355b390d8f"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-rs",
|
||||
|
@ -317,9 +312,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk4-sys"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c057b794185a52862037526fb95aafabce9427fb98a7e9f5fe39a6f832c92822"
|
||||
checksum = "f4993c019bf03d18137c00ddafb2b23e73f7cbb45ae244f52af2542a3f4a9452"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk-pixbuf-sys",
|
||||
|
@ -360,9 +355,9 @@ checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
|
|||
|
||||
[[package]]
|
||||
name = "gio"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d4a17d999e6e4e05d87c2bb05b7140d47769bc53211711a33e2f91536458714"
|
||||
checksum = "1981edf8679d2f2c8ec3120015867f45aa0a1c2d5e3e129ca2f7dda174d3d2a9"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"futures-channel",
|
||||
|
@ -380,9 +375,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gio-sys"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229"
|
||||
checksum = "b5d3076ecb86c8c3a672c9843d6232b3a344fb81d304d0ba1ac64b23343efa46"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
@ -393,9 +388,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib"
|
||||
version = "0.16.4"
|
||||
version = "0.17.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5204a4217749b385cefbfb7bf3a2fcde83e4ce6d0945f64440a1f5bd4010305"
|
||||
checksum = "91b429154ec5943185aeeaf79e646297567b6a056965f1e89da2657a0e23255b"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"futures-channel",
|
||||
|
@ -408,6 +403,7 @@ dependencies = [
|
|||
"glib-sys",
|
||||
"gobject-sys",
|
||||
"libc",
|
||||
"memchr",
|
||||
"once_cell",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
|
@ -415,9 +411,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib-macros"
|
||||
version = "0.16.3"
|
||||
version = "0.17.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e084807350b01348b6d9dbabb724d1a0bb987f47a2c85de200e98e12e30733bf"
|
||||
checksum = "9bc80ac951300ca288dd9ab3863743c37a608fb0e5ca12863495640ec6b781ab"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck 0.4.0",
|
||||
|
@ -430,9 +426,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib-sys"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65"
|
||||
checksum = "9ddcb73fa8236277bedadaaadb76aef49c85d66340f83bece244f46c2d4f0e01"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"system-deps",
|
||||
|
@ -440,9 +436,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gobject-sys"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1"
|
||||
checksum = "9a0155d388840c77d61b033b66ef4f9bc7f4133d83df83572d6b4fb234a3be7d"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -451,9 +447,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "graphene-rs"
|
||||
version = "0.16.3"
|
||||
version = "0.17.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95ecb4d347e6d09820df3bdfd89a74a8eec07753a06bb92a3aac3ad31d04447b"
|
||||
checksum = "21cf11565bb0e4dfc2f99d4775b6c329f0d40a2cff9c0066214d31a0e1b46256"
|
||||
dependencies = [
|
||||
"glib",
|
||||
"graphene-sys",
|
||||
|
@ -462,9 +458,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "graphene-sys"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9aa82337d3972b4eafdea71e607c23f47be6f27f749aab613f1ad8ddbe6dcd6"
|
||||
checksum = "cf80a4849a8d9565410a8fec6fc3678e9c617f4ac7be182ca55ab75016e07af9"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -474,9 +470,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gsk4"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5dcd01e485189515263f6d3ac8a624b1c0cd13c1097991e72d0cc0c145a303c0"
|
||||
checksum = "432f981e4ea9f0739a5731d8a649acb794a3a729d2254e559ce7d613b17caf95"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-rs",
|
||||
|
@ -490,9 +486,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gsk4-sys"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f47c49111e33020615a6c6b78d755c8b54b8504143cae1bf972bccc03eaa3f59"
|
||||
checksum = "096cb59175b0915ebf69c05a45263c0c989bd8537b8f2169912d0de644ba6a76"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk4-sys",
|
||||
|
@ -506,14 +502,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gst-plugin-gtk4"
|
||||
version = "0.9.1"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52832b7e14e43c82e2139a0dbe704e8404bc6e306684cc417ccfdb876f522daa"
|
||||
checksum = "2f38df9956c32e9aa41df32cc624adc33397f73e8572d41016d9f31b2b875ccb"
|
||||
dependencies = [
|
||||
"fragile",
|
||||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"gstreamer-base",
|
||||
"gstreamer-gl",
|
||||
"gstreamer-video",
|
||||
"gtk4",
|
||||
"once_cell",
|
||||
|
@ -550,9 +546,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gstreamer"
|
||||
version = "0.19.3"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e52247a9e1c5a2edb082fac77a59f8b40ec4c4eb719ccafe37072daabf4b56a9"
|
||||
checksum = "6d73132d9be53e8317e92169e06aea63be6712210fa254b4f17b76f207bd44cf"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cfg-if",
|
||||
|
@ -569,14 +565,15 @@ dependencies = [
|
|||
"option-operations",
|
||||
"paste",
|
||||
"pretty-hex",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-base"
|
||||
version = "0.19.3"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a61a299f9ea2ca892b43e2e428b86c679875e95ba23f8ae06fd730308df630f0"
|
||||
checksum = "5598bfedbff12675a6cddbe420b6a3ba5039c64aaf7df130db6339d09b634b0e"
|
||||
dependencies = [
|
||||
"atomic_refcell",
|
||||
"bitflags 1.3.2",
|
||||
|
@ -589,9 +586,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gstreamer-base-sys"
|
||||
version = "0.19.3"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dbc3c4476e1503ae245c89fbe20060c30ec6ade5f44620bcc402cbc70a3911a1"
|
||||
checksum = "26114ed96f6668380f5a1554128159e98e06c3a7a8460f216d7cd6dce28f928c"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
@ -601,10 +598,41 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-sys"
|
||||
version = "0.19.2"
|
||||
name = "gstreamer-gl"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd119152dff9472ef8fa76afe7fb85a8ec639a5388f5c4b68058ce794a765a2a"
|
||||
checksum = "b82b83d18ad1c4d890694b4bedde170c748462a11f51a68428671bc1bf93e71e"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"glib",
|
||||
"gstreamer",
|
||||
"gstreamer-base",
|
||||
"gstreamer-gl-sys",
|
||||
"gstreamer-video",
|
||||
"libc",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-gl-sys"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f08af9ae5ca5aa01c4875346bb7e61310b75a9afc3607b52a6b73470be93bbc7"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
"gstreamer-base-sys",
|
||||
"gstreamer-sys",
|
||||
"gstreamer-video-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gstreamer-sys"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e56fe047adef7d47dbafa8bc1340fddb53c325e16574763063702fc94b5786d2"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
@ -614,9 +642,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gstreamer-video"
|
||||
version = "0.19.3"
|
||||
version = "0.20.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "065f78ce526608441f215182b94b624580a1817fe2982d1b1b439ab8d370af30"
|
||||
checksum = "5f74a5a277e91afde7f049174e6c84cfe670c7ae424a4a15ab309e60f25336f7"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cfg-if",
|
||||
|
@ -631,9 +659,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gstreamer-video-sys"
|
||||
version = "0.19.3"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "298b78c5980c7ca790c48bab740ca5ffe70d08997987da103bfbfc566bcfd2a9"
|
||||
checksum = "66ddb6112d438aac0004d2db6053a572f92b1c5e0e9d6ff6c71d9245f7f73e46"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
@ -645,9 +673,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk4"
|
||||
version = "0.5.2"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4c61a704ecdedd1c0ca66ff0184bd19e9c488835bb391655bfe6b60f6e2e43e"
|
||||
checksum = "73421200ad9c3919d0720779b345b05d31a6ce9998e74fc27012f12580822e46"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-rs",
|
||||
|
@ -668,9 +696,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk4-macros"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42f57e7025a8bae8429e07aeeae9c4c3fef5d7cd14834afdd6d6d23f76984246"
|
||||
checksum = "db4676c4f90d8b010e88cb4558f61f47d76d6f6b8e6f6b89e62640f443907f61"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"proc-macro-crate",
|
||||
|
@ -682,9 +710,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk4-sys"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42e1bb57be47aac6ce77b5281ad64389a19db5aba6db75b07f0049571ad6fe0f"
|
||||
checksum = "e13cf3bc9559f71963c957eb639060b643e1276ae47b892ef6091d5bc15c3e1b"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk-pixbuf-sys",
|
||||
|
@ -803,9 +831,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
|||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.4.1"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
|
@ -917,9 +945,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pango"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f6a83cd4015382dbb0f4fcf3ab7b277d4885711a62b2f2c1e6582a120094edad"
|
||||
checksum = "243c048be90312220fb3bd578176eed8290568274a93c95040289d39349384bc"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"gio",
|
||||
|
@ -931,9 +959,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pango-sys"
|
||||
version = "0.16.3"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e134909a9a293e04d2cc31928aa95679c5e4df954d0b85483159bd20d8f047f"
|
||||
checksum = "4293d0f0b5525eb5c24734d30b0ed02cd02aa734f216883f376b54de49625de8"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
|
|
@ -7,9 +7,9 @@ rust-version = "1.67"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
gtk = { version = "0.5.2", package = "gtk4" }
|
||||
gst = { package = "gstreamer", version = "0.19.3" }
|
||||
gst-plugin-gtk4 = { version = "0.9.1", optional=true }
|
||||
gtk = { version = "0.6.1", package = "gtk4" }
|
||||
gst = { package = "gstreamer", version = "0.20" }
|
||||
gst-plugin-gtk4 = { version = "0.10", optional=true }
|
||||
anyhow = "1"
|
||||
gettext-rs = {version = "0.7", features = ["gettext-system"]}
|
||||
log = "0.4.11"
|
||||
|
|
|
@ -133,8 +133,6 @@ mod imp {
|
|||
),
|
||||
);
|
||||
|
||||
obj.add_controller(&drag_controller);
|
||||
|
||||
let gesture = gtk::GestureClick::new();
|
||||
gesture.set_button(0);
|
||||
gesture.connect_pressed(
|
||||
|
@ -234,7 +232,6 @@ mod imp {
|
|||
}
|
||||
}
|
||||
}));
|
||||
obj.add_controller(&gesture);
|
||||
|
||||
let event_motion = gtk::EventControllerMotion::new();
|
||||
event_motion.connect_motion(glib::clone!(@weak obj => move |_e, x, y| {
|
||||
|
@ -245,7 +242,10 @@ mod imp {
|
|||
}
|
||||
|
||||
}));
|
||||
obj.add_controller(&event_motion);
|
||||
|
||||
obj.add_controller(drag_controller);
|
||||
obj.add_controller(gesture);
|
||||
obj.add_controller(event_motion);
|
||||
}
|
||||
|
||||
fn dispose(&self) {
|
||||
|
@ -458,26 +458,26 @@ impl GraphView {
|
|||
pub fn new() -> Self {
|
||||
// Load CSS from the STYLE variable.
|
||||
let provider = gtk::CssProvider::new();
|
||||
provider.load_from_data(GRAPHVIEW_STYLE.as_bytes());
|
||||
provider.load_from_data(GRAPHVIEW_STYLE);
|
||||
gtk::StyleContext::add_provider_for_display(
|
||||
>k::gdk::Display::default().expect("Error initializing gtk css provider."),
|
||||
&provider,
|
||||
gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||
);
|
||||
glib::Object::new::<Self>(&[])
|
||||
glib::Object::new::<Self>()
|
||||
}
|
||||
|
||||
/// Set graphview id
|
||||
///
|
||||
pub fn set_id(&self, id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private.id.set(id)
|
||||
}
|
||||
|
||||
/// Retrives the graphview id
|
||||
///
|
||||
pub fn id(&self) -> u32 {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private.id.get()
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,7 @@ impl GraphView {
|
|||
/// Add node to the graphview without port
|
||||
///
|
||||
pub fn add_node(&self, node: Node) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
node.set_parent(self);
|
||||
|
||||
// Place widgets in colums of 3, growing down
|
||||
|
@ -566,7 +566,7 @@ impl GraphView {
|
|||
/// Remove node from the graphview
|
||||
///
|
||||
pub fn remove_node(&self, id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let mut nodes = private.nodes.borrow_mut();
|
||||
if let Some(node) = nodes.remove(&id) {
|
||||
while let Some(link_id) = self.node_is_linked(node.id()) {
|
||||
|
@ -584,7 +584,7 @@ impl GraphView {
|
|||
///
|
||||
/// Returns a vector of nodes
|
||||
pub fn all_nodes(&self, node_type: NodeType) -> Vec<Node> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let nodes = private.nodes.borrow();
|
||||
let nodes_list: Vec<_> = nodes
|
||||
.iter()
|
||||
|
@ -600,14 +600,14 @@ impl GraphView {
|
|||
///
|
||||
/// Returns `None` if the node is not in the graphview.
|
||||
pub fn node(&self, id: u32) -> Option<Node> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private.nodes.borrow().get(&id).cloned()
|
||||
}
|
||||
|
||||
/// Remove all the nodes from the graphview
|
||||
///
|
||||
pub fn remove_all_nodes(&self) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let nodes_list = self.all_nodes(NodeType::All);
|
||||
for node in nodes_list {
|
||||
self.remove_node(node.id());
|
||||
|
@ -622,7 +622,7 @@ impl GraphView {
|
|||
///
|
||||
/// Returns Some(link id) or `None` if the node is not linked.
|
||||
pub fn node_is_linked(&self, node_id: u32) -> Option<u32> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
for (key, link) in private.links.borrow().iter() {
|
||||
if link.node_from == node_id || link.node_to == node_id {
|
||||
return Some(*key);
|
||||
|
@ -670,7 +670,7 @@ impl GraphView {
|
|||
/// Add the port with id from node with id.
|
||||
///
|
||||
pub fn add_port_to_node(&self, node: &mut Node, port: Port) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let port_id = port.id();
|
||||
node.add_port(port);
|
||||
|
||||
|
@ -681,7 +681,7 @@ impl GraphView {
|
|||
///
|
||||
/// Return true if the port presence is not always.
|
||||
pub fn can_remove_port(&self, node_id: u32, port_id: u32) -> bool {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let nodes = private.nodes.borrow();
|
||||
if let Some(node) = nodes.get(&node_id) {
|
||||
return node.can_remove_port(port_id);
|
||||
|
@ -693,7 +693,7 @@ impl GraphView {
|
|||
/// Remove the port with id from node with id.
|
||||
///
|
||||
pub fn remove_port(&self, node_id: u32, port_id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let nodes = private.nodes.borrow();
|
||||
if let Some(node) = nodes.get(&node_id) {
|
||||
if let Some(link_id) = self.port_is_linked(port_id) {
|
||||
|
@ -707,7 +707,7 @@ impl GraphView {
|
|||
///
|
||||
/// Returns Some(link id) or `None` if the port is not linked.
|
||||
pub fn port_is_linked(&self, port_id: u32) -> Option<u32> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
for (key, link) in private.links.borrow().iter() {
|
||||
if link.port_from == port_id || link.port_to == port_id {
|
||||
return Some(*key);
|
||||
|
@ -741,7 +741,7 @@ impl GraphView {
|
|||
/// Add a link to the graphView
|
||||
///
|
||||
pub fn add_link(&self, link: Link) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
if !self.link_exists(&link) {
|
||||
private.links.borrow_mut().insert(link.id, link);
|
||||
self.graph_updated();
|
||||
|
@ -751,7 +751,7 @@ impl GraphView {
|
|||
/// Set the link state with ink id and link state (boolean)
|
||||
///
|
||||
pub fn set_link_state(&self, link_id: u32, active: bool) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
if let Some(link) = private.links.borrow_mut().get_mut(&link_id) {
|
||||
link.active = active;
|
||||
self.queue_draw();
|
||||
|
@ -764,7 +764,7 @@ impl GraphView {
|
|||
///
|
||||
/// Returns a vector of links
|
||||
pub fn all_links(&self, link_state: bool) -> Vec<Link> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let links = private.links.borrow();
|
||||
let links_list: Vec<_> = links
|
||||
.iter()
|
||||
|
@ -777,7 +777,7 @@ impl GraphView {
|
|||
/// Retrieves the node/port id connected to the input port id
|
||||
///
|
||||
pub fn port_connected_to(&self, port_id: u32) -> Option<(u32, u32)> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
for (_id, link) in private.links.borrow().iter() {
|
||||
if port_id == link.port_from {
|
||||
return Some((link.port_to, link.node_to));
|
||||
|
@ -789,7 +789,7 @@ impl GraphView {
|
|||
/// Delete the selected element (link, node, port)
|
||||
///
|
||||
pub fn delete_selected(&self) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let mut link_id = None;
|
||||
let mut node_id = None;
|
||||
for link in private.links.borrow_mut().values() {
|
||||
|
@ -815,7 +815,7 @@ impl GraphView {
|
|||
/// Render the graph with XML format in a buffer
|
||||
///
|
||||
pub fn render_xml(&self) -> anyhow::Result<Vec<u8>> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
|
||||
let mut buffer = Vec::new();
|
||||
let mut writer = EmitterConfig::new()
|
||||
|
@ -1114,7 +1114,7 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn remove_link(&self, id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
let mut links = private.links.borrow_mut();
|
||||
links.remove(&id);
|
||||
|
||||
|
@ -1122,14 +1122,14 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn update_current_link_id(&self, link_id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
if link_id > private.current_link_id.get() {
|
||||
private.current_link_id.set(link_id);
|
||||
}
|
||||
}
|
||||
|
||||
fn link_exists(&self, new_link: &Link) -> bool {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
|
||||
for link in private.links.borrow().values() {
|
||||
if (new_link.port_from == link.port_from && new_link.port_to == link.port_to)
|
||||
|
@ -1170,7 +1170,7 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn unselect_nodes(&self) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
for node in private.nodes.borrow_mut().values() {
|
||||
node.set_selected(false);
|
||||
node.unselect_all_ports();
|
||||
|
@ -1178,14 +1178,14 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn update_current_node_id(&self, node_id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
if node_id > private.current_node_id.get() {
|
||||
private.current_node_id.set(node_id);
|
||||
}
|
||||
}
|
||||
|
||||
fn unselect_links(&self) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
for link in private.links.borrow_mut().values() {
|
||||
link.set_selected(false);
|
||||
}
|
||||
|
@ -1198,7 +1198,7 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn point_on_link(&self, point: &graphene::Point) -> Option<Link> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
self.unselect_all();
|
||||
for link in private.links.borrow_mut().values() {
|
||||
if let Some((from_x, from_y, to_x, to_y)) = private.link_coordinates(link) {
|
||||
|
@ -1220,13 +1220,13 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn graph_updated(&self) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
self.queue_draw();
|
||||
self.emit_by_name::<()>("graph-updated", &[&private.id.get()]);
|
||||
}
|
||||
|
||||
fn next_node_id(&self) -> u32 {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private
|
||||
.current_node_id
|
||||
.set(private.current_node_id.get() + 1);
|
||||
|
@ -1234,7 +1234,7 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn next_port_id(&self) -> u32 {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private
|
||||
.current_port_id
|
||||
.set(private.current_port_id.get() + 1);
|
||||
|
@ -1242,7 +1242,7 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn next_link_id(&self) -> u32 {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private
|
||||
.current_link_id
|
||||
.set(private.current_link_id.get() + 1);
|
||||
|
@ -1253,17 +1253,17 @@ impl GraphView {
|
|||
if port.is_some() {
|
||||
self.unselect_all();
|
||||
}
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
*private.port_selected.borrow_mut() = port.cloned();
|
||||
}
|
||||
|
||||
fn selected_port(&self) -> RefMut<Option<Port>> {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private.port_selected.borrow_mut()
|
||||
}
|
||||
|
||||
fn set_mouse_position(&self, x: f64, y: f64) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
private.mouse_position.set((x, y));
|
||||
}
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ impl GraphView {
|
|||
}
|
||||
|
||||
fn update_current_port_id(&self, port_id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let private = imp::GraphView::from_obj(self);
|
||||
if port_id > private.current_port_id.get() {
|
||||
private.current_port_id.set(port_id);
|
||||
}
|
||||
|
|
|
@ -139,8 +139,8 @@ impl Node {
|
|||
/// Create a new node
|
||||
///
|
||||
pub fn new(id: u32, name: &str, node_type: NodeType) -> Self {
|
||||
let res = glib::Object::new::<Self>(&[]);
|
||||
let private = imp::Node::from_instance(&res);
|
||||
let res = glib::Object::new::<Self>();
|
||||
let private = imp::Node::from_obj(&res);
|
||||
private.id.set(id).expect("Node id is already set");
|
||||
res.set_name(name);
|
||||
res.add_css_class("node");
|
||||
|
@ -154,7 +154,7 @@ impl Node {
|
|||
/// Add a new port to the node
|
||||
///
|
||||
pub fn add_port(&mut self, port: Port) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
match port.direction() {
|
||||
PortDirection::Input => {
|
||||
private
|
||||
|
@ -176,7 +176,7 @@ impl Node {
|
|||
/// Retrieves all ports as an hashmap
|
||||
///
|
||||
pub fn ports(&self) -> Ref<HashMap<u32, Port>> {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.ports.borrow()
|
||||
}
|
||||
|
||||
|
@ -195,14 +195,14 @@ impl Node {
|
|||
/// Retrieves the port with id
|
||||
///
|
||||
pub fn port(&self, id: u32) -> Option<super::port::Port> {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.ports.borrow().get(&id).cloned()
|
||||
}
|
||||
|
||||
/// Check if we can remove a port dependending on PortPrensence attribute
|
||||
///
|
||||
pub fn can_remove_port(&self, id: u32) -> bool {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
if let Some(port) = private.ports.borrow().get(&id) {
|
||||
if port.presence() != PortPresence::Always {
|
||||
return true;
|
||||
|
@ -214,7 +214,7 @@ impl Node {
|
|||
/// Removes a port id from the given node
|
||||
///
|
||||
pub fn remove_port(&self, id: u32) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
if let Some(port) = private.ports.borrow_mut().remove(&id) {
|
||||
match port.direction() {
|
||||
PortDirection::Input => private.num_ports_in.set(private.num_ports_in.get() - 1),
|
||||
|
@ -228,21 +228,21 @@ impl Node {
|
|||
/// Retrieves the node id
|
||||
///
|
||||
pub fn id(&self) -> u32 {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.id.get().copied().expect("Node id is not set")
|
||||
}
|
||||
|
||||
/// Retrieves the node name
|
||||
///
|
||||
pub fn name(&self) -> String {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.name.text().to_string()
|
||||
}
|
||||
|
||||
/// Retrieves the unique name composed with the node name and its id
|
||||
///
|
||||
pub fn unique_name(&self) -> String {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
let mut unique_name = private.name.text().to_string();
|
||||
unique_name.push_str(&self.id().to_string());
|
||||
unique_name
|
||||
|
@ -251,14 +251,14 @@ impl Node {
|
|||
/// Retrieves the NodeType
|
||||
///
|
||||
pub fn node_type(&self) -> Option<&NodeType> {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.node_type.get()
|
||||
}
|
||||
|
||||
/// Unselect all the ports of the given node.
|
||||
///
|
||||
pub fn unselect_all_ports(&self) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
for port in private.ports.borrow_mut().values() {
|
||||
port.set_selected(false);
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ impl Node {
|
|||
/// Set coordinates for the drawn node.
|
||||
///
|
||||
pub fn set_position(&self, x: f32, y: f32) {
|
||||
imp::Node::from_instance(self).position.set((x, y));
|
||||
imp::Node::from_obj(self).position.set((x, y));
|
||||
}
|
||||
|
||||
/// Get coordinates for the drawn node.
|
||||
|
@ -275,11 +275,11 @@ impl Node {
|
|||
/// # Returns
|
||||
/// `(x, y)`
|
||||
pub fn position(&self) -> (f32, f32) {
|
||||
imp::Node::from_instance(self).position.get()
|
||||
imp::Node::from_obj(self).position.get()
|
||||
}
|
||||
|
||||
pub fn set_light(&self, light: bool) {
|
||||
let self_ = imp::Node::from_instance(self);
|
||||
let self_ = imp::Node::from_obj(self);
|
||||
self_.light.set(light);
|
||||
if light {
|
||||
self.add_css_class("node-light");
|
||||
|
@ -289,25 +289,25 @@ impl Node {
|
|||
}
|
||||
|
||||
pub fn light(&self) -> bool {
|
||||
let self_ = imp::Node::from_instance(self);
|
||||
let self_ = imp::Node::from_obj(self);
|
||||
self_.light.get()
|
||||
}
|
||||
|
||||
//Private
|
||||
|
||||
fn set_name(&self, name: &str) {
|
||||
let self_ = imp::Node::from_instance(self);
|
||||
let self_ = imp::Node::from_obj(self);
|
||||
self_.name.set_text(name);
|
||||
}
|
||||
|
||||
fn set_description(&self, description: &str) {
|
||||
let self_ = imp::Node::from_instance(self);
|
||||
let self_ = imp::Node::from_obj(self);
|
||||
self_.description.set_text(description);
|
||||
trace!("Node description is {}", description);
|
||||
}
|
||||
|
||||
fn update_description(&self) {
|
||||
let self_ = imp::Node::from_instance(self);
|
||||
let self_ = imp::Node::from_obj(self);
|
||||
let mut description = String::from("");
|
||||
for (name, value) in self_.properties.borrow().iter() {
|
||||
if !self.hidden_property(name) {
|
||||
|
@ -325,7 +325,7 @@ impl SelectionExt for Node {
|
|||
}
|
||||
|
||||
fn set_selected(&self, selected: bool) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.selected.set(selected);
|
||||
if selected {
|
||||
self.add_css_class("node-selected");
|
||||
|
@ -335,7 +335,7 @@ impl SelectionExt for Node {
|
|||
}
|
||||
|
||||
fn selected(&self) -> bool {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.selected.get()
|
||||
}
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ impl PropertyExt for Node {
|
|||
/// Add a node property with a name and a value.
|
||||
///
|
||||
fn add_property(&self, name: &str, value: &str) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
trace!("property name={} updated with value={}", name, value);
|
||||
private
|
||||
.properties
|
||||
|
@ -356,7 +356,7 @@ impl PropertyExt for Node {
|
|||
/// Remove a port property with a name.
|
||||
///
|
||||
fn remove_property(&self, name: &str) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
trace!("property name={} removed", name);
|
||||
private.properties.borrow_mut().remove(name);
|
||||
self.update_description();
|
||||
|
@ -365,7 +365,7 @@ impl PropertyExt for Node {
|
|||
/// Retrieves node properties.
|
||||
///
|
||||
fn properties(&self) -> Ref<HashMap<String, String>> {
|
||||
let private = imp::Node::from_instance(self);
|
||||
let private = imp::Node::from_obj(self);
|
||||
private.properties.borrow()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,9 +135,9 @@ impl Port {
|
|||
///
|
||||
pub fn new(id: u32, name: &str, direction: PortDirection, presence: PortPresence) -> Self {
|
||||
// Create the widget and initialize needed fields
|
||||
let port: Self = glib::Object::new::<Self>(&[]);
|
||||
let port: Self = glib::Object::new::<Self>();
|
||||
port.add_css_class("port");
|
||||
let private = imp::Port::from_instance(&port);
|
||||
let private = imp::Port::from_obj(&port);
|
||||
private.id.set(id).expect("Port id already set");
|
||||
private.selected.set(false);
|
||||
private
|
||||
|
@ -166,35 +166,35 @@ impl Port {
|
|||
/// Retrieves the port id
|
||||
///
|
||||
pub fn id(&self) -> u32 {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
private.id.get().copied().expect("Port id is not set")
|
||||
}
|
||||
|
||||
/// Retrieves the port name
|
||||
///
|
||||
pub fn name(&self) -> String {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
private.label.text().to_string()
|
||||
}
|
||||
|
||||
/// Set the port name
|
||||
///
|
||||
pub fn set_name(&self, name: &str) {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
private.label.set_text(name);
|
||||
}
|
||||
|
||||
/// Retrieves the port direction
|
||||
///
|
||||
pub fn direction(&self) -> PortDirection {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
*private.direction.get().expect("Port direction is not set")
|
||||
}
|
||||
|
||||
/// Retrieves the port presence
|
||||
///
|
||||
pub fn presence(&self) -> PortPresence {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
*private.presence.get().expect("Port presence is not set")
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ impl SelectionExt for Port {
|
|||
}
|
||||
|
||||
fn set_selected(&self, selected: bool) {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
private.selected.set(selected);
|
||||
if selected {
|
||||
self.add_css_class("port-selected");
|
||||
|
@ -215,7 +215,7 @@ impl SelectionExt for Port {
|
|||
}
|
||||
|
||||
fn selected(&self) -> bool {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
private.selected.get()
|
||||
}
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ impl PropertyExt for Port {
|
|||
/// Add a port property with a name and a value.
|
||||
///
|
||||
fn add_property(&self, name: &str, value: &str) {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
trace!("property name={} updated with value={}", name, value);
|
||||
private
|
||||
.properties
|
||||
|
@ -235,7 +235,7 @@ impl PropertyExt for Port {
|
|||
/// Remove a port property with a name.
|
||||
///
|
||||
fn remove_property(&self, name: &str) {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
trace!("property name={} removed", name);
|
||||
private.properties.borrow_mut().remove(name);
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ impl PropertyExt for Port {
|
|||
/// Retrieves node properties.
|
||||
///
|
||||
fn properties(&self) -> Ref<HashMap<String, String>> {
|
||||
let private = imp::Port::from_instance(self);
|
||||
let private = imp::Port::from_obj(self);
|
||||
private.properties.borrow()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue