~nicohman/signal-rs

f72f1012a4b1aa4cfc535e6e12dd722d3cb9b57a — nicohman 1 year, 20 days ago d6e8691
GTK start
5 files changed, 728 insertions(+), 237 deletions(-)

M Cargo.lock
M Cargo.toml
M src/main.rs
A src/signal.glade
M src/signal.rs
M Cargo.lock => Cargo.lock +558 -51
@@ 42,6 42,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e"

[[package]]
name = "anyhow"
version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"

[[package]]
name = "approx"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 57,6 63,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"

[[package]]
name = "atk"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812b4911e210bd51b24596244523c856ca749e6223c50a7fbbba3f89ee37c426"
dependencies = [
 "atk-sys",
 "bitflags",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
]

[[package]]
name = "atk-sys"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f530e4af131d94cc4fa15c5c9d0348f0ef28bac64ba660b6b2a1cf2605dedfce"
dependencies = [
 "glib-sys",
 "gobject-sys",
 "libc",
 "system-deps",
]

[[package]]
name = "autocfg"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 116,6 148,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"

[[package]]
name = "cairo-rs"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5c0f2e047e8ca53d0ff249c54ae047931d7a6ebe05d00af73e0ffeb6e34bdb8"
dependencies = [
 "bitflags",
 "cairo-sys-rs",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
 "thiserror",
]

[[package]]
name = "cairo-sys-rs"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ed2639b9ad5f1d6efa76de95558e11339e7318426d84ac4890b86c03e828ca7"
dependencies = [
 "glib-sys",
 "libc",
 "system-deps",
]

[[package]]
name = "calloop"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 281,6 339,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"

[[package]]
name = "either"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"

[[package]]
name = "enum_variant_type"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 330,12 394,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"

[[package]]
name = "futures"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
 "futures-channel",
 "futures-core",
 "futures-executor",
 "futures-io",
 "futures-sink",
 "futures-task",
 "futures-util",
]

[[package]]
name = "futures-channel"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
 "futures-core",
 "futures-sink",
]

[[package]]
name = "futures-core"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"

[[package]]
name = "futures-executor"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
 "futures-core",
 "futures-task",
 "futures-util",
]

[[package]]
name = "futures-io"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"

[[package]]
name = "futures-macro"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 359,7 465,7 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
dependencies = [
 "once_cell",
 "once_cell 1.4.1",
]

[[package]]


@@ 368,10 474,13 @@ version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
 "futures-channel",
 "futures-core",
 "futures-io",
 "futures-macro",
 "futures-sink",
 "futures-task",
 "memchr",
 "pin-project",
 "pin-utils",
 "proc-macro-hack",


@@ 380,6 489,71 @@ dependencies = [
]

[[package]]
name = "gdk"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db00839b2a68a7a10af3fa28dfb3febaba3a20c3a9ac2425a33b7df1f84a6b7d"
dependencies = [
 "bitflags",
 "cairo-rs",
 "cairo-sys-rs",
 "gdk-pixbuf",
 "gdk-sys",
 "gio",
 "gio-sys",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
 "pango",
]

[[package]]
name = "gdk-pixbuf"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f6dae3cb99dd49b758b88f0132f8d401108e63ae8edd45f432d42cdff99998a"
dependencies = [
 "gdk-pixbuf-sys",
 "gio",
 "gio-sys",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
]

[[package]]
name = "gdk-pixbuf-sys"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bfe468a7f43e97b8d193a762b6c5cf67a7d36cacbc0b9291dbcae24bfea1e8f"
dependencies = [
 "gio-sys",
 "glib-sys",
 "gobject-sys",
 "libc",
 "system-deps",
]

[[package]]
name = "gdk-sys"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a9653cfc500fd268015b1ac055ddbc3df7a5c9ea3f4ccef147b3957bd140d69"
dependencies = [
 "cairo-sys-rs",
 "gdk-pixbuf-sys",
 "gio-sys",
 "glib-sys",
 "gobject-sys",
 "libc",
 "pango-sys",
 "pkg-config",
 "system-deps",
]

[[package]]
name = "generic-array"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 407,6 581,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"

[[package]]
name = "gio"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb60242bfff700772dae5d9e3a1f7aa2e4ebccf18b89662a16acb2822568561"
dependencies = [
 "bitflags",
 "futures",
 "futures-channel",
 "futures-core",
 "futures-io",
 "futures-util",
 "gio-sys",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
 "once_cell 1.4.1",
 "thiserror",
]

[[package]]
name = "gio-sys"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e24fb752f8f5d2cf6bbc2c606fd2bc989c81c5e2fe321ab974d54f8b6344eac"
dependencies = [
 "glib-sys",
 "gobject-sys",
 "libc",
 "system-deps",
 "winapi 0.3.9",
]

[[package]]
name = "gl_generator"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 418,6 626,51 @@ dependencies = [
]

[[package]]
name = "glib"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f11a45bde4cf9567653a14ff96cdbb01e6d2a89651746dbc118319dfdac433e"
dependencies = [
 "bitflags",
 "futures-channel",
 "futures-core",
 "futures-executor",
 "futures-task",
 "futures-util",
 "glib-macros",
 "glib-sys",
 "gobject-sys",
 "libc",
 "once_cell 1.4.1",
]

[[package]]
name = "glib-macros"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41486a26d1366a8032b160b59065a59fb528530a46a49f627e7048fb8c064039"
dependencies = [
 "anyhow",
 "heck",
 "itertools",
 "proc-macro-crate",
 "proc-macro-error",
 "proc-macro2 1.0.20",
 "quote 1.0.7",
 "syn",
]

[[package]]
name = "glib-sys"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1"
dependencies = [
 "libc",
 "system-deps",
]

[[package]]
name = "glium"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 429,7 682,7 @@ dependencies = [
 "glutin",
 "lazy_static",
 "memoffset",
 "smallvec",
 "smallvec 1.4.2",
 "takeable-option",
]



@@ 454,7 707,7 @@ dependencies = [
 "log",
 "objc",
 "osmesa-sys",
 "parking_lot",
 "parking_lot 0.10.2",
 "wayland-client",
 "winapi 0.3.9",
 "winit",


@@ 506,82 759,106 @@ dependencies = [
]

[[package]]
name = "hermit-abi"
version = "0.1.15"
name = "gobject-sys"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c"
dependencies = [
 "glib-sys",
 "libc",
 "system-deps",
]

[[package]]
name = "http"
version = "0.2.1"
name = "gtk"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9"
checksum = "2f022f2054072b3af07666341984562c8e626a79daa8be27b955d12d06a5ad6a"
dependencies = [
 "bytes",
 "fnv",
 "itoa",
 "atk",
 "bitflags",
 "cairo-rs",
 "cairo-sys-rs",
 "cc",
 "gdk",
 "gdk-pixbuf",
 "gdk-pixbuf-sys",
 "gdk-sys",
 "gio",
 "gio-sys",
 "glib",
 "glib-sys",
 "gobject-sys",
 "gtk-sys",
 "libc",
 "once_cell 1.4.1",
 "pango",
 "pango-sys",
 "pkg-config",
]

[[package]]
name = "httparse"
version = "1.3.4"
name = "gtk-sys"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9"
checksum = "89acda6f084863307d948ba64a4b1ef674e8527dddab147ee4cdcc194c880457"
dependencies = [
 "atk-sys",
 "cairo-sys-rs",
 "gdk-pixbuf-sys",
 "gdk-sys",
 "gio-sys",
 "glib-sys",
 "gobject-sys",
 "libc",
 "pango-sys",
 "system-deps",
]

[[package]]
name = "idna"
version = "0.2.0"
name = "heck"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
dependencies = [
 "matches",
 "unicode-bidi",
 "unicode-normalization",
 "unicode-segmentation",
]

[[package]]
name = "imgui"
version = "0.4.0"
name = "hermit-abi"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fdb2bcc7e498e78137ce28705ae836d69e36ee2eac89d0d926cfabfcf550570"
checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
dependencies = [
 "bitflags",
 "glium",
 "imgui-sys",
 "lazy_static",
 "parking_lot",
 "libc",
]

[[package]]
name = "imgui-glium-renderer"
version = "0.4.0"
name = "http"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c73e47cb3db3e354e3977265b14d7e6ff8b55a83f06ab6c7d04b4d441d64f586"
checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9"
dependencies = [
 "glium",
 "imgui",
 "bytes",
 "fnv",
 "itoa",
]

[[package]]
name = "imgui-sys"
version = "0.4.0"
name = "httparse"
version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72be9671d64dd0ed26bb708cd10060a431262ac90ae70cf7c5912feefe6849da"
dependencies = [
 "cc",
]
checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9"

[[package]]
name = "imgui-winit-support"
version = "0.4.0"
name = "idna"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f98171c35263e3eb0dfb66cb876e3efdb788d777c1b613c7d2592303d1276bb5"
checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
dependencies = [
 "imgui",
 "winit",
 "matches",
 "unicode-bidi",
 "unicode-normalization",
]

[[package]]


@@ 609,6 886,15 @@ dependencies = [
]

[[package]]
name = "itertools"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
dependencies = [
 "either",
]

[[package]]
name = "itoa"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 987,6 1273,15 @@ checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"

[[package]]
name = "once_cell"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d584f08c2d717d5c23a6414fc2822b71c651560713e54fa7eace675f758a355e"
dependencies = [
 "parking_lot 0.9.0",
]

[[package]]
name = "once_cell"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"


@@ 1049,13 1344,97 @@ dependencies = [
]

[[package]]
name = "pango"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9937068580bebd8ced19975938573803273ccbcbd598c58d4906efd4ac87c438"
dependencies = [
 "bitflags",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
 "once_cell 1.4.1",
 "pango-sys",
]

[[package]]
name = "pango-sys"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d2650c8b62d116c020abd0cea26a4ed96526afda89b1c4ea567131fdefc890"
dependencies = [
 "glib-sys",
 "gobject-sys",
 "libc",
 "system-deps",
]

[[package]]
name = "pangocairo"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00f5ae67a05a5e023f09f64e9a71c845274d4b82dedee237b70425811885e883"
dependencies = [
 "bitflags",
 "cairo-rs",
 "cairo-sys-rs",
 "glib",
 "glib-sys",
 "gobject-sys",
 "libc",
 "pango",
 "pango-sys",
 "pangocairo-sys",
]

[[package]]
name = "pangocairo-sys"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94ccc97f698c2f0233b84e5ca676893a1e676785b60eec700b9c0e6dcd0feb98"
dependencies = [
 "cairo-sys-rs",
 "glib-sys",
 "libc",
 "pango-sys",
 "system-deps",
]

[[package]]
name = "parking_lot"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
dependencies = [
 "lock_api",
 "parking_lot_core 0.6.2",
 "rustc_version",
]

[[package]]
name = "parking_lot"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
dependencies = [
 "lock_api",
 "parking_lot_core",
 "parking_lot_core 0.7.2",
]

[[package]]
name = "parking_lot_core"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
dependencies = [
 "cfg-if",
 "cloudabi",
 "libc",
 "redox_syscall",
 "rustc_version",
 "smallvec 0.6.13",
 "winapi 0.3.9",
]

[[package]]


@@ 1068,7 1447,7 @@ dependencies = [
 "cloudabi",
 "libc",
 "redox_syscall",
 "smallvec",
 "smallvec 1.4.2",
 "winapi 0.3.9",
]



@@ 1132,6 1511,30 @@ dependencies = [
]

[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
 "proc-macro-error-attr",
 "proc-macro2 1.0.20",
 "quote 1.0.7",
 "syn",
 "version_check",
]

[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
 "proc-macro2 1.0.20",
 "quote 1.0.7",
 "version_check",
]

[[package]]
name = "proc-macro-hack"
version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1262,6 1665,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"

[[package]]
name = "rustc_version"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
dependencies = [
 "semver",
]

[[package]]
name = "rusttype"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1336,6 1748,21 @@ dependencies = [
]

[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
 "semver-parser",
]

[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"

[[package]]
name = "serde"
version = "1.0.115"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1403,14 1830,20 @@ dependencies = [
name = "signal-rs"
version = "0.1.0"
dependencies = [
 "cairo-rs",
 "crossbeam-channel",
 "enum_variant_type",
 "futures-util",
 "gdk",
 "gdk-pixbuf",
 "gio",
 "glib",
 "glium",
 "imgui",
 "imgui-glium-renderer",
 "imgui-winit-support",
 "gtk",
 "mio 0.7.0",
 "once_cell 0.2.4",
 "pango",
 "pangocairo",
 "serde",
 "serde_json",
 "tokio",


@@ 1427,6 1860,15 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"

[[package]]
name = "smallvec"
version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
dependencies = [
 "maybe-uninit",
]

[[package]]
name = "smallvec"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"


@@ 1469,6 1911,24 @@ dependencies = [
]

[[package]]
name = "strum"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b"

[[package]]
name = "strum_macros"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c"
dependencies = [
 "heck",
 "proc-macro2 1.0.20",
 "quote 1.0.7",
 "syn",
]

[[package]]
name = "syn"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1480,6 1940,21 @@ dependencies = [
]

[[package]]
name = "system-deps"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b"
dependencies = [
 "heck",
 "pkg-config",
 "strum",
 "strum_macros",
 "thiserror",
 "toml",
 "version-compare",
]

[[package]]
name = "takeable-option"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1500,6 1975,26 @@ dependencies = [
]

[[package]]
name = "thiserror"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
dependencies = [
 "thiserror-impl",
]

[[package]]
name = "thiserror-impl"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
dependencies = [
 "proc-macro2 1.0.20",
 "quote 1.0.7",
 "syn",
]

[[package]]
name = "tinyvec"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1607,6 2102,12 @@ dependencies = [
]

[[package]]
name = "unicode-segmentation"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"

[[package]]
name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1642,6 2143,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"

[[package]]
name = "version-compare"
version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1"

[[package]]
name = "version_check"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 1795,7 2302,7 @@ dependencies = [
 "ndk-glue",
 "ndk-sys",
 "objc",
 "parking_lot",
 "parking_lot 0.10.2",
 "percent-encoding",
 "raw-window-handle",
 "smithay-client-toolkit",

M Cargo.toml => Cargo.toml +10 -4
@@ 17,7 17,13 @@ tokio = { version = "0.2.22",features = ["io-util", "full", "stream"] }
tokio-tungstenite = "*"
enum_variant_type = "0.2.0"
glium = { version = "0.27", default-features = true }
imgui-glium-renderer = "0.4.0"
imgui-winit-support = "0.4.0"
imgui = "0.4.0"
crossbeam-channel = "0.4.4"
\ No newline at end of file
crossbeam-channel = "0.4.4"
glib = "^0"
gio = "^0"
gdk = "^0"
gdk-pixbuf = "^0"
gtk = "^0"
once_cell = "^0"
pango = "^0"
pangocairo = "^0"
cairo-rs = { version = "^0", features = ["png"] }
\ No newline at end of file

M src/main.rs => src/main.rs +114 -177
@@ 1,14 1,9 @@
#[macro_use]
extern crate serde;
extern crate glium;
extern crate imgui_glium_renderer;
extern crate imgui_winit_support;
extern crate mio;
extern crate tungstenite;
extern crate url;
#[macro_use]
extern crate imgui;
#[macro_use]
extern crate enum_variant_type;
#[macro_use]
extern crate serde_json;


@@ 16,6 11,9 @@ extern crate crossbeam_channel;
#[macro_use]
extern crate tokio;
extern crate futures_util;
extern crate gio;
extern crate glib;
extern crate gtk;
extern crate tokio_tungstenite;
use crossbeam_channel::*;
use futures_util::sink::SinkExt;


@@ 24,188 22,127 @@ use serde::*;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::prelude::*;
use tokio::sync::mpsc::*;
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message};
use tokio_tungstenite::{connect_async};
const CONNECTION: &'static str = "ws://localhost:9080/ws";
mod signal;
use glium::glutin;
use glium::glutin::event::{Event, WindowEvent};
use glium::glutin::event_loop::{ControlFlow, EventLoop};
use glium::glutin::window::WindowBuilder;
use glium::{Display, Surface};
use imgui::*;
use imgui::{Context, FontConfig, FontGlyphRanges, FontSource, Ui};
use imgui_glium_renderer::Renderer;
use imgui_winit_support::{HiDpiMode, WinitPlatform};
use gio::prelude::*;
use glib::prelude::*;
use gtk::prelude::*;
use glib::clone;
use gtk::*;
use signal::*;
use std::time::Duration;
use std::time::Instant;
use std::collections::*;
use std::env::args;
use tungstenite::*;
use url::Url;
pub struct GuiController {
    pub event_loop: EventLoop<()>,
    pub display: glium::Display,
    pub imgui: Context,
    pub platform: WinitPlatform,
    pub renderer: Renderer,
    pub font_size: f32,
pub struct SignalState {
    pub chats: HashMap<i32, Chat>,
}
#[tokio::main]
async fn main() -> Result<()> {
    let controller = init();
    let (resSender, resReceiver) = unbounded::<SignalResponse>();
    let (reqSender, mut reqReceiver) = unbounded_channel::<SignalRequest>();
    let handle = tokio::spawn(async move {
        let (mut socket, response) = connect_async(Url::parse(CONNECTION).unwrap())
            .await
            .unwrap();
        let mut session = SignalSession::from_socket(socket);
        loop {
            tokio::select! {
                next = session.stream.next() => {
                    println!("Got response");
                    resSender.send(next.unwrap());
                },
                inc = reqReceiver.recv() => {
                    println!("Sending reqest");
                    session.send(inc.unwrap()).await;
                },
            };
impl SignalState {
    pub fn new() -> SignalState {
        SignalState {
            chats: HashMap::new(),
        }
        let req = SignalRequest::GetContactList;
        let req2 = SignalRequest::GetChatList;
        let req3 = SignalRequest::AddContact {
            name: "Nico".to_string(),
            phone: "+14254920949".to_string(),
        };
        let res: ContactList = session.send_res(req).await.unwrap();
        //let res2 : ChatList = session.send_res(req2).await.unwrap();
        session.send(req3).await.unwrap();
        println!("{}", serde_json::to_string(&res).unwrap());
        //println!("{}", serde_json::to_string(&res2).unwrap());
    });
    let mut total : Vec<SignalResponse> = vec![];
    let mut manager = SignalManager::new();
    controller
        .main_loop(move |_, ui, display| {
            let inc_count = resReceiver.len();
            let mut incoming : Vec<SignalResponse> = resReceiver.iter().take(inc_count).collect();
            manager.process_responses(incoming);
            Window::new(im_str!("Signal"))
                .size(
                    display.gl_window().window().outer_size().into(),
                    Condition::Always,
                )
                .resizable(false)
                .menu_bar(false)
                .position([0.0, 0.0], Condition::Always)
                .title_bar(true)
                .collapsible(false)
                .build(ui, || {
                    ui.separator();
                    let clicked = ui.button(im_str!("Fetch contacts"), [120.0,20.0]);
                    if clicked {
                        println!("Fetching contacts");
                        reqSender.send(SignalRequest::GetContactList);
                    }
                    ui.separator();
                    for (tel, contact) in &manager.contacts {
                        ui.text_wrapped(&ImString::new(format!("{} - {}", contact.name, contact.tel)));
                        if ui.is_item_clicked(MouseButton::Left) {
                            println!("{}", tel);
                        }
    }
    pub fn process_response(&mut self, response: SignalResponse) {
        match response {
            SignalResponse::ChatList(chats) => {
                for chat in chats.into_iter() {
                    if let Some(mut chat_p) = self.chats.get_mut(&chat.ID) {
                        *chat_p = chat;
                    } else {
                        self.chats.insert(chat.ID, chat);
                    }
                });
        })
        .await;
    Ok(())
}
fn init() -> GuiController {
    let title = "Signal".to_string();
    let event_loop = EventLoop::new();
    let context = glutin::ContextBuilder::new().with_vsync(true);
    let builder = WindowBuilder::new()
        .with_title(title)
        .with_inner_size(glutin::dpi::LogicalSize::new(1024f64, 768f64));
    let display =
        Display::new(builder, context, &event_loop).expect("Failed to initialize display");
    let mut imgui = Context::create();
    imgui.style_mut().window_rounding = 0.0;
    imgui.set_ini_filename(None);
    let mut platform = WinitPlatform::init(&mut imgui);
    {
        let gl_window = display.gl_window();
        let window = gl_window.window();
        platform.attach_window(imgui.io_mut(), &window, HiDpiMode::Rounded);
                }
            }
            _ => {}
        };
    }
    let hidpi_factor = platform.hidpi_factor();
    let font_size = (13.0 * hidpi_factor) as f32;
    imgui.fonts().add_font(&[FontSource::DefaultFontData {
        config: Some(FontConfig {
            size_pixels: font_size,
            ..FontConfig::default()
        }),
    }]);
    imgui.io_mut().font_global_scale = (1.0 / hidpi_factor) as f32;
    let renderer = Renderer::init(&mut imgui, &display).expect("Failed to initialize renderer");
    GuiController {
        event_loop,
        display,
        imgui,
        platform,
        renderer,
        font_size,
    pub fn chat_by_tel<'a>(&'a self, tel: String) -> Option<&'a Chat> {
        self.chats.values().filter(|x| {
            x.tel == tel
        }).next()
    }
}
impl GuiController {
    pub async fn main_loop<F: FnMut(&mut bool, &mut Ui, &Display) + 'static>(self, mut run_ui: F) {
        let GuiController {
            event_loop,
            display,
            mut imgui,
            mut platform,
            mut renderer,
            ..
        } = self;
        let mut last_frame = Instant::now();

        event_loop.run(move |event, _, control_flow| match event {
            Event::NewEvents(_) => {
                let now = Instant::now();
                imgui.io_mut().update_delta_time(now);
                last_frame = now;
            }
            Event::MainEventsCleared => {
                let gl_window = display.gl_window();
                platform
                    .prepare_frame(imgui.io_mut(), &gl_window.window())
                    .expect("Failed to prepare frame");
                gl_window.window().request_redraw();
            }
            Event::RedrawRequested(_) => {
                let mut ui = imgui.frame();
                let mut run = true;
                run_ui(&mut run, &mut ui, &display);
                if !run {
                    *control_flow = ControlFlow::Exit;
                }
                let gl_window = display.gl_window();
                let mut target = display.draw();
                target.clear_color_srgb(1.0, 1.0, 1.0, 1.0);
                platform.prepare_render(&ui, gl_window.window());
                let draw_data = ui.render();
                renderer
                    .render(&mut target, draw_data)
                    .expect("Rendering failed");
                target.finish().expect("Failed to swap buffers");
            }
            Event::WindowEvent {
                event: WindowEvent::CloseRequested,
                ..
            } => *control_flow = ControlFlow::Poll,
            event => {
                let gl_window = display.gl_window();
                platform.handle_event(imgui.io_mut(), gl_window.window(), &event);
            }
        })
pub struct Message {
    pub msg: SignalMessage,
}
impl Message {
    pub fn build_ui(&self) -> gtk::Box {
        let msg_box = gtk::Box::new(Orientation::Vertical, 6);
        let label = Label::new(Some(&self.msg.message));
        msg_box.add(&label);
        msg_box
    }
}
#[tokio::main]
async fn main() -> Result<()> {
    let mut total: Vec<SignalResponse> = vec![];
    let mut manager = SignalManager::new();
    let application = gtk::Application::new(Some("com.nicohman"), Default::default()).unwrap();
    application.connect_activate(move |app| {
        let (resSender, resReceiver) =
            glib::MainContext::channel::<SignalResponse>(glib::PRIORITY_DEFAULT);
        let (reqSender, mut reqReceiver) = unbounded_channel::<SignalRequest>();
        let handle = tokio::spawn(async move {
            let (mut socket, response) = connect_async(Url::parse(CONNECTION).unwrap())
                .await
                .unwrap();
            let mut session = SignalSession::from_socket(socket);
            loop {
                tokio::select! {
                    next = session.stream.next() => {
                        println!("Got response");
                        resSender.send(next.unwrap());
                    },
                    inc = reqReceiver.recv() => {
                        println!("Sending reqest");
                        session.send(inc.unwrap()).await;
                    },
                };
            }
            let req = SignalRequest::GetContactList;
            let req2 = SignalRequest::GetChatList;
            let req3 = SignalRequest::AddContact {
                name: "Nico".to_string(),
                phone: "".to_string(),
            };
            let res: ContactList = session.send_res(req).await.unwrap();
            //let res2 : ChatList = session.send_res(req2).await.unwrap();
            session.send(req3).await.unwrap();
            println!("{}", serde_json::to_string(&res).unwrap());
            //println!("{}", serde_json::to_string(&res2).unwrap());
        });

        let mut state = SignalState::new();
        let window = gtk::ApplicationWindow::new(app);
        window.set_title("Signal");
        window.set_border_width(10);
        window.set_position(gtk::WindowPosition::Center);
        window.set_default_size(350, 70);
        let mut input = gtk::EntryBuilder::new().build();
        let button = gtk::Button::with_label("Send debug text");
        button.connect_clicked(clone!( @weak input => move |_| {
            reqSender.send(SignalRequest::SendMessage {
                to: "".to_owned(),
                message: input.get_buffer().get_text().clone(),
            });
        }));
        let mut app_box = gtk::Box::new(Orientation::Vertical, 6);
        let mut message_box = gtk::Box::new(Orientation::Vertical, 8);
        let mut text = gtk::TextViewBuilder::new().wrap_mode(WrapMode::Word).build();
        //app_box.add(&text);
        app_box.add(&message_box);
        app_box.add(&input);
        window.add(&app_box);
        app_box.add(&button);
        resReceiver.attach(None, move |value| {
            state.process_response(value);
            text.get_buffer().unwrap().set_text(&format!("{:?}", state.chats));
            Continue(true)
        });
        window.show_all();
    });
    application.run(&args().collect::<Vec<_>>());
    Ok(())
}

A src/signal.glade => src/signal.glade +43 -0
@@ 0,0 1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.36.0 -->
<interface>
  <requires lib="gtk+" version="3.22"/>
  <object class="GtkApplicationWindow" id="window1">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkBox">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="orientation">vertical</property>
        <property name="baseline_position">top</property>
        <child>
          <placeholder/>
        </child>
        <child>
          <object class="GtkBox">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="orientation">vertical</property>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="position">1</property>
          </packing>
        </child>
      </object>
    </child>
    <child type="titlebar">
      <placeholder/>
    </child>
  </object>
</interface>

M src/signal.rs => src/signal.rs +3 -5
@@ 9,13 9,13 @@ use futures_util::{future, pin_mut, StreamExt};
use mio::net::TcpStream;
use serde::*;
use serde::{Deserialize, Serialize};
use std::collections::*;
use std::convert::TryFrom;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::prelude::*;
use tokio::stream::*;
use tokio_tungstenite::tungstenite::protocol::*;
use tokio_tungstenite::*;
use std::collections::*;
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[serde(tag = "request")]


@@ 146,7 146,7 @@ impl<'a> SignalSession<'a> {
    }
}
pub struct SignalManager {
    pub contacts : HashMap<String, Contact>,
    pub contacts: HashMap<String, Contact>,
}
impl SignalManager {
    pub fn new() -> SignalManager {


@@ 161,10 161,8 @@ impl SignalManager {
                    for contact in v.into_iter() {
                        self.contacts.insert(contact.tel.clone(), contact);
                    }
                },
                _ => {
                    
                }
                _ => {}
            }
        }
    }