Compare commits
460 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
208c5d5391 | ||
![]() |
8182d77dfa | ||
![]() |
3991735d0d | ||
![]() |
c0d8e79aad | ||
![]() |
8ed8f3459e | ||
![]() |
a83425ff68 | ||
![]() |
3646632011 | ||
![]() |
be9c5e1024 | ||
![]() |
2d8a38f922 | ||
![]() |
ee7109d1da | ||
![]() |
c382669135 | ||
![]() |
704a4b5715 | ||
![]() |
7f3d7d860c | ||
![]() |
f9c66a6afe | ||
![]() |
9ad07e4232 | ||
![]() |
7e84f86ecb | ||
![]() |
db2ecdc3d0 | ||
![]() |
401976e280 | ||
![]() |
6f0e7a6a2b | ||
![]() |
55d8dc29ef | ||
![]() |
7b2b6b22f8 | ||
![]() |
1f198f1e5f | ||
![]() |
42f109bf7e | ||
![]() |
781947df9f | ||
![]() |
8d8f46cd36 | ||
![]() |
7fcbe8343c | ||
![]() |
aeafe01696 | ||
![]() |
dccfc81e33 | ||
![]() |
cb0005118c | ||
![]() |
8549f24d0a | ||
![]() |
1d83cd8dd0 | ||
![]() |
1b36b8607f | ||
![]() |
7505c40342 | ||
![]() |
da02d6d6ee | ||
![]() |
c5000d9a66 | ||
![]() |
26ca8df32a | ||
![]() |
923652b56a | ||
![]() |
78e7cd54cd | ||
![]() |
e0d792e648 | ||
![]() |
e447986cfc | ||
![]() |
093e4917b5 | ||
![]() |
dbab12d084 | ||
![]() |
165c9ad12e | ||
![]() |
e303c52f9c | ||
![]() |
6d7bd5aee1 | ||
![]() |
c280e23beb | ||
![]() |
7ca2f61658 | ||
![]() |
c00224fb5f | ||
![]() |
7e600490fc | ||
![]() |
cdf3b261ef | ||
![]() |
68248ce80f | ||
![]() |
e216515aed | ||
![]() |
49e8588290 | ||
![]() |
fb209ce009 | ||
![]() |
03bf9e743c | ||
![]() |
82447b3bc6 | ||
![]() |
c555f462de | ||
![]() |
452e2df3d5 | ||
![]() |
5b67135d6f | ||
![]() |
5025b4169d | ||
![]() |
7847a02840 | ||
![]() |
8e74040bb5 | ||
![]() |
ea55fda70a | ||
![]() |
ea0032f3df | ||
![]() |
8630c116b5 | ||
![]() |
69c46620ad | ||
![]() |
3de59702f4 | ||
![]() |
4d04f152fd | ||
![]() |
5af733d166 | ||
![]() |
6768f44c8b | ||
![]() |
ed6c7009b0 | ||
![]() |
547f3dec8e | ||
![]() |
e1dfcdd048 | ||
![]() |
db871f8708 | ||
![]() |
0e3ac9c8b0 | ||
![]() |
60e57f74fa | ||
![]() |
f80784aa5c | ||
![]() |
e50fc55860 | ||
![]() |
ffbf8faccd | ||
![]() |
d130c2a855 | ||
![]() |
e72989fe22 | ||
![]() |
c1facbef23 | ||
![]() |
9e6d7c5784 | ||
![]() |
f7c4cd08eb | ||
![]() |
3ba23320c0 | ||
![]() |
87fa3fbf70 | ||
![]() |
219551b747 | ||
![]() |
19b0a662d3 | ||
![]() |
561a3df448 | ||
![]() |
6d8375de9c | ||
![]() |
1cc38e2535 | ||
![]() |
fdc4b4ef8d | ||
![]() |
042d3aa96b | ||
![]() |
f0b2702e36 | ||
![]() |
49d0c9eebe | ||
![]() |
9192b42be0 | ||
![]() |
1ad4e24a78 | ||
![]() |
d928d8841b | ||
![]() |
3ff0dcc1ae | ||
![]() |
7c64eca4fd | ||
![]() |
a4256f54c9 | ||
![]() |
7caf4f192e | ||
![]() |
0706b625cf | ||
![]() |
c45738db29 | ||
![]() |
59191f8df2 | ||
![]() |
b0494bd5c8 | ||
![]() |
08ccedece4 | ||
![]() |
d231615550 | ||
![]() |
18fbe6a5a8 | ||
![]() |
89f1bb46b6 | ||
![]() |
a34bacb8f5 | ||
![]() |
78e3e3b7e1 | ||
![]() |
fe14d53521 | ||
![]() |
9fb6ac8653 | ||
![]() |
45f09af98f | ||
![]() |
d9a024af37 | ||
![]() |
b079e79561 | ||
![]() |
187fe2649b | ||
![]() |
e4db93704e | ||
![]() |
f98022401f | ||
![]() |
eae3e300ef | ||
![]() |
30c0c29d4a | ||
![]() |
8914ab9e46 | ||
![]() |
9df88d5737 | ||
![]() |
7d0f1beaf2 | ||
![]() |
111861ec8b | ||
![]() |
632f4492f5 | ||
![]() |
d0efbba02e | ||
![]() |
968e4b9ff0 | ||
![]() |
607391d25d | ||
![]() |
5e700019a1 | ||
![]() |
5cd9018ce4 | ||
![]() |
953093390e | ||
![]() |
1142fd1082 | ||
![]() |
1f975d7dbd | ||
![]() |
578c67ef0d | ||
![]() |
75cbc90a1d | ||
![]() |
8ecf82db56 | ||
![]() |
4f496f5ab8 | ||
![]() |
695b42e82b | ||
![]() |
9832b0f99e | ||
![]() |
3bcb48a43c | ||
![]() |
16452602eb | ||
![]() |
ed81280762 | ||
![]() |
ee6bca704d | ||
![]() |
112f5409cf | ||
![]() |
cdc5f0f2f4 | ||
![]() |
6d3f4c4821 | ||
![]() |
b102d44046 | ||
![]() |
7f357e2586 | ||
![]() |
6b72f388f6 | ||
![]() |
302c1b57f8 | ||
![]() |
031f667caa | ||
![]() |
10460da435 | ||
![]() |
8e482da448 | ||
![]() |
648fdcca20 | ||
![]() |
e2d555c22a | ||
![]() |
e7aee219b3 | ||
![]() |
c1733a39fd | ||
![]() |
d407c971ee | ||
![]() |
3e251c35ec | ||
![]() |
02911d9550 | ||
![]() |
917c3c0bb8 | ||
![]() |
a82cacd126 | ||
![]() |
a78428c698 | ||
![]() |
0e28a4a006 | ||
![]() |
1ae40a0019 | ||
![]() |
d0dda4eb8e | ||
![]() |
2a24de7616 | ||
![]() |
8cd957db6a | ||
![]() |
f0131a36ac | ||
![]() |
4aa0d56503 | ||
![]() |
b2c4e99650 | ||
![]() |
4528919814 | ||
![]() |
22173bcb23 | ||
![]() |
627b7ab6b8 | ||
![]() |
77e9f18470 | ||
![]() |
3d11c9b1f7 | ||
![]() |
a47b9854f3 | ||
![]() |
382b9349be | ||
![]() |
2743a83e27 | ||
![]() |
c771c72017 | ||
![]() |
6abca346be | ||
![]() |
2fc73a0c45 | ||
![]() |
db31458ffe | ||
![]() |
395d4bbc86 | ||
![]() |
cc48d9427a | ||
![]() |
c13839cb19 | ||
![]() |
d4feb2c867 | ||
![]() |
2e370cc972 | ||
![]() |
10b2c4b47c | ||
![]() |
3f1b943876 | ||
![]() |
d36da88f31 | ||
![]() |
b0b07e443c | ||
![]() |
2e1e759b76 | ||
![]() |
db7b90c328 | ||
![]() |
8039134d6b | ||
![]() |
3905b8305d | ||
![]() |
9f9a39d1f0 | ||
![]() |
40263e766d | ||
![]() |
63e466e16d | ||
![]() |
8c4a37e3a6 | ||
![]() |
8a18bc3dd1 | ||
![]() |
8e71ccee3b | ||
![]() |
9eea55b7aa | ||
![]() |
d9bcce1a21 | ||
![]() |
8e7f398626 | ||
![]() |
fa3d63322c | ||
![]() |
071126801e | ||
![]() |
4030f6f971 | ||
![]() |
7253252421 | ||
![]() |
6a05513931 | ||
![]() |
56b86ffb03 | ||
![]() |
aba242d14c | ||
![]() |
c0c2036686 | ||
![]() |
347faf6a03 | ||
![]() |
16fa2d5997 | ||
![]() |
9dad245027 | ||
![]() |
d1bb5fe847 | ||
![]() |
4e843637cb | ||
![]() |
cc001bd8d7 | ||
![]() |
d517550994 | ||
![]() |
5bc46846a5 | ||
![]() |
bec5189a1c | ||
![]() |
eb6e1c9d2e | ||
![]() |
a20b4714ec | ||
![]() |
354bbfc1ca | ||
![]() |
4133d2148c | ||
![]() |
4e356f9e77 | ||
![]() |
39b93b11f1 | ||
![]() |
189e3a70d1 | ||
![]() |
b04fbabae6 | ||
![]() |
dada8bc6e7 | ||
![]() |
6f60f41d1c | ||
![]() |
6bc990bbf9 | ||
![]() |
197bfee1da | ||
![]() |
57f129bda3 | ||
![]() |
56af2311b9 | ||
![]() |
d50d757022 | ||
![]() |
fa0824bce9 | ||
![]() |
5b0da969af | ||
![]() |
d2fdcd240b | ||
![]() |
3f9794c2a4 | ||
![]() |
aa716dd04b | ||
![]() |
804876a987 | ||
![]() |
a63fd77a50 | ||
![]() |
914cc7c3a7 | ||
![]() |
bb7fb114f8 | ||
![]() |
3ff693ac37 | ||
![]() |
3c229a8526 | ||
![]() |
36484beb58 | ||
![]() |
2af22cde92 | ||
![]() |
a17b7f05d7 | ||
![]() |
c1bcf311bc | ||
![]() |
76dd2feb30 | ||
![]() |
4b9b6c7233 | ||
![]() |
6d78650b12 | ||
![]() |
e40bac0924 | ||
![]() |
5c0f88a961 | ||
![]() |
5667f98a01 | ||
![]() |
35c22db10c | ||
![]() |
5c02a8c9cf | ||
![]() |
2ba3fcdf6e | ||
![]() |
a969687b7b | ||
![]() |
c622ed748a | ||
![]() |
3be25ac28f | ||
![]() |
0914b264f4 | ||
![]() |
c791add587 | ||
![]() |
311d723bb3 | ||
![]() |
c78fbb009a | ||
![]() |
a502b2363a | ||
![]() |
b4198f61f2 | ||
![]() |
9369a94350 | ||
![]() |
1052d873e1 | ||
![]() |
97b749e64f | ||
![]() |
dedac98702 | ||
![]() |
3014b30358 | ||
![]() |
99d067ea2d | ||
![]() |
abc80e046d | ||
![]() |
fe39854b57 | ||
![]() |
1bcfd8db08 | ||
![]() |
f0990faa56 | ||
![]() |
b0e4f19491 | ||
![]() |
f321e243ba | ||
![]() |
6cd837b423 | ||
![]() |
82994b69bc | ||
![]() |
b1e5ce0172 | ||
![]() |
50d839a02f | ||
![]() |
18f3f57606 | ||
![]() |
1988cd3c09 | ||
![]() |
d481bcdceb | ||
![]() |
df0ba78298 | ||
![]() |
2fda049c26 | ||
![]() |
f8d24aa191 | ||
![]() |
057126a7a0 | ||
![]() |
1980ed1590 | ||
![]() |
93dae0a8ca | ||
![]() |
734b0e36e3 | ||
![]() |
0d07315253 | ||
![]() |
0320ce13b4 | ||
![]() |
03807a1afb | ||
![]() |
02f2cef5e3 | ||
![]() |
462891951b | ||
![]() |
5a83dce8ed | ||
![]() |
04b1180b26 | ||
![]() |
ba6efbe8ea | ||
![]() |
6b2a481cf2 | ||
![]() |
d6aa4d6959 | ||
![]() |
e56c33cbd8 | ||
![]() |
0e5809120d | ||
![]() |
42cbf9ecdf | ||
![]() |
a2660fc15c | ||
![]() |
31279b1015 | ||
![]() |
ff7d9c0aa9 | ||
![]() |
c643d9a4f5 | ||
![]() |
d34e1d379c | ||
![]() |
c9ca36085e | ||
![]() |
24fafc5746 | ||
![]() |
de7e09acc7 | ||
![]() |
edc073a0ea | ||
![]() |
49e9ccd0ca | ||
![]() |
775c63a301 | ||
![]() |
de07befb88 | ||
![]() |
59d957f06c | ||
![]() |
7ba410bb4e | ||
![]() |
5055669981 | ||
![]() |
8440bc6fc7 | ||
![]() |
fe5e8bf730 | ||
![]() |
9b2beb3d37 | ||
![]() |
1b1b74f39b | ||
![]() |
5db88cffe3 | ||
![]() |
c1406e6bfc | ||
![]() |
6bfd26bf0c | ||
![]() |
22fda2dbba | ||
![]() |
470eb93a3f | ||
![]() |
ea4c1cbb92 | ||
![]() |
c15f589a8f | ||
![]() |
778c578656 | ||
![]() |
b34c890d3e | ||
![]() |
63e7b3dd89 | ||
![]() |
db9111ff22 | ||
![]() |
c11bd9dc7b | ||
![]() |
61d4f7d2c2 | ||
![]() |
95995eab0e | ||
![]() |
1b2f5fabfa | ||
![]() |
3f262dfcd2 | ||
![]() |
6e5e7cb891 | ||
![]() |
66fdeefe84 | ||
![]() |
59c4216bca | ||
![]() |
d36278fd5e | ||
![]() |
4d564e29de | ||
![]() |
ebac276af7 | ||
![]() |
5a3df33890 | ||
![]() |
4f86e075e0 | ||
![]() |
333857ff81 | ||
![]() |
abd69a2acd | ||
![]() |
a6bf4fc2fc | ||
![]() |
2ca07cafd0 | ||
![]() |
f2e6244b4a | ||
![]() |
01d53fe29c | ||
![]() |
7c0380c25e | ||
![]() |
2a9777e3e7 | ||
![]() |
96efbbcc9f | ||
![]() |
4d07fc41f0 | ||
![]() |
a1320fe8da | ||
![]() |
b4ed9b4e7d | ||
![]() |
11ab3d7c42 | ||
![]() |
fcee5844cc | ||
![]() |
bff0dcfb7a | ||
![]() |
589693778a | ||
![]() |
dbbdfe876c | ||
![]() |
04b9f7b5c1 | ||
![]() |
1d7c95a822 | ||
![]() |
e4ab7d0a32 | ||
![]() |
6027a387b0 | ||
![]() |
3e2336a63d | ||
![]() |
1260afb2c4 | ||
![]() |
dbee403b59 | ||
![]() |
7676d5867b | ||
![]() |
6bae00361b | ||
![]() |
1c18890fbf | ||
![]() |
8e400e7ee5 | ||
![]() |
cd9b713c41 | ||
![]() |
9ce0776d53 | ||
![]() |
346ec59ea5 | ||
![]() |
bc533f3d18 | ||
![]() |
efaca311fc | ||
![]() |
2b3338cc43 | ||
![]() |
56cb31fd2a | ||
![]() |
5b97e7ef60 | ||
![]() |
3a20245304 | ||
![]() |
768425ad0f | ||
![]() |
60cd782c64 | ||
![]() |
8d59e7138c | ||
![]() |
e79de6c36d | ||
![]() |
810de851ff | ||
![]() |
15af258db0 | ||
![]() |
15d94d2c4b | ||
![]() |
dae2a3a512 | ||
![]() |
2575d4c909 | ||
![]() |
f15f65192d | ||
![]() |
dad0f0e962 | ||
![]() |
7d8a728925 | ||
![]() |
bf2f0f5ad7 | ||
![]() |
3994039864 | ||
![]() |
a5320b28ee | ||
![]() |
94a18707dd | ||
![]() |
67cc8aa480 | ||
![]() |
da66c27580 | ||
![]() |
4acac51a8d | ||
![]() |
94075595de | ||
![]() |
5ac88dbd1c | ||
![]() |
24c03163f6 | ||
![]() |
4ffe24f427 | ||
![]() |
2f12127cc9 | ||
![]() |
071a3b4f22 | ||
![]() |
6465ea9ed6 | ||
![]() |
c97f932bc3 | ||
![]() |
41aa42d897 | ||
![]() |
76dbdcdfa0 | ||
![]() |
76b6b648cc | ||
![]() |
694713ba17 | ||
![]() |
6c64aa7c3d | ||
![]() |
882078cd60 | ||
![]() |
19773884de | ||
![]() |
dad30d33bd | ||
![]() |
bf199478d7 | ||
![]() |
a5df20851d | ||
![]() |
227cc6eb49 | ||
![]() |
f03719af81 | ||
![]() |
73d131972a | ||
![]() |
fa2e34a065 | ||
![]() |
2204f27b01 | ||
![]() |
3fb18391df | ||
![]() |
2138c0e123 | ||
![]() |
3df710e1fc | ||
![]() |
f627011802 | ||
![]() |
2ef607ecb9 | ||
![]() |
2820b840e4 | ||
![]() |
78fe8d2558 | ||
![]() |
7b6fa41baf | ||
![]() |
44f52db289 | ||
![]() |
75bed46029 | ||
![]() |
fe5079a571 | ||
![]() |
fd1fdf1c73 | ||
![]() |
45b7361e79 | ||
![]() |
b0e8a29f85 | ||
![]() |
86dacf6e73 | ||
![]() |
e05ef2e969 | ||
![]() |
ea15722629 | ||
![]() |
a370b8a7e1 | ||
![]() |
83713412f2 | ||
![]() |
c50aa6c312 | ||
![]() |
5f6c5d0e07 | ||
![]() |
72d5f232d6 | ||
![]() |
4cc98c59fd | ||
![]() |
61fc320b8f | ||
![]() |
9ca358bd5a | ||
![]() |
61074fea2c | ||
![]() |
6453b74a96 |
@@ -1,15 +1,28 @@
|
||||
version: '{build}'
|
||||
image: Visual Studio 2017
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
skip_branch_with_pr: true
|
||||
image: Visual Studio 2019
|
||||
configuration: Release
|
||||
platform: Any CPU
|
||||
clone_script:
|
||||
- cmd: >-
|
||||
git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/%APPVEYOR_REPO_NAME%.git %APPVEYOR_BUILD_FOLDER%
|
||||
|
||||
cd %APPVEYOR_BUILD_FOLDER%
|
||||
|
||||
git checkout -qf %APPVEYOR_REPO_COMMIT%
|
||||
|
||||
git submodule update --init --recursive
|
||||
cache:
|
||||
- packages -> **\packages.config
|
||||
- '%USERPROFILE%\.nuget\packages -> **\project.json'
|
||||
before_build:
|
||||
- ps: >-
|
||||
$env:GIT_TAG = git describe --always --tags
|
||||
|
||||
nuget restore
|
||||
|
||||
nuget restore -verbosity detailed
|
||||
build:
|
||||
verbosity: minimal
|
||||
after_build:
|
||||
@@ -25,3 +38,12 @@ artifacts:
|
||||
name: QuickLook-%GIT_TAG%
|
||||
- path: QuickLook-%GIT_TAG%.msi
|
||||
name: QuickLook-%GIT_TAG%
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: 5CSvkfKBq9kUho529L1tkH5ywQQFJY/A8Y6lNoHGJFi7mnSqQAaoiVPbUVU4a/KC
|
||||
artifact: QuickLook-$(APPVEYOR_REPO_TAG_NAME)
|
||||
draft: true
|
||||
on:
|
||||
branch: master
|
||||
APPVEYOR_REPO_TAG: true
|
||||
|
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: Report a bug
|
||||
about: Please follow this template or your issue will be closed
|
||||
|
||||
---
|
||||
|
||||
*For all's convenience, please use English to fill this issue.*
|
||||
|
||||
*Please search within existing issues before the submission. Has this issue already been reported?*
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS Version: [e.g. Windows 10 1803]
|
||||
- QuickLook Version: [e.g. 0.3.3 from Windows Store]
|
||||
|
||||
**Screenshots and Exception Log**
|
||||
If applicable, add screenshots and logs to help explain your problem. The log file is located in `%APPDATA%\pooi.moe\QuickLook\QuickLook.Exception.log` (`.msi` or `.zip` version) or `%LOCALAPPDATA%\Packages\21090PaddyXu.QuickLook_egxr34yet59cg\LocalCache\Roaming\pooi.moe\QuickLook\QuickLook.Exception.log` (Windows Store version).
|
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Suggest a new idea
|
||||
about: Please follow this template or your issue will be closed
|
||||
|
||||
---
|
||||
|
||||
*For all's convenience, please use English to fill this issue.*
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
8
.gitignore
vendored
@@ -17,8 +17,6 @@
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
@@ -290,4 +288,8 @@ __pycache__/
|
||||
/QuickLook.Plugin.PDFViewer/MoonPdfLib
|
||||
/GitVersion.cs
|
||||
/QuickLook.Installer/C_QuickLookComponents.wxs
|
||||
/Build/
|
||||
/Build/*
|
||||
!/Build/Assets
|
||||
!/Build/AppxManifest.*
|
||||
!/Build/assetslayout.resfiles
|
||||
!/Build/priconfig.xml
|
||||
|
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "QuickLook.Common"]
|
||||
path = QuickLook.Common
|
||||
url = https://github.com/QL-Win/QuickLook.Common.git
|
53
Build/AppxManifest.dev.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
|
||||
<Identity Name="21090PaddyXu.QuickLook" Version="0.0.0.0"
|
||||
Publisher='E=xupaddy@gmail.com, CN="Open Source Developer, Pengfei Xu", O=Open Source Developer, C=FI' />
|
||||
<Properties>
|
||||
<DisplayName>QuickLook</DisplayName>
|
||||
<PublisherDisplayName>Paddy Xu</PublisherDisplayName>
|
||||
<Description>Bring macOS “Quick Look” feature to Windows</Description>
|
||||
<Logo>Assets\storelogo.png</Logo>
|
||||
</Properties>
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
<Resource uap:Scale="100" />
|
||||
<Resource uap:Scale="125" />
|
||||
<Resource uap:Scale="150" />
|
||||
<Resource uap:Scale="200" />
|
||||
<Resource uap:Scale="400" />
|
||||
</Resources>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.15063.0" />
|
||||
</Dependencies>
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
<Applications>
|
||||
<Application Id="Main" Executable="Package\QuickLook.exe" EntryPoint="Windows.FullTrustApplication">
|
||||
<Extensions>
|
||||
<desktop:Extension Category="windows.startupTask" Executable="Package\QuickLook.exe"
|
||||
EntryPoint="Windows.FullTrustApplication">
|
||||
<desktop:StartupTask TaskId="QuickLookTask" Enabled="true" DisplayName="QuickLook" />
|
||||
</desktop:Extension>
|
||||
</Extensions>
|
||||
<uap:VisualElements DisplayName="QuickLook"
|
||||
Description="Bring macOS “Quick Look” feature to Windows"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"
|
||||
Square310x310Logo="Assets\LargeTile.png"
|
||||
Square71x71Logo="Assets\SmallTile.png">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo" />
|
||||
<uap:ShowOn Tile="wide310x150Logo" />
|
||||
<uap:ShowOn Tile="square310x310Logo" />
|
||||
</uap:ShowNameOnTiles>
|
||||
</uap:DefaultTile>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
</Package>
|
52
Build/AppxManifest.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
|
||||
<Identity Name="21090PaddyXu.QuickLook" Version="0.0.0.0" Publisher="CN=CE36AF3D-FF94-43EB-9908-7EC8FD1D29FB" />
|
||||
<Properties>
|
||||
<DisplayName>QuickLook</DisplayName>
|
||||
<PublisherDisplayName>Paddy Xu</PublisherDisplayName>
|
||||
<Description>Bring macOS “Quick Look” feature to Windows</Description>
|
||||
<Logo>Assets\storelogo.png</Logo>
|
||||
</Properties>
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
<Resource uap:Scale="100" />
|
||||
<Resource uap:Scale="125" />
|
||||
<Resource uap:Scale="150" />
|
||||
<Resource uap:Scale="200" />
|
||||
<Resource uap:Scale="400" />
|
||||
</Resources>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.15063.0" />
|
||||
</Dependencies>
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
<Applications>
|
||||
<Application Id="Main" Executable="Package\QuickLook.exe" EntryPoint="Windows.FullTrustApplication">
|
||||
<Extensions>
|
||||
<desktop:Extension Category="windows.startupTask" Executable="Package\QuickLook.exe"
|
||||
EntryPoint="Windows.FullTrustApplication">
|
||||
<desktop:StartupTask TaskId="QuickLookTask" Enabled="true" DisplayName="QuickLook" />
|
||||
</desktop:Extension>
|
||||
</Extensions>
|
||||
<uap:VisualElements DisplayName="QuickLook"
|
||||
Description="Bring macOS “Quick Look” feature to Windows"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"
|
||||
Square310x310Logo="Assets\LargeTile.png"
|
||||
Square71x71Logo="Assets\SmallTile.png">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo" />
|
||||
<uap:ShowOn Tile="wide310x150Logo" />
|
||||
<uap:ShowOn Tile="square310x310Logo" />
|
||||
</uap:ShowNameOnTiles>
|
||||
</uap:DefaultTile>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
</Package>
|
BIN
Build/Assets/LargeTile.scale-100.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
Build/Assets/LargeTile.scale-125.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
Build/Assets/LargeTile.scale-150.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
Build/Assets/LargeTile.scale-200.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
Build/Assets/LargeTile.scale-400.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
Build/Assets/SmallTile.scale-100.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
Build/Assets/SmallTile.scale-125.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
Build/Assets/SmallTile.scale-150.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
Build/Assets/SmallTile.scale-200.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
Build/Assets/SmallTile.scale-400.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
Build/Assets/Square150x150Logo.scale-100.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
Build/Assets/Square150x150Logo.scale-125.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
Build/Assets/Square150x150Logo.scale-150.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
Build/Assets/Square150x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
Build/Assets/Square150x150Logo.scale-400.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
Build/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
Normal file
After Width: | Height: | Size: 793 B |
BIN
Build/Assets/Square44x44Logo.altform-unplated_targetsize-24.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
Build/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
Build/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
Build/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
Build/Assets/Square44x44Logo.scale-100.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
Build/Assets/Square44x44Logo.scale-125.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
Build/Assets/Square44x44Logo.scale-150.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
Build/Assets/Square44x44Logo.scale-200.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
Build/Assets/Square44x44Logo.scale-400.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
Build/Assets/Square44x44Logo.targetsize-16.png
Normal file
After Width: | Height: | Size: 615 B |
BIN
Build/Assets/Square44x44Logo.targetsize-24.png
Normal file
After Width: | Height: | Size: 948 B |
BIN
Build/Assets/Square44x44Logo.targetsize-256.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
Build/Assets/Square44x44Logo.targetsize-32.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
Build/Assets/Square44x44Logo.targetsize-48.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
Build/Assets/Wide310x150Logo.scale-100.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
Build/Assets/Wide310x150Logo.scale-125.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
Build/Assets/Wide310x150Logo.scale-150.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
Build/Assets/Wide310x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
Build/Assets/Wide310x150Logo.scale-400.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
Build/Assets/storelogo.scale-100.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
Build/Assets/storelogo.scale-125.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
Build/Assets/storelogo.scale-150.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
Build/Assets/storelogo.scale-200.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
Build/Assets/storelogo.scale-400.png
Normal file
After Width: | Height: | Size: 18 KiB |
40
Build/assetslayout.resfiles
Normal file
@@ -0,0 +1,40 @@
|
||||
Assets\LargeTile.scale-100.png
|
||||
Assets\LargeTile.scale-125.png
|
||||
Assets\LargeTile.scale-150.png
|
||||
Assets\LargeTile.scale-200.png
|
||||
Assets\LargeTile.scale-400.png
|
||||
Assets\SmallTile.scale-100.png
|
||||
Assets\SmallTile.scale-125.png
|
||||
Assets\SmallTile.scale-150.png
|
||||
Assets\SmallTile.scale-200.png
|
||||
Assets\SmallTile.scale-400.png
|
||||
Assets\Square150x150Logo.scale-100.png
|
||||
Assets\Square150x150Logo.scale-125.png
|
||||
Assets\Square150x150Logo.scale-150.png
|
||||
Assets\Square150x150Logo.scale-200.png
|
||||
Assets\Square150x150Logo.scale-400.png
|
||||
Assets\Square44x44Logo.altform-unplated_targetsize-16.png
|
||||
Assets\Square44x44Logo.altform-unplated_targetsize-24.png
|
||||
Assets\Square44x44Logo.altform-unplated_targetsize-32.png
|
||||
Assets\Square44x44Logo.altform-unplated_targetsize-48.png
|
||||
Assets\Square44x44Logo.altform-unplated_targetsize-256.png
|
||||
Assets\Square44x44Logo.scale-100.png
|
||||
Assets\Square44x44Logo.scale-125.png
|
||||
Assets\Square44x44Logo.scale-150.png
|
||||
Assets\Square44x44Logo.scale-200.png
|
||||
Assets\Square44x44Logo.scale-400.png
|
||||
Assets\Square44x44Logo.targetsize-16.png
|
||||
Assets\Square44x44Logo.targetsize-24.png
|
||||
Assets\Square44x44Logo.targetsize-32.png
|
||||
Assets\Square44x44Logo.targetsize-48.png
|
||||
Assets\Square44x44Logo.targetsize-256.png
|
||||
Assets\storelogo.scale-100.png
|
||||
Assets\storelogo.scale-125.png
|
||||
Assets\storelogo.scale-150.png
|
||||
Assets\storelogo.scale-200.png
|
||||
Assets\storelogo.scale-400.png
|
||||
Assets\Wide310x150Logo.scale-100.png
|
||||
Assets\Wide310x150Logo.scale-125.png
|
||||
Assets\Wide310x150Logo.scale-150.png
|
||||
Assets\Wide310x150Logo.scale-200.png
|
||||
Assets\Wide310x150Logo.scale-400.png
|
18
Build/priconfig.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources targetOsVersion="10.0.0" majorVersion="1">
|
||||
<index root="\" startIndexAt="..\assetslayout.resfiles">
|
||||
<default>
|
||||
<qualifier name="Language" value="en-US" />
|
||||
<qualifier name="Contrast" value="standard" />
|
||||
<qualifier name="Scale" value="100" />
|
||||
<qualifier name="HomeRegion" value="001" />
|
||||
<qualifier name="TargetSize" value="256" />
|
||||
<qualifier name="LayoutDirection" value="LTR" />
|
||||
<qualifier name="Configuration" value="" />
|
||||
<qualifier name="AlternateForm" value="" />
|
||||
<qualifier name="DXFeatureLevel" value="DX9" />
|
||||
<qualifier name="Platform" value="UAP" />
|
||||
</default>
|
||||
<indexer-config type="RESFILES" qualifierDelimiter="." />
|
||||
</index>
|
||||
</resources>
|
1
QuickLook.Common
Submodule
@@ -31,7 +31,7 @@
|
||||
<RemoveFolder Id="ProgramMenuFolder" On="uninstall" />
|
||||
<RegistryValue
|
||||
Root="HKCU"
|
||||
Key="Software/QuickLook"
|
||||
Key="Software\QuickLook"
|
||||
Name="installed"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
@@ -48,7 +48,7 @@
|
||||
<RemoveFolder Id="DesktopFolder" On="uninstall" />
|
||||
<RegistryValue
|
||||
Root="HKCU"
|
||||
Key="Software/QuickLook"
|
||||
Key="Software\QuickLook"
|
||||
Name="installed"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
|
@@ -8,16 +8,14 @@
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>QuickLook</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<OutputPath>..\Build\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DefineConstants>Debug</DefineConstants>
|
||||
<SuppressPdbOutput>True</SuppressPdbOutput>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>..\Build\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<DefineConstants>PackageDir=$(SolutionDir)Build\Package\</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@@ -39,20 +37,16 @@
|
||||
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>rmdir /S /Q "$(SolutionDir)Build\Package\%2a"
|
||||
<PostBuildEvent>powershell -file "$(SolutionDir)Scripts\rename-msi.ps1"
|
||||
|
||||
powershell -file "$(SolutionDir)Scripts\pack-zip.ps1"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>rmdir /S /Q "$(SolutionDir)Build\Package"
|
||||
|
||||
robocopy "$(SolutionDir)Build\$(Configuration)" "$(SolutionDir)Build\Package" %2a.%2a /e /njh /njs /ndl /nfl /nc /ns /np /xf %2a.pdb /xf %2a.obj /xf %2a.ipdb /xf %2a.iobj /xf %2a.exp /xf %2a.lib /xf %2a.ilk /xf %2a.xml
|
||||
|
||||
powershell -file "$(SolutionDir)Scripts\sign-package.ps1"
|
||||
|
||||
"$(WIX)bin\heat" dir "$(SolutionDir)Build\Package" -dr INSTALLFOLDER -cg QuickLookComponents -gg -g1 -sf -srd -sreg -var "var.PackageDir" -out "$(ProjectDir)C_QuickLookComponents.wxs"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>powershell -file "$(SolutionDir)Scripts\sign-msi.ps1"
|
||||
|
||||
powershell -file "$(SolutionDir)Scripts\rename-msi.ps1"
|
||||
|
||||
powershell -file "$(SolutionDir)Scripts\pack-zip.ps1"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -62,10 +62,11 @@ void DOpus::GetSelected(PWCHAR buffer)
|
||||
PWCHAR data = DOPUS_IPC_LP_DATA;
|
||||
COPYDATASTRUCT cds;
|
||||
cds.dwData = DOPUS_IPC_LP_INFO;
|
||||
cds.cbData = (wcslen(data) + 1) * sizeof WCHAR;
|
||||
cds.cbData = static_cast<DWORD>(wcslen(data) + 1) * sizeof WCHAR;
|
||||
cds.lpData = data;
|
||||
|
||||
auto ret = SendMessage(FindWindow(DOPUS_CLASS, DOPUS_NAME), WM_COPYDATA, (WPARAM)hMsgWnd, (LPARAM)&cds);
|
||||
auto ret = SendMessage(FindWindow(DOPUS_CLASS, DOPUS_NAME), WM_COPYDATA, reinterpret_cast<WPARAM>(hMsgWnd),
|
||||
reinterpret_cast<LPARAM>(&cds));
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
@@ -111,7 +112,7 @@ void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
||||
|
||||
void DOpus::PrepareMessageWindow()
|
||||
{
|
||||
WNDCLASSEX wx = {'\0'};
|
||||
WNDCLASSEX wx = {sizeof wx};
|
||||
wx.cbSize = sizeof(WNDCLASSEX);
|
||||
wx.lpfnWndProc = msgWindowProc;
|
||||
wx.lpszClassName = MSGWINDOW_CLASS;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -99,7 +99,8 @@ void DialogHook::GetSelectedFromWoW64HookHelper(PWCHAR buffer)
|
||||
if (hHelperWnd == nullptr)
|
||||
return;
|
||||
|
||||
auto hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, MAX_PATH * sizeof WCHAR, SHARED_MEM_NAME);
|
||||
auto hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, MAX_PATH * sizeof WCHAR,
|
||||
SHARED_MEM_NAME);
|
||||
if (hMapFile == nullptr)
|
||||
return;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -42,7 +42,7 @@ void HelperMethods::GetSelectedInternal(CComQIPtr<IWebBrowserApp> pwba, PWCHAR b
|
||||
void HelperMethods::ObtainFirstItem(CComPtr<IDataObject> dao, PWCHAR buffer)
|
||||
{
|
||||
FORMATETC formatetc;
|
||||
STGMEDIUM medium;
|
||||
STGMEDIUM medium = {sizeof medium};
|
||||
|
||||
formatetc.cfFormat = CF_HDROP;
|
||||
formatetc.ptd = nullptr;
|
||||
@@ -63,18 +63,44 @@ void HelperMethods::ObtainFirstItem(CComPtr<IDataObject> dao, PWCHAR buffer)
|
||||
DragQueryFile(HDROP(medium.hGlobal), 0, buffer, MAX_PATH - 1);
|
||||
}
|
||||
|
||||
bool HelperMethods::IsListaryToolbarVisible()
|
||||
{
|
||||
auto CALLBACK findListaryWindowProc = [](__in HWND hwnd, __in LPARAM lParam)-> BOOL
|
||||
{
|
||||
WCHAR classBuffer[MAX_PATH] = {'\0'};
|
||||
if (FAILED(GetClassName(hwnd, classBuffer, MAX_PATH)))
|
||||
return TRUE;
|
||||
|
||||
if (wcsncmp(classBuffer, L"Listary_WidgetWin_", 18) == 0)
|
||||
{
|
||||
if (IsWindowVisible(hwnd))
|
||||
{
|
||||
*reinterpret_cast<bool*>(lParam) = true;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
auto found = false;
|
||||
EnumWindows(findListaryWindowProc, reinterpret_cast<LPARAM>(&found));
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
bool HelperMethods::IsCursorActivated(HWND hwnd)
|
||||
{
|
||||
auto tId = GetWindowThreadProcessId(hwnd, nullptr);
|
||||
|
||||
GUITHREADINFO gui = {sizeof gui};
|
||||
GetGUIThreadInfo(tId, &gui);
|
||||
return gui.flags || gui.hwndCaret;
|
||||
return gui.flags || gui.hwndCaret || IsListaryToolbarVisible();
|
||||
}
|
||||
|
||||
bool HelperMethods::IsUWP()
|
||||
{
|
||||
auto pGCPFN = decltype(&GetCurrentPackageFullName)(GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetCurrentPackageFullName"));
|
||||
auto pGCPFN = decltype(&GetCurrentPackageFullName)(
|
||||
GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetCurrentPackageFullName"));
|
||||
|
||||
if (!pGCPFN)
|
||||
return false;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -23,4 +23,7 @@ public:
|
||||
static void ObtainFirstItem(CComPtr<IDataObject> dao, PWCHAR buffer);
|
||||
static bool IsCursorActivated(HWND hwndfg);
|
||||
static bool HelperMethods::IsUWP();
|
||||
|
||||
private:
|
||||
static bool IsListaryToolbarVisible();
|
||||
};
|
||||
|
@@ -15,20 +15,20 @@
|
||||
<ProjectGuid>{D31EE321-C2B0-4984-B749-736F7DE509F1}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>QuickLookNative32</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>QuickLook.Native32</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -40,7 +40,7 @@ Shell32::FocusedWindowType Shell32::GetFocusedWindowType()
|
||||
{
|
||||
return DOPUS;
|
||||
}
|
||||
if (wcscmp(classBuffer, L"EVERYTHING") == 0)
|
||||
if (wcscmp(classBuffer, L"EVERYTHING") == 0 || wcscmp(classBuffer, L"EVERYTHING_SHELL_EXECUTE") == 0)
|
||||
{
|
||||
return EVERYTHING;
|
||||
}
|
||||
@@ -106,12 +106,12 @@ void Shell32::getSelectedFromExplorer(PWCHAR buffer)
|
||||
for (auto i = 0; i < count; i++)
|
||||
{
|
||||
VARIANT vi;
|
||||
VariantInit(&vi);
|
||||
V_VT(&vi) = VT_I4;
|
||||
V_I4(&vi) = i;
|
||||
|
||||
CComPtr<IDispatch> pdisp;
|
||||
// ReSharper disable once CppSomeObjectMembersMightNotBeInitialized
|
||||
if (FAILED(psw->Item(vi, &pdisp)))
|
||||
if (S_OK != psw->Item(vi, &pdisp))
|
||||
continue;
|
||||
|
||||
CComQIPtr<IWebBrowserApp> pwba;
|
||||
@@ -139,9 +139,11 @@ void Shell32::getSelectedFromDesktop(PWCHAR buffer)
|
||||
if (FAILED(psw.CoCreateInstance(CLSID_ShellWindows)))
|
||||
return;
|
||||
|
||||
VARIANT pvarLoc = {VT_EMPTY};
|
||||
VARIANT pvarLoc;
|
||||
VariantInit(&pvarLoc);
|
||||
long phwnd;
|
||||
if (FAILED(psw->FindWindowSW(&pvarLoc, &pvarLoc, SWC_DESKTOP, &phwnd, SWFO_NEEDDISPATCH, reinterpret_cast<IDispatch**>(&pwba))))
|
||||
if (FAILED(psw->FindWindowSW(&pvarLoc, &pvarLoc, SWC_DESKTOP, &phwnd, SWFO_NEEDDISPATCH, reinterpret_cast<IDispatch**>(
|
||||
&pwba))))
|
||||
return;
|
||||
|
||||
if (HelperMethods::IsCursorActivated(reinterpret_cast<HWND>(LongToHandle(phwnd))))
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -51,7 +51,7 @@ bool WoW64HookHelper::Launch()
|
||||
auto p = wcsrchr(fullPath, L'\\');
|
||||
memcpy(p, HELPER_FILE, wcslen(HELPER_FILE) * sizeof WCHAR);
|
||||
|
||||
STARTUPINFO si = {'\0'};
|
||||
STARTUPINFO si = {sizeof si};
|
||||
PROCESS_INFORMATION pi = {nullptr};
|
||||
si.cb = sizeof si;
|
||||
|
||||
@@ -70,10 +70,11 @@ void WoW64HookHelper::createJob()
|
||||
|
||||
hJob = CreateJobObject(nullptr, nullptr);
|
||||
|
||||
JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation = {'\0'};
|
||||
JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation = {sizeof BasicLimitInformation};
|
||||
BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
|
||||
JOBOBJECT_EXTENDED_LIMIT_INFORMATION lpJobObjectInfo = {'\0'};
|
||||
JOBOBJECT_EXTENDED_LIMIT_INFORMATION lpJobObjectInfo = {sizeof lpJobObjectInfo};
|
||||
lpJobObjectInfo.BasicLimitInformation = BasicLimitInformation;
|
||||
|
||||
SetInformationJobObject(hJob, JobObjectExtendedLimitInformation, &lpJobObjectInfo, sizeof JOBOBJECT_EXTENDED_LIMIT_INFORMATION);
|
||||
SetInformationJobObject(hJob, JobObjectExtendedLimitInformation, &lpJobObjectInfo,
|
||||
sizeof JOBOBJECT_EXTENDED_LIMIT_INFORMATION);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -35,20 +35,20 @@
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{794E4DCF-F715-4836-9D30-ABD296586D23}</ProjectGuid>
|
||||
<RootNamespace>QuickLookNative64</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>QuickLook.Native64</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -34,9 +34,9 @@ HWND hMsgWindow = nullptr;
|
||||
UINT WM_HOOK_NOTIFY = 0;
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
// do not run when double-clicking
|
||||
if (wcsstr(GetCommandLine(), RUN_ARG) == nullptr)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -15,20 +15,20 @@
|
||||
<ProjectGuid>{2C58F9B2-D8FA-4586-942B-5170CECE5963}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>QuickLookWoW64HookHelper</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>QuickLook.WoW64HookHelper</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
|
@@ -90,7 +90,7 @@
|
||||
|
||||
<TreeView BorderThickness="0" Focusable="False" Background="Transparent"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<TreeViewItem Focusable="False">
|
||||
<TreeViewItem Focusable="False" Visibility="Collapsed">
|
||||
<TreeViewItem.Header>
|
||||
<Grid ShowGridLines="False">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -130,13 +130,13 @@
|
||||
|
||||
<TreeView Grid.Row="1"
|
||||
x:Name="treeView"
|
||||
BorderThickness="0" Background="Transparent"
|
||||
BorderThickness="0" Background="Transparent" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=local:ArchiveFileListView}}"
|
||||
ItemsSource="{Binding}">
|
||||
<!--<TreeView.ItemContainerStyle>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="{Binding Level, Converter={StaticResource LevelToBooleanConverter}}" />
|
||||
<Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType=TreeView}}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>-->
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -37,16 +37,11 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
IconManager.ClearCache();
|
||||
}
|
||||
|
||||
~ArchiveFileListView()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public void SetDataContext(object context)
|
||||
{
|
||||
treeGrid.DataContext = context;
|
||||
|
||||
treeView.Loaded += (sender, e) =>
|
||||
treeView.LayoutUpdated += (sender, e) =>
|
||||
{
|
||||
// return when empty
|
||||
if (treeView.Items.Count == 0)
|
||||
|
@@ -7,21 +7,42 @@
|
||||
mc:Ignorable="d"
|
||||
x:Name="infoPanel"
|
||||
d:DesignHeight="600" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<!-- only for design -->
|
||||
<ResourceDictionary Source="/QuickLook.Common;component/Styles/MainWindowStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<local:Percent100ToVisibilityVisibleConverter x:Key="Percent100ToVisibilityVisibleConverter" />
|
||||
<local:Percent100ToVisibilityCollapsedConverter x:Key="Percent100ToVisibilityCollapsedConverter" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<local:ArchiveFileListView Grid.Row="0" x:Name="fileListView" Focusable="False" />
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="40*" />
|
||||
<ColumnDefinition Width="30*" />
|
||||
<ColumnDefinition Width="30*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label x:Name="archiveCount" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">9 folders and 10 files, solid, password-protected</Label>
|
||||
<Label x:Name="archiveSizeC" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">Compressed size 9999 bytes</Label>
|
||||
<Label x:Name="archiveSizeU" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">Uncompressed size 99999 bytes</Label>
|
||||
<Grid ZIndex="9999"
|
||||
Visibility="{Binding ElementName=infoPanel, Path=LoadPercent, Mode=OneWay, Converter={StaticResource Percent100ToVisibilityCollapsedConverter}}">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Label x:Name="lblLoading" FontSize="14" HorizontalAlignment="Center" Foreground="{DynamicResource WindowTextForeground}">Loading archive ...</Label>
|
||||
<ProgressBar Height="13" Width="150"
|
||||
Value="{Binding ElementName=infoPanel, Path=LoadPercent, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid
|
||||
Visibility="{Binding ElementName=infoPanel, Path=LoadPercent, Mode=OneWay, Converter={StaticResource Percent100ToVisibilityVisibleConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<local:ArchiveFileListView Grid.Row="0" x:Name="fileListView" Focusable="False" Foreground="{DynamicResource WindowTextForeground}" />
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="40*" />
|
||||
<ColumnDefinition Width="30*" />
|
||||
<ColumnDefinition Width="30*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label x:Name="archiveCount" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource WindowTextForegroundAlternative}">0 folders and 0 files, solid, password-protected</Label>
|
||||
<Label x:Name="archiveSizeC" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource WindowTextForegroundAlternative}">Compressed size 0 bytes</Label>
|
||||
<Label x:Name="archiveSizeU" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource WindowTextForegroundAlternative}">Uncompressed size 0 bytes</Label>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -17,9 +17,15 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using QuickLook.Common.Annotations;
|
||||
using QuickLook.Common.ExtensionMethods;
|
||||
using QuickLook.Common.Helpers;
|
||||
using SharpCompress.Archives;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Readers;
|
||||
@@ -29,9 +35,11 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
/// <summary>
|
||||
/// Interaction logic for ArchiveInfoPanel.xaml
|
||||
/// </summary>
|
||||
public partial class ArchiveInfoPanel : UserControl, IDisposable
|
||||
public partial class ArchiveInfoPanel : UserControl, IDisposable, INotifyPropertyChanged
|
||||
{
|
||||
private readonly Dictionary<string, ArchiveFileEntry> _fileEntries = new Dictionary<string, ArchiveFileEntry>();
|
||||
private bool _disposed;
|
||||
private double _loadPercent;
|
||||
private ulong _totalZippedSize;
|
||||
private string _type;
|
||||
|
||||
@@ -39,57 +47,92 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
LoadArchive(path);
|
||||
// design-time only
|
||||
Resources.MergedDictionaries.Clear();
|
||||
|
||||
fileListView.SetDataContext(_fileEntries[""].Children.Keys);
|
||||
BeginLoadArchive(path);
|
||||
}
|
||||
|
||||
public double LoadPercent
|
||||
{
|
||||
get => _loadPercent;
|
||||
private set
|
||||
{
|
||||
if (value == _loadPercent) return;
|
||||
_loadPercent = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
_fileEntries.Clear();
|
||||
_disposed = true;
|
||||
|
||||
fileListView.Dispose();
|
||||
}
|
||||
|
||||
~ArchiveInfoPanel()
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void BeginLoadArchive(string path)
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private void LoadArchive(string path)
|
||||
{
|
||||
_totalZippedSize = (ulong) new FileInfo(path).Length;
|
||||
|
||||
LoadItemsFromArchive(path);
|
||||
|
||||
var folders = -1; // do not count root node
|
||||
var files = 0;
|
||||
ulong sizeU = 0L;
|
||||
_fileEntries.ForEach(e =>
|
||||
new Task(() =>
|
||||
{
|
||||
if (e.Value.IsFolder)
|
||||
folders++;
|
||||
_totalZippedSize = (ulong) new FileInfo(path).Length;
|
||||
|
||||
var root = new ArchiveFileEntry(Path.GetFileName(path), true);
|
||||
_fileEntries.Add("", root);
|
||||
|
||||
try
|
||||
{
|
||||
LoadItemsFromArchive(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ProcessHelper.WriteLog(e.ToString());
|
||||
Dispatcher.Invoke(() => { lblLoading.Content = "Preview failed. See log for more details."; });
|
||||
return;
|
||||
}
|
||||
|
||||
var folders = -1; // do not count root node
|
||||
var files = 0;
|
||||
ulong sizeU = 0L;
|
||||
_fileEntries.ForEach(e =>
|
||||
{
|
||||
if (e.Value.IsFolder)
|
||||
folders++;
|
||||
else
|
||||
files++;
|
||||
|
||||
sizeU += e.Value.Size;
|
||||
});
|
||||
|
||||
string t;
|
||||
var d = folders != 0 ? $"{folders} folders" : string.Empty;
|
||||
var f = files != 0 ? $"{files} files" : string.Empty;
|
||||
if (!string.IsNullOrEmpty(d) && !string.IsNullOrEmpty(f))
|
||||
t = $", {d} and {f}";
|
||||
else if (string.IsNullOrEmpty(d) && string.IsNullOrEmpty(f))
|
||||
t = string.Empty;
|
||||
else
|
||||
files++;
|
||||
t = $", {d}{f}";
|
||||
|
||||
sizeU += e.Value.Size;
|
||||
});
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
string t;
|
||||
var d = folders != 0 ? $"{folders} folders" : string.Empty;
|
||||
var f = files != 0 ? $"{files} files" : string.Empty;
|
||||
if (!string.IsNullOrEmpty(d) && !string.IsNullOrEmpty(f))
|
||||
t = $", {d} and {f}";
|
||||
else if (string.IsNullOrEmpty(d) && string.IsNullOrEmpty(f))
|
||||
t = string.Empty;
|
||||
else
|
||||
t = $", {d}{f}";
|
||||
fileListView.SetDataContext(_fileEntries[""].Children.Keys);
|
||||
archiveCount.Content =
|
||||
$"{_type} archive{t}";
|
||||
archiveSizeC.Content =
|
||||
$"Compressed size {((long) _totalZippedSize).ToPrettySize(2)}";
|
||||
archiveSizeU.Content = $"Uncompressed size {((long) sizeU).ToPrettySize(2)}";
|
||||
});
|
||||
|
||||
archiveCount.Content =
|
||||
$"{_type} archive{t}";
|
||||
archiveSizeC.Content = $"Compressed size {_totalZippedSize.ToPrettySize(2)}";
|
||||
archiveSizeU.Content = $"Uncompressed size {sizeU.ToPrettySize(2)}";
|
||||
LoadPercent = 100d;
|
||||
}).Start();
|
||||
}
|
||||
|
||||
private void LoadItemsFromArchive(string path)
|
||||
@@ -99,29 +142,33 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
// ReaderFactory is slow... so limit its usage
|
||||
string[] useReader = {".tar.gz", ".tgz", ".tar.bz2", ".tar.lz", ".tar.xz"};
|
||||
|
||||
if (useReader.Any(i => path.EndsWith(i)))
|
||||
if (useReader.Any(path.ToLower().EndsWith))
|
||||
{
|
||||
var reader = ReaderFactory.Open(stream);
|
||||
var reader = ReaderFactory.Open(stream, new ChardetReaderOptions());
|
||||
|
||||
_type = reader.ArchiveType.ToString();
|
||||
|
||||
var root = new ArchiveFileEntry(Path.GetFileName(path), true);
|
||||
_fileEntries.Add("", root);
|
||||
|
||||
while (reader.MoveToNextEntry())
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
LoadPercent = 100d * stream.Position / stream.Length;
|
||||
ProcessByLevel(reader.Entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var archive = ArchiveFactory.Open(stream);
|
||||
var archive = ArchiveFactory.Open(stream, new ChardetReaderOptions());
|
||||
|
||||
_type = archive.Type.ToString();
|
||||
|
||||
var root = new ArchiveFileEntry(Path.GetFileName(path), true);
|
||||
_fileEntries.Add("", root);
|
||||
|
||||
foreach (var entry in archive.Entries)
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
LoadPercent = 100d * stream.Position / stream.Length;
|
||||
ProcessByLevel(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,8 +185,7 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
if (_fileEntries.ContainsKey(f))
|
||||
return;
|
||||
|
||||
ArchiveFileEntry parent;
|
||||
_fileEntries.TryGetValue(GetDirectoryName(f), out parent);
|
||||
_fileEntries.TryGetValue(GetDirectoryName(f), out var parent);
|
||||
|
||||
var afe = new ArchiveFileEntry(Path.GetFileName(f), true, parent);
|
||||
|
||||
@@ -151,8 +197,7 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
var file = pf.Last();
|
||||
|
||||
ArchiveFileEntry parent;
|
||||
_fileEntries.TryGetValue(GetDirectoryName(file), out parent);
|
||||
_fileEntries.TryGetValue(GetDirectoryName(file), out var parent);
|
||||
|
||||
_fileEntries.Add(file, new ArchiveFileEntry(Path.GetFileName(entry.Key), false, parent)
|
||||
{
|
||||
@@ -179,5 +224,11 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
|
||||
return frags.Select((s, i) => frags.Take(i + 1).Aggregate((a, b) => a + "\\" + b)).ToArray();
|
||||
}
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,22 +16,32 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Readers;
|
||||
using UtfUnknown;
|
||||
|
||||
namespace QuickLook.Helpers.BlurLibrary.PlatformsImpl
|
||||
namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
public class OsNotSupportedWindowBlurController : IWindowBlurController
|
||||
internal class ChardetReaderOptions : ReaderOptions
|
||||
{
|
||||
public void EnableBlur(IntPtr hwnd)
|
||||
public ChardetReaderOptions()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
ArchiveEncoding = new ArchiveEncoding
|
||||
{
|
||||
CustomDecoder = Chardet
|
||||
};
|
||||
}
|
||||
|
||||
public void DisableBlur(IntPtr hwnd)
|
||||
public string Chardet(byte[] bytes, int index, int count)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
var buffer = new byte[count];
|
||||
|
||||
public bool Enabled { get; } = false;
|
||||
public bool CanBeEnabled { get; } = false;
|
||||
Array.Copy(bytes, index, buffer, 0, count);
|
||||
|
||||
var encoding = CharsetDetector.DetectFromBytes(buffer).Detected?.Encoding ?? Encoding.Default;
|
||||
|
||||
return encoding.GetString(buffer);
|
||||
}
|
||||
}
|
||||
}
|
@@ -19,9 +19,44 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using QuickLook.Common.ExtensionMethods;
|
||||
|
||||
namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
public class Percent100ToVisibilityVisibleConverter : DependencyObject, IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
value = 0;
|
||||
|
||||
var percent = (double) value;
|
||||
return Math.Abs(percent - 100) < 0.00001 ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class Percent100ToVisibilityCollapsedConverter : DependencyObject, IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null)
|
||||
value = 0;
|
||||
|
||||
var percent = (double) value;
|
||||
return Math.Abs(percent - 100) < 0.00001 ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class LevelToIndentConverter : DependencyObject, IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
@@ -77,7 +112,7 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
var size = (ulong) values[0];
|
||||
var isFolder = (bool) values[1];
|
||||
|
||||
return isFolder ? "" : size.ToPrettySize(2);
|
||||
return isFolder ? "" : ((long) size).ToPrettySize(2);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
|
@@ -47,31 +47,8 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
if (foundElement != null)
|
||||
break;
|
||||
}
|
||||
|
||||
return foundElement;
|
||||
}
|
||||
|
||||
public static string ToPrettySize(this ulong value, int decimalPlaces = 0)
|
||||
{
|
||||
const long OneKb = 1024;
|
||||
const long OneMb = OneKb * 1024;
|
||||
const long OneGb = OneMb * 1024;
|
||||
const long OneTb = OneGb * 1024;
|
||||
|
||||
var asTb = Math.Round((double) value / OneTb, decimalPlaces);
|
||||
var asGb = Math.Round((double) value / OneGb, decimalPlaces);
|
||||
var asMb = Math.Round((double) value / OneMb, decimalPlaces);
|
||||
var asKb = Math.Round((double) value / OneKb, decimalPlaces);
|
||||
var chosenValue = asTb > 1
|
||||
? $"{asTb} TB"
|
||||
: asGb > 1
|
||||
? $"{asGb} GB"
|
||||
: asMb > 1
|
||||
? $"{asMb} MB"
|
||||
: asKb > 1
|
||||
? $"{asKb} KB"
|
||||
: $"{Math.Round((double) value, decimalPlaces)} bytes";
|
||||
|
||||
return chosenValue;
|
||||
}
|
||||
}
|
||||
}
|
@@ -211,8 +211,10 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
public readonly IntPtr hIcon;
|
||||
private readonly int iIcon;
|
||||
private readonly uint dwAttributes;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MaxPath)] private readonly string szDisplayName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Namesize)] private readonly string szTypeName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MaxPath)]
|
||||
private readonly string szDisplayName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Namesize)]
|
||||
private readonly string szTypeName;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -17,16 +17,20 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using QuickLook.Common.Plugin;
|
||||
|
||||
namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
public class Plugin : IViewer
|
||||
{
|
||||
private static readonly string[] Extensions =
|
||||
{".rar", ".zip", ".tar", ".tgz", ".gz", ".bz2", ".lz", ".xz", ".7z"};
|
||||
|
||||
private ArchiveInfoPanel _panel;
|
||||
|
||||
public int Priority => 0;
|
||||
public bool AllowsTransparency => true;
|
||||
public int Priority => -5;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
@@ -34,25 +38,7 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
|
||||
public bool CanHandle(string path)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
return false;
|
||||
|
||||
switch (Path.GetExtension(path).ToLower())
|
||||
{
|
||||
case ".rar":
|
||||
case ".zip":
|
||||
case ".tar":
|
||||
case ".tgz":
|
||||
case ".gz":
|
||||
case ".bz2":
|
||||
case ".lz":
|
||||
case ".xz":
|
||||
case ".7z":
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return !Directory.Exists(path) && Extensions.Any(path.ToLower().EndsWith);
|
||||
}
|
||||
|
||||
public void Prepare(string path, ContextObject context)
|
||||
@@ -77,10 +63,5 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
_panel?.Dispose();
|
||||
_panel = null;
|
||||
}
|
||||
|
||||
~Plugin()
|
||||
{
|
||||
Cleanup();
|
||||
}
|
||||
}
|
||||
}
|
@@ -50,21 +50,25 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="SharpCompress, Version=0.17.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll</HintPath>
|
||||
<Reference Include="SharpCompress, Version=0.23.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SharpCompress.0.23.0\lib\net45\SharpCompress.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="UtfUnknown, Version=2.0.0.0, Culture=neutral, PublicKeyToken=90217ce7a23260d4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\UTF.Unknown.2.0.0-rc1\lib\net40\UtfUnknown.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -75,6 +79,7 @@
|
||||
<DependentUpon>ArchiveInfoPanel.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ArchiveFileEntry.cs" />
|
||||
<Compile Include="ChardetReaderOptions.cs" />
|
||||
<Compile Include="IconManager.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="Converters.cs" />
|
||||
@@ -85,9 +90,9 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\QuickLook\QuickLook.csproj">
|
||||
<Project>{8b4a9ce5-67b5-4a94-81cb-3771f688fdeb}</Project>
|
||||
<Name>QuickLook</Name>
|
||||
<ProjectReference Include="..\..\QuickLook.Common\QuickLook.Common.csproj">
|
||||
<Project>{85FDD6BA-871D-46C8-BD64-F6BB0CB5EA95}</Project>
|
||||
<Name>QuickLook.Common</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
@@ -102,7 +107,6 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="SharpCompress" version="0.17.1" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.23.0" targetFramework="net462" />
|
||||
<package id="UTF.Unknown" version="2.0.0-rc1" targetFramework="net462" />
|
||||
</packages>
|
@@ -9,10 +9,9 @@
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<DataGrid x:Name="dataGrid" AlternationCount="2" BorderThickness="0" Background="Transparent"
|
||||
RowBackground="Transparent" GridLinesVisibility="None"
|
||||
IsReadOnly="True" HeadersVisibility="None"
|
||||
AutoGenerateColumns="False" CanUserReorderColumns="False"
|
||||
ItemsSource="{Binding Path=Rows,ElementName=csvViewer}" AlternatingRowBackground="#99ECECEC" />
|
||||
RowBackground="Transparent" IsReadOnly="True" HeadersVisibility="None" AutoGenerateColumns="False"
|
||||
CanUserReorderColumns="False" ItemsSource="{Binding Path=Rows,ElementName=csvViewer}"
|
||||
AlternatingRowBackground="#99D8D8D8" HorizontalGridLinesBrush="#FFBDBDBD" VerticalGridLinesBrush="#FFBDBDBD" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -41,12 +41,14 @@ namespace QuickLook.Plugin.CsvViewer
|
||||
|
||||
public void LoadFile(string path)
|
||||
{
|
||||
const int limit = 100000;
|
||||
const int limit = 10000;
|
||||
var binded = false;
|
||||
|
||||
using (var sr = new StreamReader(path))
|
||||
using (var sr = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
|
||||
{
|
||||
using (var parser = new CsvParser(sr))
|
||||
var conf = new CsvHelper.Configuration.Configuration() {MissingFieldFound = null, BadDataFound = null};
|
||||
|
||||
using (var parser = new CsvParser(sr, conf))
|
||||
{
|
||||
var i = 0;
|
||||
while (true)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -18,6 +18,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using QuickLook.Common.Plugin;
|
||||
|
||||
namespace QuickLook.Plugin.CsvViewer
|
||||
{
|
||||
@@ -25,8 +26,7 @@ namespace QuickLook.Plugin.CsvViewer
|
||||
{
|
||||
private CsvViewerPanel _panel;
|
||||
|
||||
public int Priority => int.MaxValue;
|
||||
public bool AllowsTransparency => true;
|
||||
public int Priority => 0;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
@@ -34,10 +34,7 @@ namespace QuickLook.Plugin.CsvViewer
|
||||
|
||||
public bool CanHandle(string path)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
return false;
|
||||
|
||||
return Path.GetExtension(path).ToLower() == ".csv";
|
||||
return !Directory.Exists(path) && path.ToLower().EndsWith(".csv");
|
||||
}
|
||||
|
||||
public void Prepare(string path, ContextObject context)
|
||||
@@ -62,10 +59,5 @@ namespace QuickLook.Plugin.CsvViewer
|
||||
|
||||
_panel = null;
|
||||
}
|
||||
|
||||
~Plugin()
|
||||
{
|
||||
Cleanup();
|
||||
}
|
||||
}
|
||||
}
|
@@ -49,17 +49,22 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CsvHelper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\CsvHelper.2.16.3.0\lib\net45\CsvHelper.dll</HintPath>
|
||||
<Reference Include="CsvHelper, Version=12.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\CsvHelper.12.1.2\lib\net45\CsvHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
@@ -83,14 +88,14 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\QuickLook\QuickLook.csproj">
|
||||
<Project>{8b4a9ce5-67b5-4a94-81cb-3771f688fdeb}</Project>
|
||||
<Name>QuickLook</Name>
|
||||
<ProjectReference Include="..\..\QuickLook.Common\QuickLook.Common.csproj">
|
||||
<Project>{85FDD6BA-871D-46C8-BD64-F6BB0CB5EA95}</Project>
|
||||
<Name>QuickLook.Common</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
11
QuickLook.Plugin/QuickLook.Plugin.CsvViewer/app.config
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="CsvHelper" version="2.16.3.0" targetFramework="net462" />
|
||||
<package id="CsvHelper" version="12.1.2" targetFramework="net462" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
</packages>
|
@@ -1,63 +0,0 @@
|
||||
// Copyright <20> 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace QuickLook.Plugin.HtmlViewer
|
||||
{
|
||||
internal static class DpiHelper
|
||||
{
|
||||
public enum DeviceCap
|
||||
{
|
||||
/// <summary>
|
||||
/// Logical pixels inch in X
|
||||
/// </summary>
|
||||
LOGPIXELSX = 88,
|
||||
/// <summary>
|
||||
/// Logical pixels inch in Y
|
||||
/// </summary>
|
||||
LOGPIXELSY = 90
|
||||
}
|
||||
|
||||
public const float DEFAULT_DPI = 96;
|
||||
|
||||
public static Dpi GetCurrentDpi()
|
||||
{
|
||||
var g = Graphics.FromHwnd(IntPtr.Zero);
|
||||
var desktop = g.GetHdc();
|
||||
|
||||
var dpi = new Dpi
|
||||
{
|
||||
HorizontalDpi = GetDeviceCaps(desktop, (int) DeviceCap.LOGPIXELSX),
|
||||
VerticalDpi = GetDeviceCaps(desktop, (int) DeviceCap.LOGPIXELSY)
|
||||
};
|
||||
|
||||
return dpi;
|
||||
}
|
||||
|
||||
[DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
|
||||
public static extern int GetDeviceCaps(IntPtr hDC, int nIndex);
|
||||
}
|
||||
|
||||
internal class Dpi
|
||||
{
|
||||
public float HorizontalDpi { get; set; }
|
||||
public float VerticalDpi { get; set; }
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
// Copyright <EFBFBD> 2017 Paddy Xu
|
||||
// Copyright © 2017 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
@@ -63,5 +63,25 @@ namespace QuickLook.Plugin.HtmlViewer
|
||||
key?.SetValue(appName, value, RegistryValueKind.DWord);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetUrlPath(string url)
|
||||
{
|
||||
int index = -1;
|
||||
string[] lines = File.ReadAllLines(url);
|
||||
foreach (string line in lines)
|
||||
{
|
||||
if (line.ToLower().Contains("url="))
|
||||
{
|
||||
index = System.Array.IndexOf(lines, line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index != -1)
|
||||
{
|
||||
var fullLine = lines.GetValue(index);
|
||||
return fullLine.ToString().Substring(fullLine.ToString().LastIndexOf('=') + 1);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
@@ -17,17 +17,20 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using QuickLook.Common.Plugin;
|
||||
|
||||
namespace QuickLook.Plugin.HtmlViewer
|
||||
{
|
||||
public class Plugin : IViewer
|
||||
{
|
||||
private static readonly string[] Extensions = { ".mht", ".mhtml", ".htm", ".html", ".svg", ".url" };
|
||||
|
||||
private WebpagePanel _panel;
|
||||
|
||||
public int Priority => int.MaxValue;
|
||||
public bool AllowsTransparency => false;
|
||||
public int Priority => 0;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
@@ -36,25 +39,12 @@ namespace QuickLook.Plugin.HtmlViewer
|
||||
|
||||
public bool CanHandle(string path)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
return false;
|
||||
|
||||
switch (Path.GetExtension(path).ToLower())
|
||||
{
|
||||
case ".html":
|
||||
case ".htm":
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return !Directory.Exists(path) && Extensions.Any(path.ToLower().EndsWith);
|
||||
}
|
||||
|
||||
public void Prepare(string path, ContextObject context)
|
||||
{
|
||||
context.PreferredSize = new Size(1000, 600);
|
||||
|
||||
context.CanFocus = true;
|
||||
context.PreferredSize = new Size(1280, 720);
|
||||
}
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
@@ -63,21 +53,18 @@ namespace QuickLook.Plugin.HtmlViewer
|
||||
context.ViewerContent = _panel;
|
||||
context.Title = Path.IsPathRooted(path) ? Path.GetFileName(path) : path;
|
||||
|
||||
_panel.Navigate(path);
|
||||
if (path.ToLower().EndsWith(".url"))
|
||||
{
|
||||
path = Helper.GetUrlPath(path);
|
||||
}
|
||||
_panel.LoadFile(path);
|
||||
_panel.Dispatcher.Invoke(() => { context.IsBusy = false; }, DispatcherPriority.Loaded);
|
||||
}
|
||||
|
||||
public void Cleanup()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
_panel?.Dispose();
|
||||
_panel = null;
|
||||
}
|
||||
|
||||
~Plugin()
|
||||
{
|
||||
Cleanup();
|
||||
}
|
||||
}
|
||||
}
|