ref: bef4378c5cac18cea163dcdd6aea424e08e56ebf
dir: /vdir-tweaks/
diff d57a09f05c237d004770493258c206bbe9916681 uncommitted --- a/icons.h +++ b/icons.h @@ -420,3 +420,181 @@ 0x46, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, }; + +uchar backdata[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +uchar refdata[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; --- a/theme.c +++ b/theme.c @@ -21,64 +21,57 @@ return i; } -Theme* -loadtheme(void) +void +loadtheme(Theme *theme) { - Theme *theme; Biobuf *bp; char *s; if(access("/dev/theme", AREAD) < 0) - return 0; + return; bp = Bopen("/dev/theme", OREAD); if(bp == nil) - return 0; - theme = malloc(sizeof *theme); - if(theme == nil){ - Bterm(bp); - return nil; - } + return; for(;;){ s = Brdstr(bp, '\n', 1); if(s == nil) break; if(strncmp(s, "back", 4) == 0) - theme->back = ereadcol(s+5); + theme->back = strtoul(s+5, nil, 16); else if(strncmp(s, "high", 4) == 0) - theme->high = ereadcol(s+5); + theme->high = strtoul(s+5, nil, 16); else if(strncmp(s, "border", 6) == 0) - theme->border = ereadcol(s+7); + theme->border = strtoul(s+7, nil, 16); else if(strncmp(s, "text", 4) == 0) - theme->text = ereadcol(s+5); + theme->text = strtoul(s+5, nil, 16); else if(strncmp(s, "htext", 5) == 0) - theme->htext = ereadcol(s+6); + theme->htext = strtoul(s+6, nil, 16); else if(strncmp(s, "title", 5) == 0) - theme->title = ereadcol(s+6); + theme->title = strtoul(s+6, nil, 16); else if(strncmp(s, "ltitle", 6) == 0) - theme->ltitle = ereadcol(s+7); + theme->ltitle = strtoul(s+7, nil, 16); else if(strncmp(s, "hold", 4) == 0) - theme->hold = ereadcol(s+5); + theme->hold = strtoul(s+5, nil, 16); else if(strncmp(s, "lhold", 5) == 0) - theme->lhold = ereadcol(s+6); + theme->lhold = strtoul(s+6, nil, 16); else if(strncmp(s, "palehold", 8) == 0) - theme->palehold = ereadcol(s+9); + theme->palehold = strtoul(s+9, nil, 16); else if(strncmp(s, "paletext", 8) == 0) - theme->paletext = ereadcol(s+9); + theme->paletext = strtoul(s+9, nil, 16); else if(strncmp(s, "size", 4) == 0) - theme->size = ereadcol(s+5); + theme->size = strtoul(s+5, nil, 16); else if(strncmp(s, "menuback", 8) == 0) - theme->menuback = ereadcol(s+9); + theme->menuback = strtoul(s+9, nil, 16); else if(strncmp(s, "menuhigh", 8) == 0) - theme->menuhigh = ereadcol(s+9); + theme->menuhigh = strtoul(s+9, nil, 16); else if(strncmp(s, "menubord", 8) == 0) - theme->menubord = ereadcol(s+9); + theme->menubord = strtoul(s+9, nil, 16); else if(strncmp(s, "menutext", 8) == 0) - theme->menutext = ereadcol(s+9); + theme->menutext = strtoul(s+9, nil, 16); else if(strncmp(s, "menuhtext", 5) == 0) - theme->menuhtext = ereadcol(s+6); + theme->menuhtext = strtoul(s+6, nil, 16); free(s); } Bterm(bp); - return theme; } --- a/theme.h +++ b/theme.h @@ -2,24 +2,25 @@ struct Theme { - Image *back; - Image *high; - Image *border; - Image *text; - Image *htext; - Image *title; - Image *ltitle; - Image *hold; - Image *lhold; - Image *palehold; - Image *paletext; - Image *size; - Image *menubar; - Image *menuback; - Image *menuhigh; - Image *menubord; - Image *menutext; - Image *menuhtext; + u32int back; + u32int high; + u32int border; + u32int text; + u32int htext; + u32int title; + u32int ltitle; + u32int hold; + u32int lhold; + u32int palehold; + u32int paletext; + u32int size; + u32int menubar; + u32int menuback; + u32int menuhigh; + u32int menubord; + u32int menutext; + u32int menuhtext; }; -Theme* loadtheme(void); +void loadtheme(Theme*); +Image* ereadcol(char*); --- a/vdir.c +++ b/vdir.c @@ -21,6 +21,13 @@ Slowscroll = 10, }; +enum{ + Nback = 64, +}; +char *backlist[Nback]; +int backoff[Nback]; +int backp = -1; + enum { Emouse, @@ -50,6 +57,8 @@ Rectangle homer; Rectangle upr; Rectangle cdr; +Rectangle refr; +Rectangle backr; Rectangle newdirr; Rectangle newfiler; Rectangle viewr; @@ -63,6 +72,8 @@ Image *iup; Image *inewfile; Image *inewfolder; +Image *iref; +Image *iback; Image *toolbg; Image *toolfg; Image *viewbg; @@ -71,6 +82,7 @@ Image *selfg; Image *scrollbg; Image *scrollfg; +Image *fb; Image *high; int sizew; int lineh; @@ -124,8 +136,10 @@ return 1; } +int scrollclamp(int); + void -loaddirs(void) +loaddirs(int fixoff) { int fd, i; vlong m; @@ -138,14 +152,11 @@ if(dirs!=nil) free(dirs); ndirs = dirreadall(fd, &dirs); - if(ndirs > 0) - qsort(dirs, ndirs, sizeof *dirs, (int(*)(void*,void*))dircmp); - else{ - if(ndirs < 0) - showerrstr("Unable to read directory"); - ndirs = 0; - } - offset = 0; + qsort(dirs, ndirs, sizeof *dirs, (int(*)(void*,void*))dircmp); + if(!fixoff) + scrollclamp(offset); + else + offset = 0; close(fd); m = 1; for(i=0; i < ndirs; i++){ @@ -152,14 +163,47 @@ if(dirs[i].length>m) m=dirs[i].length; } - sizew = m == 0 ? 3 : 1+1+log(m)/log(10); + sizew = 1+1+log(m)/log(10); } void +pushback(void) +{ + if(strlen(path) < 1) + return; + if(backp == Nback-1) + memmove(backlist, backlist+1, (Nback-1) * sizeof *backlist); + else + backp++; + if((backlist[backp] = strdup(path)) == nil) + sysfatal("strdup: %r"); + backoff[backp] = offset; +} + +int +back(void) +{ + char *p; + + if(backp < 0) + return 0; + offset = backoff[backp]; + backoff[backp] = 0; + p = backlist[backp]; + backlist[backp] = nil; + backp--; + strecpy(path, path+sizeof path, p); + free(p); + loaddirs(0); + return 1; +} + +void up(void) { + pushback(); snprint(path, sizeof path, abspath(path, "..")); - loaddirs(); + loaddirs(1); } void @@ -167,6 +211,7 @@ { char newpath[4096] = {0}; + pushback(); if(dir == nil) snprint(newpath, sizeof newpath, home); else if(dir[0] == '/') @@ -177,7 +222,7 @@ showerrstr("Directory does not exist"); else snprint(path, sizeof path, abspath(path, newpath)); - loaddirs(); + loaddirs(1); } void @@ -197,7 +242,7 @@ goto cleanup; } close(fd); - loaddirs(); + loaddirs(0); cleanup: free(p); } @@ -219,7 +264,7 @@ goto cleanup; } close(fd); - loaddirs(); + loaddirs(0); cleanup: free(p); } @@ -272,11 +317,11 @@ return; p = smprint("%s/%s", path, d.name); qp = quotestrdup(p); - snprint(cmd, sizeof cmd, "rm -r %s >/dev/null >[2=1]", qp); + snprint(cmd, sizeof cmd, "rm -r \'%s\' >/dev/null >[2=1]", qp); if(doexec(cmd) < 0) showerrstr("Cannot remove file/directory"); else - loaddirs(); + loaddirs(0); free(qp); free(p); } @@ -292,11 +337,11 @@ qfp = quotestrdup(fp); qtp = quotestrdup(tp); - snprint(cmd, sizeof cmd, "mv %s %s >/dev/null >[2=1]", qfp, qtp); + snprint(cmd, sizeof cmd, "mv \'%s\' \'%s\' >/dev/null >[2=1]", qfp, qtp); if(doexec(cmd) < 0) showerrstr("Cannot rename file/directory"); else - loaddirs(); + loaddirs(0); free(qtp); free(qfp); free(tp); @@ -304,7 +349,7 @@ } int -plumbfile(char *path, char *name) +plumbfile(char *path, char *name, int isdir) { char *f; int e; @@ -311,11 +356,14 @@ f = smprint("%s/%s", path, name); e = access(f, 0)==0; - if(e) - plumbsendtext(plumbfd, "vdir", nil, path, name); - else{ + if(e){ + if(isdir) + plumbsendtext(plumbfd, "vdir", nil, nil, f); + else + plumbsendtext(plumbfd, "vdir", nil, path, name); + }else{ alert("File does not exist anymore", nil, mctl, kctl); - loaddirs(); + loaddirs(0); redraw(); } free(f); @@ -325,30 +373,22 @@ void initcolors(void) { - Theme *theme; + Theme theme; - theme = loadtheme(); - if(theme == nil){ - toolbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xEFEFEFFF); - toolfg = display->black; - viewbg = display->white; - viewfg = display->black; - selbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xEFEFEFFF); - selfg = display->black; - scrollbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x999999FF); - scrollfg = display->white; - high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DGreygreen); - }else{ - toolbg = theme->back; - toolfg = theme->text; - viewbg = theme->back; - viewfg = theme->text; - selbg = theme->border; - selfg = theme->text; - scrollbg = theme->border; - scrollfg = theme->back; - high = theme->high; - } + memset(&theme, 0, sizeof theme); + theme.back = 0xEFEFEF; + theme.text = 0; + theme.border = 0x999999; + loadtheme(&theme); + toolbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.back << 8 | 0xff); + toolfg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.text << 8 | 0xff); + viewbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.back << 8 | 0xff); + viewfg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.text << 8 | 0xff); + selbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.border << 8 | 0xff); + selfg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.text << 8 | 0xff); + scrollbg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.border << 8 | 0xff); + scrollfg = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.back << 8 | 0xff); + high = allocimage(display, Rect(0,0,1,1), screen->chan, 1, theme.high << 8 | 0xff); } Image* @@ -379,6 +419,8 @@ iup = loadicon(big, updata, sizeof updata); inewfile = loadicon(big, newfiledata, sizeof newfiledata); inewfolder = loadicon(big, newfolderdata, sizeof newfolderdata); + iref = loadicon(big, refdata, sizeof refdata); + iback = loadicon(big, backdata, sizeof backdata); } char* @@ -399,7 +441,7 @@ p->x += Toolpadding; r = Rect(p->x, p->y, p->x+16, p->y+16); - draw(screen, r, c, i, ZP); + draw(fb, r, c, i, ZP); p->x += 16+Toolpadding; return r; } @@ -412,12 +454,12 @@ s = t; if(*s && (p.x+stringwidth(font, s)) > n){ - p = string(screen, p, i, ZP, font, ellipsis); + p = string(fb, p, i, ZP, font, ellipsis); while (*s && (p.x+stringwidth(font, s)) > n) s++; } for( ; *s; s++){ s += chartorune(&rn, s) - 1; - p = runestringn(screen, p, i, ZP, font, &rn, 1); + p = runestringn(fb, p, i, ZP, font, &rn, 1); } return p; } @@ -440,7 +482,7 @@ p = addpt(viewr.min, Pt(Toolpadding, Toolpadding)); p.y += n*lineh; r = Rpt(p, addpt(p, Pt(Dx(viewr)-2*Toolpadding, lineh))); - draw(screen, r, bg, nil, ZP); + draw(fb, r, bg, nil, ZP); t = mdate(d); snprint(buf, sizeof buf, "%*lld %s", sizew, d.length, t); free(t); @@ -447,12 +489,12 @@ img = (d.qid.type&QTDIR) ? folder : file; p.y -= Padding; dy = (lineh-12)/2; - draw(screen, Rect(p.x, p.y+dy, p.x+12, p.y+dy+12), fg, img, ZP); + draw(fb, Rect(p.x, p.y+dy, p.x+12, p.y+dy+12), fg, img, ZP); p.x += 12+4+Padding; p.y += Padding; p = drawtext(p, fg, d.name, viewr.max.x - stringwidth(font, buf) - 2*Padding - Toolpadding); p.x = viewr.max.x - stringwidth(font, buf) - 2*Padding - Toolpadding; - string(screen, p, fg, ZP, font, buf); + string(fb, p, fg, ZP, font, buf); } void @@ -473,22 +515,25 @@ Point p; int i, h, y; - draw(screen, screen->r, viewbg, nil, ZP); - p = addpt(screen->r.min, Pt(0, Toolpadding)); - draw(screen, toolr, toolbg, nil, ZP); - line(screen, Pt(toolr.min.x, toolr.max.y), toolr.max, 0, 0, 0, toolfg, ZP); + draw(fb, fb->r, viewbg, nil, ZP); + p = Pt(0, Toolpadding); + draw(fb, toolr, toolbg, nil, ZP); + line(fb, Pt(toolr.min.x, toolr.max.y), toolr.max, 0, 0, 0, toolfg, ZP); homer = drawbutton(&p, toolfg, ihome); cdr = drawbutton(&p, toolfg, icd); + backr = drawbutton(&p, toolfg, iback); upr = drawbutton(&p, toolfg, iup); + refr = drawbutton(&p, toolfg, iref); + p.x += Toolpadding; p.y = toolr.min.y + (Toolpadding+16+Toolpadding-font->height)/2; pathr = Rect(p.x, p.y, p.x + stringwidth(font, path), p.y + font->height); - p = drawtext(p, toolfg, path, screen->r.max.x - 2*(Toolpadding+16+Toolpadding)); - p.x = screen->r.max.x - 2*(Toolpadding+16+Toolpadding); - p.y = screen->r.min.y + Toolpadding; + p = drawtext(p, toolfg, path, fb->r.max.x - 2*(Toolpadding+16+Toolpadding)); + p.x = fb->r.max.x - 2*(Toolpadding+16+Toolpadding); + p.y = fb->r.min.y + Toolpadding; newdirr = drawbutton(&p, toolfg, inewfolder); newfiler = drawbutton(&p, toolfg, inewfile); - draw(screen, scrollr, scrollbg, nil, ZP); + draw(fb, scrollr, scrollbg, nil, ZP); if(ndirs>0){ h = ((double)nlines/ndirs)*Dy(scrollr); y = ((double)offset/ndirs)*Dy(scrollr); @@ -495,10 +540,11 @@ scrposr = Rect(scrollr.min.x, scrollr.min.y+y, scrollr.max.x-1, scrollr.min.y+y+h); }else scrposr = Rect(scrollr.min.x, scrollr.min.y, scrollr.max.x-1, scrollr.max.y); - draw(screen, scrposr, scrollfg, nil, ZP); + draw(fb, scrposr, scrollfg, nil, ZP); for(i = 0; i<nlines && offset+i<ndirs; i++){ drawdir(i, 0); } + draw(screen, screen->r, fb, nil, ZP); flushimage(display, 1); } @@ -539,18 +585,42 @@ } void +scroll(Mouse m) +{ + int dy; + + if(m.buttons & 1){ + dy = 1+nlines*((double)(m.xy.y - scrollr.min.y)/Dy(scrollr)); + scrollup(dy); + }else if(m.buttons & 2){ + if(nlines<ndirs){ + offset = scrollclamp((m.xy.y-Dy(scrposr)/2 - (scrollr.min.y)) * ndirs/Dy(scrollr)); + redraw(); + } + }else if(m.buttons & 4){ + dy = 1+nlines*((double)(m.xy.y - scrollr.min.y)/Dy(scrollr)); + scrolldown(dy); + } +} + +void evtresize(void) { if(getwindow(display, Refnone)<0) sysfatal("cannot reattach: %r"); lineh = Padding+font->height+Padding; - toolr = screen->r; + freeimage(fb); + if((fb = allocimage(display, + Rect(0,0,Dx(screen->r),Dy(screen->r)), + screen->chan, 0, DNofill)) == nil) + sysfatal("allocimage: %r"); + toolr = fb->r; toolr.max.y = toolr.min.y+16+2*Toolpadding; - scrollr = screen->r; + scrollr = fb->r; scrollr.min.y = toolr.max.y+1; scrollr.max.x = scrollr.min.x + Scrollwidth; scrollr = insetrect(scrollr, 1); - viewr = screen->r; + viewr = fb->r; viewr.min.x += Scrollwidth; viewr.min.y = toolr.max.y+1; nlines = Dy(viewr)/lineh; @@ -571,17 +641,38 @@ case Kpgdown: scrolldown(nlines); break; + case 'k': + case Kup: + scrollup(1); + break; + case 'j': + case Kdown: + scrolldown(1); + break; case Khome: - cd(nil); + scrollup(ndirs); + break; + case Kend: + scrolldown(ndirs); + break; + case 'r': + case Kesc: + loaddirs(0); redraw(); break; - case Kup: + case 'h': up(); redraw(); break; - case 0x20: - plumbsendtext(plumbfd, "vdir", nil, nil, path); + case 'b': + case Kbs: + back(); + redraw(); break; + case 'l': + case 0x0a: + plumbsendtext(plumbfd, "vdirw", nil, nil, path); + break; } } @@ -590,9 +681,8 @@ { Point p; - p = screen->r.min; - p.x += (Dx(screen->r)-stringwidth(font, text)-4)/2; - p.y += (Dy(screen->r)-font->height-4)/2; + p.x = (Dx(fb->r)-stringwidth(font, text)-4)/2; + p.y = (Dy(fb->r)-font->height-4)/2; return p; } @@ -612,66 +702,36 @@ void evtmouse(Mouse m) { - int n, dy; + int n; Dir d; char buf[4096] = {0}; - if(oldbuttons == 0 && m.buttons != 0 && ptinrect(m.xy, scrollr)) + m.xy = subpt(m.xy, screen->r.min); + if(m.buttons != 0 && (ptinrect(m.xy, scrollr) || scrolling)){ scrolling = 1; - else if(m.buttons == 0) + scroll(m); + }else scrolling = 0; - if(m.buttons&1){ - if(scrolling){ - dy = 1+nlines*((double)(m.xy.y - scrollr.min.y)/Dy(scrollr)); - scrollup(dy); - } - }else if(m.buttons&2){ - if(ptinrect(m.xy, viewr)){ - n = indexat(m.xy); - if(n==-1) - return; - d = dirs[offset+n]; - switch(menuhit(2, mctl, &menu2, nil)){ - case Mdelete: - rm(d); - redraw(); - break; - case Mrename: - snprint(buf, sizeof buf, "%s", d.name); - if(enter("Rename to", buf, sizeof buf, mctl, kctl, nil)>0){ - mv(d.name, buf); - redraw(); - } - break; - } - }else if(scrolling){ - if(nlines<ndirs){ - offset = scrollclamp((m.xy.y - scrollr.min.y) * ndirs/Dy(scrollr)); - redraw(); - } - }else if(ptinrect(m.xy, pathr)){ - loaddirs(); - redraw(); - } - }if((m.buttons&4) && oldbuttons == 0){ - if(scrolling){ - dy = 1+nlines*((double)(m.xy.y - scrollr.min.y)/Dy(scrollr)); - scrolldown(dy); - }else if(ptinrect(m.xy, homer)){ + if(m.buttons&1 && oldbuttons == 0){ + if(ptinrect(m.xy, homer)){ cd(nil); redraw(); }else if(ptinrect(m.xy, upr)){ up(); redraw(); - }else if(ptinrect(m.xy, cdr)){ + }else if(ptinrect(m.xy, refr)){ + loaddirs(0); + redraw(); + }else if(ptinrect(m.xy, backr)){ + if(back()) + redraw(); + }else if(ptinrect(m.xy, cdr) || ptinrect(m.xy, pathr)){ m.xy = cept("Go to directory"); if(enter("Go to directory", buf, sizeof buf, mctl, kctl, nil)>0){ cd(buf); redraw(); } - }else if(ptinrect(m.xy, pathr)){ - plumbsendtext(plumbfd, "vdir", nil, nil, path); }else if(ptinrect(m.xy, newdirr)){ m.xy = cept("Create directory"); if(enter("Create directory", buf, sizeof buf, mctl, kctl, nil)>0){ @@ -692,11 +752,40 @@ if(d.qid.type & QTDIR){ cd(d.name); redraw(); - }else{ - if(plumbfile(path, d.name)) - flash(n); } } + }else if(m.buttons&2 && oldbuttons == 0){ + if(ptinrect(m.xy, viewr)){ + n = indexat(m.xy); + if(n==-1) + return; + d = dirs[offset+n]; + menu2.lasthit = 0; + switch(menuhit(2, mctl, &menu2, nil)){ + case Mdelete: + rm(d); + redraw(); + break; + case Mrename: + snprint(buf, sizeof buf, "%s", d.name); + if(enter("Rename to", buf, sizeof buf, mctl, kctl, nil)>0){ + mv(d.name, buf); + redraw(); + } + break; + } + } + }if((m.buttons&4) && oldbuttons == 0){ + if(ptinrect(m.xy, pathr)){ + plumbsendtext(plumbfd, "vdirw", nil, nil, path); + }else if(ptinrect(m.xy, viewr)){ + n = indexat(m.xy); + if(n==-1) + return; + d = dirs[offset+n]; + if(plumbfile(path, d.name, d.qid.type & QTDIR)) + flash(n); + } }else if(m.buttons&8) scrollup(Slowscroll); else if(m.buttons&16) @@ -795,7 +884,7 @@ alts[Eplumb].c = chancreate(sizeof(d), 1); proccreate(plumbdir, alts[Eplumb].c, 4096); readhome(); - loaddirs(); + loaddirs(1); initcolors(); initimages(); evtresize();