├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── Roboto-Regular.ttf ├── build.rs ├── paint-brush ├── cursors │ └── paint-brush ├── index.theme ├── paint-brush.config └── paint-brush.png └── src ├── color.rs ├── keyboard.rs ├── main.rs ├── output.rs └── pointer.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "aho-corasick" 3 | version = "0.6.9" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | dependencies = [ 6 | "memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 7 | ] 8 | 9 | [[package]] 10 | name = "ansi_term" 11 | version = "0.11.0" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | dependencies = [ 14 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 15 | ] 16 | 17 | [[package]] 18 | name = "approx" 19 | version = "0.3.1" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | dependencies = [ 22 | "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 23 | ] 24 | 25 | [[package]] 26 | name = "arrayvec" 27 | version = "0.4.10" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | dependencies = [ 30 | "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", 31 | ] 32 | 33 | [[package]] 34 | name = "aster" 35 | version = "0.41.0" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | dependencies = [ 38 | "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 39 | ] 40 | 41 | [[package]] 42 | name = "atty" 43 | version = "0.2.11" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | dependencies = [ 46 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 47 | "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 48 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 49 | ] 50 | 51 | [[package]] 52 | name = "bindgen" 53 | version = "0.30.0" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | dependencies = [ 56 | "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", 57 | "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 58 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 59 | "clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", 60 | "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", 61 | "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 62 | "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 63 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 64 | "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 65 | "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", 66 | "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", 67 | "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 68 | "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 69 | "which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 70 | ] 71 | 72 | [[package]] 73 | name = "bitflags" 74 | version = "0.8.2" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | 77 | [[package]] 78 | name = "bitflags" 79 | version = "0.9.1" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | 82 | [[package]] 83 | name = "bitflags" 84 | version = "1.0.4" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | 87 | [[package]] 88 | name = "byteorder" 89 | version = "1.3.1" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | 92 | [[package]] 93 | name = "calloop" 94 | version = "0.4.2" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | dependencies = [ 97 | "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", 98 | "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 99 | "nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 100 | ] 101 | 102 | [[package]] 103 | name = "cc" 104 | version = "1.0.29" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | 107 | [[package]] 108 | name = "cexpr" 109 | version = "0.2.3" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | dependencies = [ 112 | "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 113 | ] 114 | 115 | [[package]] 116 | name = "cfg-if" 117 | version = "0.1.6" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | 120 | [[package]] 121 | name = "clang-sys" 122 | version = "0.19.0" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | dependencies = [ 125 | "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", 126 | "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 127 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 128 | "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 129 | ] 130 | 131 | [[package]] 132 | name = "clap" 133 | version = "2.32.0" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | dependencies = [ 136 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 137 | "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 138 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 139 | "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 140 | "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 141 | "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 142 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 143 | ] 144 | 145 | [[package]] 146 | name = "dlib" 147 | version = "0.4.1" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | dependencies = [ 150 | "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 151 | ] 152 | 153 | [[package]] 154 | name = "downcast-rs" 155 | version = "1.0.3" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | 158 | [[package]] 159 | name = "env_logger" 160 | version = "0.4.3" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | dependencies = [ 163 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 164 | "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 165 | ] 166 | 167 | [[package]] 168 | name = "fs_extra" 169 | version = "1.1.0" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | 172 | [[package]] 173 | name = "fuchsia-zircon" 174 | version = "0.3.3" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | dependencies = [ 177 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 178 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 179 | ] 180 | 181 | [[package]] 182 | name = "fuchsia-zircon-sys" 183 | version = "0.3.3" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | 186 | [[package]] 187 | name = "gcc" 188 | version = "0.3.55" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | 191 | [[package]] 192 | name = "glob" 193 | version = "0.2.11" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | 196 | [[package]] 197 | name = "iovec" 198 | version = "0.1.2" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | dependencies = [ 201 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 202 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 203 | ] 204 | 205 | [[package]] 206 | name = "kernel32-sys" 207 | version = "0.2.2" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | dependencies = [ 210 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 211 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 212 | ] 213 | 214 | [[package]] 215 | name = "lazy_static" 216 | version = "0.2.11" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | 219 | [[package]] 220 | name = "lazy_static" 221 | version = "1.2.0" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | 224 | [[package]] 225 | name = "lazycell" 226 | version = "1.2.1" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | 229 | [[package]] 230 | name = "libc" 231 | version = "0.2.48" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | 234 | [[package]] 235 | name = "libloading" 236 | version = "0.4.3" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | dependencies = [ 239 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 240 | "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 241 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 242 | ] 243 | 244 | [[package]] 245 | name = "libloading" 246 | version = "0.5.0" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | dependencies = [ 249 | "cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", 250 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 251 | ] 252 | 253 | [[package]] 254 | name = "log" 255 | version = "0.3.9" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | dependencies = [ 258 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 259 | ] 260 | 261 | [[package]] 262 | name = "log" 263 | version = "0.4.6" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | dependencies = [ 266 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 267 | ] 268 | 269 | [[package]] 270 | name = "memchr" 271 | version = "1.0.2" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | dependencies = [ 274 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 275 | ] 276 | 277 | [[package]] 278 | name = "memchr" 279 | version = "2.1.3" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | dependencies = [ 282 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 283 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 284 | ] 285 | 286 | [[package]] 287 | name = "meson" 288 | version = "1.0.0" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | 291 | [[package]] 292 | name = "mio" 293 | version = "0.6.16" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | dependencies = [ 296 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 297 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 298 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 299 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 300 | "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 301 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 302 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 303 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 304 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 305 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 306 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 307 | ] 308 | 309 | [[package]] 310 | name = "mio-extras" 311 | version = "2.0.5" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | dependencies = [ 314 | "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 315 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 316 | "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", 317 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 318 | ] 319 | 320 | [[package]] 321 | name = "miow" 322 | version = "0.2.1" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | dependencies = [ 325 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 326 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 327 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 328 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 329 | ] 330 | 331 | [[package]] 332 | name = "ms-paint-compositor" 333 | version = "1.0.0" 334 | dependencies = [ 335 | "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 336 | "rusttype 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", 337 | "wlroots 0.2.4 (git+https://github.com/swaywm/wlroots-rs)", 338 | ] 339 | 340 | [[package]] 341 | name = "net2" 342 | version = "0.2.33" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | dependencies = [ 345 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 346 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 347 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 348 | ] 349 | 350 | [[package]] 351 | name = "nix" 352 | version = "0.11.0" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | dependencies = [ 355 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 356 | "cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", 357 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 358 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 359 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 360 | ] 361 | 362 | [[package]] 363 | name = "nix" 364 | version = "0.12.0" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | dependencies = [ 367 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 368 | "cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", 369 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 370 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 371 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 372 | ] 373 | 374 | [[package]] 375 | name = "nodrop" 376 | version = "0.1.13" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | 379 | [[package]] 380 | name = "nom" 381 | version = "3.2.1" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | dependencies = [ 384 | "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 385 | ] 386 | 387 | [[package]] 388 | name = "num-traits" 389 | version = "0.2.6" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | 392 | [[package]] 393 | name = "ordered-float" 394 | version = "1.0.1" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | dependencies = [ 397 | "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 398 | ] 399 | 400 | [[package]] 401 | name = "peeking_take_while" 402 | version = "0.1.2" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | 405 | [[package]] 406 | name = "pkg-config" 407 | version = "0.3.14" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | 410 | [[package]] 411 | name = "proc-macro2" 412 | version = "0.4.27" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | dependencies = [ 415 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 416 | ] 417 | 418 | [[package]] 419 | name = "quasi" 420 | version = "0.32.0" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | dependencies = [ 423 | "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 424 | "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 425 | ] 426 | 427 | [[package]] 428 | name = "quasi_codegen" 429 | version = "0.32.0" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | dependencies = [ 432 | "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", 433 | "syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 434 | "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 435 | "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 436 | ] 437 | 438 | [[package]] 439 | name = "quote" 440 | version = "0.6.11" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | dependencies = [ 443 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 444 | ] 445 | 446 | [[package]] 447 | name = "redox_syscall" 448 | version = "0.1.51" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | 451 | [[package]] 452 | name = "redox_termios" 453 | version = "0.1.1" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | dependencies = [ 456 | "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", 457 | ] 458 | 459 | [[package]] 460 | name = "regex" 461 | version = "0.2.11" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | dependencies = [ 464 | "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 465 | "memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 466 | "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", 467 | "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 468 | "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 469 | ] 470 | 471 | [[package]] 472 | name = "regex-syntax" 473 | version = "0.5.6" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | dependencies = [ 476 | "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 477 | ] 478 | 479 | [[package]] 480 | name = "rustc-serialize" 481 | version = "0.3.24" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | 484 | [[package]] 485 | name = "rusttype" 486 | version = "0.7.5" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | dependencies = [ 489 | "approx 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 490 | "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", 491 | "ordered-float 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 492 | "stb_truetype 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 493 | ] 494 | 495 | [[package]] 496 | name = "slab" 497 | version = "0.4.2" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | 500 | [[package]] 501 | name = "stb_truetype" 502 | version = "0.2.6" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | dependencies = [ 505 | "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 506 | ] 507 | 508 | [[package]] 509 | name = "strsim" 510 | version = "0.7.0" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | 513 | [[package]] 514 | name = "syn" 515 | version = "0.15.26" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | dependencies = [ 518 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 519 | "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", 520 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 521 | ] 522 | 523 | [[package]] 524 | name = "syntex" 525 | version = "0.58.1" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | dependencies = [ 528 | "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 529 | "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 530 | ] 531 | 532 | [[package]] 533 | name = "syntex_errors" 534 | version = "0.58.1" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | dependencies = [ 537 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 538 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 539 | "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 540 | "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 541 | "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 542 | ] 543 | 544 | [[package]] 545 | name = "syntex_pos" 546 | version = "0.58.1" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | dependencies = [ 549 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 550 | ] 551 | 552 | [[package]] 553 | name = "syntex_syntax" 554 | version = "0.58.1" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | dependencies = [ 557 | "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 558 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 559 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 560 | "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 561 | "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", 562 | "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 563 | ] 564 | 565 | [[package]] 566 | name = "term" 567 | version = "0.4.6" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | dependencies = [ 570 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 571 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 572 | ] 573 | 574 | [[package]] 575 | name = "termion" 576 | version = "1.5.1" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | dependencies = [ 579 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 580 | "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", 581 | "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 582 | ] 583 | 584 | [[package]] 585 | name = "textwrap" 586 | version = "0.10.0" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | dependencies = [ 589 | "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 590 | ] 591 | 592 | [[package]] 593 | name = "thread_local" 594 | version = "0.3.6" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | dependencies = [ 597 | "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 598 | ] 599 | 600 | [[package]] 601 | name = "ucd-util" 602 | version = "0.1.3" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | 605 | [[package]] 606 | name = "unicode-width" 607 | version = "0.1.5" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | 610 | [[package]] 611 | name = "unicode-xid" 612 | version = "0.0.4" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | 615 | [[package]] 616 | name = "unicode-xid" 617 | version = "0.1.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | 620 | [[package]] 621 | name = "utf8-ranges" 622 | version = "1.0.2" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | 625 | [[package]] 626 | name = "vec_map" 627 | version = "0.8.1" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | 630 | [[package]] 631 | name = "void" 632 | version = "1.0.2" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | 635 | [[package]] 636 | name = "vsprintf" 637 | version = "1.0.1" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | dependencies = [ 640 | "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", 641 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 642 | ] 643 | 644 | [[package]] 645 | name = "wayland-commons" 646 | version = "0.21.11" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | dependencies = [ 649 | "nix 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 650 | "wayland-sys 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 651 | ] 652 | 653 | [[package]] 654 | name = "wayland-scanner" 655 | version = "0.21.11" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | dependencies = [ 658 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 659 | "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", 660 | "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 661 | ] 662 | 663 | [[package]] 664 | name = "wayland-server" 665 | version = "0.21.11" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | dependencies = [ 668 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 669 | "calloop 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 670 | "downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 671 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 672 | "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", 673 | "nix 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 674 | "wayland-commons 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 675 | "wayland-scanner 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 676 | "wayland-sys 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 677 | ] 678 | 679 | [[package]] 680 | name = "wayland-sys" 681 | version = "0.21.11" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | dependencies = [ 684 | "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 685 | "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 686 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 687 | ] 688 | 689 | [[package]] 690 | name = "which" 691 | version = "1.0.5" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | dependencies = [ 694 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 695 | ] 696 | 697 | [[package]] 698 | name = "winapi" 699 | version = "0.2.8" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | 702 | [[package]] 703 | name = "winapi" 704 | version = "0.3.6" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | dependencies = [ 707 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 708 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 709 | ] 710 | 711 | [[package]] 712 | name = "winapi-build" 713 | version = "0.1.1" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | 716 | [[package]] 717 | name = "winapi-i686-pc-windows-gnu" 718 | version = "0.4.0" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | 721 | [[package]] 722 | name = "winapi-x86_64-pc-windows-gnu" 723 | version = "0.4.0" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | 726 | [[package]] 727 | name = "wlroots" 728 | version = "0.2.4" 729 | source = "git+https://github.com/swaywm/wlroots-rs#cb7d9db57187ec30d6a3ce17c0eb831afc3cd2d3" 730 | dependencies = [ 731 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 732 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 733 | "vsprintf 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 734 | "wlroots-dehandle 2.0.0 (git+https://github.com/swaywm/wlroots-rs)", 735 | "wlroots-sys 0.2.1 (git+https://github.com/swaywm/wlroots-rs)", 736 | "xkbcommon 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 737 | ] 738 | 739 | [[package]] 740 | name = "wlroots-dehandle" 741 | version = "2.0.0" 742 | source = "git+https://github.com/swaywm/wlroots-rs#cb7d9db57187ec30d6a3ce17c0eb831afc3cd2d3" 743 | dependencies = [ 744 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 745 | "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", 746 | "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", 747 | ] 748 | 749 | [[package]] 750 | name = "wlroots-sys" 751 | version = "0.2.1" 752 | source = "git+https://github.com/swaywm/wlroots-rs#cb7d9db57187ec30d6a3ce17c0eb831afc3cd2d3" 753 | dependencies = [ 754 | "bindgen 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", 755 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 756 | "meson 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 757 | "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 758 | "wayland-commons 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 759 | "wayland-scanner 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 760 | "wayland-server 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 761 | "wayland-sys 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)", 762 | ] 763 | 764 | [[package]] 765 | name = "ws2_32-sys" 766 | version = "0.2.1" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | dependencies = [ 769 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 770 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 771 | ] 772 | 773 | [[package]] 774 | name = "xkbcommon" 775 | version = "0.3.0" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | dependencies = [ 778 | "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", 779 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 780 | ] 781 | 782 | [[package]] 783 | name = "xml-rs" 784 | version = "0.8.0" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | 787 | [metadata] 788 | "checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e" 789 | "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 790 | "checksum approx 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c57ff1a5b00753647aebbbcf4ea67fa1e711a65ea7a30eb90dbf07de2485aee" 791 | "checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" 792 | "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" 793 | "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" 794 | "checksum bindgen 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33024f55a754d920637461adf87fb485702a69bdf7ac1d307b7e18da93bae505" 795 | "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" 796 | "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" 797 | "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" 798 | "checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb" 799 | "checksum calloop 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4d5c2f21cbb322bacc9a32a815116c345057d47be11bf33f8038854b256ec01f" 800 | "checksum cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4390a3b5f4f6bce9c1d0c00128379df433e53777fdd30e92f16a529332baec4e" 801 | "checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" 802 | "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" 803 | "checksum clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "611ec2e3a7623afd8a8c0d027887b6b55759d894abbf5fe11b9dc11b50d5b49a" 804 | "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" 805 | "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" 806 | "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c" 807 | "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" 808 | "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" 809 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 810 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 811 | "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" 812 | "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" 813 | "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" 814 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 815 | "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" 816 | "checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" 817 | "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" 818 | "checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047" 819 | "checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" 820 | "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" 821 | "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 822 | "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" 823 | "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" 824 | "checksum memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e1dd4eaac298c32ce07eb6ed9242eda7d82955b9170b7d6db59b2e02cc63fcb8" 825 | "checksum meson 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6e688268407ad0a7c589bf2d7313db6c2079dae5c96df0f2d5903bc6343a91" 826 | "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" 827 | "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" 828 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 829 | "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" 830 | "checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17" 831 | "checksum nix 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "921f61dc817b379d0834e45d5ec45beaacfae97082090a49c2cf30dcbc30206f" 832 | "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" 833 | "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" 834 | "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" 835 | "checksum ordered-float 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2f0015e9e8e28ee20c581cfbfe47c650cedeb9ed0721090e0b7ebb10b9cdbcc2" 836 | "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 837 | "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" 838 | "checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" 839 | "checksum quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c45c4854d6d1cf5d531db97c75880feb91c958b0720f4ec1057135fec358b3" 840 | "checksum quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9e25fa23c044c1803f43ca59c98dac608976dd04ce799411edd58ece776d4" 841 | "checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1" 842 | "checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85" 843 | "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" 844 | "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" 845 | "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" 846 | "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" 847 | "checksum rusttype 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ce3926a2057b315b3e8bca6d1cec1e97f19436a8f9127621cd538cda9c96a38b" 848 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 849 | "checksum stb_truetype 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "69b7df505db8e81d54ff8be4693421e5b543e08214bd8d99eb761fcb4d5668ba" 850 | "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" 851 | "checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" 852 | "checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e" 853 | "checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" 854 | "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" 855 | "checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791" 856 | "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" 857 | "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" 858 | "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" 859 | "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" 860 | "checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" 861 | "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" 862 | "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" 863 | "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 864 | "checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" 865 | "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 866 | "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 867 | "checksum vsprintf 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e3972a36b5053b7dbf84a3cd9328fbf7ec29a8367c4f3c3664884c611b4c0fa" 868 | "checksum wayland-commons 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)" = "92af0c5dc724c049e9bd927f8563d9a6abaa94893c5305ef0a6d2805e661f3d3" 869 | "checksum wayland-scanner 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3611f231e675e15c2feb7623103e6449edc6f10b0598cafb3e16e590a0561355" 870 | "checksum wayland-server 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)" = "40227ccb9d6de8b987ca20b6fadff16b16d71290507da7a3bd556e8d99731de8" 871 | "checksum wayland-sys 0.21.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2a69d729a1747a5bf40ae05b94c7904b64fbf2381e365c046d872ce4a34aa826" 872 | "checksum which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2" 873 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 874 | "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" 875 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 876 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 877 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 878 | "checksum wlroots 0.2.4 (git+https://github.com/swaywm/wlroots-rs)" = "" 879 | "checksum wlroots-dehandle 2.0.0 (git+https://github.com/swaywm/wlroots-rs)" = "" 880 | "checksum wlroots-sys 0.2.1 (git+https://github.com/swaywm/wlroots-rs)" = "" 881 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 882 | "checksum xkbcommon 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7ac975d685d902d49d5ae9b52dbd217b2accb40ae17ee6e62beec95fafe8c856" 883 | "checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5" 884 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ms-paint-compositor" 3 | description = "MS Paint as a Wayland compositor" 4 | version = "1.0.0" 5 | authors = ["Timidger "] 6 | repository = "https://github.com/Timidger/ms-paint-compositor" 7 | keywords = ["Wayland", "compositor", "window", "wlroots", "microsoft"] 8 | readme = "README.md" 9 | license = "MIT" 10 | build = "build.rs" 11 | 12 | [dependencies] 13 | wlroots = { git = "https://github.com/swaywm/wlroots-rs", features = ["unstable", "static"] } 14 | rusttype = "0.7" 15 | 16 | [build-dependencies] 17 | fs_extra = "1.0" 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MS Paint as a Wayland compositor 2 | -------------------------------------------------------------------------------- /Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Timidger/ms-paint-compositor/759362d1a691fba29e704fe77141d3f9858801b4/Roboto-Regular.ttf -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | use std::{env, fs, io}; 2 | 3 | extern crate fs_extra; 4 | 5 | fn main() { 6 | match fs::create_dir(env::home_dir().unwrap().join(".icons")) { 7 | Ok(_) => {}, 8 | Err(err) => if err.kind() != io::ErrorKind::AlreadyExists { 9 | Err(io::Error::new(err.kind(), err)).unwrap() 10 | } 11 | } 12 | let mut options = fs_extra::dir::CopyOptions::new(); 13 | options.overwrite = true; 14 | fs_extra::copy_items(&vec!["./paint-brush"], 15 | env::home_dir().unwrap().join(".icons"), 16 | &options) 17 | .expect("Could not move brush icon to ~/.icons"); 18 | } 19 | -------------------------------------------------------------------------------- /paint-brush/cursors/paint-brush: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Timidger/ms-paint-compositor/759362d1a691fba29e704fe77141d3f9858801b4/paint-brush/cursors/paint-brush -------------------------------------------------------------------------------- /paint-brush/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=paint-brush 3 | Comment= 4 | -------------------------------------------------------------------------------- /paint-brush/paint-brush.config: -------------------------------------------------------------------------------- 1 | 34 0 4 paint-brush.png 100 2 | -------------------------------------------------------------------------------- /paint-brush/paint-brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Timidger/ms-paint-compositor/759362d1a691fba29e704fe77141d3f9858801b4/paint-brush/paint-brush.png -------------------------------------------------------------------------------- /src/color.rs: -------------------------------------------------------------------------------- 1 | use wlroots::{input::keyboard::Key, 2 | xkbcommon::xkb::keysyms}; 3 | 4 | #[derive(Debug, Default)] 5 | pub struct Color { 6 | pub red: u8, 7 | pub blue: u8, 8 | pub green: u8 9 | } 10 | 11 | impl Into<[f32; 4]> for Color { 12 | fn into(self) -> [f32; 4] { 13 | [self.red as f32 / 255.0, 14 | self.green as f32 / 255.0, 15 | self.blue as f32 / 255.0, 16 | // alpha 17 | 1.0] 18 | } 19 | } 20 | 21 | #[derive(Debug, Default)] 22 | pub struct ColorState { 23 | pub editing_color: Option, 24 | pub index: Option, 25 | pub color: Color 26 | } 27 | 28 | impl ColorState { 29 | pub fn update_key(&mut self, key: Key) { 30 | let color = match self.editing_color.as_mut() { 31 | None => return, 32 | Some(color) => color 33 | }; 34 | let number = match key { 35 | keysyms::KEY_0 ..= keysyms::KEY_9 => 36 | std::char::from_digit(key - keysyms::KEY_0, 10).unwrap(), 37 | keysyms::KEY_a => 'a', 38 | keysyms::KEY_b => 'b', 39 | keysyms::KEY_c => 'c', 40 | keysyms::KEY_d => 'd', 41 | keysyms::KEY_e => 'e', 42 | keysyms::KEY_f => 'f', 43 | _ => return 44 | }; 45 | if color.len() >= 7 { 46 | return 47 | } 48 | if self.index.is_none() { 49 | self.index = Some(color.len()); 50 | } 51 | color.push(number) 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/keyboard.rs: -------------------------------------------------------------------------------- 1 | use wlroots::{wlroots_dehandle, compositor, 2 | input::keyboard, 3 | xkbcommon::xkb::keysyms}; 4 | 5 | use crate::CompositorState; 6 | 7 | pub fn keyboard_added(_compositor_handle: compositor::Handle, 8 | _keyboard_handle: keyboard::Handle) 9 | -> Option> { 10 | Some(Box::new(KeyboardHandler::default())) 11 | } 12 | 13 | #[derive(Default)] 14 | struct KeyboardHandler; 15 | 16 | impl keyboard::Handler for KeyboardHandler { 17 | #[wlroots_dehandle] 18 | fn on_key(&mut self, 19 | compositor_handle: compositor::Handle, 20 | _keyboard_handle: keyboard::Handle, 21 | key_event: &keyboard::event::Key) { 22 | #[dehandle] let compositor = compositor_handle; 23 | if key_event.key_state() == wlroots::WLR_KEY_RELEASED { 24 | return 25 | } 26 | for key in key_event.pressed_keys() { 27 | match key { 28 | keysyms::KEY_Escape => { 29 | wlroots::compositor::terminate() 30 | }, 31 | keysyms::KEY_XF86Switch_VT_1 ..= keysyms::KEY_XF86Switch_VT_12 => { 32 | let backend = compositor.backend_mut(); 33 | if let Some(mut session) = backend.get_session() { 34 | session.change_vt(key - keysyms::KEY_XF86Switch_VT_1 + 1); 35 | } 36 | }, 37 | keysyms::KEY_numbersign => { 38 | let state: &mut CompositorState = compositor.data.downcast_mut().unwrap(); 39 | if state.color_state.editing_color.is_some() { 40 | continue 41 | } 42 | state.color_state.editing_color = Some("#".into()); 43 | state.color_state.index = Some(0); 44 | } 45 | k => { 46 | let state: &mut CompositorState = compositor.data.downcast_mut().unwrap(); 47 | state.color_state.update_key(k) 48 | } 49 | } 50 | } 51 | let state: &mut CompositorState = compositor.data.downcast_mut().unwrap(); 52 | state.drawing = true; 53 | #[dehandle] let output_layout = state.output_layout_handle; 54 | for (output_handle, _) in output_layout.outputs() { 55 | #[dehandle] let output = output_handle; 56 | output.schedule_frame(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate wlroots; 2 | extern crate rusttype; 3 | 4 | mod keyboard; 5 | mod pointer; 6 | mod output; 7 | mod color; 8 | 9 | use wlroots::{compositor, 10 | utils::log::{WLR_DEBUG, init_logging}, 11 | wlroots_dehandle}; 12 | 13 | use crate::{pointer::pointer_added, 14 | keyboard::keyboard_added, 15 | output::output_added, 16 | color::ColorState}; 17 | 18 | pub struct CompositorState { 19 | xcursor_manager: wlroots::cursor::xcursor::Manager, 20 | cursor_handle: wlroots::cursor::Handle, 21 | output_layout_handle: wlroots::output::layout::Handle, 22 | dirty: Vec<(usize, usize)>, 23 | drawing: bool, 24 | color_state: ColorState 25 | } 26 | 27 | fn main() { 28 | init_logging(WLR_DEBUG, None); 29 | let compositor_state = setup_compositor_state(); 30 | let output_builder = wlroots::output::manager::Builder::default() 31 | .output_added(output_added); 32 | let input_builder = wlroots::input::manager::Builder::default() 33 | .pointer_added(pointer_added) 34 | .keyboard_added(keyboard_added); 35 | let compositor = compositor::Builder::new() 36 | .wl_shm(true) 37 | .gles2(true) 38 | .screenshooter(true) 39 | .input_manager(input_builder) 40 | .output_manager(output_builder) 41 | .build_auto(compositor_state); 42 | compositor.run(); 43 | } 44 | 45 | #[wlroots_dehandle] 46 | pub fn setup_compositor_state() -> CompositorState { 47 | let (dirty, drawing) = (vec![], false); 48 | use wlroots::{cursor::{Cursor, xcursor}, 49 | output::layout::Layout}; 50 | use crate::{pointer::CursorHandler, output::LayoutHandler}; 51 | let output_layout_handle = Layout::create(Box::new(LayoutHandler)); 52 | let cursor_handle = Cursor::create(Box::new(CursorHandler)); 53 | let xcursor_manager = xcursor::Manager::create("paint-brush".to_string(), 24) 54 | .expect("Could not create xcursor manager"); 55 | xcursor_manager.load(1.0); 56 | #[dehandle] let output_layout = output_layout_handle.clone(); 57 | #[dehandle] let cursor = cursor_handle.clone(); 58 | cursor.attach_output_layout(output_layout); 59 | CompositorState { xcursor_manager, 60 | cursor_handle, 61 | output_layout_handle, 62 | dirty, 63 | drawing, 64 | color_state: ColorState::default() 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/output.rs: -------------------------------------------------------------------------------- 1 | use wlroots::{area::{Area, Origin, Size}, 2 | render::{Renderer, matrix}, 3 | wlroots_dehandle, compositor, output}; 4 | use rusttype::{Font, Scale}; 5 | 6 | use crate::CompositorState; 7 | 8 | struct OutputHandler { 9 | font: Font<'static> 10 | } 11 | 12 | impl OutputHandler { 13 | fn new() -> Self { 14 | let font_data = include_bytes!("../Roboto-Regular.ttf"); 15 | let font = Font::from_bytes(font_data as &[u8]) 16 | .expect("Error constructing the font"); 17 | OutputHandler { font } 18 | } 19 | } 20 | 21 | impl output::Handler for OutputHandler { 22 | #[wlroots_dehandle] 23 | fn on_frame(&mut self, 24 | compositor_handle: compositor::Handle, 25 | output_handle: output::Handle) { 26 | #[dehandle] let compositor = compositor_handle; 27 | #[dehandle] let output = output_handle; 28 | let state: &mut CompositorState = compositor.data.downcast_mut().unwrap(); 29 | if !state.drawing { 30 | state.dirty.drain(..); 31 | return 32 | } 33 | let renderer = compositor.renderer.as_mut().expect("No renderer"); 34 | let mut renderer = renderer.render(output, None); 35 | self.render_drawing(state, &mut renderer); 36 | self.render_color_change(state, &mut renderer); 37 | } 38 | } 39 | 40 | impl OutputHandler { 41 | fn render_drawing(&mut self, 42 | state: &mut CompositorState, 43 | renderer: &mut Renderer) { 44 | let transform_matrix = renderer.output.transform_matrix(); 45 | for (x, y) in &state.dirty { 46 | let area = Area::new(Origin::new(*x as _, *y as _), Size::new(1, 1)); 47 | renderer.render_colored_rect(area, [1.0, 1.0, 1.0, 1.0], transform_matrix); 48 | } 49 | } 50 | 51 | fn render_color_change(&mut self, 52 | state: &mut CompositorState, 53 | renderer: &mut Renderer) { 54 | let transform_matrix = renderer.output.transform_matrix(); 55 | let transform_inverted = renderer.output.get_transform().invert(); 56 | let (width, height) = renderer.output.effective_resolution(); 57 | let color_state = &mut state.color_state; 58 | let color = match color_state.editing_color.as_ref() { 59 | None => return, 60 | Some(color) => color 61 | }; 62 | let color_index = match color_state.index.take() { 63 | None => return, 64 | Some(index) => index 65 | }; 66 | state.drawing = false; 67 | let scale = Scale::uniform(32.0); 68 | let size = Size::new(100, 100); // TODO this number is made up 69 | let mut area = Area::new(Origin::new((width / 2) - (size.width * 4), height / 2), 70 | size); 71 | for _ in 0..color_index { 72 | area.origin.x += area.size.width; 73 | } 74 | println!("Rendering {}", color.as_str().get(color_index..).unwrap()); 75 | let v_metrics = self.font.v_metrics(scale); 76 | // layout the glyphs in a line with 5 pixel padding 77 | let glyphs: Vec<_> = self.font 78 | .layout(color.as_str().get(color_index..).unwrap(), 79 | scale, 80 | rusttype::point(5.0, 5.0 + v_metrics.ascent)) 81 | .collect(); 82 | let glyphs_height = (v_metrics.ascent - v_metrics.descent).ceil() as u32; 83 | let glyphs_width = { 84 | let min_x = glyphs 85 | .first() 86 | .map(|g| g.pixel_bounding_box().unwrap().min.x) 87 | .unwrap(); 88 | let max_x = glyphs 89 | .last() 90 | .map(|g| g.pixel_bounding_box().unwrap().max.x) 91 | .unwrap(); 92 | (max_x - min_x) as u32 93 | }; 94 | // Loop through the glyphs in the text, positing each one on a line 95 | for glyph in glyphs { 96 | println!("rendering a glyph @ {:#?}", area); 97 | // Draw the glyph into the image per-pixel by using the draw closure 98 | let mut bytes = vec![0u8; (glyphs_width * 4 * glyphs_height) as usize]; 99 | glyph.draw(|x, y, v| { 100 | let index = ((x * 4) + (y * glyphs_width * 4) ) as usize; 101 | bytes[index + 0] = (v * 255.0) as u8; 102 | bytes[index + 1] = (v * 255.0) as u8; 103 | bytes[index+ 2] = (v * 255.0) as u8; 104 | }); 105 | let texture = renderer.create_texture_from_pixels(wlroots::wl_shm_format::WL_SHM_FORMAT_ARGB8888, 106 | glyphs_width * 4, 107 | glyphs_width, 108 | glyphs_height, 109 | &bytes) 110 | .expect("Could not construct texture"); 111 | let matrix = matrix::project_box(area, 112 | transform_inverted, 113 | 0.0, 114 | transform_matrix); 115 | area.origin.x += area.size.width; 116 | renderer.render_texture_with_matrix(&texture, matrix); 117 | } 118 | } 119 | } 120 | 121 | pub struct LayoutHandler; 122 | 123 | impl output::layout::Handler for LayoutHandler {} 124 | 125 | #[wlroots_dehandle] 126 | pub fn output_added<'output>(compositor: compositor::Handle, 127 | builder: output::Builder<'output>) 128 | -> Option> { 129 | let result = builder.build_best_mode(OutputHandler::new()); 130 | #[dehandle] let compositor = compositor; 131 | let CompositorState { ref output_layout_handle, .. } = compositor.downcast(); 132 | #[dehandle] let output = result.output.clone(); 133 | #[dehandle] let output_layout = output_layout_handle; 134 | output_layout.add_auto(output); 135 | Some(result) 136 | } 137 | -------------------------------------------------------------------------------- /src/pointer.rs: -------------------------------------------------------------------------------- 1 | use wlroots::{wlroots_dehandle, 2 | compositor, 3 | input::pointer, 4 | cursor}; 5 | 6 | use CompositorState; 7 | 8 | pub struct CursorHandler; 9 | 10 | impl cursor::Handler for CursorHandler {} 11 | 12 | pub struct PointerHandler; 13 | 14 | impl pointer::Handler for PointerHandler { 15 | #[wlroots_dehandle] 16 | fn on_motion_absolute(&mut self, 17 | compositor_handle: compositor::Handle, 18 | _pointer_handle: pointer::Handle, 19 | absolute_motion_event: &pointer::event::AbsoluteMotion) { 20 | #[dehandle] let compositor = compositor_handle; 21 | let &mut CompositorState { ref cursor_handle, 22 | ref mut dirty, 23 | drawing, .. } = compositor.downcast(); 24 | #[dehandle] let cursor = cursor_handle; 25 | let (x, y) = absolute_motion_event.pos(); 26 | let (old_x, old_y) = cursor.coords(); 27 | cursor.warp_absolute(absolute_motion_event.device(), x, y); 28 | let (x, y) = cursor.coords(); 29 | if !drawing { 30 | return 31 | } 32 | draw(dirty, (x as _, y as _), (old_x as _, old_y as _)); 33 | } 34 | 35 | #[wlroots_dehandle] 36 | fn on_button(&mut self, 37 | compositor_handle: compositor::Handle, 38 | _pointer_handle: pointer::Handle, 39 | event: &pointer::event::Button) { 40 | #[dehandle] let compositor = compositor_handle; 41 | let state: &mut CompositorState = compositor.downcast(); 42 | #[dehandle] let cursor = state.cursor_handle.clone(); 43 | let (x, y) = cursor.coords(); 44 | state.dirty.push((x as _, y as _)); 45 | state.drawing = event.state() == wlroots::WLR_BUTTON_PRESSED 46 | } 47 | 48 | #[wlroots_dehandle] 49 | fn on_motion(&mut self, 50 | compositor_handle: compositor::Handle, 51 | _pointer_handle: pointer::Handle, 52 | motion_event: &pointer::event::Motion) { 53 | #[dehandle] let compositor = compositor_handle; 54 | let &mut CompositorState { ref cursor_handle, ref mut dirty, drawing, .. } = compositor.downcast(); 55 | #[dehandle] let cursor = cursor_handle; 56 | let (delta_x, delta_y) = motion_event.delta(); 57 | let (old_x, old_y) = cursor.coords(); 58 | let (old_x, old_y) = (old_x.round() as isize, old_y.round() as isize); 59 | cursor.move_relative(None, delta_x, delta_y); 60 | if !drawing { 61 | return; 62 | } 63 | let (x, y) = cursor.coords(); 64 | let (x, y) = (x.round() as isize, y.round() as isize); 65 | draw(dirty, (old_x, old_y), (x, y)); 66 | } 67 | } 68 | 69 | fn draw(dirty: &mut Vec<(usize, usize)>, 70 | (mut old_x, mut old_y): (isize, isize), 71 | (x, y): (isize, isize)) { 72 | //println!("old: {:?}", (old_x, old_y)); 73 | //println!("cur: {:?}", (x, y)); 74 | while old_x != x || old_y != y { 75 | dirty.push(((old_x) as usize, (old_y) as usize)); 76 | if old_x != x { 77 | old_x += if old_x < x {1} else {-1}; 78 | } 79 | if old_y != y { 80 | old_y += if old_y < y {1} else {-1}; 81 | } 82 | } 83 | } 84 | 85 | #[wlroots_dehandle] 86 | pub fn pointer_added(compositor_handle: compositor::Handle, 87 | pointer_handle: pointer::Handle) 88 | -> Option> { 89 | #[dehandle] let compositor = compositor_handle; 90 | #[dehandle] let pointer = pointer_handle; 91 | let CompositorState { ref cursor_handle, ref mut xcursor_manager, 92 | .. } = compositor.downcast(); 93 | #[dehandle] let cursor = cursor_handle; 94 | xcursor_manager.set_cursor_image("paint-brush".to_string(), cursor); 95 | cursor.attach_input_device(pointer.input_device()); 96 | Some(Box::new(PointerHandler) as Box) 97 | } 98 | --------------------------------------------------------------------------------