Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

gtk: initialize a new flatpak project

+1255 -1
+2
.gitignore
··· 8 8 *.o 9 9 *.a 10 10 *~ 11 + *.ui 12 + 11 13 __pycache__ 12 14 13 15 # Don't exclude zig files
+400
Cargo.lock
··· 1282 1282 checksum = "1bf2a5fb3207c12b5d208ebc145f967fea5cac41a021c37417ccc31ba40f39ee" 1283 1283 1284 1284 [[package]] 1285 + name = "cairo-rs" 1286 + version = "0.20.5" 1287 + source = "registry+https://github.com/rust-lang/crates.io-index" 1288 + checksum = "d7fa699e1d7ae691001a811dda5ef0e3e42e1d4119b26426352989df9e94e3e6" 1289 + dependencies = [ 1290 + "bitflags 2.6.0", 1291 + "cairo-sys-rs", 1292 + "glib", 1293 + "libc", 1294 + ] 1295 + 1296 + [[package]] 1297 + name = "cairo-sys-rs" 1298 + version = "0.20.0" 1299 + source = "registry+https://github.com/rust-lang/crates.io-index" 1300 + checksum = "428290f914b9b86089f60f5d8a9f6e440508e1bcff23b25afd51502b0a2da88f" 1301 + dependencies = [ 1302 + "glib-sys", 1303 + "libc", 1304 + "system-deps", 1305 + ] 1306 + 1307 + [[package]] 1285 1308 name = "cbc" 1286 1309 version = "0.1.2" 1287 1310 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1314 1337 checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" 1315 1338 dependencies = [ 1316 1339 "nom 7.1.3", 1340 + ] 1341 + 1342 + [[package]] 1343 + name = "cfg-expr" 1344 + version = "0.17.1" 1345 + source = "registry+https://github.com/rust-lang/crates.io-index" 1346 + checksum = "c360837f8f19e2e4468275138f1c0dec1647d1e17bb7c0215fe3cd7530e93c25" 1347 + dependencies = [ 1348 + "smallvec", 1349 + "target-lexicon", 1317 1350 ] 1318 1351 1319 1352 [[package]] ··· 3246 3279 checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" 3247 3280 3248 3281 [[package]] 3282 + name = "field-offset" 3283 + version = "0.3.6" 3284 + source = "registry+https://github.com/rust-lang/crates.io-index" 3285 + checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" 3286 + dependencies = [ 3287 + "memoffset 0.9.1", 3288 + "rustc_version 0.4.1", 3289 + ] 3290 + 3291 + [[package]] 3249 3292 name = "filetime" 3250 3293 version = "0.2.25" 3251 3294 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3536 3579 ] 3537 3580 3538 3581 [[package]] 3582 + name = "gdk-pixbuf" 3583 + version = "0.20.4" 3584 + source = "registry+https://github.com/rust-lang/crates.io-index" 3585 + checksum = "c4c29071a9e92337d8270a85cb0510cda4ac478be26d09ad027cc1d081911b19" 3586 + dependencies = [ 3587 + "gdk-pixbuf-sys", 3588 + "gio", 3589 + "glib", 3590 + "libc", 3591 + ] 3592 + 3593 + [[package]] 3594 + name = "gdk-pixbuf-sys" 3595 + version = "0.20.4" 3596 + source = "registry+https://github.com/rust-lang/crates.io-index" 3597 + checksum = "687343b059b91df5f3fbd87b4307038fa9e647fcc0461d0d3f93e94fee20bf3d" 3598 + dependencies = [ 3599 + "gio-sys", 3600 + "glib-sys", 3601 + "gobject-sys", 3602 + "libc", 3603 + "system-deps", 3604 + ] 3605 + 3606 + [[package]] 3607 + name = "gdk4" 3608 + version = "0.9.4" 3609 + source = "registry+https://github.com/rust-lang/crates.io-index" 3610 + checksum = "75933c4a86e8a2428814d367e22c733304fdfabc87f415750fd2f55409b6ee48" 3611 + dependencies = [ 3612 + "cairo-rs", 3613 + "gdk-pixbuf", 3614 + "gdk4-sys", 3615 + "gio", 3616 + "glib", 3617 + "libc", 3618 + "pango", 3619 + ] 3620 + 3621 + [[package]] 3622 + name = "gdk4-sys" 3623 + version = "0.9.4" 3624 + source = "registry+https://github.com/rust-lang/crates.io-index" 3625 + checksum = "20af0656d543aed3e57ac4120ef76d091c3c42ab1e0507a8febde7cd005640e2" 3626 + dependencies = [ 3627 + "cairo-sys-rs", 3628 + "gdk-pixbuf-sys", 3629 + "gio-sys", 3630 + "glib-sys", 3631 + "gobject-sys", 3632 + "libc", 3633 + "pango-sys", 3634 + "pkg-config", 3635 + "system-deps", 3636 + ] 3637 + 3638 + [[package]] 3539 3639 name = "generic-array" 3540 3640 version = "0.14.7" 3541 3641 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3576 3676 checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" 3577 3677 3578 3678 [[package]] 3679 + name = "gio" 3680 + version = "0.20.6" 3681 + source = "registry+https://github.com/rust-lang/crates.io-index" 3682 + checksum = "8826d2a9ad56ce3de1f04bea0bea0daff6f5f1c913cc834996cfea1f9401361c" 3683 + dependencies = [ 3684 + "futures-channel", 3685 + "futures-core", 3686 + "futures-io", 3687 + "futures-util", 3688 + "gio-sys", 3689 + "glib", 3690 + "libc", 3691 + "pin-project-lite", 3692 + "smallvec", 3693 + ] 3694 + 3695 + [[package]] 3696 + name = "gio-sys" 3697 + version = "0.20.6" 3698 + source = "registry+https://github.com/rust-lang/crates.io-index" 3699 + checksum = "b965df6f3534c84816b5c1a7d9efcb5671ae790822de5abe8e299797039529bc" 3700 + dependencies = [ 3701 + "glib-sys", 3702 + "gobject-sys", 3703 + "libc", 3704 + "system-deps", 3705 + "windows-sys 0.52.0", 3706 + ] 3707 + 3708 + [[package]] 3579 3709 name = "gl_generator" 3580 3710 version = "0.14.0" 3581 3711 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3587 3717 ] 3588 3718 3589 3719 [[package]] 3720 + name = "glib" 3721 + version = "0.20.6" 3722 + source = "registry+https://github.com/rust-lang/crates.io-index" 3723 + checksum = "86bd3e4ee7998ab5a135d900db56930cc19ad16681adf245daff54f618b9d5e1" 3724 + dependencies = [ 3725 + "bitflags 2.6.0", 3726 + "futures-channel", 3727 + "futures-core", 3728 + "futures-executor", 3729 + "futures-task", 3730 + "futures-util", 3731 + "gio-sys", 3732 + "glib-macros", 3733 + "glib-sys", 3734 + "gobject-sys", 3735 + "libc", 3736 + "memchr", 3737 + "smallvec", 3738 + ] 3739 + 3740 + [[package]] 3741 + name = "glib-macros" 3742 + version = "0.20.5" 3743 + source = "registry+https://github.com/rust-lang/crates.io-index" 3744 + checksum = "e7d21ca27acfc3e91da70456edde144b4ac7c36f78ee77b10189b3eb4901c156" 3745 + dependencies = [ 3746 + "heck 0.5.0", 3747 + "proc-macro-crate", 3748 + "proc-macro2", 3749 + "quote", 3750 + "syn 2.0.85", 3751 + ] 3752 + 3753 + [[package]] 3754 + name = "glib-sys" 3755 + version = "0.20.6" 3756 + source = "registry+https://github.com/rust-lang/crates.io-index" 3757 + checksum = "3d0b1827e8621fc42c0dfb228e5d57ff6a71f9699e666ece8113f979ad87c2de" 3758 + dependencies = [ 3759 + "libc", 3760 + "system-deps", 3761 + ] 3762 + 3763 + [[package]] 3590 3764 name = "glob" 3591 3765 version = "0.3.1" 3592 3766 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3626 3800 ] 3627 3801 3628 3802 [[package]] 3803 + name = "gobject-sys" 3804 + version = "0.20.4" 3805 + source = "registry+https://github.com/rust-lang/crates.io-index" 3806 + checksum = "a4c674d2ff8478cf0ec29d2be730ed779fef54415a2fb4b565c52def62696462" 3807 + dependencies = [ 3808 + "glib-sys", 3809 + "libc", 3810 + "system-deps", 3811 + ] 3812 + 3813 + [[package]] 3629 3814 name = "gpu-alloc" 3630 3815 version = "0.6.0" 3631 3816 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3665 3850 ] 3666 3851 3667 3852 [[package]] 3853 + name = "graphene-rs" 3854 + version = "0.20.4" 3855 + source = "registry+https://github.com/rust-lang/crates.io-index" 3856 + checksum = "1f53144c7fe78292705ff23935f1477d511366fb2f73c43d63b37be89076d2fe" 3857 + dependencies = [ 3858 + "glib", 3859 + "graphene-sys", 3860 + "libc", 3861 + ] 3862 + 3863 + [[package]] 3864 + name = "graphene-sys" 3865 + version = "0.20.4" 3866 + source = "registry+https://github.com/rust-lang/crates.io-index" 3867 + checksum = "e741797dc5081e59877a4d72c442c72d61efdd99161a0b1c1b29b6b988934b99" 3868 + dependencies = [ 3869 + "glib-sys", 3870 + "libc", 3871 + "pkg-config", 3872 + "system-deps", 3873 + ] 3874 + 3875 + [[package]] 3668 3876 name = "group" 3669 3877 version = "0.13.0" 3670 3878 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3676 3884 ] 3677 3885 3678 3886 [[package]] 3887 + name = "gsk4" 3888 + version = "0.9.4" 3889 + source = "registry+https://github.com/rust-lang/crates.io-index" 3890 + checksum = "b36933c1e79df378aa6e606576e680358a9582ed8c16f33e94899636e6fa6df6" 3891 + dependencies = [ 3892 + "cairo-rs", 3893 + "gdk4", 3894 + "glib", 3895 + "graphene-rs", 3896 + "gsk4-sys", 3897 + "libc", 3898 + "pango", 3899 + ] 3900 + 3901 + [[package]] 3902 + name = "gsk4-sys" 3903 + version = "0.9.4" 3904 + source = "registry+https://github.com/rust-lang/crates.io-index" 3905 + checksum = "0877a9d485bd9ba5262b0c9bce39e63750e525e3aebeb359d271ca1f0e111f1d" 3906 + dependencies = [ 3907 + "cairo-sys-rs", 3908 + "gdk4-sys", 3909 + "glib-sys", 3910 + "gobject-sys", 3911 + "graphene-sys", 3912 + "libc", 3913 + "pango-sys", 3914 + "system-deps", 3915 + ] 3916 + 3917 + [[package]] 3918 + name = "gtk-blueprint" 3919 + version = "0.2.0" 3920 + source = "registry+https://github.com/rust-lang/crates.io-index" 3921 + checksum = "3b61baeb446cc8c4622605cf3a52572d4710cb3635dc543839ea009914e19b7b" 3922 + dependencies = [ 3923 + "phf_codegen", 3924 + "syn 1.0.109", 3925 + ] 3926 + 3927 + [[package]] 3928 + name = "gtk4" 3929 + version = "0.9.4" 3930 + source = "registry+https://github.com/rust-lang/crates.io-index" 3931 + checksum = "9376d14d7e33486c54823a42bef296e882b9f25cb4c52b52f4d1d57bbadb5b6d" 3932 + dependencies = [ 3933 + "cairo-rs", 3934 + "field-offset", 3935 + "futures-channel", 3936 + "gdk-pixbuf", 3937 + "gdk4", 3938 + "gio", 3939 + "glib", 3940 + "graphene-rs", 3941 + "gsk4", 3942 + "gtk4-macros", 3943 + "gtk4-sys", 3944 + "libc", 3945 + "pango", 3946 + ] 3947 + 3948 + [[package]] 3949 + name = "gtk4-macros" 3950 + version = "0.9.3" 3951 + source = "registry+https://github.com/rust-lang/crates.io-index" 3952 + checksum = "a7c518d5dd41c57385c7cd30af52e261820c897fc1144e558bb88c303d048ae2" 3953 + dependencies = [ 3954 + "proc-macro-crate", 3955 + "proc-macro2", 3956 + "quote", 3957 + "syn 2.0.85", 3958 + ] 3959 + 3960 + [[package]] 3961 + name = "gtk4-sys" 3962 + version = "0.9.4" 3963 + source = "registry+https://github.com/rust-lang/crates.io-index" 3964 + checksum = "e653b0a9001ba9be1ffddb9373bfe9a111f688222f5aeee2841481300d91b55a" 3965 + dependencies = [ 3966 + "cairo-sys-rs", 3967 + "gdk-pixbuf-sys", 3968 + "gdk4-sys", 3969 + "gio-sys", 3970 + "glib-sys", 3971 + "gobject-sys", 3972 + "graphene-sys", 3973 + "gsk4-sys", 3974 + "libc", 3975 + "pango-sys", 3976 + "system-deps", 3977 + ] 3978 + 3979 + [[package]] 3679 3980 name = "gzip-header" 3680 3981 version = "1.0.0" 3681 3982 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4507 4808 dependencies = [ 4508 4809 "lexical-util", 4509 4810 "static_assertions", 4811 + ] 4812 + 4813 + [[package]] 4814 + name = "libadwaita" 4815 + version = "0.7.1" 4816 + source = "registry+https://github.com/rust-lang/crates.io-index" 4817 + checksum = "8611ee9fb85e7606c362b513afcaf5b59853f79e4d98caaaf581d99465014247" 4818 + dependencies = [ 4819 + "gdk4", 4820 + "gio", 4821 + "glib", 4822 + "gtk4", 4823 + "libadwaita-sys", 4824 + "libc", 4825 + "pango", 4826 + ] 4827 + 4828 + [[package]] 4829 + name = "libadwaita-sys" 4830 + version = "0.7.1" 4831 + source = "registry+https://github.com/rust-lang/crates.io-index" 4832 + checksum = "b099a223560118d4d4fa04b6d23f3ea5b7171fe1d83dfb7e6b45b54cdfc83af9" 4833 + dependencies = [ 4834 + "gdk4-sys", 4835 + "gio-sys", 4836 + "glib-sys", 4837 + "gobject-sys", 4838 + "gtk4-sys", 4839 + "libc", 4840 + "pango-sys", 4841 + "system-deps", 4510 4842 ] 4511 4843 4512 4844 [[package]] ··· 5490 5822 ] 5491 5823 5492 5824 [[package]] 5825 + name = "pango" 5826 + version = "0.20.6" 5827 + source = "registry+https://github.com/rust-lang/crates.io-index" 5828 + checksum = "71e34e7ca2c52e3933d7e5251409a82b83725fa9d6d48fbdaacec056b3a0554a" 5829 + dependencies = [ 5830 + "gio", 5831 + "glib", 5832 + "libc", 5833 + "pango-sys", 5834 + ] 5835 + 5836 + [[package]] 5837 + name = "pango-sys" 5838 + version = "0.20.4" 5839 + source = "registry+https://github.com/rust-lang/crates.io-index" 5840 + checksum = "84fd65917bf12f06544ae2bbc200abf9fc0a513a5a88a0fa81013893aef2b838" 5841 + dependencies = [ 5842 + "glib-sys", 5843 + "gobject-sys", 5844 + "libc", 5845 + "system-deps", 5846 + ] 5847 + 5848 + [[package]] 5493 5849 name = "parking" 5494 5850 version = "2.2.1" 5495 5851 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5634 5990 checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" 5635 5991 dependencies = [ 5636 5992 "phf_macros", 5993 + "phf_shared", 5994 + ] 5995 + 5996 + [[package]] 5997 + name = "phf_codegen" 5998 + version = "0.11.2" 5999 + source = "registry+https://github.com/rust-lang/crates.io-index" 6000 + checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" 6001 + dependencies = [ 6002 + "phf_generator", 5637 6003 "phf_shared", 5638 6004 ] 5639 6005 ··· 6543 6909 "sqlx", 6544 6910 "tantivy", 6545 6911 "tokio", 6912 + ] 6913 + 6914 + [[package]] 6915 + name = "rockbox-gtk" 6916 + version = "0.1.0" 6917 + dependencies = [ 6918 + "gtk-blueprint", 6919 + "gtk4", 6920 + "libadwaita", 6546 6921 ] 6547 6922 6548 6923 [[package]] ··· 8219 8594 ] 8220 8595 8221 8596 [[package]] 8597 + name = "system-deps" 8598 + version = "7.0.3" 8599 + source = "registry+https://github.com/rust-lang/crates.io-index" 8600 + checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" 8601 + dependencies = [ 8602 + "cfg-expr", 8603 + "heck 0.5.0", 8604 + "pkg-config", 8605 + "toml", 8606 + "version-compare", 8607 + ] 8608 + 8609 + [[package]] 8222 8610 name = "tantivy" 8223 8611 version = "0.22.0" 8224 8612 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 8364 8752 version = "1.0.1" 8365 8753 source = "registry+https://github.com/rust-lang/crates.io-index" 8366 8754 checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 8755 + 8756 + [[package]] 8757 + name = "target-lexicon" 8758 + version = "0.12.16" 8759 + source = "registry+https://github.com/rust-lang/crates.io-index" 8760 + checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" 8367 8761 8368 8762 [[package]] 8369 8763 name = "tempfile" ··· 9121 9515 version = "0.2.15" 9122 9516 source = "registry+https://github.com/rust-lang/crates.io-index" 9123 9517 checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 9518 + 9519 + [[package]] 9520 + name = "version-compare" 9521 + version = "0.2.0" 9522 + source = "registry+https://github.com/rust-lang/crates.io-index" 9523 + checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" 9124 9524 9125 9525 [[package]] 9126 9526 name = "version_check"
+1 -1
Cargo.toml
··· 2 2 default-members = ["crates/*"] 3 3 members = [ 4 4 "cli", 5 - "crates/*", 5 + "crates/*", "gtk", 6 6 "webui", 7 7 ] 8 8 resolver = "2"
+2
gtk/.gitignore
··· 1 + .flatpak-builder 2 + repo
+12
gtk/Cargo.toml
··· 1 + [package] 2 + edition = "2021" 3 + name = "rockbox-gtk" 4 + version = "0.1.0" 5 + 6 + [dependencies] 7 + adw = {version = "0.7", package = "libadwaita", features = ["v1_6"]} 8 + gtk = {version = "0.9", package = "gtk4", features = ["gnome_46"]} 9 + gtk-blueprint = "0.2.0" 10 + 11 + [build-dependencies] 12 + gtk-blueprint = "0.2.0"
+52
gtk/build-aux/mg.tsirysndr.Rockbox.Devel.json
··· 1 + { 2 + "id": "mg.tsirysndr.Rockbox.Devel", 3 + "runtime": "org.gnome.Platform", 4 + "runtime-version": "47", 5 + "sdk": "org.gnome.Sdk", 6 + "sdk-extensions": [ 7 + "org.freedesktop.Sdk.Extension.rust-stable", 8 + "org.freedesktop.Sdk.Extension.llvm18" 9 + ], 10 + "command": "rockbox-gtk", 11 + "tags": [ 12 + "nightly" 13 + ], 14 + "finish-args": [ 15 + "--talk-name=org.freedesktop.DBus", 16 + "--own-name=mg.tsirysndr.Rockbox.Devel", 17 + "--socket=session-bus", 18 + "--share=network", 19 + "--share=ipc", 20 + "--socket=fallback-x11", 21 + "--socket=wayland", 22 + "--device=dri", 23 + "--socket=pulseaudio", 24 + "--filesystem=xdg-run/gvfsd", 25 + "--filesystem=xdg-music" 26 + ], 27 + "build-options": { 28 + "append-path": "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm18/bin", 29 + "env": { 30 + "RUSTFLAGS": "-C force-frame-pointers=yes -C symbol-mangling-version=v0 -C linker=clang -C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold" 31 + }, 32 + "build-args": [ 33 + "--share=network" 34 + ] 35 + }, 36 + "modules": [ 37 + { 38 + "name": "rockbox", 39 + "buildsystem": "meson", 40 + "run-tests": false, 41 + "config-opts": [ 42 + "-Dprofile=development" 43 + ], 44 + "sources": [ 45 + { 46 + "type": "dir", 47 + "path": "../" 48 + } 49 + ] 50 + } 51 + ] 52 + }
+3
gtk/build.rs
··· 1 + fn main() { 2 + println!("cargo:rerun-if-changed=**/*.blp"); 3 + }
gtk/data/gtk/style.css

This is a binary file and will not be displayed.

+512
gtk/data/gtk/window.blp
··· 1 + using Gtk 4.0; 2 + using Adw 1; 3 + 4 + template $RbApplicationWindow : Adw.ApplicationWindow { 5 + title: _("Rockbox"); 6 + width-request: 360; 7 + height-request: 100; 8 + 9 + Adw.Breakpoint { 10 + condition ("max-width: 564px") 11 + 12 + setters { 13 + overlay_split_view.collapsed: true; 14 + details_view_box.orientation: vertical; 15 + details_view_box.margin-top: 12; 16 + details_view_box.margin-start: 12; 17 + details_view_box.margin-end: 12; 18 + details_view_details_box.margin-start: 0; 19 + details_view_details_box.margin-end: 0; 20 + details_view_title.margin-top: 30; 21 + details_view_title.halign: center; 22 + details_view_developer.halign: center; 23 + details_view_date_box.halign: center; 24 + details_view_toolbar.halign: center; 25 + details_view_toolbar.orientation: vertical; 26 + details_view_play_button.halign: center; 27 + details_view_toolbar_buttons.margin-start: 0; 28 + } 29 + } 30 + 31 + Adw.ToastOverlay toast_overlay { 32 + Adw.NavigationView navigation_view { 33 + Adw.NavigationPage library_page { 34 + title: _("Albums"); 35 + 36 + Adw.OverlaySplitView overlay_split_view { 37 + sidebar-width-fraction: .2; 38 + 39 + [sidebar] 40 + Adw.NavigationPage sidebar_navigation_page { 41 + title: _("Rockbox"); 42 + 43 + Adw.ToolbarView { 44 + [top] 45 + Adw.HeaderBar { 46 + [start] 47 + Button { 48 + icon-name: "sidebar-show-symbolic"; 49 + action-name: "win.show_sidebar"; 50 + tooltip-text: _("Toggle Sidebar"); 51 + } 52 + } 53 + 54 + ScrolledWindow { 55 + hscrollbar-policy: never; 56 + 57 + ListBox sidebar { 58 + Box all_games_row_box { 59 + margin-top: 12; 60 + margin-bottom: 12; 61 + margin-start: 6; 62 + margin-end: 6; 63 + spacing: 12; 64 + 65 + Image { 66 + icon-name: "view-grid-symbolic"; 67 + } 68 + 69 + Label { 70 + halign: start; 71 + label: _("Albums"); 72 + wrap: true; 73 + wrap-mode: char; 74 + } 75 + 76 + Label all_games_no_label { 77 + hexpand: true; 78 + halign: end; 79 + 80 + styles [ 81 + "dim-label" 82 + ] 83 + } 84 + } 85 + 86 + Box added_row_box { 87 + margin-top: 12; 88 + margin-bottom: 12; 89 + margin-start: 6; 90 + spacing: 12; 91 + 92 + Image { 93 + icon-name: "list-add-symbolic"; 94 + } 95 + 96 + Label { 97 + halign: start; 98 + label: _("Added"); 99 + margin-end: 6; 100 + wrap: true; 101 + wrap-mode: char; 102 + } 103 + 104 + Label added_games_no_label { 105 + hexpand: true; 106 + halign: end; 107 + margin-end: 6; 108 + 109 + styles [ 110 + "dim-label" 111 + ] 112 + } 113 + } 114 + 115 + 116 + styles [ 117 + "navigation-sidebar" 118 + ] 119 + } 120 + } 121 + } 122 + } 123 + 124 + Adw.ToolbarView library_view { 125 + [top] 126 + Adw.HeaderBar header_bar { 127 + [start] 128 + Button show_sidebar_button { 129 + icon-name: "sidebar-show-symbolic"; 130 + action-name: "win.show_sidebar"; 131 + tooltip-text: _("Toggle Sidebar"); 132 + visible: bind overlay_split_view.show-sidebar inverted; 133 + } 134 + 135 + [start] 136 + MenuButton { 137 + tooltip-text: _("Add Game"); 138 + icon-name: "list-add-symbolic"; 139 + menu-model: add_games; 140 + } 141 + 142 + [end] 143 + MenuButton primary_menu_button { 144 + tooltip-text: _("Main Menu"); 145 + icon-name: "open-menu-symbolic"; 146 + menu-model: primary_menu; 147 + } 148 + 149 + [end] 150 + ToggleButton search_button { 151 + tooltip-text: _("Search"); 152 + icon-name: "system-search-symbolic"; 153 + action-name: "win.toggle_search"; 154 + } 155 + } 156 + 157 + [top] 158 + SearchBar search_bar { 159 + search-mode-enabled: bind search_button.active bidirectional; 160 + key-capture-widget: navigation_view; 161 + 162 + Adw.Clamp { 163 + maximum-size: 500; 164 + tightening-threshold: 500; 165 + 166 + SearchEntry search_entry { 167 + placeholder-text: _("Search"); 168 + hexpand: true; 169 + 170 + ShortcutController { 171 + Shortcut { 172 + trigger: "Escape"; 173 + action: "action(win.toggle_search)"; 174 + } 175 + } 176 + } 177 + } 178 + } 179 + 180 + Overlay library_overlay { 181 + ScrolledWindow scrolledwindow { 182 + FlowBox library { 183 + homogeneous: true; 184 + halign: center; 185 + valign: start; 186 + column-spacing: 12; 187 + row-spacing: 12; 188 + margin-top: 15; 189 + margin-bottom: 15; 190 + margin-start: 15; 191 + margin-end: 15; 192 + selection-mode: none; 193 + } 194 + } 195 + } 196 + } 197 + } 198 + } 199 + } 200 + } 201 + } 202 + 203 + Adw.NavigationPage hidden_library_page { 204 + title: _("Hidden Games"); 205 + 206 + Adw.ToolbarView hidden_library_view { 207 + [top] 208 + Adw.HeaderBar hidden_header_bar { 209 + [end] 210 + MenuButton hidden_primary_menu_button { 211 + tooltip-text: _("Main Menu"); 212 + icon-name: "open-menu-symbolic"; 213 + menu-model: primary_menu; 214 + } 215 + 216 + [end] 217 + ToggleButton hidden_search_button { 218 + tooltip-text: _("Search"); 219 + icon-name: "system-search-symbolic"; 220 + action-name: "win.toggle_search"; 221 + } 222 + } 223 + 224 + [top] 225 + SearchBar hidden_search_bar { 226 + search-mode-enabled: bind hidden_search_button.active bidirectional; 227 + key-capture-widget: hidden_library_view; 228 + 229 + Adw.Clamp { 230 + maximum-size: 500; 231 + tightening-threshold: 500; 232 + 233 + SearchEntry hidden_search_entry { 234 + placeholder-text: _("Search"); 235 + hexpand: true; 236 + } 237 + } 238 + } 239 + 240 + Overlay hidden_library_overlay { 241 + ScrolledWindow hidden_scrolledwindow { 242 + FlowBox hidden_library { 243 + homogeneous: true; 244 + halign: center; 245 + valign: start; 246 + column-spacing: 12; 247 + row-spacing: 12; 248 + margin-top: 15; 249 + margin-bottom: 15; 250 + margin-start: 15; 251 + margin-end: 15; 252 + selection-mode: none; 253 + } 254 + } 255 + } 256 + 257 + styles [ 258 + "background", 259 + ] 260 + } 261 + } 262 + 263 + Adw.NavigationPage details_page { 264 + title: _("Game Details"); 265 + 266 + Overlay details_view { 267 + name: "details_view"; 268 + 269 + [overlay] 270 + Adw.ToolbarView details_view_toolbar_view { 271 + [top] 272 + Adw.HeaderBar {} 273 + 274 + ScrolledWindow { 275 + Box details_view_box { 276 + halign: center; 277 + valign: center; 278 + margin-start: 24; 279 + margin-end: 24; 280 + margin-top: 24; 281 + margin-bottom: 24; 282 + 283 + Adw.Clamp { 284 + maximum-size: 200; 285 + 286 + Overlay { 287 + [overlay] 288 + Adw.Spinner details_view_spinner { 289 + visible: false; 290 + } 291 + 292 + Picture details_view_cover { 293 + halign: end; 294 + valign: start; 295 + width-request: 200; 296 + height-request: 300; 297 + 298 + styles [ 299 + "card", 300 + ] 301 + } 302 + } 303 + } 304 + 305 + Box details_view_details_box { 306 + orientation: vertical; 307 + margin-start: 48; 308 + vexpand: true; 309 + valign: center; 310 + 311 + Label details_view_title { 312 + label: _("Game Title"); 313 + hexpand: true; 314 + halign: start; 315 + max-width-chars: 24; 316 + wrap: true; 317 + wrap-mode: word_char; 318 + natural-wrap-mode: word; 319 + 320 + styles [ 321 + "title-1", 322 + ] 323 + } 324 + 325 + Label details_view_developer { 326 + margin-top: 6; 327 + hexpand: true; 328 + halign: start; 329 + max-width-chars: 36; 330 + wrap: true; 331 + wrap-mode: word_char; 332 + natural-wrap-mode: word; 333 + 334 + styles [ 335 + "heading", 336 + ] 337 + } 338 + 339 + Box details_view_date_box { 340 + orientation: horizontal; 341 + margin-top: 15; 342 + hexpand: true; 343 + halign: start; 344 + 345 + Label details_view_added { 346 + wrap: true; 347 + wrap-mode: word_char; 348 + natural-wrap-mode: word; 349 + justify: center; 350 + } 351 + 352 + Label details_view_last_played { 353 + margin-start: 12; 354 + wrap: true; 355 + wrap-mode: word_char; 356 + natural-wrap-mode: word; 357 + justify: center; 358 + } 359 + } 360 + 361 + Box details_view_toolbar { 362 + hexpand: true; 363 + vexpand: true; 364 + valign: center; 365 + 366 + Button details_view_play_button { 367 + name: "details_view_play_button"; 368 + action-name: "app.launch_game"; 369 + label: _("Play"); 370 + halign: start; 371 + margin-top: 24; 372 + 373 + styles [ 374 + "opaque", 375 + "pill", 376 + ] 377 + } 378 + 379 + Box details_view_toolbar_buttons { 380 + halign: start; 381 + valign: center; 382 + margin-top: 24; 383 + margin-start: 9; 384 + 385 + Button { 386 + icon-name: "document-edit-symbolic"; 387 + action-name: "app.edit_game"; 388 + tooltip-text: _("Edit"); 389 + 390 + styles [ 391 + "raised", 392 + "circular", 393 + ] 394 + } 395 + 396 + Button details_view_hide_button { 397 + action-name: "app.hide_game"; 398 + 399 + styles [ 400 + "raised", 401 + "circular", 402 + ] 403 + } 404 + 405 + Button { 406 + icon-name: "user-trash-symbolic"; 407 + action-name: "app.remove_game"; 408 + tooltip-text: _("Remove"); 409 + 410 + styles [ 411 + "raised", 412 + "circular", 413 + ] 414 + } 415 + 416 + MenuButton { 417 + icon-name: "system-search-symbolic"; 418 + menu-model: search; 419 + tooltip-text: _("Search"); 420 + 421 + styles [ 422 + "raised", 423 + "circular", 424 + ] 425 + } 426 + 427 + styles [ 428 + "toolbar", 429 + ] 430 + } 431 + } 432 + } 433 + } 434 + } 435 + } 436 + 437 + Picture details_view_blurred_cover { 438 + keep-aspect-ratio: false; 439 + } 440 + } 441 + } 442 + 443 + menu primary_menu { 444 + section { 445 + submenu { 446 + label: _("Sort"); 447 + 448 + item { 449 + label: _("A-Z"); 450 + action: "win.sort_by"; 451 + target: "a-z"; 452 + } 453 + 454 + item { 455 + label: _("Z-A"); 456 + action: "win.sort_by"; 457 + target: "z-a"; 458 + } 459 + 460 + item { 461 + label: _("Newest"); 462 + action: "win.sort_by"; 463 + target: "newest"; 464 + } 465 + 466 + item { 467 + label: _("Oldest"); 468 + action: "win.sort_by"; 469 + target: "oldest"; 470 + } 471 + 472 + item { 473 + label: _("Last Played"); 474 + action: "win.sort_by"; 475 + target: "last_played"; 476 + } 477 + } 478 + 479 + item { 480 + label: _("Show Hidden"); 481 + action: "win.show_hidden"; 482 + hidden-when: "action-disabled"; 483 + } 484 + } 485 + 486 + section { 487 + item (_("Preferences"), "app.preferences") 488 + item (_("Keyboard Shortcuts"), "win.show-help-overlay") 489 + item (_("About Cartridges"), "app.about") 490 + } 491 + } 492 + 493 + menu add_games { 494 + section { 495 + item (_("Add Game"), "app.add_game") 496 + } 497 + 498 + section { 499 + item (_("Import"), "app.import") 500 + } 501 + } 502 + 503 + menu search { 504 + section { 505 + label: "Search on…"; 506 + item (_("IGDB"), "app.igdb_search") 507 + item (_("SteamGridDB"), "app.sgdb_search") 508 + item (_("ProtonDB"), "app.protondb_search") 509 + item (_("Lutris"), "app.lutris_search") 510 + item (_("HowLongToBeat"), "app.hltb_search") 511 + } 512 + }
+27
gtk/meson.build
··· 1 + project('rockbox-gtk', 'rust', 2 + version: '0.1.0', 3 + meson_version: '>= 0.59.0', 4 + license: 'GPL-3.0-or-later', 5 + ) 6 + 7 + gnome = import('gnome') 8 + i18n = import('i18n') 9 + 10 + # Dependencies 11 + 12 + dependency('glib-2.0', version: '>= 2.66') 13 + dependency('gio-2.0', version: '>= 2.66') 14 + dependency('gtk4', version: '>= 4.0.0') 15 + dependency('libadwaita-1', version: '>=1.6.beta') 16 + 17 + # Initialize project variables 18 + name = 'Rockbox' 19 + base_id = 'mg.tsirysndr.Rockbox' 20 + path_id = '/mg/tsirysndr/Rockbox' 21 + app_id = base_id 22 + vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() 23 + datadir = join_paths(get_option('prefix'), get_option('datadir')) 24 + localedir = join_paths(get_option('prefix'), get_option('localedir')) 25 + bindir = join_paths(get_option('prefix'), get_option('bindir')) 26 + 27 + subdir('src')
+9
gtk/meson_options.txt
··· 1 + option ( 2 + 'profile', 3 + type: 'combo', 4 + choices: [ 5 + 'default', 6 + 'development' 7 + ], 8 + value: 'default' 9 + )
+97
gtk/src/app.rs
··· 1 + use crate::app; 2 + use crate::ui::window::RbApplicationWindow; 3 + use adw::prelude::*; 4 + use adw::subclass::prelude::*; 5 + use gio::subclass::prelude::ApplicationImpl; 6 + use glib::subclass::types::ObjectSubclass; 7 + use glib::WeakRef; 8 + use gtk::{gio, glib}; 9 + use std::cell::OnceCell; 10 + 11 + mod imp { 12 + 13 + use super::*; 14 + pub struct RbApplication { 15 + pub window: OnceCell<WeakRef<RbApplicationWindow>>, 16 + } 17 + 18 + #[glib::object_subclass] 19 + impl ObjectSubclass for RbApplication { 20 + const NAME: &'static str = "RockboxApplication"; 21 + type Type = app::RbApplication; 22 + type ParentType = adw::Application; 23 + 24 + fn new() -> Self { 25 + Self { 26 + window: OnceCell::new(), 27 + } 28 + } 29 + } 30 + 31 + impl ObjectImpl for RbApplication {} 32 + 33 + impl ApplicationImpl for RbApplication { 34 + fn activate(&self) { 35 + let app = self.obj(); 36 + 37 + if let Some(weak_window) = self.window.get() { 38 + weak_window.upgrade().unwrap().present(); 39 + return; 40 + } 41 + 42 + let window = app.create_window(); 43 + let _ = self.window.set(window.downgrade()); 44 + 45 + app.setup_gactions(); 46 + } 47 + 48 + fn shutdown(&self) { 49 + self.parent_shutdown(); 50 + } 51 + } 52 + 53 + impl GtkApplicationImpl for RbApplication {} 54 + impl AdwApplicationImpl for RbApplication {} 55 + } 56 + 57 + glib::wrapper! { 58 + pub struct RbApplication(ObjectSubclass<imp::RbApplication>) 59 + @extends gio::Application, gtk::Application, adw::Application, 60 + @implements gio::ActionMap, gio::ActionGroup; 61 + } 62 + 63 + impl RbApplication { 64 + pub fn run() -> glib::ExitCode { 65 + // Create new GObject and downcast it into RbApplication 66 + let app = glib::Object::builder::<RbApplication>() 67 + .property("application-id", Some("mg.tsirysndr.Rockbox.Devel")) 68 + .property("flags", gio::ApplicationFlags::empty()) 69 + .property("resource-base-path", Some("/mg/tsirysndr/rockbox")) 70 + .build(); 71 + 72 + // Start running gtk::Application 73 + app.run() 74 + } 75 + 76 + pub fn create_window(&self) -> RbApplicationWindow { 77 + let window = RbApplicationWindow::new(); 78 + self.add_window(&window); 79 + 80 + window.present(); 81 + window 82 + } 83 + 84 + pub fn setup_gactions(&self) {} 85 + } 86 + 87 + impl Default for RbApplication { 88 + fn default() -> Self { 89 + println!("Creating default RbApplication"); 90 + println!("{:?}", gio::Application::default()); 91 + 92 + gio::Application::default() 93 + .expect("Could not get default GApplication") 94 + .downcast() 95 + .unwrap() 96 + } 97 + }
+8
gtk/src/config.rs.in
··· 1 + pub static NAME: &str = @NAME@; 2 + pub static PKGNAME: &str = @PKGNAME@; 3 + pub static APP_ID: &str = @APP_ID@; 4 + pub static PATH_ID: &str = @PATH_ID@; 5 + pub static VERSION: &str = @VERSION@; 6 + pub static VCS_TAG: &str = @VCS_TAG@; 7 + pub static LOCALEDIR: &str = @LOCALEDIR@; 8 + pub static DATADIR: &str = @DATADIR@;
+12
gtk/src/main.rs
··· 1 + use app::RbApplication; 2 + use gtk::glib; 3 + 4 + pub mod app; 5 + pub mod ui; 6 + 7 + fn main() -> glib::ExitCode { 8 + // Initialize GTK 9 + gtk::init().unwrap_or_else(|_| panic!("Failed to initialize GTK.")); 10 + 11 + RbApplication::run() 12 + }
+56
gtk/src/meson.build
··· 1 + # Configuration file 2 + conf = configuration_data() 3 + conf.set_quoted('NAME', name) 4 + conf.set_quoted('PKGNAME', meson.project_name()) 5 + conf.set_quoted('APP_ID', app_id) 6 + conf.set_quoted('PATH_ID', path_id) 7 + conf.set_quoted('VERSION', meson.project_version()) 8 + conf.set_quoted('VCS_TAG', vcs_tag) 9 + conf.set_quoted('LOCALEDIR', localedir) 10 + conf.set_quoted('DATADIR', datadir) 11 + 12 + configure_file( 13 + input: 'config.rs.in', 14 + output: 'config.rs', 15 + configuration: conf 16 + ) 17 + 18 + run_command( 19 + 'cp', 20 + join_paths(meson.project_build_root(), 'src', 'config.rs'), 21 + join_paths(meson.project_source_root(), 'src', 'config.rs'), 22 + check: true 23 + ) 24 + 25 + # Setup cargo 26 + cargo = find_program('cargo') 27 + cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ] 28 + cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ] 29 + cargo_options += [ '--target-dir', meson.project_build_root() / 'target' ] 30 + 31 + if get_option('profile') == 'default' 32 + cargo_options += [ '--release' ] 33 + rust_target = 'release' 34 + message('Building in release mode') 35 + else 36 + rust_target = 'debug' 37 + message('Building in debug mode') 38 + endif 39 + 40 + cargo_release = custom_target( 41 + 'cargo-build', 42 + build_by_default: true, 43 + build_always_stale: true, 44 + output: meson.project_name(), 45 + console: true, 46 + install: true, 47 + install_dir: bindir, 48 + command: [ 49 + 'env', 50 + cargo_env, 51 + cargo, 'build', 52 + cargo_options, 53 + '&&', 54 + 'cp', 'target' / rust_target / meson.project_name(), '@OUTPUT@', 55 + ] 56 + )
+1
gtk/src/ui/mod.rs
··· 1 + pub mod window;
+61
gtk/src/ui/window.rs
··· 1 + use adw::prelude::*; 2 + use adw::subclass::prelude::*; 3 + use glib::subclass; 4 + use gtk::{gio, glib, CompositeTemplate}; 5 + 6 + use crate::app::RbApplication; 7 + 8 + mod imp { 9 + 10 + use super::*; 11 + 12 + #[derive(Debug, Default, CompositeTemplate)] 13 + #[template(file = "window.ui")] 14 + pub struct RbApplicationWindow {} 15 + 16 + #[glib::object_subclass] 17 + impl ObjectSubclass for RbApplicationWindow { 18 + const NAME: &'static str = "RbApplicationWindow"; 19 + type ParentType = adw::ApplicationWindow; 20 + type Type = super::RbApplicationWindow; 21 + 22 + fn class_init(klass: &mut Self::Class) { 23 + Self::bind_template(klass); 24 + } 25 + 26 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 27 + obj.init_template(); 28 + } 29 + } 30 + 31 + impl ObjectImpl for RbApplicationWindow {} 32 + 33 + impl WidgetImpl for RbApplicationWindow {} 34 + impl WindowImpl for RbApplicationWindow {} 35 + impl ApplicationWindowImpl for RbApplicationWindow {} 36 + impl AdwApplicationWindowImpl for RbApplicationWindow {} 37 + impl RbApplicationWindow {} 38 + } 39 + 40 + glib::wrapper! { 41 + pub struct RbApplicationWindow( 42 + ObjectSubclass<imp::RbApplicationWindow>) 43 + @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, adw::ApplicationWindow, 44 + @implements gio::ActionMap, gio::ActionGroup; 45 + } 46 + 47 + impl RbApplicationWindow { 48 + pub fn new() -> Self { 49 + glib::Object::new::<Self>() 50 + } 51 + } 52 + 53 + impl Default for RbApplicationWindow { 54 + fn default() -> Self { 55 + RbApplication::default() 56 + .active_window() 57 + .unwrap() 58 + .downcast() 59 + .unwrap() 60 + } 61 + }