mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 15:57:03 -05:00
Compare commits
1167 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7866e3fc2a | ||
|
|
2abf89cd16 | ||
|
|
8b2dcf976f | ||
|
|
559b86efe1 | ||
|
|
949a26ca0e | ||
|
|
2880ca00da | ||
|
|
39da62532b | ||
|
|
483ba95d80 | ||
|
|
2300b0c692 | ||
|
|
cc59b36c54 | ||
|
|
61d9918dae | ||
|
|
2c361f9b0a | ||
|
|
775b3e8c52 | ||
|
|
2a989c6cc1 | ||
|
|
3d7adf6483 | ||
|
|
56079f70c7 | ||
|
|
6c9e969099 | ||
|
|
76f8e6d6ef | ||
|
|
174cf3ed95 | ||
|
|
540f468e8a | ||
|
|
6b2423cdce | ||
|
|
e4a3181e1d | ||
|
|
b57730c28b | ||
|
|
5a02c38fcd | ||
|
|
2847098020 | ||
|
|
0cc6d90e3d | ||
|
|
66d1b3fd2f | ||
|
|
b28eaf2dbf | ||
|
|
191a99f91b | ||
|
|
f3f1ac939a | ||
|
|
9737b9cd62 | ||
|
|
e3fbb490df | ||
|
|
73d74f6cde | ||
|
|
1487f760b0 | ||
|
|
bdb2ac3a0b | ||
|
|
75bd7805c9 | ||
|
|
ef8e9a83bb | ||
|
|
7d9c24ff51 | ||
|
|
a8e83154f0 | ||
|
|
27c2c4dc33 | ||
|
|
a9a538cec8 | ||
|
|
57e1f7ee10 | ||
|
|
754eb89f04 | ||
|
|
2e95184d30 | ||
|
|
9deab9c497 | ||
|
|
5ae6c8a627 | ||
|
|
05104aef6c | ||
|
|
08da408471 | ||
|
|
4a4d5ac694 | ||
|
|
3b4d6d465b | ||
|
|
26f998ecb6 | ||
|
|
60a717365c | ||
|
|
07ae00aa20 | ||
|
|
39cc845df3 | ||
|
|
6c8b75a05f | ||
|
|
4c8efed256 | ||
|
|
faaa90fa0d | ||
|
|
7e075e5ebb | ||
|
|
b9508d853e | ||
|
|
716d52f3e3 | ||
|
|
90753f4d42 | ||
|
|
7117592f38 | ||
|
|
b9030d7e47 | ||
|
|
b79cfa213d | ||
|
|
60af9970c1 | ||
|
|
33a1e7f055 | ||
|
|
f72e9700ab | ||
|
|
4357d68462 | ||
|
|
adfaa95149 | ||
|
|
d6b887b7db | ||
|
|
227040f82f | ||
|
|
f5440ee52c | ||
|
|
de86aee6a2 | ||
|
|
038b7961db | ||
|
|
8be39488ec | ||
|
|
24f3b8dd3d | ||
|
|
2f61a91459 | ||
|
|
9399cf873f | ||
|
|
63455ce2be | ||
|
|
585058b500 | ||
|
|
57f31123e7 | ||
|
|
b4a3eb240e | ||
|
|
0e40b8a81a | ||
|
|
2510f61a4e | ||
|
|
28e5f62c60 | ||
|
|
586bca4bf6 | ||
|
|
bd30411ba7 | ||
|
|
1b95722757 | ||
|
|
1738c3f50a | ||
|
|
18169b461a | ||
|
|
42c0b6145b | ||
|
|
abd3fe6ed1 | ||
|
|
e918a594f3 | ||
|
|
3539b42c77 | ||
|
|
56277ae6da | ||
|
|
a52fee2248 | ||
|
|
37ea9c6656 | ||
|
|
a8e49c5a85 | ||
|
|
137bfe48ca | ||
|
|
94506848e0 | ||
|
|
97db5e9698 | ||
|
|
d17cd64fea | ||
|
|
949d036a81 | ||
|
|
f1c7dea0ab | ||
|
|
2577a2f637 | ||
|
|
b3728ae658 | ||
|
|
decfad5c99 | ||
|
|
334939324c | ||
|
|
99f8efac9a | ||
|
|
c1b4c4e42a | ||
|
|
a48a1ef272 | ||
|
|
6bdd114b99 | ||
|
|
69c48edfdf | ||
|
|
16a9d0c0c6 | ||
|
|
545ff9de56 | ||
|
|
d42d87280d | ||
|
|
b8026398e0 | ||
|
|
cff8bab3d3 | ||
|
|
5c3bfa690b | ||
|
|
8ab4d25e33 | ||
|
|
eade95dff7 | ||
|
|
ca57f91bfa | ||
|
|
f9668f4ba6 | ||
|
|
618eead341 | ||
|
|
ba68f463e5 | ||
|
|
df1d302bcb | ||
|
|
c2bcbfb1e0 | ||
|
|
4c51efc5e0 | ||
|
|
f19944f54d | ||
|
|
876dbe8179 | ||
|
|
f76e65a58d | ||
|
|
6977061227 | ||
|
|
ce59226909 | ||
|
|
1991afb87b | ||
|
|
61fc479c79 | ||
|
|
8f8f3c5415 | ||
|
|
f547c3ea3c | ||
|
|
02fc175289 | ||
|
|
6ae38aead8 | ||
|
|
52fa2b4479 | ||
|
|
af57b39d8f | ||
|
|
7321d205fe | ||
|
|
6a724352b0 | ||
|
|
69bd438fe1 | ||
|
|
111c4b71aa | ||
|
|
dd572ba024 | ||
|
|
4bc074fa84 | ||
|
|
66a13266e6 | ||
|
|
bfa3538745 | ||
|
|
362413dbe7 | ||
|
|
3f5b258629 | ||
|
|
def20f7e69 | ||
|
|
ceaf9ac24b | ||
|
|
e6f1dd0490 | ||
|
|
da16be7ad8 | ||
|
|
7b1a146976 | ||
|
|
75331cda94 | ||
|
|
a0a39f1c04 | ||
|
|
48de158d7c | ||
|
|
e71091f4a8 | ||
|
|
3987a5df6a | ||
|
|
3cf9658a17 | ||
|
|
d073128cfb | ||
|
|
6319449cbd | ||
|
|
0e08b0226b | ||
|
|
a66fec489c | ||
|
|
65212f22a6 | ||
|
|
541c0d7547 | ||
|
|
b3a8d02d19 | ||
|
|
49610f59ea | ||
|
|
9cf7fc4a2e | ||
|
|
053c897056 | ||
|
|
8397af5c9b | ||
|
|
914b26caec | ||
|
|
2aed6ec13f | ||
|
|
714d421334 | ||
|
|
6c6fe8ad5c | ||
|
|
48aacc0c2e | ||
|
|
6806f8e5ba | ||
|
|
3e9493f3e7 | ||
|
|
89b9d21eaa | ||
|
|
4e047beabb | ||
|
|
d5d1577b43 | ||
|
|
42eea8ffba | ||
|
|
10df0175d5 | ||
|
|
d69eb440d8 | ||
|
|
768e74d9d3 | ||
|
|
355b99c68f | ||
|
|
cf89cbe662 | ||
|
|
e756c9d46f | ||
|
|
9ddd97a6eb | ||
|
|
ee8b665472 | ||
|
|
c4cbcc7232 | ||
|
|
8701e0f402 | ||
|
|
2df4e22bf8 | ||
|
|
b6c6ff51b4 | ||
|
|
40d7e4aa6e | ||
|
|
a5a1ae6725 | ||
|
|
a70ece7b9c | ||
|
|
ed8ee35a86 | ||
|
|
8a6b110d0b | ||
|
|
1f65fbf422 | ||
|
|
25e4902a1c | ||
|
|
bcbda85a40 | ||
|
|
abac42826c | ||
|
|
012b82c395 | ||
|
|
23190e1f87 | ||
|
|
f462a5f14b | ||
|
|
d8219ad971 | ||
|
|
b34b4c2362 | ||
|
|
0986527495 | ||
|
|
0864d582a2 | ||
|
|
3f936b57f5 | ||
|
|
54785b29dd | ||
|
|
c88d428fb5 | ||
|
|
27c08c1edf | ||
|
|
1f8c9b9f71 | ||
|
|
f6e4d56de6 | ||
|
|
0d02af3cf0 | ||
|
|
a7a57e2bd0 | ||
|
|
63edfb8d52 | ||
|
|
8d3ca3292e | ||
|
|
25df658653 | ||
|
|
6b20a9bdd5 | ||
|
|
d399a6427a | ||
|
|
2f1a707fd3 | ||
|
|
cbfe52c756 | ||
|
|
3c1f0057ae | ||
|
|
1a9bd12af0 | ||
|
|
1b853c6a84 | ||
|
|
b9034523b5 | ||
|
|
5af9af1e5a | ||
|
|
eac9fe1b70 | ||
|
|
3cecc0693b | ||
|
|
0e6446b3ef | ||
|
|
b496fedea8 | ||
|
|
dc064008f3 | ||
|
|
652896bd3a | ||
|
|
1fe6dc4c6e | ||
|
|
e35ea13f60 | ||
|
|
e1fb0a5d72 | ||
|
|
e204ef629f | ||
|
|
d2704242f2 | ||
|
|
44a1bbf414 | ||
|
|
6ada7885b1 | ||
|
|
0119ec0055 | ||
|
|
d38d261bbc | ||
|
|
4e636381fd | ||
|
|
fe04d05c28 | ||
|
|
f45cc3fc73 | ||
|
|
490eaef5c1 | ||
|
|
077bc45b7d | ||
|
|
d3d9209b39 | ||
|
|
0884025b82 | ||
|
|
3ce0f8f4a8 | ||
|
|
c76bfceb3e | ||
|
|
7c2e060a5f | ||
|
|
936d1d6072 | ||
|
|
8db0305c83 | ||
|
|
8a8a927699 | ||
|
|
85f276c259 | ||
|
|
28cba0602c | ||
|
|
28e51309cc | ||
|
|
c1bb407b34 | ||
|
|
b047fc0063 | ||
|
|
3d32261f16 | ||
|
|
78f6ef464a | ||
|
|
b3906e770f | ||
|
|
e11a5d0d44 | ||
|
|
ad223a4e5c | ||
|
|
376cb01a16 | ||
|
|
0efb226c2f | ||
|
|
ea92e17ca0 | ||
|
|
c56408640f | ||
|
|
bc53109a1f | ||
|
|
b082a28cc4 | ||
|
|
b22774e33d | ||
|
|
891cc42f08 | ||
|
|
677036fb9c | ||
|
|
8ccb300ea7 | ||
|
|
dff6e09e1c | ||
|
|
fe1ab12fec | ||
|
|
b17808c6c7 | ||
|
|
6b22464771 | ||
|
|
79ace0a106 | ||
|
|
1770235648 | ||
|
|
f325d50ab8 | ||
|
|
c61e807f13 | ||
|
|
7d0d8d5649 | ||
|
|
318e42be26 | ||
|
|
df26127f88 | ||
|
|
afcd39e162 | ||
|
|
f0c544e7c6 | ||
|
|
aec2626d73 | ||
|
|
23085aee6d | ||
|
|
0ee4b1e336 | ||
|
|
a05d09ffea | ||
|
|
9cd7b746a6 | ||
|
|
78b3f5aef1 | ||
|
|
e25d98ef63 | ||
|
|
bbeb7289c1 | ||
|
|
51474b2eae | ||
|
|
9bf9788689 | ||
|
|
b372d20ab0 | ||
|
|
d1ce8a5f9b | ||
|
|
41ce0f57ed | ||
|
|
1a0b0e2385 | ||
|
|
443dedd832 | ||
|
|
caf9ee0c58 | ||
|
|
b2a9965617 | ||
|
|
821eb4568e | ||
|
|
883207bc6b | ||
|
|
15e38e1012 | ||
|
|
8a36897fd9 | ||
|
|
3e736b36b6 | ||
|
|
2e90abd2c5 | ||
|
|
fb99674217 | ||
|
|
69def38152 | ||
|
|
5759f163e3 | ||
|
|
e3106eaa2a | ||
|
|
edca3bebd7 | ||
|
|
620c68e3f1 | ||
|
|
8f2e382c8a | ||
|
|
6a0ad22774 | ||
|
|
2ac6348fbf | ||
|
|
3086f259ff | ||
|
|
95556d35c8 | ||
|
|
ea4f4c45cb | ||
|
|
808b051a3e | ||
|
|
c55146a78c | ||
|
|
cc5a437573 | ||
|
|
4a53717676 | ||
|
|
8385b88ce8 | ||
|
|
73604e90c8 | ||
|
|
c2d1589e74 | ||
|
|
69973af1ed | ||
|
|
f0c679fb61 | ||
|
|
5a2e2b1773 | ||
|
|
e720b61df6 | ||
|
|
44b121e8b0 | ||
|
|
6a7c086514 | ||
|
|
3b59868f62 | ||
|
|
0b77a3f2c1 | ||
|
|
957dfeed81 | ||
|
|
451c550b19 | ||
|
|
21cc8555b5 | ||
|
|
19b80a1c2d | ||
|
|
a000b1a2fe | ||
|
|
856055a04d | ||
|
|
be1c5f5d1d | ||
|
|
278d46ccd7 | ||
|
|
0da31b6bbb | ||
|
|
e8bc94a25a | ||
|
|
d12869dbac | ||
|
|
fecd70c9ad | ||
|
|
4effa999b3 | ||
|
|
dd35a717b7 | ||
|
|
c71577b7bf | ||
|
|
1d3736b98c | ||
|
|
efad16f2c0 | ||
|
|
243820ca95 | ||
|
|
28805bae65 | ||
|
|
e074643783 | ||
|
|
9340c8aae3 | ||
|
|
9158d79126 | ||
|
|
ded452fdfc | ||
|
|
467e9d1463 | ||
|
|
1429f80cf9 | ||
|
|
372908ba9d | ||
|
|
0d1686e170 | ||
|
|
aa527ba29b | ||
|
|
9a545a48ab | ||
|
|
9e808f3ecd | ||
|
|
cb583b5d6c | ||
|
|
2e3c43ad9e | ||
|
|
594a6c1c0f | ||
|
|
15f81cc316 | ||
|
|
434de44ef5 | ||
|
|
1c1396bf4b | ||
|
|
beea4c4147 | ||
|
|
849f6aa3d9 | ||
|
|
3c4d57f63b | ||
|
|
116caeaa74 | ||
|
|
673d43b526 | ||
|
|
c88053a575 | ||
|
|
1f250e87a3 | ||
|
|
cd89b55f5b | ||
|
|
716d6573ca | ||
|
|
a6b8597f5a | ||
|
|
cab1089e22 | ||
|
|
c95e12c136 | ||
|
|
d9a77d396c | ||
|
|
442f164159 | ||
|
|
d6f9ec3f8f | ||
|
|
9ccfadfb54 | ||
|
|
8b6de30e92 | ||
|
|
6408741733 | ||
|
|
7562e8b172 | ||
|
|
929437c159 | ||
|
|
93474d7f43 | ||
|
|
58e3031510 | ||
|
|
1b66c84303 | ||
|
|
1c321b7de2 | ||
|
|
e3cf364903 | ||
|
|
9b1c09818c | ||
|
|
46ba46ce9d | ||
|
|
1b6035d6c6 | ||
|
|
3e5d6cf88c | ||
|
|
a4c5d0bb62 | ||
|
|
9b316795fc | ||
|
|
b12cd66679 | ||
|
|
aac1a37a3f | ||
|
|
140234aef3 | ||
|
|
ec9715f326 | ||
|
|
69ca14bf46 | ||
|
|
0226f3d047 | ||
|
|
76391edad6 | ||
|
|
9b3822a8bd | ||
|
|
72ec6baf79 | ||
|
|
21769886fc | ||
|
|
2dc1886ee9 | ||
|
|
a29e3789d2 | ||
|
|
17db605b17 | ||
|
|
4e520938c9 | ||
|
|
7498a72f70 | ||
|
|
241bbd80bc | ||
|
|
2e05845410 | ||
|
|
a67263fa27 | ||
|
|
6d8b7bef09 | ||
|
|
3e30f75e7b | ||
|
|
7eb4b40dc7 | ||
|
|
e3a6ac548b | ||
|
|
044e65eb20 | ||
|
|
545604da63 | ||
|
|
4b9aff5b29 | ||
|
|
a93049056a | ||
|
|
3543fa4caa | ||
|
|
51a98736e8 | ||
|
|
12a8cadcfe | ||
|
|
aef959854f | ||
|
|
066161f397 | ||
|
|
d3e3de3fa2 | ||
|
|
194bc3e5be | ||
|
|
a9e3db0464 | ||
|
|
334ba3ede2 | ||
|
|
7978964995 | ||
|
|
d5ca4c4f28 | ||
|
|
08c2e1cd4e | ||
|
|
2f6e91cd9e | ||
|
|
888976873a | ||
|
|
5db608c3fc | ||
|
|
e46807c600 | ||
|
|
7799bbb57a | ||
|
|
7da8a5b1d8 | ||
|
|
ae9f4fa876 | ||
|
|
e3dd5900e2 | ||
|
|
aab865fe25 | ||
|
|
62656f4c51 | ||
|
|
b323d711cf | ||
|
|
9b4cf917d9 | ||
|
|
ba97573f93 | ||
|
|
9dc62e1469 | ||
|
|
55c0cb66e3 | ||
|
|
a8526585cb | ||
|
|
3850349eae | ||
|
|
f5bd0b7971 | ||
|
|
42d9753bdb | ||
|
|
17d5a5309a | ||
|
|
71be77c54b | ||
|
|
93c1fbd65e | ||
|
|
c8114347dc | ||
|
|
3c2c2b003f | ||
|
|
2edd6cd6c4 | ||
|
|
6713f65040 | ||
|
|
82ee4ad4ca | ||
|
|
d9134f7fe1 | ||
|
|
ee26839292 | ||
|
|
cd33376c07 | ||
|
|
e57481b87c | ||
|
|
5601aab043 | ||
|
|
1b7a1852bc | ||
|
|
509795e6c1 | ||
|
|
755642862f | ||
|
|
d1c05174b6 | ||
|
|
85b8698e35 | ||
|
|
471ba80b4d | ||
|
|
9dd555f111 | ||
|
|
7df1ff07a7 | ||
|
|
15a60930d2 | ||
|
|
eb779c5986 | ||
|
|
c051f5d3e7 | ||
|
|
ed9e463550 | ||
|
|
a7ebf1f60e | ||
|
|
6ab0ec547c | ||
|
|
26a0352851 | ||
|
|
8631cb0c2a | ||
|
|
a302448b76 | ||
|
|
fef072f721 | ||
|
|
46f196cb3f | ||
|
|
c5cd6422c6 | ||
|
|
5edc0b876c | ||
|
|
131699d309 | ||
|
|
59c01feaea | ||
|
|
772b50fdfb | ||
|
|
bf493c5763 | ||
|
|
e1f410ceff | ||
|
|
d3fb00d441 | ||
|
|
222e9f6645 | ||
|
|
22a904baf4 | ||
|
|
01670e5e85 | ||
|
|
7fbb540674 | ||
|
|
bed5361879 | ||
|
|
82cc528c49 | ||
|
|
1df64031c8 | ||
|
|
ea2d181741 | ||
|
|
3cd177bff2 | ||
|
|
132fc181cd | ||
|
|
987840e480 | ||
|
|
86096708da | ||
|
|
635f0606e0 | ||
|
|
3d15a108af | ||
|
|
254b204d6c | ||
|
|
ac645c63d3 | ||
|
|
0b9f1cc3b9 | ||
|
|
b96fee95f3 | ||
|
|
8cb7fb71d1 | ||
|
|
aac6385dc6 | ||
|
|
f7ee165f43 | ||
|
|
7132b75ffb | ||
|
|
bdd4854b0d | ||
|
|
8396e40fa0 | ||
|
|
71b06f4b20 | ||
|
|
a5274daeaa | ||
|
|
36f51c427b | ||
|
|
b3d102419b | ||
|
|
5c304c002b | ||
|
|
f96e529230 | ||
|
|
717f78ce7f | ||
|
|
b224a584fb | ||
|
|
31ef6173a1 | ||
|
|
f0697679f4 | ||
|
|
8657cf26de | ||
|
|
a8ed57bd65 | ||
|
|
bfcd01afb9 | ||
|
|
1a9e3944dc | ||
|
|
1da2ca1eb8 | ||
|
|
ccac2e497d | ||
|
|
a1d9794c0e | ||
|
|
6ee8c37cf5 | ||
|
|
c605986e8a | ||
|
|
a8c9e96b72 | ||
|
|
4cc637c0b2 | ||
|
|
4b41ae6980 | ||
|
|
6cf8369a24 | ||
|
|
e74c0f5cf5 | ||
|
|
d7707bae62 | ||
|
|
680587e050 | ||
|
|
ee7c6a91a7 | ||
|
|
6879cf765f | ||
|
|
f29febdc86 | ||
|
|
4b40546750 | ||
|
|
fcfaaacdcc | ||
|
|
68d72eac16 | ||
|
|
19c367b540 | ||
|
|
82cb7917e4 | ||
|
|
9b87bb8850 | ||
|
|
5d4b998be4 | ||
|
|
5f63db4a34 | ||
|
|
32eddbf581 | ||
|
|
ef9f0cfca7 | ||
|
|
1a157c7256 | ||
|
|
633fa7213a | ||
|
|
1ba185bf71 | ||
|
|
b4f0af4c77 | ||
|
|
785140d439 | ||
|
|
02d31d2d2a | ||
|
|
f60f9f9fc9 | ||
|
|
a7e2c06bc4 | ||
|
|
1c4a00dd00 | ||
|
|
7285537d73 | ||
|
|
12f975fa70 | ||
|
|
4b0b9acceb | ||
|
|
a9a2ec7c7b | ||
|
|
16d9571743 | ||
|
|
c1751f39ae | ||
|
|
e9c349fc55 | ||
|
|
8dcd5c6e34 | ||
|
|
3138d2c4a2 | ||
|
|
c56159da89 | ||
|
|
d0aec62997 | ||
|
|
b7003d499c | ||
|
|
76f550d9e7 | ||
|
|
a7b9b185bb | ||
|
|
48b5262855 | ||
|
|
c053d54d10 | ||
|
|
9289ebf4c9 | ||
|
|
15665b03a7 | ||
|
|
a7fe8baebe | ||
|
|
71c672eb9b | ||
|
|
caab58063f | ||
|
|
ee49f17895 | ||
|
|
2eb7825e69 | ||
|
|
e6c150c586 | ||
|
|
9f61f04680 | ||
|
|
5b148f2d7a | ||
|
|
ef0a915188 | ||
|
|
a88cd4d23d | ||
|
|
4ea6f61c52 | ||
|
|
d3a227d0bc | ||
|
|
08ca626b2f | ||
|
|
c84c106b17 | ||
|
|
2362e7a11f | ||
|
|
66f94a452d | ||
|
|
95d84f78e3 | ||
|
|
6e0249d6ea | ||
|
|
72cf94106c | ||
|
|
8ad0239bca | ||
|
|
37d2d58d2f | ||
|
|
0f45bef980 | ||
|
|
5b84011888 | ||
|
|
63f4d553cc | ||
|
|
b66304fc91 | ||
|
|
48f27c2174 | ||
|
|
f9f67d3bcd | ||
|
|
2ac1a58d5e | ||
|
|
a53cfaa63a | ||
|
|
86e003b891 | ||
|
|
4d677f430b | ||
|
|
551da69a4c | ||
|
|
218f284678 | ||
|
|
d7c6451f53 | ||
|
|
41db0bfafa | ||
|
|
f8ed89ee2c | ||
|
|
c75659db82 | ||
|
|
0093d4418e | ||
|
|
132164c3de | ||
|
|
2c71f61bfc | ||
|
|
68df6d37f7 | ||
|
|
92bb852921 | ||
|
|
d345508195 | ||
|
|
e8d77f8269 | ||
|
|
bca7f738a1 | ||
|
|
f4046fb8fc | ||
|
|
c6bd6d4a3b | ||
|
|
330b4504dc | ||
|
|
07ad9ed772 | ||
|
|
fcb00292a5 | ||
|
|
af1d687758 | ||
|
|
d4e484e982 | ||
|
|
2ccf8e777c | ||
|
|
405b97e4d3 | ||
|
|
35c7f826bc | ||
|
|
1e1cdb0ef0 | ||
|
|
fde5b39495 | ||
|
|
c9fae32ddf | ||
|
|
7f0bdc95da | ||
|
|
ac53b4bcab | ||
|
|
b4b2c41b34 | ||
|
|
21f8fb4090 | ||
|
|
3cef784f75 | ||
|
|
a7092ada08 | ||
|
|
d7b591f1a2 | ||
|
|
8b7583e628 | ||
|
|
7405302a15 | ||
|
|
8ecd04cf5c | ||
|
|
35b92ac453 | ||
|
|
fff91d555b | ||
|
|
e0112472d6 | ||
|
|
7007fb53e7 | ||
|
|
44000d2518 | ||
|
|
1843db91af | ||
|
|
eaacb4d102 | ||
|
|
be81a6dc34 | ||
|
|
73b5c8512d | ||
|
|
b1adfe38e1 | ||
|
|
639ae7be4d | ||
|
|
53c8f6ec74 | ||
|
|
d1b942cea5 | ||
|
|
8850d42246 | ||
|
|
c22d1033eb | ||
|
|
c373174436 | ||
|
|
c42bd6008a | ||
|
|
00236de741 | ||
|
|
85ed93e67b | ||
|
|
6219743c82 | ||
|
|
4de8990b5c | ||
|
|
0717d4a1b4 | ||
|
|
2fde4c7c98 | ||
|
|
21525a7261 | ||
|
|
c760ccb5bb | ||
|
|
7cca646e3f | ||
|
|
1aa21b8a2d | ||
|
|
143cdbd44b | ||
|
|
e688d34587 | ||
|
|
db5402dc09 | ||
|
|
fe977f4ba9 | ||
|
|
4ccd963037 | ||
|
|
b1c597e662 | ||
|
|
16a0fe4281 | ||
|
|
fee176dc72 | ||
|
|
b6f76ad8ed | ||
|
|
0d11f4460f | ||
|
|
ee2b412a10 | ||
|
|
cf67adfa42 | ||
|
|
4029c333ed | ||
|
|
0c6bd73996 | ||
|
|
d91abb5eba | ||
|
|
d177d69724 | ||
|
|
64e35886b7 | ||
|
|
7f75f814e3 | ||
|
|
6527c942c2 | ||
|
|
ea71389982 | ||
|
|
32d47456de | ||
|
|
407c13fcce | ||
|
|
39b935affe | ||
|
|
1f2fe6b93d | ||
|
|
d7811e2c55 | ||
|
|
5b692067d8 | ||
|
|
ebbbcafe5c | ||
|
|
6fb6de6b64 | ||
|
|
24c7f1d5b7 | ||
|
|
93e1c4c4e8 | ||
|
|
72eac9f149 | ||
|
|
fddb790c70 | ||
|
|
771bb22962 | ||
|
|
59dd372ec8 | ||
|
|
a3b3eeb56a | ||
|
|
7795872be1 | ||
|
|
c3e41710c7 | ||
|
|
386ae7d8c3 | ||
|
|
2e338ebc01 | ||
|
|
8314b147d5 | ||
|
|
cab3410d23 | ||
|
|
45b00c8b5f | ||
|
|
183b8770bb | ||
|
|
950598911c | ||
|
|
8a485575f5 | ||
|
|
1e6b493b41 | ||
|
|
959988a670 | ||
|
|
907f25c231 | ||
|
|
2d7dd36b0d | ||
|
|
0168a3b741 | ||
|
|
2f19ff768d | ||
|
|
a2c80e3fd6 | ||
|
|
356273d71e | ||
|
|
6223b26888 | ||
|
|
147aefc7e5 | ||
|
|
0cc7004d0d | ||
|
|
f263685e44 | ||
|
|
a17bc43d80 | ||
|
|
d805d976a6 | ||
|
|
688ca01b1b | ||
|
|
42461c467f | ||
|
|
2c3a6d38ab | ||
|
|
ce22028781 | ||
|
|
2a7b698a3d | ||
|
|
ef747cc4c0 | ||
|
|
b7dd936dae | ||
|
|
f34b946ea9 | ||
|
|
2326e090af | ||
|
|
f2f6dd2219 | ||
|
|
ee10322603 | ||
|
|
af444999bf | ||
|
|
8423f78586 | ||
|
|
d4265f16eb | ||
|
|
cadd4e5c2b | ||
|
|
6cba868e20 | ||
|
|
4f98149fa7 | ||
|
|
32cfaac1e2 | ||
|
|
d954d9280f | ||
|
|
0ad0a91fa4 | ||
|
|
c18cb9f61e | ||
|
|
4a908a314f | ||
|
|
188723e888 | ||
|
|
4e86d874a7 | ||
|
|
8646fb4487 | ||
|
|
a91afdb6ae | ||
|
|
6e71d5aa31 | ||
|
|
b5912c59cc | ||
|
|
a9635bb78a | ||
|
|
9481c70ecd | ||
|
|
b6939654b3 | ||
|
|
c84ac0bc10 | ||
|
|
3a7a3a6e9c | ||
|
|
de327cf3a4 | ||
|
|
2e4eaf8d33 | ||
|
|
f0b392575f | ||
|
|
f1c03f8b1d | ||
|
|
8760fb39cb | ||
|
|
1e17aa7431 | ||
|
|
293fc17aa6 | ||
|
|
2eb83b0035 | ||
|
|
7a2b3397a3 | ||
|
|
7838d420d8 | ||
|
|
3e6865ffa9 | ||
|
|
c26bea06d6 | ||
|
|
f2cd60e7b2 | ||
|
|
903a4a9222 | ||
|
|
06e0bb19a3 | ||
|
|
e6dc731921 | ||
|
|
61cf13edf8 | ||
|
|
31e5ec7bc3 | ||
|
|
372981920e | ||
|
|
4c9459def3 | ||
|
|
26b881e4c9 | ||
|
|
93802f5872 | ||
|
|
205d88cd23 | ||
|
|
02a63639da | ||
|
|
4a1de5d1cb | ||
|
|
209d33ca57 | ||
|
|
e854e42bd7 | ||
|
|
b25cc17ac9 | ||
|
|
0af8b8155f | ||
|
|
7f97416e6e | ||
|
|
3cbbfb1782 | ||
|
|
ced9706c5b | ||
|
|
7f21cdffa2 | ||
|
|
0e2add204b | ||
|
|
490c7e8fec | ||
|
|
a4b4360df6 | ||
|
|
0a29f25330 | ||
|
|
5532a0673f | ||
|
|
9b9c040d2d | ||
|
|
305b4d0ac0 | ||
|
|
615a96f9d8 | ||
|
|
0da508594b | ||
|
|
89643d1538 | ||
|
|
9900a51757 | ||
|
|
e6a08b9c18 | ||
|
|
e8027293bf | ||
|
|
0e00555703 | ||
|
|
a251c7325a | ||
|
|
e5d664bc07 | ||
|
|
460d5a9386 | ||
|
|
df06dd49c5 | ||
|
|
096bdef25a | ||
|
|
5286a2d9ae | ||
|
|
714b62049c | ||
|
|
1eb6f781b3 | ||
|
|
b4c2f7d371 | ||
|
|
424bba71f7 | ||
|
|
36a4930b35 | ||
|
|
9227fba474 | ||
|
|
4a8e59a95b | ||
|
|
bd5da4a36e | ||
|
|
a926b7b912 | ||
|
|
179e222919 | ||
|
|
1b98afe37d | ||
|
|
cfb4b5bd51 | ||
|
|
8e7bfb7f1a | ||
|
|
15bcf71aaf | ||
|
|
5b38c43b7e | ||
|
|
4d7d449cea | ||
|
|
ac100936c7 | ||
|
|
5eb289f1fe | ||
|
|
fe7ae9450b | ||
|
|
91d05c5de6 | ||
|
|
ac019a7d7e | ||
|
|
8c306a5d3d | ||
|
|
785ecb8a78 | ||
|
|
fa352b6917 | ||
|
|
29f50bb70b | ||
|
|
83bbde8d29 | ||
|
|
d69eee55dd | ||
|
|
d9ec628333 | ||
|
|
16a1ae3010 | ||
|
|
8603ec1c99 | ||
|
|
0a3cfe001d | ||
|
|
ee8e1996d9 | ||
|
|
0ab565ab02 | ||
|
|
744b9f574c | ||
|
|
f259e347aa | ||
|
|
b330829f09 | ||
|
|
5a59bc2abc | ||
|
|
8dd76a6cc8 | ||
|
|
b4cbfa02cf | ||
|
|
073eee8fab | ||
|
|
5c7a529fa1 | ||
|
|
3bd01c0d98 | ||
|
|
a3d71b1dca | ||
|
|
319068eef5 | ||
|
|
bc6d33e4fb | ||
|
|
004d99fc3a | ||
|
|
49b5deb9f4 | ||
|
|
47ca69b80e | ||
|
|
8990fad85a | ||
|
|
ab2458bdf4 | ||
|
|
97f15c04b4 | ||
|
|
a1b937b1fb | ||
|
|
896c13a612 | ||
|
|
27e5f8eeb6 | ||
|
|
362f8acb15 | ||
|
|
b58bc685e1 | ||
|
|
9ff92aeb40 | ||
|
|
0b52092eda | ||
|
|
0300d77fdb | ||
|
|
4839558429 | ||
|
|
b8e383368d | ||
|
|
51d9d37d1a | ||
|
|
8e46751e98 | ||
|
|
b0b9ce0cf8 | ||
|
|
09d3ecde2a | ||
|
|
8ed03051c3 | ||
|
|
104000fbc4 | ||
|
|
9bc569bf9a | ||
|
|
7f4cc6e5c0 | ||
|
|
0aacf1d07f | ||
|
|
b6e2bbc434 | ||
|
|
9a97c6c328 | ||
|
|
e04511269a | ||
|
|
ff566aa51f | ||
|
|
3e3a5273c0 | ||
|
|
367356f7f5 | ||
|
|
f4dd79ab43 | ||
|
|
f9fa58a6ea | ||
|
|
9c055ea1fd | ||
|
|
046a5866bf | ||
|
|
22d75ed856 | ||
|
|
a641f27b7e | ||
|
|
f0ab13ebc3 | ||
|
|
31426a289c | ||
|
|
78a87baa94 | ||
|
|
b2648afc7b | ||
|
|
be738eb5e7 | ||
|
|
740619529c | ||
|
|
441f4a9fc7 | ||
|
|
cd200b978b | ||
|
|
0a8368d639 | ||
|
|
9ade281a92 | ||
|
|
eb066b3539 | ||
|
|
00648c9673 | ||
|
|
c7d179d68e | ||
|
|
c1ad816211 | ||
|
|
4328a335ec | ||
|
|
d3e47245d6 | ||
|
|
0e32dd667d | ||
|
|
95437b2afe | ||
|
|
d15307a237 | ||
|
|
ac76e47b94 | ||
|
|
df50f1934e | ||
|
|
dc85616549 | ||
|
|
8ae15abb85 | ||
|
|
84a6fff034 | ||
|
|
c09a8bca7f | ||
|
|
90e0aa83d8 | ||
|
|
81652e3650 | ||
|
|
bdd2f51497 | ||
|
|
688e921034 | ||
|
|
e27993aff2 | ||
|
|
46388f4707 | ||
|
|
d68b931013 | ||
|
|
8807d6c6f3 | ||
|
|
14adcc0e51 | ||
|
|
a09aec032f | ||
|
|
7784fca0d4 | ||
|
|
68bd5569ce | ||
|
|
60e1c23a6b | ||
|
|
77fbb54ebc | ||
|
|
9b7b782020 | ||
|
|
bb3e0c126f | ||
|
|
3aeb9f31b0 | ||
|
|
8b19f0c3c0 | ||
|
|
73e259d6e7 | ||
|
|
f9039f4b34 | ||
|
|
5fb046ad1f | ||
|
|
7b089a1f2f | ||
|
|
867faef496 | ||
|
|
557313ae1e | ||
|
|
e4c2049975 | ||
|
|
b4ef19dac7 | ||
|
|
dc6c1fa622 | ||
|
|
d9db8401e2 | ||
|
|
9fe8a0f491 | ||
|
|
43d6b48cab | ||
|
|
ad40c53eb2 | ||
|
|
c71c610eba | ||
|
|
cf1fe04431 | ||
|
|
8f16a733b9 | ||
|
|
bc4991f915 | ||
|
|
7a8e923b41 | ||
|
|
e54dbcf574 | ||
|
|
c5d023822d | ||
|
|
e28d6e7451 | ||
|
|
9f275cc84f | ||
|
|
575903f921 | ||
|
|
02b3b94804 | ||
|
|
17ecdbf8ec | ||
|
|
80e0782fdb | ||
|
|
c505b5b9cb | ||
|
|
99f37504de | ||
|
|
69f4c6e5e9 | ||
|
|
fd98db1b70 | ||
|
|
205f3a327e | ||
|
|
750f7463cc | ||
|
|
f84b661af7 | ||
|
|
56330686be | ||
|
|
a41e91a731 | ||
|
|
e758b16ba3 | ||
|
|
e48c61cf27 | ||
|
|
08c802f733 | ||
|
|
7e4babaca8 | ||
|
|
f65c792191 | ||
|
|
e572c5776d | ||
|
|
5d1e53f469 | ||
|
|
bef20f7808 | ||
|
|
b47736b595 | ||
|
|
2dbfbe70af | ||
|
|
3f1d9ed366 | ||
|
|
b30bb21646 | ||
|
|
acfd5aa02f | ||
|
|
d8b16766f5 | ||
|
|
b902cc6531 | ||
|
|
2248cd96b1 | ||
|
|
01b7059582 | ||
|
|
7fd0d87d56 | ||
|
|
be515d4c40 | ||
|
|
ceee311efa | ||
|
|
f137d759c8 | ||
|
|
f5250d6bcf | ||
|
|
af42d2ff66 | ||
|
|
f1339f8b4a | ||
|
|
eed7ef1ac3 | ||
|
|
c7c654d310 | ||
|
|
94a7d3116a | ||
|
|
e770fcd197 | ||
|
|
5a0f965125 | ||
|
|
206be8b110 | ||
|
|
4189700a3b | ||
|
|
9a968674d6 | ||
|
|
18c9340950 | ||
|
|
78ef07cf0f | ||
|
|
d510f8c7cf | ||
|
|
2180a8faef | ||
|
|
2340ab0518 | ||
|
|
de5c6a4084 | ||
|
|
ce06d9bdfb | ||
|
|
33c11baca9 | ||
|
|
8fbdcd54aa | ||
|
|
20d3a84fc0 | ||
|
|
58a65b0004 | ||
|
|
bbd00a6020 | ||
|
|
63f544918d | ||
|
|
93938d6090 | ||
|
|
144e30775f | ||
|
|
f74eff8934 | ||
|
|
8ba96904a6 | ||
|
|
dbbc525174 | ||
|
|
b9324f44e6 | ||
|
|
d6c5e3dc3e | ||
|
|
7c350dde90 | ||
|
|
2c1759ce0a | ||
|
|
7f5a32a83b | ||
|
|
379f77af48 | ||
|
|
4b59d57f89 | ||
|
|
15b3860f83 | ||
|
|
b71a9b7d14 | ||
|
|
85352868ec | ||
|
|
310059f274 | ||
|
|
b5cc3b6f1b | ||
|
|
de9421e68f | ||
|
|
413443aa95 | ||
|
|
82d7c54a3d | ||
|
|
9123b21e18 | ||
|
|
56cca88fbd | ||
|
|
9b853350f1 | ||
|
|
e3b5a55eba | ||
|
|
366dc80dc0 | ||
|
|
ba2ee6d6e5 | ||
|
|
6afcf1a26f | ||
|
|
ee831fbcb6 | ||
|
|
4d87eefbe9 | ||
|
|
ec04fea9be | ||
|
|
1586aee2d2 | ||
|
|
226169bbbe | ||
|
|
e1e73077a1 | ||
|
|
7b5cfcb817 | ||
|
|
b3645ec945 | ||
|
|
7d06460e54 | ||
|
|
485761f45c | ||
|
|
f3d788de16 | ||
|
|
b06f5630c7 | ||
|
|
5c96a28fb6 | ||
|
|
9425569784 | ||
|
|
8b982b977b | ||
|
|
7a9d7b59e8 | ||
|
|
4720cf9fbe | ||
|
|
68f93c5e3d | ||
|
|
7b8330f8f8 | ||
|
|
63696b9f5f | ||
|
|
727b3c6b10 | ||
|
|
05cb3831a2 | ||
|
|
5b51375404 | ||
|
|
398e845e8d | ||
|
|
45c29888b4 | ||
|
|
82c5bd528c | ||
|
|
45d0b614c2 | ||
|
|
4725ff6d5f | ||
|
|
7158d4d4ad | ||
|
|
502d90b117 | ||
|
|
f0c95b3f29 | ||
|
|
d3dccace37 | ||
|
|
a30453616b | ||
|
|
168ba2ff9f | ||
|
|
2ca9a8fc79 | ||
|
|
6456a68805 | ||
|
|
e82b607fa1 | ||
|
|
7168c9ed59 | ||
|
|
d7af6934b6 | ||
|
|
b4a5a936a0 | ||
|
|
6129e0d696 | ||
|
|
a0c8424800 | ||
|
|
dc839e1ad1 | ||
|
|
59155256a9 | ||
|
|
29b7995e7f | ||
|
|
ae9ec8851c | ||
|
|
7c2df736df | ||
|
|
192e7d5060 | ||
|
|
6aed140ecf | ||
|
|
76d56c9ed4 | ||
|
|
17096055f8 | ||
|
|
c6134bc038 | ||
|
|
16f885f469 | ||
|
|
00072d0216 | ||
|
|
4878f70e58 | ||
|
|
9e8523470d | ||
|
|
7316be0bc2 | ||
|
|
8a4b663890 | ||
|
|
3276ad9979 | ||
|
|
0890043bf4 | ||
|
|
c90ef343c1 | ||
|
|
0f6e276113 | ||
|
|
1395c95831 | ||
|
|
33b70a550f | ||
|
|
985e924e9d | ||
|
|
3827919a32 | ||
|
|
d55bea7c46 | ||
|
|
2efe326fdb | ||
|
|
d43bd23e1a | ||
|
|
015ec12215 | ||
|
|
fde9dc7961 | ||
|
|
ed572ececf | ||
|
|
fd2b79bea9 | ||
|
|
acc10930c2 | ||
|
|
f17d6c2359 | ||
|
|
e21211f3f6 | ||
|
|
58deaa6b29 | ||
|
|
fcd88b4b3b | ||
|
|
3bd987ff2c | ||
|
|
45bcdc8c46 | ||
|
|
0d0b2d6962 | ||
|
|
fd6a41d219 | ||
|
|
b052429a73 | ||
|
|
1996f401e0 | ||
|
|
3b3f2226f1 | ||
|
|
5c0f6a1e50 | ||
|
|
b7438f6ab8 | ||
|
|
84f80b3e06 | ||
|
|
c281372b8d | ||
|
|
788a3cfc5e | ||
|
|
01eeb53af0 | ||
|
|
7cf69128ea | ||
|
|
c977baecc4 | ||
|
|
2ab2f5e675 | ||
|
|
6a38f1e9f3 | ||
|
|
f0eba69c4a | ||
|
|
cea366e135 | ||
|
|
d752c7434f |
178
.clang-format
Normal file
178
.clang-format
Normal file
@@ -0,0 +1,178 @@
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: false
|
||||
AlignArrayOfStructures: Left
|
||||
AlignConsecutiveMacros: Consecutive
|
||||
AlignConsecutiveAssignments: Consecutive
|
||||
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
|
||||
AlignConsecutiveDeclarations: None
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
AttributeMacros:
|
||||
- __capability
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeConceptDeclarations: false
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: AfterComma
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 0
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
ExperimentalAutoDetectBinPacking: true
|
||||
FixNamespaceComments: false
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IfMacros:
|
||||
- KJ_IF_MAYBE
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseLabels: true
|
||||
IndentCaseBlocks: true
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: BeforeHash
|
||||
IndentExternBlock: Indent
|
||||
IndentRequires: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertTrailingCommas: None
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
LambdaBodyIndentation: Signature
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: All
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCBreakBeforeNestedBlockParam: true
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PenaltyIndentedWhitespace: 0
|
||||
PointerAlignment: Right
|
||||
PPIndentWidth: 4
|
||||
ReferenceAlignment: Pointer
|
||||
ReflowComments: true
|
||||
ShortNamespaceLines: 5
|
||||
SortIncludes: Never
|
||||
SortJavaStaticImport: Before
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 4
|
||||
SpacesInAngles: Never
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 1
|
||||
Maximum: -1
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeSquareBrackets: false
|
||||
BitFieldColonSpacing: Both
|
||||
Standard: Latest
|
||||
StatementAttributeLikeMacros:
|
||||
- Q_EMIT
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 4
|
||||
UseCRLF: false
|
||||
UseTab: Never
|
||||
WhitespaceSensitiveMacros:
|
||||
- STRINGIZE
|
||||
- PP_STRINGIZE
|
||||
- BOOST_PP_STRINGIZE
|
||||
- NS_SWIFT_NAME
|
||||
- CF_SWIFT_NAME
|
||||
...
|
||||
|
||||
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
lib/external/** linguist-vendored
|
||||
lib/libimhex-rs/imgui-rs/** linguist-vendored
|
||||
lib/libimhex-rs/imgui-sys/** linguist-vendored
|
||||
5
.github/FUNDING.yml
vendored
Normal file
5
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Sponsor links
|
||||
|
||||
patreon: werwolv
|
||||
custom: https://werwolv.net/donate
|
||||
github: WerWolv
|
||||
49
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
49
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Bug Report
|
||||
description: Something doesn't work correctly in ImHex.
|
||||
title: "[Bug] "
|
||||
body:
|
||||
- type: dropdown
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating System
|
||||
description: What Operating System are you using ImHex on?
|
||||
options:
|
||||
- Windows
|
||||
- Linux
|
||||
- MacOS
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What's the issue you encountered?
|
||||
description: |
|
||||
Describe the issue in detail and what you were doing beforehand.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: How can the issue be reproduced?
|
||||
description: Include a detailed step by step process for recreating your issue.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: ImHex Version
|
||||
description: |
|
||||
The version of ImHex you've been using when encountering the bug. If using a nightly, please add the commit hash as well
|
||||
placeholder: X.X.X
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: ImHex Build Type
|
||||
options:
|
||||
- label: Nightly or built from sources
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context?
|
||||
value: |
|
||||
- Additional information about your environment.
|
||||
- If possible and useful, please upload the binary you've been editing when the bug occured.
|
||||
validations:
|
||||
required: false
|
||||
22
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
22
.github/ISSUE_TEMPLATE/feature_request.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Feature Request
|
||||
description: Something you'd like to see added to ImHex in the future
|
||||
title: "[Feature] "
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What feature would you like to see?
|
||||
description: |
|
||||
Describe in detail what the feature should do and how it should work.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: How will this feature be useful to you and others?
|
||||
description: Describe how everybody will benefit from this feature if it gets added.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Request Type
|
||||
options:
|
||||
- label: I can provide a PoC for this feature or am willing to work on it myself and submit a PR
|
||||
56
.github/workflows/analysis.yml
vendored
Normal file
56
.github/workflows/analysis.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
codeql:
|
||||
name: 🐛 CodeQL
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: 🧰 Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: ✋ Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: 'cpp'
|
||||
|
||||
- name: 📜 Restore cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.ccache
|
||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
|
||||
- name: ⬇️ Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo bash dist/get_deps_debian.sh
|
||||
|
||||
- name: 🛠️ Build
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
CC=gcc-10 CXX=g++-10 cmake \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||
..
|
||||
make -j 4 install
|
||||
|
||||
- name: 🗯️ Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
254
.github/workflows/build.yml
vendored
Normal file
254
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
|
||||
# Windows build
|
||||
win:
|
||||
runs-on: windows-2022
|
||||
name: 🟦 Windows MINGW64
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
CCACHE_DIR: "${{ github.workspace }}/.ccache"
|
||||
CCACHE_MAXSIZE: "1000M"
|
||||
CCACHE_COMPRESS: "true"
|
||||
steps:
|
||||
- name: 🧰 Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: 🟦 Install msys2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: mingw64
|
||||
pacboy: >-
|
||||
gcc:p
|
||||
lld:p
|
||||
cmake:p
|
||||
make:p
|
||||
ccache:p
|
||||
glfw:p
|
||||
file:p
|
||||
mbedtls:p
|
||||
python:p
|
||||
freetype:p
|
||||
dlfcn:p
|
||||
|
||||
- name: ⬇️ Install dependencies
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://win.rustup.rs > rustup-init.exe
|
||||
./rustup-init.exe -y --default-host=x86_64-pc-windows-gnu --default-toolchain=none
|
||||
rm rustup-init.exe
|
||||
$USERPROFILE/.cargo/bin/rustup.exe target add x86_64-pc-windows-gnu
|
||||
$USERPROFILE/.cargo/bin/rustup.exe default nightly
|
||||
|
||||
- name: 📜 Prepare Cache
|
||||
id: prep-ccache
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p "${CCACHE_DIR}"
|
||||
echo "::set-output name=dir::$CCACHE_DIR"
|
||||
|
||||
- name: 📜 Restore Cache
|
||||
uses: actions/cache@v1
|
||||
id: cache-ccache
|
||||
with:
|
||||
path: ${{ steps.prep-ccache.outputs.dir }}
|
||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
|
||||
- name: 🛠️ Build
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
# Get path to mingw python library
|
||||
PYTHON_LIB_NAME=$(pkg-config --libs-only-l python3 | sed 's/^-l//' | sed 's/ //')
|
||||
PYTHON_LIB_PATH=$(cygpath -m $(which lib${PYTHON_LIB_NAME}.dll))
|
||||
|
||||
cmake -G "MinGW Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
||||
-DCREATE_PACKAGE=ON \
|
||||
-DPython_LIBRARY="$PYTHON_LIB_PATH" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||
-DRUST_PATH="$USERPROFILE/.cargo/bin/" \
|
||||
..
|
||||
mingw32-make -j4 install
|
||||
cpack
|
||||
|
||||
- name: ⬆️ Upload Portable ZIP
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Windows Portable ZIP
|
||||
path: |
|
||||
build/install/*
|
||||
|
||||
- name: ⬆️ Upload Windows Installer
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Windows Installer
|
||||
path: |
|
||||
build/*.msi
|
||||
|
||||
# MacOS build
|
||||
macos:
|
||||
runs-on: macos-11.0
|
||||
name: 🍎 macOS 11.0
|
||||
steps:
|
||||
|
||||
- name: 🧰 Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: ⬇️ Install dependencies
|
||||
run: |
|
||||
brew bundle --no-lock --file dist/Brewfile
|
||||
|
||||
- name: 📜 Restore cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.ccache
|
||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
|
||||
- name: 🛠️ Build
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
CC=$(brew --prefix llvm)/bin/clang \
|
||||
CXX=$(brew --prefix llvm)/bin/clang++ \
|
||||
PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" \
|
||||
MACOSX_DEPLOYMENT_TARGET="10.15" \
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCREATE_BUNDLE=ON \
|
||||
-DCREATE_PACKAGE=ON \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
..
|
||||
make -j4 package
|
||||
|
||||
- name: ⬆️ Upload DMG
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: macOS DMG
|
||||
path: build/*.dmg
|
||||
|
||||
# Linux build
|
||||
linux:
|
||||
runs-on: ubuntu-20.04
|
||||
name: 🐧 Ubuntu 20.04
|
||||
steps:
|
||||
|
||||
- name: 🧰 Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: 📜 Restore cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.ccache
|
||||
.flatpak-builder
|
||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
|
||||
- name: ⬇️ Install dependencies
|
||||
run: |
|
||||
sudo rm -rf /usr/share/dotnet
|
||||
sudo rm -rf /opt/ghc
|
||||
sudo rm -rf "/usr/local/share/boost"
|
||||
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||
|
||||
sudo apt update
|
||||
sudo bash dist/get_deps_debian.sh
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
|
||||
sh rustup-init.sh -y --default-toolchain none
|
||||
rm rustup-init.sh
|
||||
$HOME/.cargo/bin/rustup install nightly
|
||||
$HOME/.cargo/bin/rustup target add x86_64-unknown-linux-gnu
|
||||
$HOME/.cargo/bin/rustup default nightly
|
||||
|
||||
- name: 🛠️ Build
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
CC=gcc-10 CXX=g++-10 cmake \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_INSTALL_PREFIX="$PWD/install/usr" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||
-DRUST_PATH="$HOME/.cargo/bin/" \
|
||||
..
|
||||
make -j 4 install
|
||||
|
||||
#- name: 📦 Bundle Flatpak
|
||||
# run: |
|
||||
# sudo apt install flatpak flatpak-builder
|
||||
# flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
# flatpak --user install -y flathub org.freedesktop.Platform//20.08
|
||||
# flatpak --user install -y flathub org.freedesktop.Sdk//20.08
|
||||
# flatpak-builder --jobs=4 --repo=imhex _flatpak dist/net.werwolv.ImHex.yaml --ccache --keep-build-dirs
|
||||
# flatpak build-bundle imhex imhex.flatpak net.werwolv.ImHex stable
|
||||
|
||||
- name: 📦 Bundle DEB
|
||||
run: |
|
||||
cp -r build/DEBIAN build/install
|
||||
dpkg-deb --build build/install
|
||||
mv build/install.deb imhex.deb
|
||||
rm -rf build/install/DEBIAN
|
||||
|
||||
- name: 📦 Bundle AppImage
|
||||
run: |
|
||||
dist/AppImage/package.sh build
|
||||
mv build/ImHex-x86_64.AppImage imhex.AppImage
|
||||
|
||||
- name: ⬆️ Upload ELF
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Linux ELF
|
||||
path: |
|
||||
build/install/*
|
||||
|
||||
- name: ⬆️ Upload Flatpak
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Linux Flatpak
|
||||
path: |
|
||||
imhex.flatpak
|
||||
|
||||
- name: ⬆️ Upload .deb
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Linux DEB
|
||||
path: |
|
||||
imhex.deb
|
||||
|
||||
- name: ⬆️ Upload AppImage
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Linux AppImage
|
||||
path: |
|
||||
imhex.AppImage
|
||||
|
||||
55
.github/workflows/tests.yml
vendored
Normal file
55
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: "Unit Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: 🧪 Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: 🧰 Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: 📜 Restore cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.ccache
|
||||
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
|
||||
- name: ⬇️ Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo bash dist/get_deps_debian.sh
|
||||
|
||||
- name: 🛠️ Build
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
CC=gcc-10 CXX=g++-10 cmake \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||
..
|
||||
make -j4 unit_tests install
|
||||
|
||||
- name: 🧪 Perform Unit Tests
|
||||
run: |
|
||||
cd build
|
||||
ctest
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,10 +1,16 @@
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
cmake-build-debug/
|
||||
|
||||
cmake-build-release/
|
||||
cmake-build-*/
|
||||
|
||||
build-linux/
|
||||
build/
|
||||
build*/
|
||||
|
||||
*.mgc
|
||||
imgui.ini
|
||||
.DS_Store
|
||||
plugins/.rustc_info.json
|
||||
|
||||
**/target
|
||||
|
||||
plugins/example_rust/Cargo.lock
|
||||
|
||||
28
.gitmodules
vendored
Normal file
28
.gitmodules
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
[submodule "lib/external/nativefiledialog"]
|
||||
path = lib/external/nativefiledialog
|
||||
url = https://github.com/btzy/nativefiledialog-extended
|
||||
ignore = dirty
|
||||
[submodule "lib/external/yara/yara"]
|
||||
path = lib/external/yara/yara
|
||||
url = https://github.com/VirusTotal/yara
|
||||
ignore = dirty
|
||||
[submodule "lib/external/xdgpp"]
|
||||
path = lib/external/xdgpp
|
||||
url = https://git.sr.ht/~danyspin97/xdgpp
|
||||
ignore = dirty
|
||||
[submodule "lib/external/fmt"]
|
||||
path = lib/external/fmt
|
||||
url = https://github.com/fmtlib/fmt
|
||||
ignore = dirty
|
||||
[submodule "lib/external/curl"]
|
||||
path = lib/external/curl
|
||||
url = https://github.com/curl/curl
|
||||
ignore = dirty
|
||||
[submodule "lib/external/capstone"]
|
||||
path = lib/external/capstone
|
||||
url = https://github.com/capstone-engine/capstone
|
||||
ignore = dirty
|
||||
[submodule "lib/external/libromfs"]
|
||||
path = lib/external/libromfs
|
||||
url = https://github.com/WerWolv/libromfs
|
||||
ignore = dirty
|
||||
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
imhex
|
||||
0
.idea/HexEditor.iml → .idea/imhex.iml
generated
0
.idea/HexEditor.iml → .idea/imhex.iml
generated
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/HexEditor.iml" filepath="$PROJECT_DIR$/.idea/HexEditor.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/imhex.iml" filepath="$PROJECT_DIR$/.idea/imhex.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
7
.idea/vcs.xml
generated
7
.idea/vcs.xml
generated
@@ -2,5 +2,12 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/capstone" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/curl" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/fmt" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/libromfs" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/nativefiledialog" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/xdgpp" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/lib/external/yara/yara" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,64 +1,41 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(HexEditor)
|
||||
|
||||
# Updating the version here will update it throughout ImHex as well
|
||||
set(IMHEX_VERSION "1.16.2")
|
||||
project(imhex VERSION ${IMHEX_VERSION})
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules")
|
||||
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_search_module(GLFW REQUIRED glfw3)
|
||||
pkg_search_module(GLM REQUIRED glm)
|
||||
pkg_search_module(CAPSTONE REQUIRED capstone)
|
||||
find_package(OpenGL REQUIRED)
|
||||
# Make sure project is configured correctly
|
||||
setDefaultBuiltTypeIfUnset()
|
||||
detectBadClone()
|
||||
|
||||
include_directories(include ${GLFW_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} libs/ImGui/include libs/glad/include)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -DIMGUI_IMPL_OPENGL_LOADER_GLAD")
|
||||
# List plugin names here. Project name must match folder name
|
||||
set(PLUGINS
|
||||
builtin
|
||||
windows
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc -static")
|
||||
endif (WIN32)
|
||||
# Add various defines
|
||||
detectOS()
|
||||
detectArch()
|
||||
addVersionDefines()
|
||||
configurePackingResources()
|
||||
|
||||
add_executable(ImHex
|
||||
source/main.cpp
|
||||
source/window.cpp
|
||||
source/utils.cpp
|
||||
source/crypto.cpp
|
||||
# Add ImHex sources
|
||||
add_subdirectory(lib/libimhex)
|
||||
add_subdirectory(main)
|
||||
add_custom_target(imhex_all ALL DEPENDS main)
|
||||
|
||||
source/lang/preprocessor.cpp
|
||||
source/lang/lexer.cpp
|
||||
source/lang/parser.cpp
|
||||
source/lang/validator.cpp
|
||||
source/lang/evaluator.cpp
|
||||
# Add unit tests
|
||||
enable_testing()
|
||||
add_subdirectory(tests EXCLUDE_FROM_ALL)
|
||||
|
||||
source/provider/file_provider.cpp
|
||||
# Configure packaging
|
||||
createPackage()
|
||||
|
||||
source/views/view_hexeditor.cpp
|
||||
source/views/view_pattern.cpp
|
||||
source/views/view_pattern_data.cpp
|
||||
source/views/view_hashes.cpp
|
||||
source/views/view_information.cpp
|
||||
source/views/view_help.cpp
|
||||
source/views/view_tools.cpp
|
||||
source/views/view_strings.cpp
|
||||
source/views/view_data_inspector.cpp
|
||||
source/views/view_disassembler.cpp
|
||||
|
||||
libs/glad/source/glad.c
|
||||
|
||||
libs/ImGui/source/imgui.cpp
|
||||
libs/ImGui/source/imgui_draw.cpp
|
||||
libs/ImGui/source/imgui_widgets.cpp
|
||||
libs/ImGui/source/imgui_demo.cpp
|
||||
libs/ImGui/source/imgui_impl_glfw.cpp
|
||||
libs/ImGui/source/imgui_impl_opengl3.cpp
|
||||
libs/ImGui/source/ImGuiFileBrowser.cpp
|
||||
libs/ImGui/source/TextEditor.cpp
|
||||
|
||||
resource.rc
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(ImHex libglfw3.a libgcc.a libstdc++.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a shlwapi.lib libcrypto.a libwinpthread.a libcapstone.a)
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so)
|
||||
endif (UNIX)
|
||||
# Download and install all current files from the ImHex-Patterns repo
|
||||
downloadImHexPatternsFiles()
|
||||
339
LICENSE
Normal file
339
LICENSE
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 2 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, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
242
README.md
242
README.md
@@ -1,7 +1,243 @@
|
||||
# ImHex
|
||||
<a href="https://imhex.werwolv.net"><h1 align="center" >:mag: ImHex</h1></a>
|
||||
|
||||
A Hex editor written in C++ using OpenGL, GLFW and Dear ImGui
|
||||
<p align="center">A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.</p>
|
||||
|
||||
<p align="center">
|
||||
<a title="'Build' workflow Status" href="https://github.com/WerWolv/ImHex/actions?query=workflow%3ABuild"><img alt="'Build' workflow Status" src="https://img.shields.io/github/workflow/status/WerWolv/ImHex/Build?longCache=true&style=for-the-badge&label=Build&logoColor=fff&logo=GitHub%20Actions"></a>
|
||||
<a title="Discord Server" href="https://discord.gg/X63jZ36xBY"><img alt="Discord Server" src="https://img.shields.io/discord/789833418631675954?label=Discord&logo=Discord&style=for-the-badge"></a>
|
||||
<a title="Total Downloads" href="https://github.com/WerWolv/ImHex/releases/latest"><img alt="Total Downloads" src="https://img.shields.io/github/downloads/WerWolv/ImHex/total?longCache=true&style=for-the-badge&label=Downloads&logoColor=fff&logo=GitHub"></a>
|
||||
</p>
|
||||
|
||||
## Supporting
|
||||
|
||||
If you like my work, please consider supporting me on GitHub Sponsors, Patreon or PayPal. Thanks a lot!
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/sponsors/WerWolv"><img src="https://werwolv.net/assets/github_banner.png" alt="GitHub donate button" /> </a>
|
||||
<a href="https://www.patreon.com/werwolv"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Patreon donate button" /> </a>
|
||||
<a href="https://werwolv.net/donate"><img src="https://werwolv.net/assets/paypal_banner.png" alt="PayPal donate button" /> </a>
|
||||
</p>
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- Featureful hex view
|
||||
- Byte patching
|
||||
- Patch management
|
||||
- Copy bytes as feature
|
||||
- Bytes
|
||||
- Hex string
|
||||
- C, C++, C#, Rust, Python, Java & JavaScript array
|
||||
- ASCII-Art hex view
|
||||
- HTML self contained div
|
||||
- String and hex search
|
||||
- Colorful highlighting
|
||||
- Goto from start, end and current cursor position
|
||||
- Custom C++-like pattern language for parsing highlighting a file's content
|
||||
- Automatic loading based on MIME type
|
||||
- arrays, pointers, structs, unions, enums, bitfields, namespaces, little and big endian support, conditionals and much more!
|
||||
- Useful error messages, syntax highlighting and error marking
|
||||
- Data importing
|
||||
- Base64 files
|
||||
- IPS and IPS32 patches
|
||||
- Data exporting
|
||||
- IPS and IPS32 patches
|
||||
- Data inspector allowing interpretation of data as many different types (little and big endian)
|
||||
- Huge file support with fast and efficient loading
|
||||
- String search
|
||||
- Copying of strings
|
||||
- Copying of demangled strings
|
||||
- File hashing support
|
||||
- CRC16 and CRC32 with custom initial values and polynomials
|
||||
- MD4, MD5
|
||||
- SHA-1, SHA-224, SHA-256, SHA-384, SHA-512
|
||||
- Disassembler supporting many architectures (frontend for Capstone)
|
||||
- ARM32 (ARM, Thumb, Cortex-M, AArch32)
|
||||
- ARM64
|
||||
- MIPS (MIPS32, MIPS64, MIPS32R6, Micro)
|
||||
- x86 (16-bit, 32-bit, 64-bit)
|
||||
- PowerPC (32-bit, 64-bit)
|
||||
- SPARC
|
||||
- IBM SystemZ
|
||||
- xCORE
|
||||
- M68K
|
||||
- TMS320C64X
|
||||
- M680X
|
||||
- Ethereum
|
||||
- RISC-V
|
||||
- WebAssembly
|
||||
- MOS565XX
|
||||
- Berkeley Packet Filter
|
||||
- Bookmarks
|
||||
- Region highlighting
|
||||
- Comments
|
||||
- Data Analyzer
|
||||
- File magic-based file parser and MIME type database
|
||||
- Byte distribution graph
|
||||
- Entropy graph
|
||||
- Highest and average entropy
|
||||
- Encrypted / Compressed file detection
|
||||
- Built-in Content Store
|
||||
- Download all files found in the database directly from within ImHex
|
||||
- Yara Rules support
|
||||
- Quickly scan a file for vulnearabilities with official yara rules
|
||||
- Helpful tools
|
||||
- Itanium and MSVC demangler
|
||||
- ASCII table
|
||||
- Regex replacer
|
||||
- Mathematical expression evaluator (Calculator)
|
||||
- Hexadecimal Color picker
|
||||
- Base converter
|
||||
- UNIX Permissions calculator
|
||||
- Anonfiles File upload tool
|
||||
- Wikipedia term definition finder
|
||||
- File utilities
|
||||
- File splitter
|
||||
- File combiner
|
||||
- File shredderer
|
||||
- Built-in cheat sheet for pattern language and Math evaluator
|
||||
- Doesn't burn out your retinas when used in late-night sessions
|
||||
|
||||
## Pattern Language
|
||||
|
||||
The custom C-like Pattern Language developed and used by ImHex is easy to read, understand and learn. A guide with all features of the language can be found [on the docs page](http://imhex.werwolv.net/docs).
|
||||
|
||||
## Plugin development
|
||||
|
||||
To develop plugins for ImHex, use one of the following two templates projects to get startet. You then have access to the entirety of libimhex as well as the ImHex API and the Content Registry to interact with ImHex or to add new content.
|
||||
- [C++ Plugin Template](https://github.com/WerWolv/ImHex-Cpp-Plugin-Template)
|
||||
- [Rust Plugin Template](https://github.com/WerWolv/ImHex-Rust-Plugin-Template)
|
||||
|
||||
## Additional Files
|
||||
|
||||
For format patterns, includable libraries and magic files, check out the [ImHex-Patterns](https://github.com/WerWolv/ImHex-Patterns) repository. Feel free to PR your own files there as well!
|
||||
|
||||
## Nightly builds
|
||||
|
||||
Nightlies are available via GitHub Actions [here](https://github.com/WerWolv/ImHex/actions?query=workflow%3ABuild).
|
||||
|
||||
- Windows • __x86_64__
|
||||
- [MSI](https://nightly.link/WerWolv/ImHex/workflows/build/master/Windows%20Installer.zip)
|
||||
- [EXE](https://nightly.link/WerWolv/ImHex/workflows/build/master/Windows%20Portable%20ZIP.zip)
|
||||
- MacOS • __x86_64__
|
||||
- [DMG](https://nightly.link/WerWolv/ImHex/workflows/build/master/macOS%20DMG.zip)
|
||||
- Linux • __x86_64__
|
||||
- [ELF](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20ELF.zip)
|
||||
- [DEB](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20DEB.zip)
|
||||
- [Flatpak](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20Flatpak.zip)
|
||||
- [AppImage](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20AppImage.zip)
|
||||
|
||||
## Compiling
|
||||
|
||||
You need a C++20 compatible compiler such as GCC 10.2.0 to compile ImHex.
|
||||
|
||||
Many dependencies are bundled into the repository using submodules so make sure to clone it using the `--recurse-submodules` option.
|
||||
All dependencies that aren't bundled, can be installed using the dependency installer scripts found in the `/dist` folder.
|
||||
|
||||
For working examples
|
||||
|
||||
### Windows
|
||||
|
||||
On Windows, ImHex is built through msys2 / mingw. To install all dependencies, open a mys2 window and run the PKGCONFIG script in the [dist/msys2](dist/msys2) folder.
|
||||
After all the dependencies are installed, run the following commands to build ImHex:
|
||||
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
To create a standalone zipfile on Windows, get the Python standard library (e.g. from https://github.com/python/cpython/tree/master/Lib) and place the files and folders in `lib/python3.8` next to your built executable. Don't forget to also copy the `libpython3.8.dll` and `libwinpthread-1.dll` from your mingw setup next to the executable.
|
||||
|
||||
- Copy the files inside the `/resources/lib/python` folder into the `lib` folder next to your built executable.
|
||||
- Place your magic databases in the `magic` folder next to your built executable
|
||||
- Place your patterns in the `pattern` folder next to your built executable
|
||||
- Place your include pattern files in the `include` folder next to your built executable
|
||||
|
||||
### macOS
|
||||
|
||||
To build ImHex on macOS, run the following commands:
|
||||
|
||||
```sh
|
||||
brew bundle --no-lock --file dist/Brewfile
|
||||
mkdir build
|
||||
cd build
|
||||
CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j
|
||||
```
|
||||
|
||||
Install the ImHex executable as well as libimhex.dylib to wherever ImHex should be installed.
|
||||
|
||||
All other files belong in `~/Library/Application Support/imhex`:
|
||||
```
|
||||
Patterns: ~/Library/Application Support/imhex/patterns
|
||||
Pattern Includes: ~/Library/Application Support/imhex/includes
|
||||
Magic files: ~/Library/Application Support/imhex/magic
|
||||
Python: ~/Library/Application Support/imhex/lib/pythonX.X
|
||||
Plugins: ~/Library/Application Support/imhex/plugins
|
||||
Configuration: ~/Library/Application Support/imhex/config
|
||||
Resources: ~/Library/Application Support/imhex/resources
|
||||
```
|
||||
|
||||
If the build fails while trying to find the macOS libraries, make sure you have
|
||||
XCode installed with `xcode-select --install`. Homebrew will also help get the
|
||||
most recent SDK installed and configured with `brew doctor`.
|
||||
|
||||
### Linux
|
||||
|
||||
Dependency installation scripts are available for many common Linux distributions in the [/dist](dist) folder.
|
||||
After all the dependencies are installed, run the following commands to build ImHex:
|
||||
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Put the ImHex executable into the `/usr/bin` folder.
|
||||
Put libimhex.so into the `/usr/lib` folder.
|
||||
Configuration files go to `/etc/xdg/imhex` or `~/.config/imhex`.
|
||||
All other files belong in `/usr/share/imhex` or `~/.local/share/imhex`:
|
||||
|
||||
```
|
||||
Patterns: /usr/share/imhex/patterns
|
||||
Pattern Includes: /usr/share/imhex/includes
|
||||
Magic files: /usr/share/imhex/magic
|
||||
Python: /usr/share/imhex/lib/pythonX.X
|
||||
Plugins: /usr/share/imhex/plugins
|
||||
Configuration: /etc/xdg/imhex/config
|
||||
Resources: /usr/share/imhex/resources
|
||||
```
|
||||
|
||||
All paths follow the XDG Base Directories standard, and can thus be modified
|
||||
with the environment variables `XDG_CONFIG_HOME`, `XDG_CONFIG_DIRS`,
|
||||
`XDG_DATA_HOME` and `XDG_DATA_DIRS`.
|
||||
|
||||
## Credits
|
||||
|
||||
### Contributors
|
||||
|
||||
- [Mary](https://github.com/Thog) for her immense help porting ImHex to MacOS and help during development
|
||||
- [Roblabla](https://github.com/Roblabla) for adding MSI Installer support to ImHex
|
||||
- [jam1garner](https://github.com/jam1garner) and [raytwo](https://github.com/raytwo) for their help with adding Rust support to plugins
|
||||
- All other people that have been reporting issues on Discord or GitHub that I had great conversations with :)
|
||||
|
||||
### Libraries
|
||||
|
||||
- Thanks a lot to ocornut for their amazing [Dear ImGui](https://github.com/ocornut/imgui) which is used for building the entire interface
|
||||
- Thanks to ocornut as well for their hex editor view used as base for this project.
|
||||
- Thanks to BalazsJako for their incredible [ImGuiColorTextEdit](https://github.com/BalazsJako/ImGuiColorTextEdit) used for the pattern language syntax highlighting
|
||||
- Thanks to nlohmann for their [json](https://github.com/nlohmann/json) library used for project files
|
||||
- Thanks to aquynh for [capstone](https://github.com/aquynh/capstone) which is the base of the disassembly window
|
||||
- Thanks to vitaut for their [libfmt](https://github.com/fmtlib/fmt) library which makes formatting and logging so much better
|
||||
- Thanks to rxi for [microtar](https://github.com/rxi/microtar) used for extracting downloaded store assets
|
||||
|
||||
300
cmake/build_helpers.cmake
Normal file
300
cmake/build_helpers.cmake
Normal file
@@ -0,0 +1,300 @@
|
||||
include(FetchContent)
|
||||
|
||||
macro(addVersionDefines)
|
||||
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/.git")
|
||||
# Get the current working branch
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
add_compile_definitions(GIT_COMMIT_HASH="${GIT_COMMIT_HASH}" GIT_BRANCH="${GIT_BRANCH}")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} -DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR} -DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH} ")
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set(IMHEX_VERSION_STRING ${IMHEX_VERSION})
|
||||
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(IMHEX_VERSION_STRING ${IMHEX_VERSION}-Debug)
|
||||
add_compile_definitions(DEBUG)
|
||||
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
set(IMHEX_VERSION_STRING ${IMHEX_VERSION}-RelWithDebInfo)
|
||||
elseif (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||
set(IMHEX_VERSION_STRING ${IMHEX_VERSION}-MinSizeRel)
|
||||
endif ()
|
||||
|
||||
add_compile_definitions(IMHEX_VERSION="${IMHEX_VERSION_STRING}")
|
||||
|
||||
endmacro()
|
||||
|
||||
macro(configurePython)
|
||||
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
|
||||
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
|
||||
|
||||
# Enforce that we use non system Python 3 on macOS.
|
||||
set(Python_FIND_FRAMEWORK NEVER)
|
||||
|
||||
find_package(Python COMPONENTS Development REQUIRED)
|
||||
if(Python_VERSION LESS 3)
|
||||
message(STATUS ${PYTHON_VERSION_MAJOR_MINOR})
|
||||
message(FATAL_ERROR "No valid version of Python 3 was found.")
|
||||
endif()
|
||||
|
||||
string(REPLACE "." ";" PYTHON_VERSION_MAJOR_MINOR ${Python_VERSION})
|
||||
|
||||
list(LENGTH PYTHON_VERSION_MAJOR_MINOR PYTHON_VERSION_COMPONENT_COUNT)
|
||||
|
||||
if (PYTHON_VERSION_COMPONENT_COUNT EQUAL 3)
|
||||
list(REMOVE_AT PYTHON_VERSION_MAJOR_MINOR 2)
|
||||
endif ()
|
||||
list(JOIN PYTHON_VERSION_MAJOR_MINOR "." PYTHON_VERSION_MAJOR_MINOR)
|
||||
|
||||
add_compile_definitions(PYTHON_VERSION_MAJOR_MINOR="${PYTHON_VERSION_MAJOR_MINOR}")
|
||||
endmacro()
|
||||
|
||||
# Detect current OS / System
|
||||
macro(detectOS)
|
||||
if (WIN32)
|
||||
add_compile_definitions(OS_WINDOWS)
|
||||
set(CMAKE_INSTALL_BINDIR ".")
|
||||
set(CMAKE_INSTALL_LIBDIR ".")
|
||||
set(PLUGINS_INSTALL_LOCATION "plugins")
|
||||
set(MAGIC_INSTALL_LOCATION "magic")
|
||||
elseif (APPLE)
|
||||
add_compile_definitions(OS_MACOS)
|
||||
set(CMAKE_INSTALL_BINDIR ".")
|
||||
set(CMAKE_INSTALL_LIBDIR ".")
|
||||
set(PLUGINS_INSTALL_LOCATION "plugins")
|
||||
set(MAGIC_INSTALL_LOCATION "magic")
|
||||
elseif (UNIX AND NOT APPLE)
|
||||
add_compile_definitions(OS_LINUX)
|
||||
set(CMAKE_INSTALL_BINDIR "bin")
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
set(PLUGINS_INSTALL_LOCATION "share/imhex/plugins")
|
||||
set(MAGIC_INSTALL_LOCATION "share/imhex/magic")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unknown / unsupported system!")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Detect 32 vs. 64 bit system
|
||||
macro(detectArch)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_compile_definitions(ARCH_64_BIT)
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
add_compile_definitions(ARCH_32_BIT)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(configurePackingResources)
|
||||
option (CREATE_PACKAGE "Create a package with CPack" OFF)
|
||||
|
||||
if (APPLE)
|
||||
option (CREATE_BUNDLE "Create a bundle on macOS" OFF)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set(APPLICATION_TYPE)
|
||||
set(IMHEX_ICON "${IMHEX_BASE_FOLDER}/resources/resource.rc")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-subsystem,windows")
|
||||
|
||||
if (CREATE_PACKAGE)
|
||||
set(CPACK_GENERATOR "WIX")
|
||||
set(CPACK_PACKAGE_NAME "ImHex")
|
||||
set(CPACK_PACKAGE_VENDOR "WerWolv")
|
||||
set(CPACK_WIX_UPGRADE_GUID "05000E99-9659-42FD-A1CF-05C554B39285")
|
||||
set(CPACK_WIX_PRODUCT_ICON "${PROJECT_SOURCE_DIR}/resources/icon.ico")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ImHex")
|
||||
set_property(INSTALL "$<TARGET_FILE_NAME:main>"
|
||||
PROPERTY CPACK_START_MENU_SHORTCUTS "ImHex"
|
||||
)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/resources/LICENSE.rtf")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
set (IMHEX_ICON "${IMHEX_BASE_FOLDER}/resources/AppIcon.icns")
|
||||
|
||||
if (CREATE_BUNDLE)
|
||||
set(APPLICATION_TYPE MACOSX_BUNDLE)
|
||||
set_source_files_properties(${IMHEX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set(MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
|
||||
set(MACOSX_BUNDLE_INFO_STRING "WerWolv")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "ImHex")
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "WerWolv.ImHex")
|
||||
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}-${GIT_COMMIT_HASH}")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2020 WerWolv and Thog. All rights reserved." )
|
||||
if ("${CMAKE_GENERATOR}" STREQUAL "Xcode")
|
||||
set ( bundle_path "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/imhex.app" )
|
||||
else ()
|
||||
set ( bundle_path "${CMAKE_BINARY_DIR}/imhex.app" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(createPackage)
|
||||
file(MAKE_DIRECTORY "plugins")
|
||||
foreach (plugin IN LISTS PLUGINS)
|
||||
add_subdirectory("plugins/${plugin}")
|
||||
if (TARGET ${plugin})
|
||||
set_target_properties(${plugin} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
|
||||
set_target_properties(${plugin} PROPERTIES CARGO_BUILD_TARGET_DIR ${CMAKE_BINARY_DIR}/plugins)
|
||||
|
||||
get_target_property(IS_RUST_PROJECT ${plugin} RUST_PROJECT)
|
||||
|
||||
if (IS_RUST_PROJECT)
|
||||
set_target_properties(${plugin} PROPERTIES CARGO_BUILD_TARGET_DIR ${CMAKE_BINARY_DIR}/plugins)
|
||||
|
||||
get_target_property(PLUGIN_LOCATION ${plugin} LOCATION)
|
||||
|
||||
install(FILES "${PLUGIN_LOCATION}/../${plugin}.hexplug" DESTINATION "${PLUGINS_INSTALL_LOCATION}")
|
||||
else ()
|
||||
set_target_properties(${plugin} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
|
||||
if (WIN32)
|
||||
install(TARGETS ${plugin} RUNTIME DESTINATION ${PLUGINS_INSTALL_LOCATION})
|
||||
elseif (APPLE)
|
||||
if (CREATE_BUNDLE)
|
||||
set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:main>/${PLUGINS_INSTALL_LOCATION})
|
||||
else ()
|
||||
set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
|
||||
endif ()
|
||||
else ()
|
||||
install(TARGETS ${plugin} LIBRARY DESTINATION ${PLUGINS_INSTALL_LOCATION})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
add_dependencies(imhex_all ${plugin})
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
install(FILES "$<TARGET_FILE:libimhex>" DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
set_target_properties(libimhex PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
if (WIN32)
|
||||
# Install binaries directly in the prefix, usually C:\Program Files\ImHex.
|
||||
set(CMAKE_INSTALL_BINDIR ".")
|
||||
|
||||
# Grab all dynamically linked dependencies.
|
||||
INSTALL(CODE "set(CMAKE_INSTALL_BINDIR \"${CMAKE_INSTALL_BINDIR}\")")
|
||||
INSTALL(CODE "get_filename_component(PY_PARENT \"${Python_LIBRARIES}\" DIRECTORY)")
|
||||
INSTALL(CODE "LIST(APPEND DEP_FOLDERS \${PY_PARENT})")
|
||||
install(CODE [[
|
||||
file(GET_RUNTIME_DEPENDENCIES
|
||||
EXECUTABLES $<TARGET_FILE:builtin> $<TARGET_FILE:libimhex> $<TARGET_FILE:main>
|
||||
RESOLVED_DEPENDENCIES_VAR _r_deps
|
||||
UNRESOLVED_DEPENDENCIES_VAR _u_deps
|
||||
CONFLICTING_DEPENDENCIES_PREFIX _c_deps
|
||||
DIRECTORIES ${DEP_FOLDERS} $ENV{PATH}
|
||||
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
|
||||
)
|
||||
|
||||
if(_u_deps)
|
||||
message(WARNING "There were unresolved dependencies for binary: \"${_u_deps}\"!")
|
||||
endif()
|
||||
if(_c_deps_FILENAMES)
|
||||
message(WARNING "There were conflicting dependencies for library: \"${_c_deps}\"!")
|
||||
endif()
|
||||
|
||||
foreach(_file ${_r_deps})
|
||||
file(INSTALL
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
|
||||
TYPE SHARED_LIBRARY
|
||||
FOLLOW_SYMLINK_CHAIN
|
||||
FILES "${_file}"
|
||||
)
|
||||
endforeach()
|
||||
]])
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png)
|
||||
endif()
|
||||
|
||||
if (CREATE_BUNDLE)
|
||||
include(PostprocessBundle)
|
||||
|
||||
# Fix rpath
|
||||
add_custom_command(TARGET imhex_all POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/" $<TARGET_FILE:main>)
|
||||
|
||||
# FIXME: Remove this once we move/integrate the plugins directory.
|
||||
add_custom_target(build-time-make-plugins-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${bundle_path}/Contents/MacOS/plugins")
|
||||
add_custom_target(build-time-make-resources-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${bundle_path}/Contents/Resources")
|
||||
|
||||
install(FILES ${IMHEX_ICON} DESTINATION "${bundle_path}/Contents/Resources")
|
||||
|
||||
# Update library references to make the bundle portable
|
||||
postprocess_bundle(imhex_all main)
|
||||
|
||||
# Enforce DragNDrop packaging.
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
|
||||
install(TARGETS main BUNDLE DESTINATION .)
|
||||
else()
|
||||
install(TARGETS main RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
|
||||
if (CREATE_PACKAGE)
|
||||
include(apple)
|
||||
include(CPack)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(JOIN OUTPUT GLUE)
|
||||
set(_TMP_RESULT "")
|
||||
set(_GLUE "") # effective glue is empty at the beginning
|
||||
foreach(arg ${ARGN})
|
||||
set(_TMP_RESULT "${_TMP_RESULT}${_GLUE}${arg}")
|
||||
set(_GLUE "${GLUE}")
|
||||
endforeach()
|
||||
set(${OUTPUT} "${_TMP_RESULT}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(setDefaultBuiltTypeIfUnset)
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Using Release build type as it was left unset" FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(detectBadClone)
|
||||
file (GLOB EXTERNAL_DIRS "lib/external/*")
|
||||
foreach (EXTERNAL_DIR ${EXTERNAL_DIRS})
|
||||
file(GLOB RESULT "${EXTERNAL_DIR}/*")
|
||||
list(LENGTH RESULT ENTRY_COUNT)
|
||||
if(ENTRY_COUNT LESS_EQUAL 1)
|
||||
message(FATAL_ERROR "External dependency ${EXTERNAL_DIR} is empty!\nMake sure to correctly clone ImHex using the --recurse-submodules git option or initialize the submodules manually.")
|
||||
endif()
|
||||
endforeach ()
|
||||
endmacro()
|
||||
|
||||
|
||||
function(downloadImHexPatternsFiles)
|
||||
FetchContent_Declare(
|
||||
imhex_patterns
|
||||
GIT_REPOSITORY https://github.com/WerWolv/ImHex-Patterns.git
|
||||
GIT_TAG master
|
||||
)
|
||||
|
||||
FetchContent_Populate(imhex_patterns)
|
||||
|
||||
set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic)
|
||||
foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
|
||||
install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "./")
|
||||
endforeach()
|
||||
|
||||
endfunction()
|
||||
70
cmake/modules/FindmbedTLS.cmake
Normal file
70
cmake/modules/FindmbedTLS.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# - Try to find mbedTLS
|
||||
# Once done this will define
|
||||
#
|
||||
# Read-Only variables
|
||||
# MBEDTLS_FOUND - system has mbedTLS
|
||||
# MBEDTLS_INCLUDE_DIR - the mbedTLS include directory
|
||||
# MBEDTLS_LIBRARY_DIR - the mbedTLS library directory
|
||||
# MBEDTLS_LIBRARIES - Link these to use mbedTLS
|
||||
# MBEDTLS_LIBRARY - path to mbedTLS library
|
||||
# MBEDX509_LIBRARY - path to mbedTLS X.509 library
|
||||
# MBEDCRYPTO_LIBRARY - path to mbedTLS Crypto library
|
||||
|
||||
# Copyright (c) 2004-2007 Sara Golemon <sarag@libssh2.org>
|
||||
# Copyright (c) 2005,2006 Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
# Copyright (c) 2006-2007 The Written Word, Inc.
|
||||
# Copyright (c) 2007 Eli Fant <elifantu@mail.ru>
|
||||
# Copyright (c) 2009-2019 Daniel Stenberg
|
||||
# Copyright (C) 2008, 2009 Simon Josefsson
|
||||
# All rights reserved.
|
||||
|
||||
|
||||
FIND_PATH(MBEDTLS_INCLUDE_DIR mbedtls/version.h)
|
||||
|
||||
SET(MBEDTLS_FIND_QUIETLY TRUE)
|
||||
|
||||
FIND_LIBRARY(MBEDTLS_LIBRARY NAMES mbedtls libmbedtls libmbedx509)
|
||||
FIND_LIBRARY(MBEDX509_LIBRARY NAMES mbedx509 libmbedx509)
|
||||
FIND_LIBRARY(MBEDCRYPTO_LIBRARY NAMES mbedcrypto libmbedcrypto)
|
||||
|
||||
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY)
|
||||
SET(MBEDTLS_FOUND TRUE)
|
||||
ENDIF()
|
||||
|
||||
IF(MBEDTLS_FOUND)
|
||||
# split mbedTLS into -L and -l linker options, so we can set them for pkg-config
|
||||
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_DIR ${MBEDTLS_LIBRARY} PATH)
|
||||
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE)
|
||||
STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE})
|
||||
STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE})
|
||||
STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
|
||||
SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}")
|
||||
|
||||
IF(NOT MBEDTLS_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found mbedTLS:")
|
||||
FILE(READ ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLSCONTENT)
|
||||
STRING(REGEX MATCH "MBEDTLS_VERSION_STRING +\"[0-9|.]+\"" MBEDTLSMATCH ${MBEDTLSCONTENT})
|
||||
IF (MBEDTLSMATCH)
|
||||
STRING(REGEX REPLACE "MBEDTLS_VERSION_STRING +\"([0-9|.]+)\"" "\\1" MBEDTLS_VERSION ${MBEDTLSMATCH})
|
||||
MESSAGE(STATUS " version ${MBEDTLS_VERSION}")
|
||||
ENDIF(MBEDTLSMATCH)
|
||||
MESSAGE(STATUS " TLS: ${MBEDTLS_LIBRARY}")
|
||||
MESSAGE(STATUS " X509: ${MBEDX509_LIBRARY}")
|
||||
MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}")
|
||||
ENDIF(NOT MBEDTLS_FIND_QUIETLY)
|
||||
ELSE(MBEDTLS_FOUND)
|
||||
IF(MBEDTLS_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find mbedTLS")
|
||||
ENDIF(MBEDTLS_FIND_REQUIRED)
|
||||
ENDIF(MBEDTLS_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
MBEDTLS_INCLUDE_DIR
|
||||
MBEDTLS_LIBRARY_DIR
|
||||
MBEDTLS_LIBRARIES
|
||||
MBEDTLS_LIBRARY
|
||||
MBEDX509_LIBRARY
|
||||
MBEDCRYPTO_LIBRARY
|
||||
)
|
||||
61
cmake/modules/PostprocessBundle.cmake
Normal file
61
cmake/modules/PostprocessBundle.cmake
Normal file
@@ -0,0 +1,61 @@
|
||||
# Adapted from the Dolphin project: https://dolphin-emu.org/
|
||||
# This module can be used in two different ways.
|
||||
#
|
||||
# When invoked as `cmake -P PostprocessBundle.cmake`, it fixes up an
|
||||
# application folder to be standalone. It bundles all required libraries from
|
||||
# the system and fixes up library IDs. Any additional shared libraries, like
|
||||
# plugins, that are found under Contents/MacOS/ will be made standalone as well.
|
||||
#
|
||||
# When called with `include(PostprocessBundle)`, it defines a helper
|
||||
# function `postprocess_bundle` that sets up the command form of the
|
||||
# module as a post-build step.
|
||||
|
||||
if(CMAKE_GENERATOR)
|
||||
# Being called as include(PostprocessBundle), so define a helper function.
|
||||
set(_POSTPROCESS_BUNDLE_MODULE_LOCATION "${CMAKE_CURRENT_LIST_FILE}")
|
||||
function(postprocess_bundle out_target in_target)
|
||||
add_custom_command(TARGET ${out_target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -DBUNDLE_PATH="$<TARGET_FILE_DIR:${in_target}>/../.." -DCODE_SIGN_CERTIFICATE_ID="${CODE_SIGN_CERTIFICATE_ID}"
|
||||
-P "${_POSTPROCESS_BUNDLE_MODULE_LOCATION}"
|
||||
)
|
||||
endfunction()
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_filename_component(BUNDLE_PATH "${BUNDLE_PATH}" ABSOLUTE)
|
||||
message(STATUS "Fixing up application bundle: ${BUNDLE_PATH}")
|
||||
|
||||
|
||||
# Make sure to fix up any included ImHex plugin.
|
||||
file(GLOB_RECURSE extra_libs "${BUNDLE_PATH}/Contents/MacOS/plugins/*.hexplug")
|
||||
|
||||
message(STATUS "Fixing up application bundle: ${extra_dirs}")
|
||||
|
||||
# BundleUtilities doesn't support DYLD_FALLBACK_LIBRARY_PATH behavior, which
|
||||
# makes it sometimes break on libraries that do weird things with @rpath. Specify
|
||||
# equivalent search directories until https://gitlab.kitware.com/cmake/cmake/issues/16625
|
||||
# is fixed and in our minimum CMake version.
|
||||
set(extra_dirs "/usr/local/lib" "/lib" "/usr/lib")
|
||||
|
||||
# BundleUtilities is overly verbose, so disable most of its messages
|
||||
function(message)
|
||||
if(NOT ARGV MATCHES "^STATUS;")
|
||||
_message(${ARGV})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
include(BundleUtilities)
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
fixup_bundle("${BUNDLE_PATH}" "${extra_libs}" "${extra_dirs}" IGNORE_ITEM "Python")
|
||||
|
||||
if (CODE_SIGN_CERTIFICATE_ID)
|
||||
# Hack around Apple Silicon signing bugs by copying the real app, signing it and moving it back.
|
||||
# IMPORTANT: DON'T USE ${CMAKE_COMMAND} -E copy_directory HERE (this follow symbolic links).
|
||||
execute_process(COMMAND cp -R "${BUNDLE_PATH}" "${BUNDLE_PATH}.temp")
|
||||
execute_process(COMMAND codesign --deep --force --sign "${CODE_SIGN_CERTIFICATE_ID}" "${BUNDLE_PATH}.temp")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${BUNDLE_PATH}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename "${BUNDLE_PATH}.temp" "${BUNDLE_PATH}")
|
||||
endif()
|
||||
|
||||
# Add a necessary rpath to the imhex binary
|
||||
get_bundle_main_executable("${BUNDLE_PATH}" IMHEX_EXECUTABLE)
|
||||
3
cmake/modules/apple.cmake
Normal file
3
cmake/modules/apple.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
set (CPACK_BUNDLE_NAME "ImHex")
|
||||
set (CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/resources/AppIcon.icns" )
|
||||
set (CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/ImHex.app/Contents/Info.plist")
|
||||
40
dist/AppImage/Dockerfile
vendored
Normal file
40
dist/AppImage/Dockerfile
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
FROM debian:bullseye-slim
|
||||
LABEL maintainer Example <example@example.com>
|
||||
|
||||
ARG TAG=master
|
||||
ARG REPO=https://github.com/WerWolv/ImHex.git
|
||||
|
||||
USER root
|
||||
|
||||
# Bring packages up to date
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get install -y \
|
||||
git \
|
||||
cmake \
|
||||
curl \
|
||||
squashfs-tools
|
||||
|
||||
# Fetch source and dependencies
|
||||
RUN mkdir -p /source \
|
||||
&& cd /source \
|
||||
&& git clone $REPO \
|
||||
&& cd ImHex \
|
||||
&& git checkout $TAG \
|
||||
&& git submodule update --init --recursive \
|
||||
&& cd /source/ImHex/dist \
|
||||
&& ./get_deps_debian.sh
|
||||
|
||||
ARG CXX=g++-10
|
||||
|
||||
# Build ImHex
|
||||
RUN mkdir -p /source/ImHex/build \
|
||||
&& cd /source/ImHex/build \
|
||||
&& cmake --install-prefix /usr -DCMAKE_BUILD_TYPE=Release .. \
|
||||
&& make -j
|
||||
|
||||
# Prepare for AppImage
|
||||
RUN cd /source/ImHex/dist/AppImage \
|
||||
&& ./package.sh /source/ImHex/build \
|
||||
&& mv /source/ImHex/build/ImHex-x86_64.AppImage /
|
||||
6
dist/AppImage/ImHex.desktop
vendored
Normal file
6
dist/AppImage/ImHex.desktop
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Name=ImHex
|
||||
Exec=imhex
|
||||
Icon=imhex
|
||||
Type=Application
|
||||
Categories=Utility;
|
||||
22
dist/AppImage/README.md
vendored
Normal file
22
dist/AppImage/README.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Building an AppImage
|
||||
There are two ways of building an AppImage for ImHex, using the provided
|
||||
tools here.
|
||||
|
||||
If you want to create an AppImage and do not have a build to work from
|
||||
already, you can use docker to build ImHex and package an AppImage.
|
||||
|
||||
Alternatively you can create an AppImage using an existing build.
|
||||
|
||||
## Using docker
|
||||
First run `build.sh` to create a docker image. Then run `extract.sh` to get the
|
||||
AppImage out. This needs to be in two steps, as a docker build cannot copy
|
||||
files out. Nor can docker build use volume mounts.
|
||||
|
||||
The environment variable TAG can be set to build for a specific git tag.
|
||||
Without the master branch is build.
|
||||
|
||||
## Using an existing build
|
||||
Run `package.sh` with the build dir as an argument. E.g.:
|
||||
```
|
||||
./package.sh ../../build
|
||||
```
|
||||
16
dist/AppImage/build.sh
vendored
Executable file
16
dist/AppImage/build.sh
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the TAG environment variable to build a specific tag
|
||||
# Set the REPO environment variable to point at a different git repository
|
||||
|
||||
# Make sure we're in the same directory as this script
|
||||
pushd $(dirname "$(realpath "$0")")
|
||||
|
||||
BUILDARG=""
|
||||
SUFFIX=""
|
||||
[ -n "${TAG}" ] && BUILDARG="${BUILDARG} --build-arg=TAG=${TAG}" && SUFFIX=":${TAG}"
|
||||
[ -n "${REPO}" ] && BUILDARG="${BUILDARG} --build-arg=REPO=${REPO}"
|
||||
|
||||
docker build ${BUILDARG} -t imhex-appimage-build${SUFFIX} .
|
||||
|
||||
popd
|
||||
26
dist/AppImage/extract.sh
vendored
Executable file
26
dist/AppImage/extract.sh
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the TAG environment variable to move to a versioned name while extracting
|
||||
|
||||
# Make sure we're in the same directory as this script
|
||||
pushd $(dirname "$(realpath "$0")")
|
||||
|
||||
SUFFIX=""
|
||||
[ -n "$TAG" ] && SUFFIX=":$TAG"
|
||||
|
||||
# Remove old containers
|
||||
docker rm imhex 2>&1 > /dev/null
|
||||
|
||||
docker run -d --name imhex imhex-appimage-build${SUFFIX} sleep 30 &
|
||||
sleep 15
|
||||
docker cp imhex:/ImHex-x86_64.AppImage .
|
||||
|
||||
# Move to tagged name if $TAG set
|
||||
if [ -n "$TAG" ]; then
|
||||
mv ImHex-x86_64.AppImage ImHex-${TAG}-x86_64.AppImage
|
||||
echo -e "\nThe created AppImage can be found here:\n $(pwd)/ImHex-${TAG}-x86_64.AppImage\n\n"
|
||||
else
|
||||
echo -e "\nThe created AppImage can be found here:\n $(pwd)/ImHex-x86_64.AppImage\n\n"
|
||||
fi
|
||||
|
||||
popd
|
||||
BIN
dist/AppImage/imhex.png
vendored
Normal file
BIN
dist/AppImage/imhex.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
58
dist/AppImage/package.sh
vendored
Executable file
58
dist/AppImage/package.sh
vendored
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
set -e # Exit on error
|
||||
set -o pipefail # Bash specific
|
||||
|
||||
usage() {
|
||||
echo "Tool to package an ImHex build into an AppImage"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo "$0 <build dir>"
|
||||
echo
|
||||
exit
|
||||
}
|
||||
|
||||
MYDIR=$(dirname "$(realpath "$0")")
|
||||
|
||||
# Check is a build dir has been specified and it's a dir
|
||||
[ -z "$1" ] && usage
|
||||
[ -d "$1" ] || usage
|
||||
|
||||
set -u # Throw errors when unset variables are used
|
||||
|
||||
BUILDDIR=$1
|
||||
APPDIR=${BUILDDIR}/ImHex.AppDir
|
||||
APPIMAGE=${BUILDDIR}/ImHex-x86_64.AppImage
|
||||
|
||||
# Prepare for AppImage
|
||||
## Fetch the needed AppImage binaries
|
||||
curl -L https://github.com/AppImage/AppImageKit/releases/download/13/AppRun-x86_64 -o ${MYDIR}/AppRun-x86_64
|
||||
curl -L https://github.com/AppImage/AppImageKit/releases/download/13/runtime-x86_64 -o ${MYDIR}/runtime-x86_64
|
||||
|
||||
## Setup directory structure
|
||||
mkdir -p ${BUILDDIR}/ImHex.AppDir/usr/{bin,lib} ${BUILDDIR}/ImHex.AppDir/usr/share/imhex/plugins
|
||||
|
||||
## Add ImHex files to structure
|
||||
cp ${BUILDDIR}/imhex ${APPDIR}/usr/bin
|
||||
cp ${BUILDDIR}/plugins/builtin/builtin.hexplug ${APPDIR}/usr/share/imhex/plugins
|
||||
cp ${MYDIR}/{AppRun-x86_64,ImHex.desktop,imhex.png} ${APPDIR}/
|
||||
mv ${BUILDDIR}/ImHex.AppDir/AppRun-x86_64 ${APPDIR}/AppRun
|
||||
chmod a+x ${BUILDDIR}/ImHex.AppDir/AppRun
|
||||
|
||||
## Add all dependencies
|
||||
ldd ${BUILDDIR}/imhex | awk '/ => /{print $3}' | awk '!/(libc|libstdc++|libc++|libdl|libpthread|libselinux|ld-linux|libgdk)/' | xargs -I '{}' cp '{}' ${APPDIR}/usr/lib
|
||||
ldd ${BUILDDIR}/plugins/builtin/builtin.hexplug | awk '/ => /{print $3}' | awk '!/(libc|libstdc++|libc++|libdl|libpthread|libselinux|ld-linux|libgdk)/' | xargs -I '{}' cp '{}' ${APPDIR}/usr/lib
|
||||
ldd ${BUILDDIR}/lib/libimhex/libimhex.so | awk '/ => /{print $3}' | awk '!/(libc|libstdc++|libc++|libdl|libpthread|libselinux|ld-linux|libgdk)/' | xargs -I '{}' cp '{}' ${APPDIR}/usr/lib
|
||||
|
||||
# Package it up as described here:
|
||||
# https://github.com/AppImage/AppImageKit#appimagetool-usage
|
||||
# under 'If you want to generate an AppImage manually'
|
||||
# This builds a v2 AppImage according to
|
||||
# https://github.com/AppImage/AppImageSpec/blob/master/draft.md#type-2-image-format
|
||||
mksquashfs ${APPDIR} ${BUILDDIR}/ImHex.squashfs -root-owned -noappend
|
||||
cat ${MYDIR}/runtime-x86_64 > ${APPIMAGE}
|
||||
cat ${BUILDDIR}/ImHex.squashfs >> ${APPIMAGE}
|
||||
chmod a+x ${APPIMAGE}
|
||||
|
||||
if [ ! -f /.dockerenv ]; then
|
||||
echo -e "\nThe created AppImage can be found here:\n ${APPIMAGE}\n\n"
|
||||
fi
|
||||
12
dist/Brewfile
vendored
Normal file
12
dist/Brewfile
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
brew "glfw"
|
||||
brew "mbedtls"
|
||||
brew "nlohmann-json"
|
||||
brew "cmake"
|
||||
brew "ccache"
|
||||
brew "python3"
|
||||
brew "freetype2"
|
||||
brew "libmagic"
|
||||
brew "pkg-config"
|
||||
|
||||
# TODO: Remove this when XCode version of clang will support the same level as LLVM 10
|
||||
brew "llvm"
|
||||
12
dist/DEBIAN/control.in
vendored
Normal file
12
dist/DEBIAN/control.in
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
Package: ImHex
|
||||
Version: ${PROJECT_VERSION}
|
||||
Section: editors
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
License: GNU GPL-2
|
||||
Depends: libglfw3-dev, libmagic-dev, libmbedtls-dev, libcapstone-dev, python3-dev, libfreetype-dev, libgtk-3-dev, libldap2-dev
|
||||
Maintainer: WerWolv <hey@werwolv.net>
|
||||
Description: ImHex Hex Editor
|
||||
A Hex Editor for Reverse Engineers, Programmers and
|
||||
people who value their retinas when working at 3 AM.
|
||||
|
||||
11
dist/DEBIAN/imhex.desktop
vendored
Normal file
11
dist/DEBIAN/imhex.desktop
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name=ImHex
|
||||
Comment=ImHex Hex Editor
|
||||
GenericName=Hex Editor
|
||||
Exec=/usr/bin/imhex %U
|
||||
Icon=/usr/share/pixmaps/imhex.png
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Development;
|
||||
StartupWMClass=imhex
|
||||
|
||||
27
dist/Dockerfile
vendored
Normal file
27
dist/Dockerfile
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM archlinux:latest
|
||||
|
||||
MAINTAINER WerWolv "hey@werwolv.net"
|
||||
|
||||
# Install dependencies
|
||||
RUN pacman -Syy --needed --noconfirm
|
||||
RUN pacman -S --needed --noconfirm \
|
||||
git \
|
||||
cmake \
|
||||
base-devel \
|
||||
gcc \
|
||||
pkg-config \
|
||||
glfw-x11 \
|
||||
file \
|
||||
mbedtls \
|
||||
python3 \
|
||||
freetype2 \
|
||||
gtk3
|
||||
|
||||
# Clone ImHex
|
||||
RUN git clone https://github.com/WerWolv/ImHex --recurse-submodules /root/ImHex
|
||||
|
||||
# Build ImHex
|
||||
RUN mkdir /root/ImHex/build
|
||||
WORKDIR /root/ImHex/build
|
||||
RUN cmake .. && make -j
|
||||
WORKDIR /root/ImHex
|
||||
32
dist/ImHex-9999.ebuild
vendored
Normal file
32
dist/ImHex-9999.ebuild
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# app-editors/ImHex
|
||||
# Copyright 2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
DESCRIPTION="A hex editor for reverse engineers, programmers, and eyesight"
|
||||
HOMEPAGE="https://github.com/WerWolv/ImHex"
|
||||
SRC_URI=""
|
||||
EGIT_REPO_URI="https://github.com/WerWolv/ImHex.git"
|
||||
|
||||
PYTHON_COMPAT=( python3_{6,7,8,9} )
|
||||
|
||||
inherit git-r3 python-single-r1 cmake
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE=""
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="${DEPEND}
|
||||
${PYTHON_DEPS}
|
||||
media-libs/glfw
|
||||
sys-apps/file
|
||||
dev-libs/mbedtls
|
||||
dev-cpp/nlohmann_json
|
||||
x11-libs/gtk+
|
||||
"
|
||||
BDEPEND="${DEPEND}"
|
||||
12
dist/get_deps_archlinux.sh
vendored
Executable file
12
dist/get_deps_archlinux.sh
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
pacman -S --needed \
|
||||
cmake \
|
||||
gcc \
|
||||
lld \
|
||||
glfw \
|
||||
file \
|
||||
mbedtls \
|
||||
python3 \
|
||||
freetype2 \
|
||||
gtk3
|
||||
31
dist/get_deps_debian.sh
vendored
Executable file
31
dist/get_deps_debian.sh
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
echo "As of 2020-12, Debian stable does not include g++-10, needs debian testing or unstable."
|
||||
|
||||
# Tested on 2020-12-09 with Docker image bitnami/minideb:unstable
|
||||
|
||||
# Install pkgconf (adds minimum dependencies) only if the equivalent pkf-config is not already installed.
|
||||
if ! which pkg-config
|
||||
then
|
||||
PKGCONF="pkgconf"
|
||||
fi
|
||||
|
||||
apt install -y \
|
||||
build-essential \
|
||||
gcc-10 \
|
||||
g++-10 \
|
||||
lld \
|
||||
${PKGCONF:-} \
|
||||
cmake \
|
||||
make \
|
||||
ccache \
|
||||
libglfw3-dev \
|
||||
libglm-dev \
|
||||
libmagic-dev \
|
||||
libmbedtls-dev \
|
||||
python3-dev \
|
||||
libfreetype-dev \
|
||||
libgtk-3-dev \
|
||||
|
||||
echo "Please consider this before running cmake (useful on e.g. Ubuntu 20.04):"
|
||||
echo "export CXX=g++-10"
|
||||
13
dist/get_deps_fedora.sh
vendored
Executable file
13
dist/get_deps_fedora.sh
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
dnf install \
|
||||
cmake \
|
||||
gcc-c++ \
|
||||
lld \
|
||||
file-devel \
|
||||
glfw-devel \
|
||||
mesa-libGL-devel \
|
||||
mbedtls-devel \
|
||||
python-devel \
|
||||
freetype-devel \
|
||||
gtk3-devel
|
||||
14
dist/get_deps_msys2.sh
vendored
Executable file
14
dist/get_deps_msys2.sh
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
pacman -S --needed --noconfirm \
|
||||
mingw-w64-x86_64-gcc \
|
||||
mingw-w64-x86_64-lld \
|
||||
mingw-w64-x86_64-cmake \
|
||||
mingw-w64-x86_64-make \
|
||||
mingw-w64-x86_64-ccache \
|
||||
mingw-w64-x86_64-glfw \
|
||||
mingw-w64-x86_64-file \
|
||||
mingw-w64-x86_64-mbedtls \
|
||||
mingw-w64-x86_64-python \
|
||||
mingw-w64-x86_64-freetype \
|
||||
mingw-w64-x86_64-dlfcn
|
||||
11
dist/imhex.desktop
vendored
Normal file
11
dist/imhex.desktop
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name=ImHex
|
||||
Comment=ImHex Hex Editor
|
||||
GenericName=Hex Editor
|
||||
Exec=/usr/bin/imhex %U
|
||||
Icon=/usr/share/pixmaps/imhex.png
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;GTK;Development;
|
||||
StartupWMClass=imhex
|
||||
|
||||
45
dist/msys2/PKGBUILD
vendored
Normal file
45
dist/msys2/PKGBUILD
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
_realname=ImHex
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
pkgver=ci
|
||||
pkgrel=1
|
||||
pkgdesc="${_realname}: a Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM (mingw-w64)"
|
||||
arch=('any')
|
||||
url="https://github.com/WerWolv/ImHex"
|
||||
license=('GPLv2')
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
||||
"${MINGW_PACKAGE_PREFIX}-lld"
|
||||
"${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-make"
|
||||
"${MINGW_PACKAGE_PREFIX}-dlfcn"
|
||||
"${MINGW_PACKAGE_PREFIX}-glfw"
|
||||
"${MINGW_PACKAGE_PREFIX}-file"
|
||||
"${MINGW_PACKAGE_PREFIX}-mbedtls"
|
||||
"${MINGW_PACKAGE_PREFIX}-polly"
|
||||
"${MINGW_PACKAGE_PREFIX}-python"
|
||||
"${MINGW_PACKAGE_PREFIX}-freetype")
|
||||
|
||||
source=()
|
||||
sha256sums=()
|
||||
|
||||
build() {
|
||||
cd "${srcdir}"/../..
|
||||
mkdir build
|
||||
cd build
|
||||
export BUILD_TYPE='Release'
|
||||
MSYS2_ARG_CONV_EXCL=- cmake \
|
||||
-G "MinGW Makefiles" \
|
||||
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
|
||||
../../
|
||||
mingw32-make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}"/../../build
|
||||
mingw32-make DESTDIR="${pkgdir}" install
|
||||
|
||||
_licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}"
|
||||
mkdir -p "${_licenses}"
|
||||
install -m 644 ../LICENSE "${_licenses}"
|
||||
}
|
||||
61
dist/net.werwolv.ImHex.yaml
vendored
Normal file
61
dist/net.werwolv.ImHex.yaml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
app-id: net.werwolv.ImHex
|
||||
runtime: org.freedesktop.Platform
|
||||
runtime-version: '20.08'
|
||||
default-branch: stable
|
||||
sdk: org.freedesktop.Sdk
|
||||
command: imhex
|
||||
|
||||
finish-args:
|
||||
- --share=ipc
|
||||
- --socket=x11
|
||||
- --filesystem=host
|
||||
- --device=all
|
||||
|
||||
modules:
|
||||
- name: libiconv
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
|
||||
sha256: e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04
|
||||
|
||||
- name: glfw
|
||||
buildsystem: cmake-ninja
|
||||
builddir: true
|
||||
config-opts:
|
||||
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
- -DBUILD_SHARED_LIBS:BOOL=ON
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip
|
||||
sha256: 08a33a512f29d7dbf78eab39bd7858576adcc95228c9efe8e4bc5f0f3261efc7
|
||||
cleanup:
|
||||
- /include
|
||||
- /lib/pkgconfig
|
||||
|
||||
- name: mbedtls
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
- -DCMAKE_C_FLAGS=-fPIC
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://github.com/ARMmbed/mbedtls/archive/refs/tags/v2.27.0.tar.gz
|
||||
sha256: 2a07856e541f0e5f6eaee4f78018c52f25bd244ed76f9020dea54a8b02cac6ea
|
||||
|
||||
- name: nlohmann-json
|
||||
buildsystem: cmake-ninja
|
||||
builddir: true
|
||||
config-opts:
|
||||
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
- -DBUILD_TESTING=OFF
|
||||
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://github.com/nlohmann/json/archive/v3.9.1.tar.gz
|
||||
sha256: 4cf0df69731494668bdd6460ed8cb269b68de9c19ad8c27abc24cd72605b2d5b
|
||||
|
||||
- name: imhex
|
||||
buildsystem: cmake
|
||||
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/WerWolv/ImHex.git
|
||||
@@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
u16 crc16(prv::Provider* &data, u64 offset, size_t size, u16 polynomial, u16 init);
|
||||
u32 crc32(prv::Provider* &data, u64 offset, size_t size, u32 polynomial, u32 init);
|
||||
|
||||
std::array<u32, 4> md4(prv::Provider* &data, u64 offset, size_t size);
|
||||
std::array<u32, 4> md5(prv::Provider* &data, u64 offset, size_t size);
|
||||
std::array<u32, 5> sha1(prv::Provider* &data, u64 offset, size_t size);
|
||||
std::array<u32, 7> sha224(prv::Provider* &data, u64 offset, size_t size);
|
||||
std::array<u32, 8> sha256(prv::Provider* &data, u64 offset, size_t size);
|
||||
std::array<u32, 12> sha384(prv::Provider* &data, u64 offset, size_t size);
|
||||
std::array<u32, 16> sha512(prv::Provider* &data, u64 offset, size_t size);
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
namespace hex {
|
||||
|
||||
enum class Events {
|
||||
DataChanged,
|
||||
PatternChanged,
|
||||
FileDropped,
|
||||
ByteSelected
|
||||
};
|
||||
|
||||
struct EventHandler {
|
||||
void *sender;
|
||||
Events eventType;
|
||||
std::function<void(const void*)> callback;
|
||||
};
|
||||
|
||||
class EventManager {
|
||||
public:
|
||||
|
||||
void post(Events eventType, const void *userData) {
|
||||
for (auto &handler : this->m_eventHandlers)
|
||||
if (eventType == handler.eventType)
|
||||
handler.callback(userData);
|
||||
}
|
||||
|
||||
void subscribe(Events eventType, void *sender, std::function<void(const void*)> callback) {
|
||||
for (auto &handler : this->m_eventHandlers)
|
||||
if (eventType == handler.eventType && sender == handler.sender)
|
||||
return;
|
||||
|
||||
this->m_eventHandlers.push_back(EventHandler { sender, eventType, callback });
|
||||
}
|
||||
|
||||
void unsubscribe(Events eventType, void *sender) {
|
||||
std::erase_if(this->m_eventHandlers, [&eventType, &sender](EventHandler handler) {
|
||||
return eventType == handler.eventType && sender == handler.sender;
|
||||
});
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<EventHandler> m_eventHandlers;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
using u8 = std::uint8_t;
|
||||
using u16 = std::uint16_t;
|
||||
using u32 = std::uint32_t;
|
||||
using u64 = std::uint64_t;
|
||||
using u128 = __uint128_t;
|
||||
|
||||
using s8 = std::int8_t;
|
||||
using s16 = std::int16_t;
|
||||
using s32 = std::int32_t;
|
||||
using s64 = std::int64_t;
|
||||
using s128 = __int128_t;
|
||||
|
||||
#include "lang/result.hpp"
|
||||
#include "lang/results.hpp"
|
||||
|
||||
#if defined(__EMX__) || defined (WIN32)
|
||||
#define MAGIC_PATH_SEPARATOR ";"
|
||||
#else
|
||||
#define MAGIC_PATH_SEPARATOR ":"
|
||||
#endif
|
||||
@@ -1,128 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "token.hpp"
|
||||
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class ASTNode {
|
||||
public:
|
||||
enum class Type {
|
||||
VariableDecl,
|
||||
TypeDecl,
|
||||
Struct,
|
||||
Union,
|
||||
Enum,
|
||||
Bitfield,
|
||||
Scope,
|
||||
};
|
||||
|
||||
explicit ASTNode(Type type) : m_type(type) {}
|
||||
virtual ~ASTNode() = default;
|
||||
|
||||
Type getType() { return this->m_type; }
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
class ASTNodeVariableDecl : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeVariableDecl(const Token::TypeToken::Type &type, const std::string &name, const std::string& customTypeName = "", std::optional<u64> offset = { }, size_t arraySize = 1, std::optional<std::string> arraySizeVariable = { }, std::optional<u8> pointerSize = { })
|
||||
: ASTNode(Type::VariableDecl), m_type(type), m_name(name), m_customTypeName(customTypeName), m_offset(offset), m_arraySize(arraySize), m_arraySizeVariable(arraySizeVariable), m_pointerSize(pointerSize) { }
|
||||
|
||||
const Token::TypeToken::Type& getVariableType() const { return this->m_type; }
|
||||
const std::string& getCustomVariableTypeName() const { return this->m_customTypeName; }
|
||||
const std::string& getVariableName() const { return this->m_name; };
|
||||
std::optional<u64> getOffset() const { return this->m_offset; }
|
||||
size_t getArraySize() const { return this->m_arraySize; }
|
||||
std::optional<std::string> getArraySizeVariable() const { return this->m_arraySizeVariable; }
|
||||
std::optional<u8> getPointerSize() const { return this->m_pointerSize; }
|
||||
|
||||
private:
|
||||
Token::TypeToken::Type m_type;
|
||||
std::string m_name, m_customTypeName;
|
||||
std::optional<u64> m_offset;
|
||||
size_t m_arraySize;
|
||||
std::optional<std::string> m_arraySizeVariable;
|
||||
std::optional<u8> m_pointerSize;
|
||||
};
|
||||
|
||||
class ASTNodeScope : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeScope(std::vector<ASTNode*> nodes) : ASTNode(Type::Scope), m_nodes(nodes) { }
|
||||
|
||||
std::vector<ASTNode*> &getNodes() { return this->m_nodes; }
|
||||
private:
|
||||
std::vector<ASTNode*> m_nodes;
|
||||
};
|
||||
|
||||
class ASTNodeStruct : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeStruct(std::string name, std::vector<ASTNode*> nodes)
|
||||
: ASTNode(Type::Struct), m_name(name), m_nodes(nodes) { }
|
||||
|
||||
const std::string& getName() const { return this->m_name; }
|
||||
std::vector<ASTNode*> &getNodes() { return this->m_nodes; }
|
||||
private:
|
||||
std::string m_name;
|
||||
std::vector<ASTNode*> m_nodes;
|
||||
};
|
||||
|
||||
class ASTNodeUnion : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeUnion(std::string name, std::vector<ASTNode*> nodes)
|
||||
: ASTNode(Type::Union), m_name(name), m_nodes(nodes) { }
|
||||
|
||||
const std::string& getName() const { return this->m_name; }
|
||||
std::vector<ASTNode*> &getNodes() { return this->m_nodes; }
|
||||
private:
|
||||
std::string m_name;
|
||||
std::vector<ASTNode*> m_nodes;
|
||||
};
|
||||
|
||||
class ASTNodeBitField : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeBitField(std::string name, std::vector<std::pair<std::string, size_t>> fields)
|
||||
: ASTNode(Type::Bitfield), m_name(name), m_fields(fields) { }
|
||||
|
||||
const std::string& getName() const { return this->m_name; }
|
||||
std::vector<std::pair<std::string, size_t>> &getFields() { return this->m_fields; }
|
||||
private:
|
||||
std::string m_name;
|
||||
std::vector<std::pair<std::string, size_t>> m_fields;
|
||||
};
|
||||
|
||||
class ASTNodeTypeDecl : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeTypeDecl(const Token::TypeToken::Type &type, const std::string &name, const std::string& customTypeName = "")
|
||||
: ASTNode(Type::TypeDecl), m_type(type), m_name(name), m_customTypeName(customTypeName) { }
|
||||
|
||||
const std::string& getTypeName() const { return this->m_name; };
|
||||
|
||||
const Token::TypeToken::Type& getAssignedType() const { return this->m_type; }
|
||||
const std::string& getAssignedCustomTypeName() const { return this->m_customTypeName; }
|
||||
private:
|
||||
Token::TypeToken::Type m_type;
|
||||
std::string m_name, m_customTypeName;
|
||||
};
|
||||
|
||||
class ASTNodeEnum : public ASTNode {
|
||||
public:
|
||||
explicit ASTNodeEnum(const Token::TypeToken::Type &type, const std::string &name)
|
||||
: ASTNode(Type::Enum), m_type(type), m_name(name) { }
|
||||
|
||||
const std::string& getName() const { return this->m_name; };
|
||||
|
||||
const Token::TypeToken::Type& getUnderlyingType() const { return this->m_type; }
|
||||
std::vector<std::pair<u64, std::string>>& getValues() { return this->m_values; }
|
||||
private:
|
||||
Token::TypeToken::Type m_type;
|
||||
std::string m_name;
|
||||
std::vector<std::pair<u64, std::string>> m_values;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "providers/provider.hpp"
|
||||
#include "lang/pattern_data.hpp"
|
||||
#include "ast_node.hpp"
|
||||
|
||||
#include <bit>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class Evaluator {
|
||||
public:
|
||||
Evaluator(prv::Provider* &provider, std::endian dataEndianess);
|
||||
|
||||
std::pair<Result, std::vector<PatternData*>> evaluate(const std::vector<ASTNode*>& ast);
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, ASTNode*> m_types;
|
||||
prv::Provider* &m_provider;
|
||||
std::endian m_dataEndianess;
|
||||
|
||||
|
||||
std::pair<PatternData*, size_t> createStructPattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createUnionPattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createEnumPattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createBitfieldPattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createArrayPattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createStringPattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createCustomTypePattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
std::pair<PatternData*, size_t> createBuiltInTypePattern(ASTNodeVariableDecl *varDeclNode, u64 offset);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "token.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class Lexer {
|
||||
public:
|
||||
Lexer();
|
||||
|
||||
std::pair<Result, std::vector<Token>> lex(const std::string& code);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
#include "token.hpp"
|
||||
#include "ast_node.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class Parser {
|
||||
public:
|
||||
Parser();
|
||||
|
||||
std::pair<Result, std::vector<ASTNode*>> parse(const std::vector<Token> &tokens);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,598 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
#include <string>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "imgui_memory_editor.h"
|
||||
|
||||
#include "providers/provider.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
#include <random>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
namespace {
|
||||
|
||||
std::string makeDisplayable(u8 *data, size_t size) {
|
||||
std::string result;
|
||||
for (u8* c = data; c < (data + size); c++) {
|
||||
if (iscntrl(*c) || *c > 0x7F)
|
||||
result += " ";
|
||||
else
|
||||
result += *c;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class PatternData {
|
||||
public:
|
||||
enum class Type { Padding, Unsigned, Signed, Float, Character, String, Struct, Union, Array, Enum };
|
||||
|
||||
PatternData(Type type, u64 offset, size_t size, const std::string &name, u32 color = 0)
|
||||
: m_type(type), m_offset(offset), m_size(size), m_color(color), m_name(name) {
|
||||
constexpr u32 Palette[] = { 0x50b4771f, 0x500e7fff, 0x502ca02c, 0x502827d6, 0x50bd6794, 0x504b568c, 0x50c277e3, 0x507f7f7f, 0x5022bdbc, 0x50cfbe17 };
|
||||
|
||||
if (color != 0)
|
||||
return;
|
||||
|
||||
this->m_color = Palette[PatternData::s_paletteOffset++];
|
||||
|
||||
if (PatternData::s_paletteOffset >= (sizeof(Palette) / sizeof(u32)))
|
||||
PatternData::s_paletteOffset = 0;
|
||||
}
|
||||
virtual ~PatternData() = default;
|
||||
|
||||
[[nodiscard]] Type getPatternType() const { return this->m_type; }
|
||||
[[nodiscard]] u64 getOffset() const { return this->m_offset; }
|
||||
[[nodiscard]] size_t getSize() const { return this->m_size; }
|
||||
|
||||
[[nodiscard]] const std::string& getName() const { return this->m_name; }
|
||||
void setName(std::string name) { this->m_name = name; }
|
||||
|
||||
[[nodiscard]] u32 getColor() const { return this->m_color; }
|
||||
void setColor(u32 color) { this->m_color = color; }
|
||||
|
||||
virtual void createEntry(prv::Provider* &provider) = 0;
|
||||
virtual std::string getTypeName() = 0;
|
||||
|
||||
virtual std::optional<u32> highlightBytes(size_t offset) {
|
||||
if (offset >= this->getOffset() && offset < (this->getOffset() + this->getSize()))
|
||||
return this->getColor();
|
||||
else
|
||||
return { };
|
||||
}
|
||||
|
||||
virtual void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) { }
|
||||
|
||||
static bool sortPatternDataTable(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider, lang::PatternData* left, lang::PatternData* right) {
|
||||
if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("name")) {
|
||||
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
|
||||
return left->getName() > right->getName();
|
||||
else
|
||||
return left->getName() < right->getName();
|
||||
}
|
||||
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("offset")) {
|
||||
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
|
||||
return left->getOffset() > right->getOffset();
|
||||
else
|
||||
return left->getOffset() < right->getOffset();
|
||||
}
|
||||
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("size")) {
|
||||
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
|
||||
return left->getSize() > right->getSize();
|
||||
else
|
||||
return left->getSize() < right->getSize();
|
||||
}
|
||||
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("value")) {
|
||||
size_t biggerSize = std::max(left->getSize(), right->getSize());
|
||||
std::vector<u8> leftBuffer(biggerSize, 0x00), rightBuffer(biggerSize, 0x00);
|
||||
|
||||
provider->read(left->getOffset(), leftBuffer.data(), left->getSize());
|
||||
provider->read(right->getOffset(), rightBuffer.data(), right->getSize());
|
||||
|
||||
if (PatternData::s_endianess != std::endian::native) {
|
||||
std::reverse(leftBuffer.begin(), leftBuffer.end());
|
||||
std::reverse(rightBuffer.begin(), rightBuffer.end());
|
||||
}
|
||||
|
||||
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
|
||||
return leftBuffer > rightBuffer;
|
||||
else
|
||||
return leftBuffer < rightBuffer;
|
||||
}
|
||||
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("type")) {
|
||||
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
|
||||
return left->getTypeName() > right->getTypeName();
|
||||
else
|
||||
return left->getTypeName() < right->getTypeName();
|
||||
}
|
||||
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("color")) {
|
||||
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
|
||||
return left->getColor() > right->getColor();
|
||||
else
|
||||
return left->getColor() < right->getColor();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void resetPalette() { PatternData::s_paletteOffset = 0; }
|
||||
static void setEndianess(std::endian endianess) { PatternData::s_endianess = endianess; }
|
||||
|
||||
protected:
|
||||
void createDefaultEntry(std::string value) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset(), this->getOffset() + this->getSize() - 1);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%04lx", this->getSize());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", value.c_str());
|
||||
}
|
||||
|
||||
protected:
|
||||
static inline std::endian s_endianess = std::endian::native;
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
u64 m_offset;
|
||||
size_t m_size;
|
||||
|
||||
u32 m_color;
|
||||
std::string m_name;
|
||||
|
||||
static inline u8 s_paletteOffset = 0;
|
||||
|
||||
};
|
||||
|
||||
class PatternDataPadding : public PatternData {
|
||||
public:
|
||||
PatternDataPadding(u64 offset, size_t size) : PatternData(Type::Padding, offset, size, "", 0x00FFFFFF) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
class PatternDataPointer : public PatternData {
|
||||
public:
|
||||
PatternDataPointer(u64 offset, size_t size, const std::string &name, PatternData *pointedAt, u32 color = 0)
|
||||
: PatternData(Type::Unsigned, offset, size, name, color), m_pointedAt(pointedAt) {
|
||||
this->m_pointedAt->setName("*" + this->m_pointedAt->getName());
|
||||
}
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
u64 data = 0;
|
||||
provider->read(this->getOffset(), &data, this->getSize());
|
||||
data = hex::changeEndianess(data, this->getSize(), PatternData::s_endianess);
|
||||
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip);
|
||||
ImGui::TableNextColumn();
|
||||
bool open = ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset(), this->getOffset() + this->getSize() - 1);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%04lx", this->getSize());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("*(0x%0*llx)", this->getSize() * 2, data);
|
||||
|
||||
if (open) {
|
||||
this->m_pointedAt->createEntry(provider);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
virtual std::optional<u32> highlightBytes(size_t offset) {
|
||||
if (offset >= this->getOffset() && offset < (this->getOffset() + this->getSize()))
|
||||
return this->getColor();
|
||||
else if (auto color = this->m_pointedAt->highlightBytes(offset); color.has_value())
|
||||
return color.value();
|
||||
else
|
||||
return { };
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "Pointer";
|
||||
}
|
||||
|
||||
private:
|
||||
PatternData *m_pointedAt;
|
||||
};
|
||||
|
||||
class PatternDataUnsigned : public PatternData {
|
||||
public:
|
||||
PatternDataUnsigned(u64 offset, size_t size, const std::string &name, u32 color = 0) : PatternData(Type::Unsigned, offset, size, name, color) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
u64 data = 0;
|
||||
provider->read(this->getOffset(), &data, this->getSize());
|
||||
data = hex::changeEndianess(data, this->getSize(), PatternData::s_endianess);
|
||||
|
||||
this->createDefaultEntry(hex::format("%lu (0x%0*lx)", data, this->getSize() * 2, data));
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
switch (this->getSize()) {
|
||||
case 1: return "u8";
|
||||
case 2: return "u16";
|
||||
case 4: return "u32";
|
||||
case 8: return "u64";
|
||||
case 16: return "u128";
|
||||
default: return "Unsigned data";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class PatternDataSigned : public PatternData {
|
||||
public:
|
||||
PatternDataSigned(u64 offset, size_t size, const std::string &name, u32 color = 0) : PatternData(Type::Signed, offset, size, name, color) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
u64 data = 0;
|
||||
provider->read(this->getOffset(), &data, this->getSize());
|
||||
data = hex::changeEndianess(data, this->getSize(), PatternData::s_endianess);
|
||||
|
||||
s64 signedData = signedData = hex::signExtend(data, this->getSize(), 64);
|
||||
|
||||
this->createDefaultEntry(hex::format("%ld (0x%0*lx)", signedData, this->getSize() * 2, data));
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
switch (this->getSize()) {
|
||||
case 1: return "s8";
|
||||
case 2: return "s16";
|
||||
case 4: return "s32";
|
||||
case 8: return "s64";
|
||||
case 16: return "s128";
|
||||
default: return "Signed data";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class PatternDataFloat : public PatternData {
|
||||
public:
|
||||
PatternDataFloat(u64 offset, size_t size, const std::string &name, u32 color = 0) : PatternData(Type::Float, offset, size, name, color) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
double formatData = 0;
|
||||
if (this->getSize() == 4) {
|
||||
float data = 0;
|
||||
provider->read(this->getOffset(), &data, 4);
|
||||
data = hex::changeEndianess(data, 4, PatternData::s_endianess);
|
||||
|
||||
formatData = data;
|
||||
} else if (this->getSize() == 8) {
|
||||
double data = 0;
|
||||
provider->read(this->getOffset(), &data, 8);
|
||||
data = hex::changeEndianess(data, 8, PatternData::s_endianess);
|
||||
|
||||
formatData = data;
|
||||
}
|
||||
|
||||
this->createDefaultEntry(hex::format("%f (0x%0*lx)", formatData, this->getSize() * 2, formatData));
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
switch (this->getSize()) {
|
||||
case 4: return "float";
|
||||
case 8: return "double";
|
||||
default: return "Floating point data";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class PatternDataCharacter : public PatternData {
|
||||
public:
|
||||
PatternDataCharacter(u64 offset, size_t size, const std::string &name, u32 color = 0) : PatternData(Type::Character, offset, size, name, color) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
char character;
|
||||
provider->read(this->getOffset(), &character, 1);
|
||||
|
||||
this->createDefaultEntry(hex::format("'%c'", character));
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "Character";
|
||||
}
|
||||
};
|
||||
|
||||
class PatternDataString : public PatternData {
|
||||
public:
|
||||
PatternDataString(u64 offset, size_t size, const std::string &name, u32 color = 0) : PatternData(Type::String, offset, size, name, color) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
std::vector<u8> buffer(this->getSize() + 1, 0x00);
|
||||
provider->read(this->getOffset(), buffer.data(), this->getSize());
|
||||
buffer[this->getSize()] = '\0';
|
||||
|
||||
this->createDefaultEntry(hex::format("\"%s\"", makeDisplayable(buffer.data(), this->getSize()).c_str()));
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "String";
|
||||
}
|
||||
};
|
||||
|
||||
class PatternDataArray : public PatternData {
|
||||
public:
|
||||
PatternDataArray(u64 offset, size_t size, const std::string &name, const std::vector<PatternData*> & entries, u32 color = 0)
|
||||
: PatternData(Type::Array, offset, size, name, color), m_entries(entries) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_AlphaPreview);
|
||||
ImGui::TableNextColumn();
|
||||
bool open = ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset(), this->getOffset() + this->getSize() - 1);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%04lx", this->getSize());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", "{ ... }");
|
||||
|
||||
if (open) {
|
||||
for (auto &member : this->m_entries)
|
||||
member->createEntry(provider);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<u32> highlightBytes(size_t offset) override{
|
||||
for (auto &entry : this->m_entries) {
|
||||
if (auto color = entry->highlightBytes(offset); color.has_value())
|
||||
return color.value();
|
||||
}
|
||||
|
||||
return { };
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return this->m_entries[0]->getTypeName() + "[" + std::to_string(this->m_entries.size()) + "]";
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<PatternData*> m_entries;
|
||||
};
|
||||
|
||||
class PatternDataStruct : public PatternData {
|
||||
public:
|
||||
PatternDataStruct(u64 offset, size_t size, const std::string &name, const std::string &structName, const std::vector<PatternData*> & members, u32 color = 0)
|
||||
: PatternData(Type::Struct, offset, size, name, color), m_structName(structName), m_members(members), m_sortedMembers(members) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_AlphaPreview);
|
||||
ImGui::TableNextColumn();
|
||||
bool open = ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset(), this->getOffset() + this->getSize() - 1);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%04lx", this->getSize());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", "{ ... }");
|
||||
|
||||
if (open) {
|
||||
for (auto &member : this->m_sortedMembers)
|
||||
member->createEntry(provider);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::optional<u32> highlightBytes(size_t offset) override{
|
||||
for (auto &member : this->m_members) {
|
||||
if (auto color = member->highlightBytes(offset); color.has_value())
|
||||
return color.value();
|
||||
}
|
||||
|
||||
return { };
|
||||
}
|
||||
|
||||
void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override {
|
||||
this->m_sortedMembers = this->m_members;
|
||||
|
||||
std::sort(this->m_sortedMembers.begin(), this->m_sortedMembers.end(), [&sortSpecs, &provider](PatternData *left, PatternData *right) {
|
||||
return PatternData::sortPatternDataTable(sortSpecs, provider, left, right);
|
||||
});
|
||||
|
||||
for (auto &member : this->m_members)
|
||||
member->sort(sortSpecs, provider);
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "struct " + this->m_structName;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_structName;
|
||||
std::vector<PatternData*> m_members;
|
||||
std::vector<PatternData*> m_sortedMembers;
|
||||
};
|
||||
|
||||
class PatternDataUnion : public PatternData {
|
||||
public:
|
||||
PatternDataUnion(u64 offset, size_t size, const std::string &name, const std::string &unionName, const std::vector<PatternData*> & members, u32 color = 0)
|
||||
: PatternData(Type::Union, offset, size, name, color), m_unionName(unionName), m_members(members), m_sortedMembers(members) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_AlphaPreview);
|
||||
ImGui::TableNextColumn();
|
||||
bool open = ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset(), this->getOffset() + this->getSize() - 1);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%04lx", this->getSize());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", "{ ... }");
|
||||
|
||||
if (open) {
|
||||
for (auto &member : this->m_sortedMembers)
|
||||
member->createEntry(provider);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::optional<u32> highlightBytes(size_t offset) override{
|
||||
for (auto &member : this->m_members) {
|
||||
if (auto color = member->highlightBytes(offset); color.has_value())
|
||||
return color.value();
|
||||
}
|
||||
|
||||
return { };
|
||||
}
|
||||
|
||||
void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override {
|
||||
this->m_sortedMembers = this->m_members;
|
||||
|
||||
std::sort(this->m_sortedMembers.begin(), this->m_sortedMembers.end(), [&sortSpecs, &provider](PatternData *left, PatternData *right) {
|
||||
return PatternData::sortPatternDataTable(sortSpecs, provider, left, right);
|
||||
});
|
||||
|
||||
for (auto &member : this->m_members)
|
||||
member->sort(sortSpecs, provider);
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "union " + this->m_unionName;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_unionName;
|
||||
std::vector<PatternData*> m_members;
|
||||
std::vector<PatternData*> m_sortedMembers;
|
||||
};
|
||||
|
||||
class PatternDataEnum : public PatternData {
|
||||
public:
|
||||
PatternDataEnum(u64 offset, size_t size, const std::string &name, const std::string &enumName, std::vector<std::pair<u64, std::string>> enumValues, u32 color = 0)
|
||||
: PatternData(Type::Enum, offset, size, name, color), m_enumName(enumName), m_enumValues(enumValues) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
u64 value = 0;
|
||||
provider->read(this->getOffset(), &value, this->getSize());
|
||||
value = hex::changeEndianess(value, this->getSize(), PatternData::s_endianess);
|
||||
|
||||
std::string valueString = this->m_enumName + "::";
|
||||
|
||||
bool foundValue = false;
|
||||
for (auto &[entryValue, entryName] : this->m_enumValues) {
|
||||
if (value == entryValue) {
|
||||
valueString += entryName;
|
||||
foundValue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundValue)
|
||||
valueString += "???";
|
||||
|
||||
this->createDefaultEntry(hex::format("%s (0x%0*lx)", valueString.c_str(), this->getSize() * 2, value));
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "enum " + this->m_enumName;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_enumName;
|
||||
std::vector<std::pair<u64, std::string>> m_enumValues;
|
||||
};
|
||||
|
||||
class PatternDataBitfield : public PatternData {
|
||||
public:
|
||||
PatternDataBitfield(u64 offset, size_t size, const std::string &name, const std::string &bitfieldName, std::vector<std::pair<std::string, size_t>> fields, u32 color = 0)
|
||||
: PatternData(Type::Enum, offset, size, name, color), m_bitfieldName(bitfieldName), m_fields(fields) { }
|
||||
|
||||
void createEntry(prv::Provider* &provider) override {
|
||||
u64 value = 0;
|
||||
provider->read(this->getOffset(), &value, this->getSize());
|
||||
value = hex::changeEndianess(value, this->getSize(), PatternData::s_endianess);
|
||||
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(0x00FFFFFF), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_AlphaPreview);
|
||||
ImGui::TableNextColumn();
|
||||
bool open = ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset(), this->getOffset() + this->getSize() - 1);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%04lx", this->getSize());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", this->getTypeName().c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("{ %llx }", value);
|
||||
|
||||
if (open) {
|
||||
u16 bitOffset = 0;
|
||||
for (auto &[entryName, entrySize] : this->m_fields) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TreeNodeEx(this->getName().c_str(), ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_SpanFullWidth);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", entryName.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("0x%08lx : 0x%08lx", this->getOffset() + (bitOffset >> 3), this->getOffset() + ((bitOffset + entrySize) >> 3) - 1);
|
||||
ImGui::TableNextColumn();
|
||||
if (entrySize == 1)
|
||||
ImGui::Text("%llu bit", entrySize);
|
||||
else
|
||||
ImGui::Text("%llu bits", entrySize);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", entryName.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%llx", hex::extract((bitOffset + entrySize) - 1, bitOffset, value));
|
||||
bitOffset += entrySize;
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string getTypeName() override {
|
||||
return "bitfield " + this->m_bitfieldName;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_bitfieldName;
|
||||
std::vector<std::pair<std::string, size_t>> m_fields;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "token.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class Preprocessor {
|
||||
public:
|
||||
Preprocessor();
|
||||
|
||||
std::pair<Result, std::string> preprocess(const std::string& code, bool initialRun = true);
|
||||
|
||||
void addPragmaHandler(std::string pragmaType, std::function<bool(std::string)> function);
|
||||
void addDefaultPragramHandlers();
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::function<bool(std::string)>> m_pragmaHandlers;
|
||||
|
||||
std::set<std::pair<std::string, std::string>> m_defines;
|
||||
std::set<std::pair<std::string, std::string>> m_pragmas;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class Result {
|
||||
public:
|
||||
constexpr Result(const std::uint8_t module, const std::uint32_t desc) noexcept : m_result((module << 24) | (desc & 0x00FFFFFF)) { }
|
||||
|
||||
constexpr std::uint32_t getResult() const noexcept { return this->m_result; }
|
||||
constexpr std::uint8_t getModule() const noexcept { return this->m_result >> 24; }
|
||||
constexpr std::uint32_t getDescription() const noexcept { return this->m_result & 0x00FFFFFF; }
|
||||
|
||||
constexpr bool succeeded() const noexcept { return this->m_result == 0; }
|
||||
constexpr bool failed() const noexcept { return !succeeded(); }
|
||||
private:
|
||||
const std::uint32_t m_result;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "result.hpp"
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
constexpr Result ResultSuccess(0, 0);
|
||||
|
||||
constexpr Result ResultPreprocessingError(1, 1);
|
||||
constexpr Result ResultLexicalError(2, 1);
|
||||
constexpr Result ResultParseError(3, 1);
|
||||
constexpr Result ResultEvaluatorError(4, 1);
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
struct Token {
|
||||
enum class Type : u64 {
|
||||
Keyword,
|
||||
Type,
|
||||
Operator,
|
||||
Integer,
|
||||
Identifier,
|
||||
EndOfExpression,
|
||||
ScopeOpen,
|
||||
ScopeClose,
|
||||
ArrayOpen,
|
||||
ArrayClose,
|
||||
Separator,
|
||||
EndOfProgram
|
||||
} type;
|
||||
|
||||
struct KeywordToken {
|
||||
enum class Keyword {
|
||||
Struct,
|
||||
Union,
|
||||
Using,
|
||||
Enum,
|
||||
Bitfield
|
||||
} keyword;
|
||||
} keywordToken;
|
||||
struct IdentifierToken {
|
||||
std::string identifier;
|
||||
} identifierToken;
|
||||
struct OperatorToken {
|
||||
enum class Operator {
|
||||
AtDeclaration,
|
||||
Assignment,
|
||||
Inherit,
|
||||
Star
|
||||
} op;
|
||||
} operatorToken;
|
||||
struct IntegerToken {
|
||||
s128 integer;
|
||||
} integerToken;
|
||||
struct TypeToken {
|
||||
enum class Type {
|
||||
Unsigned8Bit = 0x10,
|
||||
Signed8Bit = 0x11,
|
||||
Unsigned16Bit = 0x20,
|
||||
Signed16Bit = 0x21,
|
||||
Unsigned32Bit = 0x40,
|
||||
Signed32Bit = 0x41,
|
||||
Unsigned64Bit = 0x80,
|
||||
Signed64Bit = 0x81,
|
||||
Unsigned128Bit = 0x100,
|
||||
Signed128Bit = 0x101,
|
||||
Float = 0x42,
|
||||
Double = 0x82,
|
||||
CustomType = 0x00,
|
||||
Padding = 0x1F
|
||||
} type;
|
||||
} typeToken;
|
||||
};
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "token.hpp"
|
||||
#include "ast_node.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hex::lang {
|
||||
|
||||
class Validator {
|
||||
public:
|
||||
Validator();
|
||||
|
||||
bool validate(const std::vector<ASTNode*>& ast);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "providers/provider.hpp"
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
namespace hex::prv {
|
||||
|
||||
class FileProvider : public Provider {
|
||||
public:
|
||||
explicit FileProvider(std::string_view path);
|
||||
~FileProvider() override;
|
||||
|
||||
bool isAvailable() override;
|
||||
bool isReadable() override;
|
||||
bool isWritable() override;
|
||||
|
||||
void read(u64 offset, void *buffer, size_t size) override;
|
||||
void write(u64 offset, void *buffer, size_t size) override;
|
||||
size_t getActualSize() override;
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> getDataInformation() override;
|
||||
|
||||
private:
|
||||
FILE *m_file;
|
||||
std::string m_path;
|
||||
|
||||
bool m_fileStatsValid = false;
|
||||
struct stat m_fileStats = { 0 };
|
||||
|
||||
bool m_readable, m_writable;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hex::prv {
|
||||
|
||||
class Provider {
|
||||
public:
|
||||
constexpr static size_t PageSize = 0x1000'0000;
|
||||
|
||||
Provider() = default;
|
||||
virtual ~Provider() = default;
|
||||
|
||||
virtual bool isAvailable() = 0;
|
||||
virtual bool isReadable() = 0;
|
||||
virtual bool isWritable() = 0;
|
||||
|
||||
virtual void read(u64 offset, void *buffer, size_t size) = 0;
|
||||
virtual void write(u64 offset, void *buffer, size_t size) = 0;
|
||||
virtual size_t getActualSize() = 0;
|
||||
|
||||
u32 getPageCount() { return std::ceil(this->getActualSize() / double(PageSize)); }
|
||||
u32 getCurrentPage() const { return this->m_currPage; }
|
||||
void setCurrentPage(u32 page) { if (page < getPageCount()) this->m_currPage = page; }
|
||||
|
||||
virtual size_t getBaseAddress() {
|
||||
return PageSize * this->m_currPage;
|
||||
}
|
||||
|
||||
virtual size_t getSize() {
|
||||
return std::min(this->getActualSize() - PageSize * this->m_currPage, PageSize);
|
||||
}
|
||||
|
||||
virtual std::vector<std::pair<std::string, std::string>> getDataInformation() = 0;
|
||||
|
||||
protected:
|
||||
u32 m_currPage = 0;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include "lang/token.hpp"
|
||||
|
||||
namespace hex {
|
||||
|
||||
template<typename ... Args>
|
||||
inline std::string format(const std::string &format, Args ... args) {
|
||||
size_t size = snprintf( nullptr, 0, format.c_str(), args ... );
|
||||
|
||||
if( size <= 0 )
|
||||
return "";
|
||||
|
||||
std::vector<char> buffer(size + 1, 0x00);
|
||||
snprintf(buffer.data(), size + 1, format.c_str(), args ...);
|
||||
|
||||
return std::string(buffer.data(), buffer.data() + size);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr inline u64 signExtend(u64 value, u8 currWidth, u8 targetWidth) {
|
||||
u64 mask = 1LLU << (currWidth - 1);
|
||||
return (((value ^ mask) - mask) << (64 - targetWidth)) >> (64 - targetWidth);
|
||||
}
|
||||
|
||||
constexpr inline bool isUnsigned(const lang::Token::TypeToken::Type type) {
|
||||
return (static_cast<u32>(type) & 0x0F) == 0x00;
|
||||
}
|
||||
|
||||
constexpr inline bool isSigned(const lang::Token::TypeToken::Type type) {
|
||||
return (static_cast<u32>(type) & 0x0F) == 0x01;
|
||||
}
|
||||
|
||||
constexpr inline bool isFloatingPoint(const lang::Token::TypeToken::Type type) {
|
||||
return (static_cast<u32>(type) & 0x0F) == 0x02;
|
||||
}
|
||||
|
||||
constexpr inline u32 getTypeSize(const lang::Token::TypeToken::Type type) {
|
||||
return static_cast<u32>(type) >> 4;
|
||||
}
|
||||
|
||||
inline std::string toByteString(u64 bytes) {
|
||||
double value = bytes;
|
||||
u8 unitIndex = 0;
|
||||
|
||||
while (value > 1024) {
|
||||
value /= 1024;
|
||||
unitIndex++;
|
||||
|
||||
if (unitIndex == 6)
|
||||
break;
|
||||
}
|
||||
|
||||
std::string result = std::to_string(value);
|
||||
|
||||
switch (unitIndex) {
|
||||
case 0: result += " Bytes"; break;
|
||||
case 1: result += " kB"; break;
|
||||
case 2: result += " MB"; break;
|
||||
case 3: result += " GB"; break;
|
||||
case 4: result += " TB"; break;
|
||||
case 5: result += " PB"; break;
|
||||
case 6: result += " EB"; break;
|
||||
default: result = "A lot!";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr inline u64 extract(u8 from, u8 to, const u64 &value) {
|
||||
u64 mask = (std::numeric_limits<u64>::max() >> (63 - (from - to))) << to;
|
||||
return (value & mask) >> to;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct always_false : std::false_type {};
|
||||
|
||||
template<typename T>
|
||||
constexpr T changeEndianess(T value, std::endian endian) {
|
||||
if (endian == std::endian::native)
|
||||
return value;
|
||||
|
||||
if constexpr (sizeof(T) == 1)
|
||||
return value;
|
||||
else if constexpr (sizeof(T) == 2)
|
||||
return __builtin_bswap16(value);
|
||||
else if constexpr (sizeof(T) == 4)
|
||||
return __builtin_bswap32(value);
|
||||
else if constexpr (sizeof(T) == 8)
|
||||
return __builtin_bswap64(value);
|
||||
else
|
||||
static_assert(always_false<T>::value, "Invalid type provided!");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr T changeEndianess(T value, size_t size, std::endian endian) {
|
||||
if (endian == std::endian::native)
|
||||
return value;
|
||||
|
||||
if (size == 1)
|
||||
return value;
|
||||
else if (size == 2)
|
||||
return __builtin_bswap16(value);
|
||||
else if (size == 4)
|
||||
return __builtin_bswap32(value);
|
||||
else if (size == 8)
|
||||
return __builtin_bswap64(value);
|
||||
else
|
||||
throw std::invalid_argument("Invalid value size!");
|
||||
}
|
||||
|
||||
|
||||
class ScopeExit {
|
||||
public:
|
||||
ScopeExit(std::function<void()> func) : m_func(func) {}
|
||||
~ScopeExit() { if (this->m_func != nullptr) this->m_func(); }
|
||||
|
||||
void release() {
|
||||
this->m_func = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
std::function<void()> m_func;
|
||||
};
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "imgui.h"
|
||||
|
||||
#include "event.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace hex {
|
||||
|
||||
class View {
|
||||
public:
|
||||
View() { }
|
||||
virtual ~View() { }
|
||||
|
||||
virtual void createView() = 0;
|
||||
virtual void createMenu() { }
|
||||
virtual bool handleShortcut(int key, int mods) { return false; }
|
||||
|
||||
static std::vector<std::function<void()>>& getDeferedCalls() {
|
||||
return View::s_deferedCalls;
|
||||
}
|
||||
|
||||
static void postEvent(Events eventType, const void *userData = nullptr) {
|
||||
View::s_eventManager.post(eventType, userData);
|
||||
}
|
||||
|
||||
protected:
|
||||
void subscribeEvent(Events eventType, std::function<void(const void*)> callback) {
|
||||
View::s_eventManager.subscribe(eventType, this, callback);
|
||||
}
|
||||
|
||||
void unsubscribeEvent(Events eventType) {
|
||||
View::s_eventManager.unsubscribe(eventType, this);
|
||||
}
|
||||
|
||||
void doLater(std::function<void()> &&function) {
|
||||
View::s_deferedCalls.push_back(function);
|
||||
}
|
||||
|
||||
private:
|
||||
static inline EventManager s_eventManager;
|
||||
static inline std::vector<std::function<void()>> s_deferedCalls;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <bit>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
struct GUID {
|
||||
u32 data1;
|
||||
u16 data2;
|
||||
u16 data3;
|
||||
u8 data4[8];
|
||||
};
|
||||
|
||||
union PreviewData {
|
||||
u8 unsigned8;
|
||||
s8 signed8;
|
||||
u16 unsigned16;
|
||||
s16 signed16;
|
||||
u32 unsigned32;
|
||||
s32 signed32;
|
||||
u64 unsigned64;
|
||||
s64 signed64;
|
||||
char8_t ansiChar;
|
||||
char16_t wideChar;
|
||||
u8 utf8Char[4];
|
||||
float float32;
|
||||
double float64;
|
||||
#if defined(_WIN64)
|
||||
__time32_t time32;
|
||||
__time64_t time64;
|
||||
#else
|
||||
time_t time;
|
||||
#endif
|
||||
GUID guid;
|
||||
};
|
||||
|
||||
class ViewDataInspector : public View {
|
||||
public:
|
||||
explicit ViewDataInspector(prv::Provider* &dataProvider);
|
||||
~ViewDataInspector() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
prv::Provider* &m_dataProvider;
|
||||
bool m_windowOpen = true;
|
||||
bool m_shouldInvalidate = true;
|
||||
|
||||
std::endian m_endianess = std::endian::native;
|
||||
|
||||
PreviewData m_previewData = { 0 };
|
||||
size_t m_validBytes = 0;
|
||||
std::vector<std::pair<std::string, std::string>> m_cachedData;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <capstone/capstone.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
struct Disassembly {
|
||||
u64 address;
|
||||
u64 offset;
|
||||
std::string bytes;
|
||||
std::string opcodeString;
|
||||
};
|
||||
|
||||
class ViewDisassembler : public View {
|
||||
public:
|
||||
explicit ViewDisassembler(prv::Provider* &dataProvider);
|
||||
~ViewDisassembler() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
prv::Provider* &m_dataProvider;
|
||||
bool m_windowOpen = true;
|
||||
|
||||
bool m_shouldInvalidate = false;
|
||||
|
||||
u64 m_baseAddress = 0;
|
||||
u64 m_codeOffset = 0;
|
||||
u64 m_codeSize = 0;
|
||||
|
||||
cs_arch m_architecture = CS_ARCH_ARM;
|
||||
cs_mode m_modeBasicARM = cs_mode(0), m_modeExtraARM = cs_mode(0), m_modeBasicMIPS = cs_mode(0), m_modeBasicPPC = cs_mode(0), m_modeBasicX86 = cs_mode(0);
|
||||
bool m_littleEndianMode = true, m_micoMode = false, m_sparcV9Mode = false;
|
||||
|
||||
std::vector<Disassembly> m_disassembly;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
class ViewHashes : public View {
|
||||
public:
|
||||
explicit ViewHashes(prv::Provider* &dataProvider);
|
||||
~ViewHashes() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
prv::Provider* &m_dataProvider;
|
||||
bool m_windowOpen = true;
|
||||
|
||||
bool m_shouldInvalidate = true;
|
||||
int m_currHashFunction = 0;
|
||||
int m_hashStart = 0, m_hashEnd = 0;
|
||||
static constexpr const char* HashFunctionNames[] = { "CRC16", "CRC32", "MD4", "MD5", "SHA-1", "SHA-224", "SHA-256", "SHA-384", "SHA-512" };
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "views/view.hpp"
|
||||
#include "lang/pattern_data.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
#include <cstdio>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
class ViewHelp : public View {
|
||||
public:
|
||||
ViewHelp();
|
||||
~ViewHelp() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
bool m_aboutWindowOpen = false;
|
||||
bool m_patternHelpWindowOpen = false;
|
||||
|
||||
void drawAboutPopup();
|
||||
void drawPatternHelpPopup();
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "utils.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include "imgui_memory_editor.h"
|
||||
#include "ImGuiFileBrowser.h"
|
||||
|
||||
#include <tuple>
|
||||
#include <random>
|
||||
#include <vector>
|
||||
|
||||
#include "lang/pattern_data.hpp"
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
using SearchFunction = std::vector<std::pair<u64, u64>> (*)(prv::Provider* &provider, std::string string);
|
||||
|
||||
class ViewHexEditor : public View {
|
||||
public:
|
||||
ViewHexEditor(prv::Provider* &dataProvider, std::vector<lang::PatternData*> &patternData);
|
||||
~ViewHexEditor() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
bool handleShortcut(int key, int mods) override;
|
||||
|
||||
private:
|
||||
MemoryEditor m_memoryEditor;
|
||||
imgui_addons::ImGuiFileBrowser m_fileBrowser;
|
||||
|
||||
prv::Provider* &m_dataProvider;
|
||||
std::vector<lang::PatternData*> &m_patternData;
|
||||
|
||||
char m_searchStringBuffer[0xFFFF] = { 0 };
|
||||
char m_searchHexBuffer[0xFFFF] = { 0 };
|
||||
SearchFunction m_searchFunction = nullptr;
|
||||
std::vector<std::pair<u64, u64>> *m_lastSearchBuffer;
|
||||
|
||||
s64 m_lastSearchIndex = 0;
|
||||
std::vector<std::pair<u64, u64>> m_lastStringSearch;
|
||||
std::vector<std::pair<u64, u64>> m_lastHexSearch;
|
||||
|
||||
s64 m_gotoAddress = 0;
|
||||
|
||||
|
||||
void drawSearchPopup();
|
||||
void drawGotoPopup();
|
||||
|
||||
void openFile(std::string path);
|
||||
|
||||
enum class Language { C, Cpp, CSharp, Rust, Python, Java, JavaScript };
|
||||
void copyBytes();
|
||||
void copyString();
|
||||
void copyLanguageArray(Language language);
|
||||
void copyHexView();
|
||||
void copyHexViewHTML();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
class ViewInformation : public View {
|
||||
public:
|
||||
explicit ViewInformation(prv::Provider* &dataProvider);
|
||||
~ViewInformation() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
prv::Provider* &m_dataProvider;
|
||||
bool m_windowOpen = true;
|
||||
|
||||
bool m_dataValid = false;
|
||||
u32 m_blockSize = 0;
|
||||
float m_averageEntropy = 0;
|
||||
float m_highestBlockEntropy = 0;
|
||||
std::vector<float> m_blockEntropy;
|
||||
|
||||
std::array<float, 256> m_valueCounts = { 0 };
|
||||
bool m_shouldInvalidate = false;
|
||||
|
||||
std::pair<u64, u64> m_analyzedRegion = { 0, 0 };
|
||||
|
||||
std::string m_fileDescription;
|
||||
std::string m_mimeType;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "lang/ast_node.hpp"
|
||||
|
||||
#include "views/view.hpp"
|
||||
#include "lang/pattern_data.hpp"
|
||||
|
||||
#include "providers/provider.hpp"
|
||||
|
||||
#include <concepts>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
|
||||
#include "ImGuiFileBrowser.h"
|
||||
#include "TextEditor.h"
|
||||
|
||||
namespace hex {
|
||||
|
||||
class ViewPattern : public View {
|
||||
public:
|
||||
explicit ViewPattern(prv::Provider* &dataProvider, std::vector<lang::PatternData*> &patternData);
|
||||
~ViewPattern() override;
|
||||
|
||||
void createMenu() override;
|
||||
void createView() override;
|
||||
|
||||
private:
|
||||
std::vector<lang::PatternData*> &m_patternData;
|
||||
prv::Provider* &m_dataProvider;
|
||||
std::filesystem::path m_possiblePatternFile;
|
||||
bool m_windowOpen = true;
|
||||
|
||||
TextEditor m_textEditor;
|
||||
imgui_addons::ImGuiFileBrowser m_fileBrowser;
|
||||
|
||||
void loadPatternFile(std::string path);
|
||||
void clearPatternData();
|
||||
void parsePattern(char *buffer);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "views/view.hpp"
|
||||
#include "lang/pattern_data.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
#include <cstdio>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
class ViewPatternData : public View {
|
||||
public:
|
||||
ViewPatternData(prv::Provider* &dataProvider, std::vector<lang::PatternData*> &patternData);
|
||||
~ViewPatternData() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
prv::Provider* &m_dataProvider;
|
||||
std::vector<lang::PatternData*> &m_patternData;
|
||||
std::vector<lang::PatternData*> m_sortedPatternData;
|
||||
bool m_windowOpen = true;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
struct FoundString {
|
||||
std::string string;
|
||||
u64 offset;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
class ViewStrings : public View {
|
||||
public:
|
||||
explicit ViewStrings(prv::Provider* &dataProvider);
|
||||
~ViewStrings() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
prv::Provider* &m_dataProvider;
|
||||
bool m_windowOpen = true;
|
||||
bool m_shouldInvalidate = false;
|
||||
|
||||
std::vector<FoundString> m_foundStrings;
|
||||
int m_minimumLength = 5;
|
||||
char *m_filter;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex.hpp>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
|
||||
class ViewTools : public View {
|
||||
public:
|
||||
ViewTools();
|
||||
~ViewTools() override;
|
||||
|
||||
void createView() override;
|
||||
void createMenu() override;
|
||||
|
||||
private:
|
||||
bool m_windowOpen = true;
|
||||
|
||||
char *m_mangledBuffer = nullptr;
|
||||
char *m_demangledName = nullptr;
|
||||
|
||||
bool m_asciiTableShowOctal = false;
|
||||
|
||||
char *m_regexInput = nullptr;
|
||||
char *m_regexPattern = nullptr;
|
||||
char *m_replacePattern = nullptr;
|
||||
std::string m_regexOutput;
|
||||
|
||||
std::array<float, 4> m_pickedColor;
|
||||
|
||||
void drawDemangler();
|
||||
void drawASCIITable();
|
||||
void drawRegexReplacer();
|
||||
void drawColorPicker();
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <concepts>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "views/view.hpp"
|
||||
|
||||
struct GLFWwindow;
|
||||
|
||||
namespace hex {
|
||||
|
||||
class Window {
|
||||
public:
|
||||
Window();
|
||||
~Window();
|
||||
|
||||
void loop();
|
||||
|
||||
template<std::derived_from<View> T, typename ... Args>
|
||||
T* addView(Args&& ... args) {
|
||||
this->m_views.emplace_back(new T(std::forward<Args>(args)...));
|
||||
|
||||
return static_cast<T*>(this->m_views.back());
|
||||
}
|
||||
|
||||
public:
|
||||
float m_globalScale = 1.0f, m_fontScale = 1.0f;
|
||||
|
||||
private:
|
||||
void frameBegin();
|
||||
void frameEnd();
|
||||
|
||||
void initGLFW();
|
||||
void initImGui();
|
||||
void deinitGLFW();
|
||||
void deinitImGui();
|
||||
|
||||
GLFWwindow* m_window;
|
||||
std::vector<View*> m_views;
|
||||
bool m_fpsVisible = false;
|
||||
|
||||
static inline std::tuple<int, int> s_currShortcut = { -1, -1 };
|
||||
};
|
||||
|
||||
}
|
||||
1
lib/external/capstone
vendored
Submodule
1
lib/external/capstone
vendored
Submodule
Submodule lib/external/capstone added at c7c665f8f3
1
lib/external/curl
vendored
Submodule
1
lib/external/curl
vendored
Submodule
Submodule lib/external/curl added at 801bd5138c
1
lib/external/fmt
vendored
Submodule
1
lib/external/fmt
vendored
Submodule
Submodule lib/external/fmt added at d141cdbeb0
50
lib/external/imgui/CMakeLists.txt
vendored
Normal file
50
lib/external/imgui/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(imgui)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
pkg_search_module(GLFW REQUIRED glfw3)
|
||||
|
||||
if (UNIX)
|
||||
find_package(OpenGL REQUIRED)
|
||||
endif ()
|
||||
|
||||
add_library(imgui OBJECT
|
||||
source/imgui.cpp
|
||||
source/imgui_demo.cpp
|
||||
source/imgui_draw.cpp
|
||||
source/imgui_freetype.cpp
|
||||
source/imgui_impl_glfw.cpp
|
||||
source/imgui_impl_opengl3.cpp
|
||||
source/imgui_tables.cpp
|
||||
source/imgui_widgets.cpp
|
||||
|
||||
source/cimgui.cpp
|
||||
|
||||
source/TextEditor.cpp
|
||||
|
||||
source/imnodes.cpp
|
||||
|
||||
source/implot.cpp
|
||||
source/implot_items.cpp
|
||||
source/implot_demo.cpp
|
||||
|
||||
fonts/fontawesome_font.c
|
||||
fonts/codicons_font.c
|
||||
fonts/unifont_font.c
|
||||
)
|
||||
|
||||
add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD)
|
||||
|
||||
target_include_directories(imgui PUBLIC include fonts ${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS})
|
||||
|
||||
target_link_directories(imgui PUBLIC ${GLFW_LIBRARY_DIRS})
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(imgui PUBLIC Freetype::Freetype glfw3 opengl32.lib)
|
||||
elseif (UNIX)
|
||||
target_link_libraries(imgui PUBLIC Freetype::Freetype glfw OpenGL::GL)
|
||||
endif()
|
||||
1095
lib/external/imgui/fonts/codicons_font.c
vendored
Normal file
1095
lib/external/imgui/fonts/codicons_font.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
475
lib/external/imgui/fonts/codicons_font.h
vendored
Normal file
475
lib/external/imgui/fonts/codicons_font.h
vendored
Normal file
@@ -0,0 +1,475 @@
|
||||
// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++
|
||||
// from https://raw.githubusercontent.com/microsoft/vscode-codicons/main/dist/codicon.css
|
||||
// for use with https://github.com/microsoft/vscode-codicons/raw/main/dist/codicon.ttf
|
||||
#pragma once
|
||||
|
||||
#define FONT_ICON_FILE_NAME_VS "codicon.ttf"
|
||||
|
||||
extern const unsigned int codicons_compressed_size;
|
||||
extern const unsigned int codicons_compressed_data[52184/4];
|
||||
|
||||
#define ICON_MIN_VS 0xea60
|
||||
#define ICON_MAX_VS 0xebdd
|
||||
#define ICON_VS_ADD "\xee\xa9\xa0" // U+ea60
|
||||
#define ICON_VS_PLUS "\xee\xa9\xa0" // U+ea60
|
||||
#define ICON_VS_GIST_NEW "\xee\xa9\xa0" // U+ea60
|
||||
#define ICON_VS_REPO_CREATE "\xee\xa9\xa0" // U+ea60
|
||||
#define ICON_VS_LIGHTBULB "\xee\xa9\xa1" // U+ea61
|
||||
#define ICON_VS_LIGHT_BULB "\xee\xa9\xa1" // U+ea61
|
||||
#define ICON_VS_REPO "\xee\xa9\xa2" // U+ea62
|
||||
#define ICON_VS_REPO_DELETE "\xee\xa9\xa2" // U+ea62
|
||||
#define ICON_VS_GIST_FORK "\xee\xa9\xa3" // U+ea63
|
||||
#define ICON_VS_REPO_FORKED "\xee\xa9\xa3" // U+ea63
|
||||
#define ICON_VS_GIT_PULL_REQUEST "\xee\xa9\xa4" // U+ea64
|
||||
#define ICON_VS_GIT_PULL_REQUEST_ABANDONED "\xee\xa9\xa4" // U+ea64
|
||||
#define ICON_VS_RECORD_KEYS "\xee\xa9\xa5" // U+ea65
|
||||
#define ICON_VS_KEYBOARD "\xee\xa9\xa5" // U+ea65
|
||||
#define ICON_VS_TAG "\xee\xa9\xa6" // U+ea66
|
||||
#define ICON_VS_TAG_ADD "\xee\xa9\xa6" // U+ea66
|
||||
#define ICON_VS_TAG_REMOVE "\xee\xa9\xa6" // U+ea66
|
||||
#define ICON_VS_PERSON "\xee\xa9\xa7" // U+ea67
|
||||
#define ICON_VS_PERSON_FOLLOW "\xee\xa9\xa7" // U+ea67
|
||||
#define ICON_VS_PERSON_OUTLINE "\xee\xa9\xa7" // U+ea67
|
||||
#define ICON_VS_PERSON_FILLED "\xee\xa9\xa7" // U+ea67
|
||||
#define ICON_VS_GIT_BRANCH "\xee\xa9\xa8" // U+ea68
|
||||
#define ICON_VS_GIT_BRANCH_CREATE "\xee\xa9\xa8" // U+ea68
|
||||
#define ICON_VS_GIT_BRANCH_DELETE "\xee\xa9\xa8" // U+ea68
|
||||
#define ICON_VS_SOURCE_CONTROL "\xee\xa9\xa8" // U+ea68
|
||||
#define ICON_VS_MIRROR "\xee\xa9\xa9" // U+ea69
|
||||
#define ICON_VS_MIRROR_PUBLIC "\xee\xa9\xa9" // U+ea69
|
||||
#define ICON_VS_STAR "\xee\xa9\xaa" // U+ea6a
|
||||
#define ICON_VS_STAR_ADD "\xee\xa9\xaa" // U+ea6a
|
||||
#define ICON_VS_STAR_DELETE "\xee\xa9\xaa" // U+ea6a
|
||||
#define ICON_VS_STAR_EMPTY "\xee\xa9\xaa" // U+ea6a
|
||||
#define ICON_VS_COMMENT "\xee\xa9\xab" // U+ea6b
|
||||
#define ICON_VS_COMMENT_ADD "\xee\xa9\xab" // U+ea6b
|
||||
#define ICON_VS_ALERT "\xee\xa9\xac" // U+ea6c
|
||||
#define ICON_VS_WARNING "\xee\xa9\xac" // U+ea6c
|
||||
#define ICON_VS_SEARCH "\xee\xa9\xad" // U+ea6d
|
||||
#define ICON_VS_SEARCH_SAVE "\xee\xa9\xad" // U+ea6d
|
||||
#define ICON_VS_LOG_OUT "\xee\xa9\xae" // U+ea6e
|
||||
#define ICON_VS_SIGN_OUT "\xee\xa9\xae" // U+ea6e
|
||||
#define ICON_VS_LOG_IN "\xee\xa9\xaf" // U+ea6f
|
||||
#define ICON_VS_SIGN_IN "\xee\xa9\xaf" // U+ea6f
|
||||
#define ICON_VS_EYE "\xee\xa9\xb0" // U+ea70
|
||||
#define ICON_VS_EYE_UNWATCH "\xee\xa9\xb0" // U+ea70
|
||||
#define ICON_VS_EYE_WATCH "\xee\xa9\xb0" // U+ea70
|
||||
#define ICON_VS_CIRCLE_FILLED "\xee\xa9\xb1" // U+ea71
|
||||
#define ICON_VS_PRIMITIVE_DOT "\xee\xa9\xb1" // U+ea71
|
||||
#define ICON_VS_CLOSE_DIRTY "\xee\xa9\xb1" // U+ea71
|
||||
#define ICON_VS_DEBUG_BREAKPOINT "\xee\xa9\xb1" // U+ea71
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_DISABLED "\xee\xa9\xb1" // U+ea71
|
||||
#define ICON_VS_DEBUG_HINT "\xee\xa9\xb1" // U+ea71
|
||||
#define ICON_VS_PRIMITIVE_SQUARE "\xee\xa9\xb2" // U+ea72
|
||||
#define ICON_VS_EDIT "\xee\xa9\xb3" // U+ea73
|
||||
#define ICON_VS_PENCIL "\xee\xa9\xb3" // U+ea73
|
||||
#define ICON_VS_INFO "\xee\xa9\xb4" // U+ea74
|
||||
#define ICON_VS_ISSUE_OPENED "\xee\xa9\xb4" // U+ea74
|
||||
#define ICON_VS_GIST_PRIVATE "\xee\xa9\xb5" // U+ea75
|
||||
#define ICON_VS_GIT_FORK_PRIVATE "\xee\xa9\xb5" // U+ea75
|
||||
#define ICON_VS_LOCK "\xee\xa9\xb5" // U+ea75
|
||||
#define ICON_VS_MIRROR_PRIVATE "\xee\xa9\xb5" // U+ea75
|
||||
#define ICON_VS_CLOSE "\xee\xa9\xb6" // U+ea76
|
||||
#define ICON_VS_REMOVE_CLOSE "\xee\xa9\xb6" // U+ea76
|
||||
#define ICON_VS_X "\xee\xa9\xb6" // U+ea76
|
||||
#define ICON_VS_REPO_SYNC "\xee\xa9\xb7" // U+ea77
|
||||
#define ICON_VS_SYNC "\xee\xa9\xb7" // U+ea77
|
||||
#define ICON_VS_CLONE "\xee\xa9\xb8" // U+ea78
|
||||
#define ICON_VS_DESKTOP_DOWNLOAD "\xee\xa9\xb8" // U+ea78
|
||||
#define ICON_VS_BEAKER "\xee\xa9\xb9" // U+ea79
|
||||
#define ICON_VS_MICROSCOPE "\xee\xa9\xb9" // U+ea79
|
||||
#define ICON_VS_VM "\xee\xa9\xba" // U+ea7a
|
||||
#define ICON_VS_DEVICE_DESKTOP "\xee\xa9\xba" // U+ea7a
|
||||
#define ICON_VS_FILE "\xee\xa9\xbb" // U+ea7b
|
||||
#define ICON_VS_FILE_TEXT "\xee\xa9\xbb" // U+ea7b
|
||||
#define ICON_VS_MORE "\xee\xa9\xbc" // U+ea7c
|
||||
#define ICON_VS_ELLIPSIS "\xee\xa9\xbc" // U+ea7c
|
||||
#define ICON_VS_KEBAB_HORIZONTAL "\xee\xa9\xbc" // U+ea7c
|
||||
#define ICON_VS_MAIL_REPLY "\xee\xa9\xbd" // U+ea7d
|
||||
#define ICON_VS_REPLY "\xee\xa9\xbd" // U+ea7d
|
||||
#define ICON_VS_ORGANIZATION "\xee\xa9\xbe" // U+ea7e
|
||||
#define ICON_VS_ORGANIZATION_FILLED "\xee\xa9\xbe" // U+ea7e
|
||||
#define ICON_VS_ORGANIZATION_OUTLINE "\xee\xa9\xbe" // U+ea7e
|
||||
#define ICON_VS_NEW_FILE "\xee\xa9\xbf" // U+ea7f
|
||||
#define ICON_VS_FILE_ADD "\xee\xa9\xbf" // U+ea7f
|
||||
#define ICON_VS_NEW_FOLDER "\xee\xaa\x80" // U+ea80
|
||||
#define ICON_VS_FILE_DIRECTORY_CREATE "\xee\xaa\x80" // U+ea80
|
||||
#define ICON_VS_TRASH "\xee\xaa\x81" // U+ea81
|
||||
#define ICON_VS_TRASHCAN "\xee\xaa\x81" // U+ea81
|
||||
#define ICON_VS_HISTORY "\xee\xaa\x82" // U+ea82
|
||||
#define ICON_VS_CLOCK "\xee\xaa\x82" // U+ea82
|
||||
#define ICON_VS_FOLDER "\xee\xaa\x83" // U+ea83
|
||||
#define ICON_VS_FILE_DIRECTORY "\xee\xaa\x83" // U+ea83
|
||||
#define ICON_VS_SYMBOL_FOLDER "\xee\xaa\x83" // U+ea83
|
||||
#define ICON_VS_LOGO_GITHUB "\xee\xaa\x84" // U+ea84
|
||||
#define ICON_VS_MARK_GITHUB "\xee\xaa\x84" // U+ea84
|
||||
#define ICON_VS_GITHUB "\xee\xaa\x84" // U+ea84
|
||||
#define ICON_VS_TERMINAL "\xee\xaa\x85" // U+ea85
|
||||
#define ICON_VS_CONSOLE "\xee\xaa\x85" // U+ea85
|
||||
#define ICON_VS_REPL "\xee\xaa\x85" // U+ea85
|
||||
#define ICON_VS_ZAP "\xee\xaa\x86" // U+ea86
|
||||
#define ICON_VS_SYMBOL_EVENT "\xee\xaa\x86" // U+ea86
|
||||
#define ICON_VS_ERROR "\xee\xaa\x87" // U+ea87
|
||||
#define ICON_VS_STOP "\xee\xaa\x87" // U+ea87
|
||||
#define ICON_VS_VARIABLE "\xee\xaa\x88" // U+ea88
|
||||
#define ICON_VS_SYMBOL_VARIABLE "\xee\xaa\x88" // U+ea88
|
||||
#define ICON_VS_ARRAY "\xee\xaa\x8a" // U+ea8a
|
||||
#define ICON_VS_SYMBOL_ARRAY "\xee\xaa\x8a" // U+ea8a
|
||||
#define ICON_VS_SYMBOL_MODULE "\xee\xaa\x8b" // U+ea8b
|
||||
#define ICON_VS_SYMBOL_PACKAGE "\xee\xaa\x8b" // U+ea8b
|
||||
#define ICON_VS_SYMBOL_NAMESPACE "\xee\xaa\x8b" // U+ea8b
|
||||
#define ICON_VS_SYMBOL_OBJECT "\xee\xaa\x8b" // U+ea8b
|
||||
#define ICON_VS_SYMBOL_METHOD "\xee\xaa\x8c" // U+ea8c
|
||||
#define ICON_VS_SYMBOL_FUNCTION "\xee\xaa\x8c" // U+ea8c
|
||||
#define ICON_VS_SYMBOL_CONSTRUCTOR "\xee\xaa\x8c" // U+ea8c
|
||||
#define ICON_VS_SYMBOL_BOOLEAN "\xee\xaa\x8f" // U+ea8f
|
||||
#define ICON_VS_SYMBOL_NULL "\xee\xaa\x8f" // U+ea8f
|
||||
#define ICON_VS_SYMBOL_NUMERIC "\xee\xaa\x90" // U+ea90
|
||||
#define ICON_VS_SYMBOL_NUMBER "\xee\xaa\x90" // U+ea90
|
||||
#define ICON_VS_SYMBOL_STRUCTURE "\xee\xaa\x91" // U+ea91
|
||||
#define ICON_VS_SYMBOL_STRUCT "\xee\xaa\x91" // U+ea91
|
||||
#define ICON_VS_SYMBOL_PARAMETER "\xee\xaa\x92" // U+ea92
|
||||
#define ICON_VS_SYMBOL_TYPE_PARAMETER "\xee\xaa\x92" // U+ea92
|
||||
#define ICON_VS_SYMBOL_KEY "\xee\xaa\x93" // U+ea93
|
||||
#define ICON_VS_SYMBOL_TEXT "\xee\xaa\x93" // U+ea93
|
||||
#define ICON_VS_SYMBOL_REFERENCE "\xee\xaa\x94" // U+ea94
|
||||
#define ICON_VS_GO_TO_FILE "\xee\xaa\x94" // U+ea94
|
||||
#define ICON_VS_SYMBOL_ENUM "\xee\xaa\x95" // U+ea95
|
||||
#define ICON_VS_SYMBOL_VALUE "\xee\xaa\x95" // U+ea95
|
||||
#define ICON_VS_SYMBOL_RULER "\xee\xaa\x96" // U+ea96
|
||||
#define ICON_VS_SYMBOL_UNIT "\xee\xaa\x96" // U+ea96
|
||||
#define ICON_VS_ACTIVATE_BREAKPOINTS "\xee\xaa\x97" // U+ea97
|
||||
#define ICON_VS_ARCHIVE "\xee\xaa\x98" // U+ea98
|
||||
#define ICON_VS_ARROW_BOTH "\xee\xaa\x99" // U+ea99
|
||||
#define ICON_VS_ARROW_DOWN "\xee\xaa\x9a" // U+ea9a
|
||||
#define ICON_VS_ARROW_LEFT "\xee\xaa\x9b" // U+ea9b
|
||||
#define ICON_VS_ARROW_RIGHT "\xee\xaa\x9c" // U+ea9c
|
||||
#define ICON_VS_ARROW_SMALL_DOWN "\xee\xaa\x9d" // U+ea9d
|
||||
#define ICON_VS_ARROW_SMALL_LEFT "\xee\xaa\x9e" // U+ea9e
|
||||
#define ICON_VS_ARROW_SMALL_RIGHT "\xee\xaa\x9f" // U+ea9f
|
||||
#define ICON_VS_ARROW_SMALL_UP "\xee\xaa\xa0" // U+eaa0
|
||||
#define ICON_VS_ARROW_UP "\xee\xaa\xa1" // U+eaa1
|
||||
#define ICON_VS_BELL "\xee\xaa\xa2" // U+eaa2
|
||||
#define ICON_VS_BOLD "\xee\xaa\xa3" // U+eaa3
|
||||
#define ICON_VS_BOOK "\xee\xaa\xa4" // U+eaa4
|
||||
#define ICON_VS_BOOKMARK "\xee\xaa\xa5" // U+eaa5
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_CONDITIONAL_UNVERIFIED "\xee\xaa\xa6" // U+eaa6
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_CONDITIONAL "\xee\xaa\xa7" // U+eaa7
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_CONDITIONAL_DISABLED "\xee\xaa\xa7" // U+eaa7
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_DATA_UNVERIFIED "\xee\xaa\xa8" // U+eaa8
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_DATA "\xee\xaa\xa9" // U+eaa9
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_DATA_DISABLED "\xee\xaa\xa9" // U+eaa9
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_LOG_UNVERIFIED "\xee\xaa\xaa" // U+eaaa
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_LOG "\xee\xaa\xab" // U+eaab
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_LOG_DISABLED "\xee\xaa\xab" // U+eaab
|
||||
#define ICON_VS_BRIEFCASE "\xee\xaa\xac" // U+eaac
|
||||
#define ICON_VS_BROADCAST "\xee\xaa\xad" // U+eaad
|
||||
#define ICON_VS_BROWSER "\xee\xaa\xae" // U+eaae
|
||||
#define ICON_VS_BUG "\xee\xaa\xaf" // U+eaaf
|
||||
#define ICON_VS_CALENDAR "\xee\xaa\xb0" // U+eab0
|
||||
#define ICON_VS_CASE_SENSITIVE "\xee\xaa\xb1" // U+eab1
|
||||
#define ICON_VS_CHECK "\xee\xaa\xb2" // U+eab2
|
||||
#define ICON_VS_CHECKLIST "\xee\xaa\xb3" // U+eab3
|
||||
#define ICON_VS_CHEVRON_DOWN "\xee\xaa\xb4" // U+eab4
|
||||
#define ICON_VS_CHEVRON_LEFT "\xee\xaa\xb5" // U+eab5
|
||||
#define ICON_VS_CHEVRON_RIGHT "\xee\xaa\xb6" // U+eab6
|
||||
#define ICON_VS_CHEVRON_UP "\xee\xaa\xb7" // U+eab7
|
||||
#define ICON_VS_CHROME_CLOSE "\xee\xaa\xb8" // U+eab8
|
||||
#define ICON_VS_CHROME_MAXIMIZE "\xee\xaa\xb9" // U+eab9
|
||||
#define ICON_VS_CHROME_MINIMIZE "\xee\xaa\xba" // U+eaba
|
||||
#define ICON_VS_CHROME_RESTORE "\xee\xaa\xbb" // U+eabb
|
||||
#define ICON_VS_CIRCLE_OUTLINE "\xee\xaa\xbc" // U+eabc
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_UNVERIFIED "\xee\xaa\xbc" // U+eabc
|
||||
#define ICON_VS_CIRCLE_SLASH "\xee\xaa\xbd" // U+eabd
|
||||
#define ICON_VS_CIRCUIT_BOARD "\xee\xaa\xbe" // U+eabe
|
||||
#define ICON_VS_CLEAR_ALL "\xee\xaa\xbf" // U+eabf
|
||||
#define ICON_VS_CLIPPY "\xee\xab\x80" // U+eac0
|
||||
#define ICON_VS_CLOSE_ALL "\xee\xab\x81" // U+eac1
|
||||
#define ICON_VS_CLOUD_DOWNLOAD "\xee\xab\x82" // U+eac2
|
||||
#define ICON_VS_CLOUD_UPLOAD "\xee\xab\x83" // U+eac3
|
||||
#define ICON_VS_CODE "\xee\xab\x84" // U+eac4
|
||||
#define ICON_VS_COLLAPSE_ALL "\xee\xab\x85" // U+eac5
|
||||
#define ICON_VS_COLOR_MODE "\xee\xab\x86" // U+eac6
|
||||
#define ICON_VS_COMMENT_DISCUSSION "\xee\xab\x87" // U+eac7
|
||||
#define ICON_VS_CREDIT_CARD "\xee\xab\x89" // U+eac9
|
||||
#define ICON_VS_DASH "\xee\xab\x8c" // U+eacc
|
||||
#define ICON_VS_DASHBOARD "\xee\xab\x8d" // U+eacd
|
||||
#define ICON_VS_DATABASE "\xee\xab\x8e" // U+eace
|
||||
#define ICON_VS_DEBUG_CONTINUE "\xee\xab\x8f" // U+eacf
|
||||
#define ICON_VS_DEBUG_DISCONNECT "\xee\xab\x90" // U+ead0
|
||||
#define ICON_VS_DEBUG_PAUSE "\xee\xab\x91" // U+ead1
|
||||
#define ICON_VS_DEBUG_RESTART "\xee\xab\x92" // U+ead2
|
||||
#define ICON_VS_DEBUG_START "\xee\xab\x93" // U+ead3
|
||||
#define ICON_VS_DEBUG_STEP_INTO "\xee\xab\x94" // U+ead4
|
||||
#define ICON_VS_DEBUG_STEP_OUT "\xee\xab\x95" // U+ead5
|
||||
#define ICON_VS_DEBUG_STEP_OVER "\xee\xab\x96" // U+ead6
|
||||
#define ICON_VS_DEBUG_STOP "\xee\xab\x97" // U+ead7
|
||||
#define ICON_VS_DEBUG "\xee\xab\x98" // U+ead8
|
||||
#define ICON_VS_DEVICE_CAMERA_VIDEO "\xee\xab\x99" // U+ead9
|
||||
#define ICON_VS_DEVICE_CAMERA "\xee\xab\x9a" // U+eada
|
||||
#define ICON_VS_DEVICE_MOBILE "\xee\xab\x9b" // U+eadb
|
||||
#define ICON_VS_DIFF_ADDED "\xee\xab\x9c" // U+eadc
|
||||
#define ICON_VS_DIFF_IGNORED "\xee\xab\x9d" // U+eadd
|
||||
#define ICON_VS_DIFF_MODIFIED "\xee\xab\x9e" // U+eade
|
||||
#define ICON_VS_DIFF_REMOVED "\xee\xab\x9f" // U+eadf
|
||||
#define ICON_VS_DIFF_RENAMED "\xee\xab\xa0" // U+eae0
|
||||
#define ICON_VS_DIFF "\xee\xab\xa1" // U+eae1
|
||||
#define ICON_VS_DISCARD "\xee\xab\xa2" // U+eae2
|
||||
#define ICON_VS_EDITOR_LAYOUT "\xee\xab\xa3" // U+eae3
|
||||
#define ICON_VS_EMPTY_WINDOW "\xee\xab\xa4" // U+eae4
|
||||
#define ICON_VS_EXCLUDE "\xee\xab\xa5" // U+eae5
|
||||
#define ICON_VS_EXTENSIONS "\xee\xab\xa6" // U+eae6
|
||||
#define ICON_VS_EYE_CLOSED "\xee\xab\xa7" // U+eae7
|
||||
#define ICON_VS_FILE_BINARY "\xee\xab\xa8" // U+eae8
|
||||
#define ICON_VS_FILE_CODE "\xee\xab\xa9" // U+eae9
|
||||
#define ICON_VS_FILE_MEDIA "\xee\xab\xaa" // U+eaea
|
||||
#define ICON_VS_FILE_PDF "\xee\xab\xab" // U+eaeb
|
||||
#define ICON_VS_FILE_SUBMODULE "\xee\xab\xac" // U+eaec
|
||||
#define ICON_VS_FILE_SYMLINK_DIRECTORY "\xee\xab\xad" // U+eaed
|
||||
#define ICON_VS_FILE_SYMLINK_FILE "\xee\xab\xae" // U+eaee
|
||||
#define ICON_VS_FILE_ZIP "\xee\xab\xaf" // U+eaef
|
||||
#define ICON_VS_FILES "\xee\xab\xb0" // U+eaf0
|
||||
#define ICON_VS_FILTER "\xee\xab\xb1" // U+eaf1
|
||||
#define ICON_VS_FLAME "\xee\xab\xb2" // U+eaf2
|
||||
#define ICON_VS_FOLD_DOWN "\xee\xab\xb3" // U+eaf3
|
||||
#define ICON_VS_FOLD_UP "\xee\xab\xb4" // U+eaf4
|
||||
#define ICON_VS_FOLD "\xee\xab\xb5" // U+eaf5
|
||||
#define ICON_VS_FOLDER_ACTIVE "\xee\xab\xb6" // U+eaf6
|
||||
#define ICON_VS_FOLDER_OPENED "\xee\xab\xb7" // U+eaf7
|
||||
#define ICON_VS_GEAR "\xee\xab\xb8" // U+eaf8
|
||||
#define ICON_VS_GIFT "\xee\xab\xb9" // U+eaf9
|
||||
#define ICON_VS_GIST_SECRET "\xee\xab\xba" // U+eafa
|
||||
#define ICON_VS_GIST "\xee\xab\xbb" // U+eafb
|
||||
#define ICON_VS_GIT_COMMIT "\xee\xab\xbc" // U+eafc
|
||||
#define ICON_VS_GIT_COMPARE "\xee\xab\xbd" // U+eafd
|
||||
#define ICON_VS_COMPARE_CHANGES "\xee\xab\xbd" // U+eafd
|
||||
#define ICON_VS_GIT_MERGE "\xee\xab\xbe" // U+eafe
|
||||
#define ICON_VS_GITHUB_ACTION "\xee\xab\xbf" // U+eaff
|
||||
#define ICON_VS_GITHUB_ALT "\xee\xac\x80" // U+eb00
|
||||
#define ICON_VS_GLOBE "\xee\xac\x81" // U+eb01
|
||||
#define ICON_VS_GRABBER "\xee\xac\x82" // U+eb02
|
||||
#define ICON_VS_GRAPH "\xee\xac\x83" // U+eb03
|
||||
#define ICON_VS_GRIPPER "\xee\xac\x84" // U+eb04
|
||||
#define ICON_VS_HEART "\xee\xac\x85" // U+eb05
|
||||
#define ICON_VS_HOME "\xee\xac\x86" // U+eb06
|
||||
#define ICON_VS_HORIZONTAL_RULE "\xee\xac\x87" // U+eb07
|
||||
#define ICON_VS_HUBOT "\xee\xac\x88" // U+eb08
|
||||
#define ICON_VS_INBOX "\xee\xac\x89" // U+eb09
|
||||
#define ICON_VS_ISSUE_REOPENED "\xee\xac\x8b" // U+eb0b
|
||||
#define ICON_VS_ISSUES "\xee\xac\x8c" // U+eb0c
|
||||
#define ICON_VS_ITALIC "\xee\xac\x8d" // U+eb0d
|
||||
#define ICON_VS_JERSEY "\xee\xac\x8e" // U+eb0e
|
||||
#define ICON_VS_JSON "\xee\xac\x8f" // U+eb0f
|
||||
#define ICON_VS_KEBAB_VERTICAL "\xee\xac\x90" // U+eb10
|
||||
#define ICON_VS_KEY "\xee\xac\x91" // U+eb11
|
||||
#define ICON_VS_LAW "\xee\xac\x92" // U+eb12
|
||||
#define ICON_VS_LIGHTBULB_AUTOFIX "\xee\xac\x93" // U+eb13
|
||||
#define ICON_VS_LINK_EXTERNAL "\xee\xac\x94" // U+eb14
|
||||
#define ICON_VS_LINK "\xee\xac\x95" // U+eb15
|
||||
#define ICON_VS_LIST_ORDERED "\xee\xac\x96" // U+eb16
|
||||
#define ICON_VS_LIST_UNORDERED "\xee\xac\x97" // U+eb17
|
||||
#define ICON_VS_LIVE_SHARE "\xee\xac\x98" // U+eb18
|
||||
#define ICON_VS_LOADING "\xee\xac\x99" // U+eb19
|
||||
#define ICON_VS_LOCATION "\xee\xac\x9a" // U+eb1a
|
||||
#define ICON_VS_MAIL_READ "\xee\xac\x9b" // U+eb1b
|
||||
#define ICON_VS_MAIL "\xee\xac\x9c" // U+eb1c
|
||||
#define ICON_VS_MARKDOWN "\xee\xac\x9d" // U+eb1d
|
||||
#define ICON_VS_MEGAPHONE "\xee\xac\x9e" // U+eb1e
|
||||
#define ICON_VS_MENTION "\xee\xac\x9f" // U+eb1f
|
||||
#define ICON_VS_MILESTONE "\xee\xac\xa0" // U+eb20
|
||||
#define ICON_VS_MORTAR_BOARD "\xee\xac\xa1" // U+eb21
|
||||
#define ICON_VS_MOVE "\xee\xac\xa2" // U+eb22
|
||||
#define ICON_VS_MULTIPLE_WINDOWS "\xee\xac\xa3" // U+eb23
|
||||
#define ICON_VS_MUTE "\xee\xac\xa4" // U+eb24
|
||||
#define ICON_VS_NO_NEWLINE "\xee\xac\xa5" // U+eb25
|
||||
#define ICON_VS_NOTE "\xee\xac\xa6" // U+eb26
|
||||
#define ICON_VS_OCTOFACE "\xee\xac\xa7" // U+eb27
|
||||
#define ICON_VS_OPEN_PREVIEW "\xee\xac\xa8" // U+eb28
|
||||
#define ICON_VS_PACKAGE "\xee\xac\xa9" // U+eb29
|
||||
#define ICON_VS_PAINTCAN "\xee\xac\xaa" // U+eb2a
|
||||
#define ICON_VS_PIN "\xee\xac\xab" // U+eb2b
|
||||
#define ICON_VS_PLAY "\xee\xac\xac" // U+eb2c
|
||||
#define ICON_VS_RUN "\xee\xac\xac" // U+eb2c
|
||||
#define ICON_VS_PLUG "\xee\xac\xad" // U+eb2d
|
||||
#define ICON_VS_PRESERVE_CASE "\xee\xac\xae" // U+eb2e
|
||||
#define ICON_VS_PREVIEW "\xee\xac\xaf" // U+eb2f
|
||||
#define ICON_VS_PROJECT "\xee\xac\xb0" // U+eb30
|
||||
#define ICON_VS_PULSE "\xee\xac\xb1" // U+eb31
|
||||
#define ICON_VS_QUESTION "\xee\xac\xb2" // U+eb32
|
||||
#define ICON_VS_QUOTE "\xee\xac\xb3" // U+eb33
|
||||
#define ICON_VS_RADIO_TOWER "\xee\xac\xb4" // U+eb34
|
||||
#define ICON_VS_REACTIONS "\xee\xac\xb5" // U+eb35
|
||||
#define ICON_VS_REFERENCES "\xee\xac\xb6" // U+eb36
|
||||
#define ICON_VS_REFRESH "\xee\xac\xb7" // U+eb37
|
||||
#define ICON_VS_REGEX "\xee\xac\xb8" // U+eb38
|
||||
#define ICON_VS_REMOTE_EXPLORER "\xee\xac\xb9" // U+eb39
|
||||
#define ICON_VS_REMOTE "\xee\xac\xba" // U+eb3a
|
||||
#define ICON_VS_REMOVE "\xee\xac\xbb" // U+eb3b
|
||||
#define ICON_VS_REPLACE_ALL "\xee\xac\xbc" // U+eb3c
|
||||
#define ICON_VS_REPLACE "\xee\xac\xbd" // U+eb3d
|
||||
#define ICON_VS_REPO_CLONE "\xee\xac\xbe" // U+eb3e
|
||||
#define ICON_VS_REPO_FORCE_PUSH "\xee\xac\xbf" // U+eb3f
|
||||
#define ICON_VS_REPO_PULL "\xee\xad\x80" // U+eb40
|
||||
#define ICON_VS_REPO_PUSH "\xee\xad\x81" // U+eb41
|
||||
#define ICON_VS_REPORT "\xee\xad\x82" // U+eb42
|
||||
#define ICON_VS_REQUEST_CHANGES "\xee\xad\x83" // U+eb43
|
||||
#define ICON_VS_ROCKET "\xee\xad\x84" // U+eb44
|
||||
#define ICON_VS_ROOT_FOLDER_OPENED "\xee\xad\x85" // U+eb45
|
||||
#define ICON_VS_ROOT_FOLDER "\xee\xad\x86" // U+eb46
|
||||
#define ICON_VS_RSS "\xee\xad\x87" // U+eb47
|
||||
#define ICON_VS_RUBY "\xee\xad\x88" // U+eb48
|
||||
#define ICON_VS_SAVE_ALL "\xee\xad\x89" // U+eb49
|
||||
#define ICON_VS_SAVE_AS "\xee\xad\x8a" // U+eb4a
|
||||
#define ICON_VS_SAVE "\xee\xad\x8b" // U+eb4b
|
||||
#define ICON_VS_SCREEN_FULL "\xee\xad\x8c" // U+eb4c
|
||||
#define ICON_VS_SCREEN_NORMAL "\xee\xad\x8d" // U+eb4d
|
||||
#define ICON_VS_SEARCH_STOP "\xee\xad\x8e" // U+eb4e
|
||||
#define ICON_VS_SERVER "\xee\xad\x90" // U+eb50
|
||||
#define ICON_VS_SETTINGS_GEAR "\xee\xad\x91" // U+eb51
|
||||
#define ICON_VS_SETTINGS "\xee\xad\x92" // U+eb52
|
||||
#define ICON_VS_SHIELD "\xee\xad\x93" // U+eb53
|
||||
#define ICON_VS_SMILEY "\xee\xad\x94" // U+eb54
|
||||
#define ICON_VS_SORT_PRECEDENCE "\xee\xad\x95" // U+eb55
|
||||
#define ICON_VS_SPLIT_HORIZONTAL "\xee\xad\x96" // U+eb56
|
||||
#define ICON_VS_SPLIT_VERTICAL "\xee\xad\x97" // U+eb57
|
||||
#define ICON_VS_SQUIRREL "\xee\xad\x98" // U+eb58
|
||||
#define ICON_VS_STAR_FULL "\xee\xad\x99" // U+eb59
|
||||
#define ICON_VS_STAR_HALF "\xee\xad\x9a" // U+eb5a
|
||||
#define ICON_VS_SYMBOL_CLASS "\xee\xad\x9b" // U+eb5b
|
||||
#define ICON_VS_SYMBOL_COLOR "\xee\xad\x9c" // U+eb5c
|
||||
#define ICON_VS_SYMBOL_CONSTANT "\xee\xad\x9d" // U+eb5d
|
||||
#define ICON_VS_SYMBOL_ENUM_MEMBER "\xee\xad\x9e" // U+eb5e
|
||||
#define ICON_VS_SYMBOL_FIELD "\xee\xad\x9f" // U+eb5f
|
||||
#define ICON_VS_SYMBOL_FILE "\xee\xad\xa0" // U+eb60
|
||||
#define ICON_VS_SYMBOL_INTERFACE "\xee\xad\xa1" // U+eb61
|
||||
#define ICON_VS_SYMBOL_KEYWORD "\xee\xad\xa2" // U+eb62
|
||||
#define ICON_VS_SYMBOL_MISC "\xee\xad\xa3" // U+eb63
|
||||
#define ICON_VS_SYMBOL_OPERATOR "\xee\xad\xa4" // U+eb64
|
||||
#define ICON_VS_SYMBOL_PROPERTY "\xee\xad\xa5" // U+eb65
|
||||
#define ICON_VS_WRENCH "\xee\xad\xa5" // U+eb65
|
||||
#define ICON_VS_WRENCH_SUBACTION "\xee\xad\xa5" // U+eb65
|
||||
#define ICON_VS_SYMBOL_SNIPPET "\xee\xad\xa6" // U+eb66
|
||||
#define ICON_VS_TASKLIST "\xee\xad\xa7" // U+eb67
|
||||
#define ICON_VS_TELESCOPE "\xee\xad\xa8" // U+eb68
|
||||
#define ICON_VS_TEXT_SIZE "\xee\xad\xa9" // U+eb69
|
||||
#define ICON_VS_THREE_BARS "\xee\xad\xaa" // U+eb6a
|
||||
#define ICON_VS_THUMBSDOWN "\xee\xad\xab" // U+eb6b
|
||||
#define ICON_VS_THUMBSUP "\xee\xad\xac" // U+eb6c
|
||||
#define ICON_VS_TOOLS "\xee\xad\xad" // U+eb6d
|
||||
#define ICON_VS_TRIANGLE_DOWN "\xee\xad\xae" // U+eb6e
|
||||
#define ICON_VS_TRIANGLE_LEFT "\xee\xad\xaf" // U+eb6f
|
||||
#define ICON_VS_TRIANGLE_RIGHT "\xee\xad\xb0" // U+eb70
|
||||
#define ICON_VS_TRIANGLE_UP "\xee\xad\xb1" // U+eb71
|
||||
#define ICON_VS_TWITTER "\xee\xad\xb2" // U+eb72
|
||||
#define ICON_VS_UNFOLD "\xee\xad\xb3" // U+eb73
|
||||
#define ICON_VS_UNLOCK "\xee\xad\xb4" // U+eb74
|
||||
#define ICON_VS_UNMUTE "\xee\xad\xb5" // U+eb75
|
||||
#define ICON_VS_UNVERIFIED "\xee\xad\xb6" // U+eb76
|
||||
#define ICON_VS_VERIFIED "\xee\xad\xb7" // U+eb77
|
||||
#define ICON_VS_VERSIONS "\xee\xad\xb8" // U+eb78
|
||||
#define ICON_VS_VM_ACTIVE "\xee\xad\xb9" // U+eb79
|
||||
#define ICON_VS_VM_OUTLINE "\xee\xad\xba" // U+eb7a
|
||||
#define ICON_VS_VM_RUNNING "\xee\xad\xbb" // U+eb7b
|
||||
#define ICON_VS_WATCH "\xee\xad\xbc" // U+eb7c
|
||||
#define ICON_VS_WHITESPACE "\xee\xad\xbd" // U+eb7d
|
||||
#define ICON_VS_WHOLE_WORD "\xee\xad\xbe" // U+eb7e
|
||||
#define ICON_VS_WINDOW "\xee\xad\xbf" // U+eb7f
|
||||
#define ICON_VS_WORD_WRAP "\xee\xae\x80" // U+eb80
|
||||
#define ICON_VS_ZOOM_IN "\xee\xae\x81" // U+eb81
|
||||
#define ICON_VS_ZOOM_OUT "\xee\xae\x82" // U+eb82
|
||||
#define ICON_VS_LIST_FILTER "\xee\xae\x83" // U+eb83
|
||||
#define ICON_VS_LIST_FLAT "\xee\xae\x84" // U+eb84
|
||||
#define ICON_VS_LIST_SELECTION "\xee\xae\x85" // U+eb85
|
||||
#define ICON_VS_SELECTION "\xee\xae\x85" // U+eb85
|
||||
#define ICON_VS_LIST_TREE "\xee\xae\x86" // U+eb86
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_FUNCTION_UNVERIFIED "\xee\xae\x87" // U+eb87
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_FUNCTION "\xee\xae\x88" // U+eb88
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_FUNCTION_DISABLED "\xee\xae\x88" // U+eb88
|
||||
#define ICON_VS_DEBUG_STACKFRAME_ACTIVE "\xee\xae\x89" // U+eb89
|
||||
#define ICON_VS_DEBUG_STACKFRAME_DOT "\xee\xae\x8a" // U+eb8a
|
||||
#define ICON_VS_DEBUG_STACKFRAME "\xee\xae\x8b" // U+eb8b
|
||||
#define ICON_VS_DEBUG_STACKFRAME_FOCUSED "\xee\xae\x8b" // U+eb8b
|
||||
#define ICON_VS_DEBUG_BREAKPOINT_UNSUPPORTED "\xee\xae\x8c" // U+eb8c
|
||||
#define ICON_VS_SYMBOL_STRING "\xee\xae\x8d" // U+eb8d
|
||||
#define ICON_VS_DEBUG_REVERSE_CONTINUE "\xee\xae\x8e" // U+eb8e
|
||||
#define ICON_VS_DEBUG_STEP_BACK "\xee\xae\x8f" // U+eb8f
|
||||
#define ICON_VS_DEBUG_RESTART_FRAME "\xee\xae\x90" // U+eb90
|
||||
#define ICON_VS_DEBUG_ALT "\xee\xae\x91" // U+eb91
|
||||
#define ICON_VS_CALL_INCOMING "\xee\xae\x92" // U+eb92
|
||||
#define ICON_VS_CALL_OUTGOING "\xee\xae\x93" // U+eb93
|
||||
#define ICON_VS_MENU "\xee\xae\x94" // U+eb94
|
||||
#define ICON_VS_EXPAND_ALL "\xee\xae\x95" // U+eb95
|
||||
#define ICON_VS_FEEDBACK "\xee\xae\x96" // U+eb96
|
||||
#define ICON_VS_GROUP_BY_REF_TYPE "\xee\xae\x97" // U+eb97
|
||||
#define ICON_VS_UNGROUP_BY_REF_TYPE "\xee\xae\x98" // U+eb98
|
||||
#define ICON_VS_ACCOUNT "\xee\xae\x99" // U+eb99
|
||||
#define ICON_VS_BELL_DOT "\xee\xae\x9a" // U+eb9a
|
||||
#define ICON_VS_DEBUG_CONSOLE "\xee\xae\x9b" // U+eb9b
|
||||
#define ICON_VS_LIBRARY "\xee\xae\x9c" // U+eb9c
|
||||
#define ICON_VS_OUTPUT "\xee\xae\x9d" // U+eb9d
|
||||
#define ICON_VS_RUN_ALL "\xee\xae\x9e" // U+eb9e
|
||||
#define ICON_VS_SYNC_IGNORED "\xee\xae\x9f" // U+eb9f
|
||||
#define ICON_VS_PINNED "\xee\xae\xa0" // U+eba0
|
||||
#define ICON_VS_GITHUB_INVERTED "\xee\xae\xa1" // U+eba1
|
||||
#define ICON_VS_SERVER_PROCESS "\xee\xae\xa2" // U+eba2
|
||||
#define ICON_VS_SERVER_ENVIRONMENT "\xee\xae\xa3" // U+eba3
|
||||
#define ICON_VS_PASS "\xee\xae\xa4" // U+eba4
|
||||
#define ICON_VS_ISSUE_CLOSED "\xee\xae\xa4" // U+eba4
|
||||
#define ICON_VS_STOP_CIRCLE "\xee\xae\xa5" // U+eba5
|
||||
#define ICON_VS_PLAY_CIRCLE "\xee\xae\xa6" // U+eba6
|
||||
#define ICON_VS_RECORD "\xee\xae\xa7" // U+eba7
|
||||
#define ICON_VS_DEBUG_ALT_SMALL "\xee\xae\xa8" // U+eba8
|
||||
#define ICON_VS_VM_CONNECT "\xee\xae\xa9" // U+eba9
|
||||
#define ICON_VS_CLOUD "\xee\xae\xaa" // U+ebaa
|
||||
#define ICON_VS_MERGE "\xee\xae\xab" // U+ebab
|
||||
#define ICON_VS_EXPORT "\xee\xae\xac" // U+ebac
|
||||
#define ICON_VS_GRAPH_LEFT "\xee\xae\xad" // U+ebad
|
||||
#define ICON_VS_MAGNET "\xee\xae\xae" // U+ebae
|
||||
#define ICON_VS_NOTEBOOK "\xee\xae\xaf" // U+ebaf
|
||||
#define ICON_VS_REDO "\xee\xae\xb0" // U+ebb0
|
||||
#define ICON_VS_CHECK_ALL "\xee\xae\xb1" // U+ebb1
|
||||
#define ICON_VS_PINNED_DIRTY "\xee\xae\xb2" // U+ebb2
|
||||
#define ICON_VS_PASS_FILLED "\xee\xae\xb3" // U+ebb3
|
||||
#define ICON_VS_CIRCLE_LARGE_FILLED "\xee\xae\xb4" // U+ebb4
|
||||
#define ICON_VS_CIRCLE_LARGE_OUTLINE "\xee\xae\xb5" // U+ebb5
|
||||
#define ICON_VS_COMBINE "\xee\xae\xb6" // U+ebb6
|
||||
#define ICON_VS_GATHER "\xee\xae\xb6" // U+ebb6
|
||||
#define ICON_VS_TABLE "\xee\xae\xb7" // U+ebb7
|
||||
#define ICON_VS_VARIABLE_GROUP "\xee\xae\xb8" // U+ebb8
|
||||
#define ICON_VS_TYPE_HIERARCHY "\xee\xae\xb9" // U+ebb9
|
||||
#define ICON_VS_TYPE_HIERARCHY_SUB "\xee\xae\xba" // U+ebba
|
||||
#define ICON_VS_TYPE_HIERARCHY_SUPER "\xee\xae\xbb" // U+ebbb
|
||||
#define ICON_VS_GIT_PULL_REQUEST_CREATE "\xee\xae\xbc" // U+ebbc
|
||||
#define ICON_VS_RUN_ABOVE "\xee\xae\xbd" // U+ebbd
|
||||
#define ICON_VS_RUN_BELOW "\xee\xae\xbe" // U+ebbe
|
||||
#define ICON_VS_NOTEBOOK_TEMPLATE "\xee\xae\xbf" // U+ebbf
|
||||
#define ICON_VS_DEBUG_RERUN "\xee\xaf\x80" // U+ebc0
|
||||
#define ICON_VS_WORKSPACE_TRUSTED "\xee\xaf\x81" // U+ebc1
|
||||
#define ICON_VS_WORKSPACE_UNTRUSTED "\xee\xaf\x82" // U+ebc2
|
||||
#define ICON_VS_WORKSPACE_UNKNOWN "\xee\xaf\x83" // U+ebc3
|
||||
#define ICON_VS_TERMINAL_CMD "\xee\xaf\x84" // U+ebc4
|
||||
#define ICON_VS_TERMINAL_DEBIAN "\xee\xaf\x85" // U+ebc5
|
||||
#define ICON_VS_TERMINAL_LINUX "\xee\xaf\x86" // U+ebc6
|
||||
#define ICON_VS_TERMINAL_POWERSHELL "\xee\xaf\x87" // U+ebc7
|
||||
#define ICON_VS_TERMINAL_TMUX "\xee\xaf\x88" // U+ebc8
|
||||
#define ICON_VS_TERMINAL_UBUNTU "\xee\xaf\x89" // U+ebc9
|
||||
#define ICON_VS_TERMINAL_BASH "\xee\xaf\x8a" // U+ebca
|
||||
#define ICON_VS_ARROW_SWAP "\xee\xaf\x8b" // U+ebcb
|
||||
#define ICON_VS_COPY "\xee\xaf\x8c" // U+ebcc
|
||||
#define ICON_VS_PERSON_ADD "\xee\xaf\x8d" // U+ebcd
|
||||
#define ICON_VS_FILTER_FILLED "\xee\xaf\x8e" // U+ebce
|
||||
#define ICON_VS_WAND "\xee\xaf\x8f" // U+ebcf
|
||||
#define ICON_VS_DEBUG_LINE_BY_LINE "\xee\xaf\x90" // U+ebd0
|
||||
#define ICON_VS_INSPECT "\xee\xaf\x91" // U+ebd1
|
||||
#define ICON_VS_LAYERS "\xee\xaf\x92" // U+ebd2
|
||||
#define ICON_VS_LAYERS_DOT "\xee\xaf\x93" // U+ebd3
|
||||
#define ICON_VS_LAYERS_ACTIVE "\xee\xaf\x94" // U+ebd4
|
||||
#define ICON_VS_COMPASS "\xee\xaf\x95" // U+ebd5
|
||||
#define ICON_VS_COMPASS_DOT "\xee\xaf\x96" // U+ebd6
|
||||
#define ICON_VS_COMPASS_ACTIVE "\xee\xaf\x97" // U+ebd7
|
||||
#define ICON_VS_AZURE "\xee\xaf\x98" // U+ebd8
|
||||
#define ICON_VS_ISSUE_DRAFT "\xee\xaf\x99" // U+ebd9
|
||||
#define ICON_VS_GIT_PULL_REQUEST_CLOSED "\xee\xaf\x9a" // U+ebda
|
||||
#define ICON_VS_GIT_PULL_REQUEST_DRAFT "\xee\xaf\x9b" // U+ebdb
|
||||
#define ICON_VS_DEBUG_ALL "\xee\xaf\x9c" // U+ebdc
|
||||
#define ICON_VS_DEBUG_COVERAGE "\xee\xaf\x9d" // U+ebdd
|
||||
3025
lib/external/imgui/fonts/fontawesome_font.c
vendored
Normal file
3025
lib/external/imgui/fonts/fontawesome_font.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1015
lib/external/imgui/fonts/fontawesome_font.h
vendored
Normal file
1015
lib/external/imgui/fonts/fontawesome_font.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
116170
lib/external/imgui/fonts/unifont_font.c
vendored
Normal file
116170
lib/external/imgui/fonts/unifont_font.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
lib/external/imgui/fonts/unifont_font.h
vendored
Normal file
6
lib/external/imgui/fonts/unifont_font.h
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define FONT_ICON_FILE_NAME_UNIFONT "unifont.ttf"
|
||||
|
||||
extern const unsigned int unifont_compressed_size;
|
||||
extern const unsigned int unifont_compressed_data[52184/4];
|
||||
3961
lib/external/imgui/include/cimgui.h
vendored
Normal file
3961
lib/external/imgui/include/cimgui.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,9 @@
|
||||
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
|
||||
|
||||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||
// Using dear imgui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||
// DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
|
||||
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
|
||||
//#define IMGUI_API __declspec( dllexport )
|
||||
//#define IMGUI_API __declspec( dllimport )
|
||||
|
||||
@@ -31,17 +33,21 @@
|
||||
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
|
||||
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
|
||||
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
|
||||
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger window: ShowMetricsWindow() will be empty.
|
||||
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger and other debug tools: ShowMetricsWindow() and ShowStackToolWindow() will be empty.
|
||||
|
||||
//---- Don't implement some functions to reduce linkage requirements.
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
|
||||
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
|
||||
#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
|
||||
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
|
||||
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
||||
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
|
||||
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
||||
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
|
||||
//---- Include imgui_user.h at the end of imgui.h as a convenience
|
||||
//#define IMGUI_INCLUDE_IMGUI_USER_H
|
||||
@@ -53,16 +59,25 @@
|
||||
//#define IMGUI_USE_WCHAR32
|
||||
|
||||
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
|
||||
// By default the embedded implementations are declared static and not available outside of imgui cpp files.
|
||||
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
|
||||
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
|
||||
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
|
||||
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
|
||||
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
|
||||
|
||||
//---- Unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined, use the much faster STB sprintf library implementation of vsnprintf instead of the one from the default C library.
|
||||
// Note that stb_sprintf.h is meant to be provided by the user and available in the include path at compile time. Also, the compatibility checks of the arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf.
|
||||
//---- Use stb_printf's faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
|
||||
// Requires 'stb_sprintf.h' to be available in the include path. Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf.
|
||||
// #define IMGUI_USE_STB_SPRINTF
|
||||
|
||||
//---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
|
||||
// Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
|
||||
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
|
||||
//#define IMGUI_ENABLE_FREETYPE
|
||||
|
||||
//---- Use stb_truetype to build and rasterize the font atlas (default)
|
||||
// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
|
||||
//#define IMGUI_ENABLE_STB_TRUETYPE
|
||||
|
||||
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
|
||||
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
|
||||
/*
|
||||
File diff suppressed because it is too large
Load Diff
50
lib/external/imgui/include/imgui_freetype.h
vendored
Normal file
50
lib/external/imgui/include/imgui_freetype.h
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder)
|
||||
// (headers)
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "imgui.h" // IMGUI_API
|
||||
|
||||
// Forward declarations
|
||||
struct ImFontAtlas;
|
||||
struct ImFontBuilderIO;
|
||||
|
||||
// Hinting greatly impacts visuals (and glyph sizes).
|
||||
// - By default, hinting is enabled and the font's native hinter is preferred over the auto-hinter.
|
||||
// - When disabled, FreeType generates blurrier glyphs, more or less matches the stb_truetype.h
|
||||
// - The Default hinting mode usually looks good, but may distort glyphs in an unusual way.
|
||||
// - The Light hinting mode generates fuzzier glyphs but better matches Microsoft's rasterizer.
|
||||
// You can set those flags globaly in ImFontAtlas::FontBuilderFlags
|
||||
// You can set those flags on a per font basis in ImFontConfig::FontBuilderFlags
|
||||
enum ImGuiFreeTypeBuilderFlags
|
||||
{
|
||||
ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, // Disable hinting. This generally generates 'blurrier' bitmap glyphs when the glyph are rendered in any of the anti-aliased modes.
|
||||
ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, // Disable auto-hinter.
|
||||
ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, // Indicates that the auto-hinter is preferred over the font's native hinter.
|
||||
ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, // A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by Microsoft's ClearType and Adobe's proprietary font renderer. This preserves inter-glyph spacing in horizontal text.
|
||||
ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, // Strong hinting algorithm that should only be used for monochrome output.
|
||||
ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, // Styling: Should we artificially embolden the font?
|
||||
ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, // Styling: Should we slant the font, emulating italic style?
|
||||
ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, // Disable anti-aliasing. Combine this with MonoHinting for best results!
|
||||
ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, // Enable FreeType color-layered glyphs
|
||||
ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 // Enable FreeType bitmap glyphs
|
||||
};
|
||||
|
||||
namespace ImGuiFreeType
|
||||
{
|
||||
// This is automatically assigned when using '#define IMGUI_ENABLE_FREETYPE'.
|
||||
// If you need to dynamically select between multiple builders:
|
||||
// - you can manually assign this builder with 'atlas->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()'
|
||||
// - prefer deep-copying this into your own ImFontBuilderIO instance if you use hot-reloading that messes up static data.
|
||||
IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType();
|
||||
|
||||
// Override allocators. By default ImGuiFreeType will use IM_ALLOC()/IM_FREE()
|
||||
// However, as FreeType does lots of allocations we provide a way for the user to redirect it to a separate memory heap if desired.
|
||||
IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = NULL);
|
||||
|
||||
// Obsolete names (will be removed soon)
|
||||
// Prefer using '#define IMGUI_ENABLE_FREETYPE'
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); }
|
||||
#endif
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// dear imgui: Platform Backend for GLFW
|
||||
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
|
||||
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)
|
||||
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
||||
|
||||
// Implemented features:
|
||||
@@ -12,7 +12,8 @@
|
||||
// Issues:
|
||||
// [ ] Platform: Multi-viewport support: ParentViewportID not honored, and so io.ConfigViewportsNoDefaultParent has no effect (minor).
|
||||
|
||||
// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
|
||||
@@ -28,12 +29,15 @@ struct GLFWmonitor;
|
||||
|
||||
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks);
|
||||
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks);
|
||||
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks);
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown();
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame();
|
||||
|
||||
// GLFW callbacks
|
||||
// - When calling Init with 'install_callbacks=true': GLFW callbacks will be installed for you. They will call user's previously installed callbacks, if any.
|
||||
// - When calling Init with 'install_callbacks=false': GLFW callbacks won't be installed. You will need to call those function yourself from your own GLFW callbacks.
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused);
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered);
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
|
||||
IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
||||
@@ -8,15 +8,11 @@
|
||||
// [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
|
||||
// [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices.
|
||||
|
||||
// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||
|
||||
// About Desktop OpenGL function loaders:
|
||||
// Modern Desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers.
|
||||
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
|
||||
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
|
||||
|
||||
// About GLSL version:
|
||||
// The 'glsl_version' initialization parameter should be NULL (default) or a "#version XXX" string.
|
||||
// On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es"
|
||||
@@ -41,19 +37,9 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
||||
//#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten
|
||||
//#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android
|
||||
|
||||
// Attempt to auto-detect the default Desktop GL loader based on available header files.
|
||||
// If auto-detection fails or doesn't select the same GL loader file as used by your application,
|
||||
// you are likely to get a crash in ImGui_ImplOpenGL3_Init().
|
||||
// You can explicitly select a loader by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line.
|
||||
// You can explicitly select GLES2 or GLES3 API by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line.
|
||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_ES3) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GL3W) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLEW) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLAD2) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3) \
|
||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
|
||||
&& !defined(IMGUI_IMPL_OPENGL_ES3)
|
||||
|
||||
// Try to detect GLES on matching platforms
|
||||
#if defined(__APPLE__)
|
||||
@@ -63,26 +49,8 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
||||
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
|
||||
|
||||
// Otherwise try to detect supported Desktop OpenGL loaders..
|
||||
#elif defined(__has_include)
|
||||
#if __has_include(<GL/glew.h>)
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLEW
|
||||
#elif __has_include(<glad/glad.h>)
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLAD
|
||||
#elif __has_include(<glad/gl.h>)
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLAD2
|
||||
#elif __has_include(<GL/gl3w.h>)
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GL3W
|
||||
#elif __has_include(<glbinding/glbinding.h>)
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLBINDING3
|
||||
#elif __has_include(<glbinding/Binding.h>)
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GLBINDING2
|
||||
#else
|
||||
#error "Cannot detect OpenGL loader!"
|
||||
#endif
|
||||
#else
|
||||
#define IMGUI_IMPL_OPENGL_LOADER_GL3W // Default to GL3W embedded in our repository
|
||||
// Otherwise imgui_impl_opengl3_loader.h will be used.
|
||||
#endif
|
||||
|
||||
#endif
|
||||
731
lib/external/imgui/include/imgui_impl_opengl3_loader.h
vendored
Normal file
731
lib/external/imgui/include/imgui_impl_opengl3_loader.h
vendored
Normal file
@@ -0,0 +1,731 @@
|
||||
/*
|
||||
* This file was generated with gl3w_gen.py, part of imgl3w
|
||||
* (hosted at https://github.com/dearimgui/gl3w_stripped)
|
||||
*
|
||||
* This is free and unencumbered software released into the public domain.
|
||||
*
|
||||
* Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
* distribute this software, either in source code form or as a compiled
|
||||
* binary, for any purpose, commercial or non-commercial, and by any
|
||||
* means.
|
||||
*
|
||||
* In jurisdictions that recognize copyright laws, the author or authors
|
||||
* of this software dedicate any and all copyright interest in the
|
||||
* software to the public domain. We make this dedication for the benefit
|
||||
* of the public at large and to the detriment of our heirs and
|
||||
* successors. We intend this dedication to be an overt act of
|
||||
* relinquishment in perpetuity of all present and future rights to this
|
||||
* software under copyright law.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// We embed our own OpenGL loader to not require user to provide their own or to have to use ours, which proved to be endless problems for users.
|
||||
// Our loader is custom-generated, based on gl3w but automatically filtered to only include enums/functions that we use in this source file.
|
||||
// Regenerate with: python gl3w_gen.py --imgui-dir /path/to/imgui/
|
||||
// see https://github.com/dearimgui/gl3w_stripped for more info.
|
||||
#ifndef __gl3w_h_
|
||||
#define __gl3w_h_
|
||||
|
||||
// Adapted from KHR/khrplatform.h to avoid including entire file.
|
||||
typedef float khronos_float_t;
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
#ifdef _WIN64
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef signed long int khronos_ssize_t;
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
typedef signed __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#elif (defined(__clang__) || defined(__GNUC__)) && (__cplusplus < 201100)
|
||||
#include <stdint.h>
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#else
|
||||
typedef signed long long khronos_int64_t;
|
||||
typedef unsigned long long khronos_uint64_t;
|
||||
#endif
|
||||
|
||||
#ifndef __gl_glcorearb_h_
|
||||
#define __gl_glcorearb_h_ 1
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
/* glcorearb.h is for use with OpenGL core profile implementations.
|
||||
** It should should be placed in the same directory as gl.h and
|
||||
** included as <GL/glcorearb.h>.
|
||||
**
|
||||
** glcorearb.h includes only APIs in the latest OpenGL core profile
|
||||
** implementation together with APIs in newer ARB extensions which
|
||||
** can be supported by the core profile. It does not, and never will
|
||||
** include functionality removed from the core profile, such as
|
||||
** fixed-function vertex and fragment processing.
|
||||
**
|
||||
** Do not #include both <GL/glcorearb.h> and either of <GL/gl.h> or
|
||||
** <GL/glext.h> in the same source file.
|
||||
*/
|
||||
/* Generated C header for:
|
||||
* API: gl
|
||||
* Profile: core
|
||||
* Versions considered: .*
|
||||
* Versions emitted: .*
|
||||
* Default extensions included: glcore
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
#ifndef GL_VERSION_1_0
|
||||
typedef void GLvoid;
|
||||
typedef unsigned int GLenum;
|
||||
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef int GLint;
|
||||
typedef int GLsizei;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef double GLdouble;
|
||||
typedef unsigned int GLuint;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_ONE 1
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_FRONT_AND_BACK 0x0408
|
||||
#define GL_POLYGON_MODE 0x0B40
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_VIEWPORT 0x0BA2
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_UNPACK_ROW_LENGTH 0x0CF2
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_FILL 0x1B02
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_LINEAR 0x2601
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
typedef void (APIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
typedef void (APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
|
||||
typedef void (APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
typedef void (APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
|
||||
typedef void (APIENTRYP PFNGLENABLEPROC) (GLenum cap);
|
||||
typedef void (APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
|
||||
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
|
||||
typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
|
||||
typedef void (APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glPolygonMode (GLenum face, GLenum mode);
|
||||
GLAPI void APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GLAPI void APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GLAPI void APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
GLAPI void APIENTRY glClear (GLbitfield mask);
|
||||
GLAPI void APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
GLAPI void APIENTRY glDisable (GLenum cap);
|
||||
GLAPI void APIENTRY glEnable (GLenum cap);
|
||||
GLAPI void APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GLAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
GLAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *data);
|
||||
GLAPI const GLubyte *APIENTRY glGetString (GLenum name);
|
||||
GLAPI GLboolean APIENTRY glIsEnabled (GLenum cap);
|
||||
GLAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
#endif /* GL_VERSION_1_0 */
|
||||
#ifndef GL_VERSION_1_1
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef double GLclampd;
|
||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
typedef void (APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
|
||||
typedef void (APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
|
||||
typedef void (APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
GLAPI void APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
GLAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
|
||||
GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
|
||||
#endif
|
||||
#endif /* GL_VERSION_1_1 */
|
||||
#ifndef GL_VERSION_1_3
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glActiveTexture (GLenum texture);
|
||||
#endif
|
||||
#endif /* GL_VERSION_1_3 */
|
||||
#ifndef GL_VERSION_1_4
|
||||
#define GL_BLEND_DST_RGB 0x80C8
|
||||
#define GL_BLEND_SRC_RGB 0x80C9
|
||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
||||
#define GL_BLEND_SRC_ALPHA 0x80CB
|
||||
#define GL_FUNC_ADD 0x8006
|
||||
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
GLAPI void APIENTRY glBlendEquation (GLenum mode);
|
||||
#endif
|
||||
#endif /* GL_VERSION_1_4 */
|
||||
#ifndef GL_VERSION_1_5
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_STREAM_DRAW 0x88E0
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
|
||||
typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
|
||||
typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||
GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
|
||||
GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
|
||||
GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||
#endif
|
||||
#endif /* GL_VERSION_1_5 */
|
||||
#ifndef GL_VERSION_2_0
|
||||
typedef char GLchar;
|
||||
typedef khronos_int16_t GLshort;
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef khronos_uint16_t GLushort;
|
||||
#define GL_BLEND_EQUATION_RGB 0x8009
|
||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||
#define GL_UPPER_LEFT 0x8CA2
|
||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
|
||||
typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
|
||||
typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
|
||||
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
|
||||
typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||
typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
|
||||
GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
|
||||
GLAPI void APIENTRY glCompileShader (GLuint shader);
|
||||
GLAPI GLuint APIENTRY glCreateProgram (void);
|
||||
GLAPI GLuint APIENTRY glCreateShader (GLenum type);
|
||||
GLAPI void APIENTRY glDeleteProgram (GLuint program);
|
||||
GLAPI void APIENTRY glDeleteShader (GLuint shader);
|
||||
GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
|
||||
GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
|
||||
GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
|
||||
GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
|
||||
GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
|
||||
GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
|
||||
GLAPI void APIENTRY glLinkProgram (GLuint program);
|
||||
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
GLAPI void APIENTRY glUseProgram (GLuint program);
|
||||
GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
|
||||
GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
|
||||
#endif
|
||||
#endif /* GL_VERSION_2_0 */
|
||||
#ifndef GL_VERSION_3_0
|
||||
typedef khronos_uint16_t GLhalf;
|
||||
#define GL_MAJOR_VERSION 0x821B
|
||||
#define GL_MINOR_VERSION 0x821C
|
||||
#define GL_NUM_EXTENSIONS 0x821D
|
||||
#define GL_FRAMEBUFFER_SRGB 0x8DB9
|
||||
#define GL_VERTEX_ARRAY_BINDING 0x85B5
|
||||
typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
|
||||
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
|
||||
typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
|
||||
typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index);
|
||||
GLAPI void APIENTRY glBindVertexArray (GLuint array);
|
||||
GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
|
||||
GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
|
||||
#endif
|
||||
#endif /* GL_VERSION_3_0 */
|
||||
#ifndef GL_VERSION_3_1
|
||||
#define GL_VERSION_3_1 1
|
||||
#define GL_PRIMITIVE_RESTART 0x8F9D
|
||||
#endif /* GL_VERSION_3_1 */
|
||||
#ifndef GL_VERSION_3_2
|
||||
#define GL_VERSION_3_2 1
|
||||
typedef struct __GLsync *GLsync;
|
||||
typedef khronos_uint64_t GLuint64;
|
||||
typedef khronos_int64_t GLint64;
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
#endif
|
||||
#endif /* GL_VERSION_3_2 */
|
||||
#ifndef GL_VERSION_3_3
|
||||
#define GL_VERSION_3_3 1
|
||||
#define GL_SAMPLER_BINDING 0x8919
|
||||
typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
|
||||
#endif
|
||||
#endif /* GL_VERSION_3_3 */
|
||||
#ifndef GL_VERSION_4_1
|
||||
typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
|
||||
typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
|
||||
#endif /* GL_VERSION_4_1 */
|
||||
#ifndef GL_VERSION_4_3
|
||||
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
||||
#endif /* GL_VERSION_4_3 */
|
||||
#ifndef GL_VERSION_4_5
|
||||
#define GL_CLIP_ORIGIN 0x935C
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param);
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
|
||||
#endif /* GL_VERSION_4_5 */
|
||||
#ifndef GL_ARB_bindless_texture
|
||||
typedef khronos_uint64_t GLuint64EXT;
|
||||
#endif /* GL_ARB_bindless_texture */
|
||||
#ifndef GL_ARB_cl_event
|
||||
struct _cl_context;
|
||||
struct _cl_event;
|
||||
#endif /* GL_ARB_cl_event */
|
||||
#ifndef GL_ARB_clip_control
|
||||
#define GL_ARB_clip_control 1
|
||||
#endif /* GL_ARB_clip_control */
|
||||
#ifndef GL_ARB_debug_output
|
||||
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
||||
#endif /* GL_ARB_debug_output */
|
||||
#ifndef GL_EXT_EGL_image_storage
|
||||
typedef void *GLeglImageOES;
|
||||
#endif /* GL_EXT_EGL_image_storage */
|
||||
#ifndef GL_EXT_direct_state_access
|
||||
typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params);
|
||||
typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param);
|
||||
#endif /* GL_EXT_direct_state_access */
|
||||
#ifndef GL_NV_draw_vulkan_image
|
||||
typedef void (APIENTRY *GLVULKANPROCNV)(void);
|
||||
#endif /* GL_NV_draw_vulkan_image */
|
||||
#ifndef GL_NV_gpu_shader5
|
||||
typedef khronos_int64_t GLint64EXT;
|
||||
#endif /* GL_NV_gpu_shader5 */
|
||||
#ifndef GL_NV_vertex_buffer_unified_memory
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
|
||||
#endif /* GL_NV_vertex_buffer_unified_memory */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GL3W_API
|
||||
#define GL3W_API
|
||||
#endif
|
||||
|
||||
#ifndef __gl_h_
|
||||
#define __gl_h_
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GL3W_OK 0
|
||||
#define GL3W_ERROR_INIT -1
|
||||
#define GL3W_ERROR_LIBRARY_OPEN -2
|
||||
#define GL3W_ERROR_OPENGL_VERSION -3
|
||||
|
||||
typedef void (*GL3WglProc)(void);
|
||||
typedef GL3WglProc (*GL3WGetProcAddressProc)(const char *proc);
|
||||
|
||||
/* gl3w api */
|
||||
GL3W_API int imgl3wInit(void);
|
||||
GL3W_API int imgl3wInit2(GL3WGetProcAddressProc proc);
|
||||
GL3W_API int imgl3wIsSupported(int major, int minor);
|
||||
GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc);
|
||||
|
||||
/* gl3w internal state */
|
||||
union GL3WProcs {
|
||||
GL3WglProc ptr[52];
|
||||
struct {
|
||||
PFNGLACTIVETEXTUREPROC ActiveTexture;
|
||||
PFNGLATTACHSHADERPROC AttachShader;
|
||||
PFNGLBINDBUFFERPROC BindBuffer;
|
||||
PFNGLBINDSAMPLERPROC BindSampler;
|
||||
PFNGLBINDTEXTUREPROC BindTexture;
|
||||
PFNGLBINDVERTEXARRAYPROC BindVertexArray;
|
||||
PFNGLBLENDEQUATIONPROC BlendEquation;
|
||||
PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate;
|
||||
PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate;
|
||||
PFNGLBUFFERDATAPROC BufferData;
|
||||
PFNGLCLEARPROC Clear;
|
||||
PFNGLCLEARCOLORPROC ClearColor;
|
||||
PFNGLCOMPILESHADERPROC CompileShader;
|
||||
PFNGLCREATEPROGRAMPROC CreateProgram;
|
||||
PFNGLCREATESHADERPROC CreateShader;
|
||||
PFNGLDELETEBUFFERSPROC DeleteBuffers;
|
||||
PFNGLDELETEPROGRAMPROC DeleteProgram;
|
||||
PFNGLDELETESHADERPROC DeleteShader;
|
||||
PFNGLDELETETEXTURESPROC DeleteTextures;
|
||||
PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays;
|
||||
PFNGLDETACHSHADERPROC DetachShader;
|
||||
PFNGLDISABLEPROC Disable;
|
||||
PFNGLDRAWELEMENTSPROC DrawElements;
|
||||
PFNGLDRAWELEMENTSBASEVERTEXPROC DrawElementsBaseVertex;
|
||||
PFNGLENABLEPROC Enable;
|
||||
PFNGLENABLEVERTEXATTRIBARRAYPROC EnableVertexAttribArray;
|
||||
PFNGLGENBUFFERSPROC GenBuffers;
|
||||
PFNGLGENTEXTURESPROC GenTextures;
|
||||
PFNGLGENVERTEXARRAYSPROC GenVertexArrays;
|
||||
PFNGLGETATTRIBLOCATIONPROC GetAttribLocation;
|
||||
PFNGLGETINTEGERVPROC GetIntegerv;
|
||||
PFNGLGETPROGRAMINFOLOGPROC GetProgramInfoLog;
|
||||
PFNGLGETPROGRAMIVPROC GetProgramiv;
|
||||
PFNGLGETSHADERINFOLOGPROC GetShaderInfoLog;
|
||||
PFNGLGETSHADERIVPROC GetShaderiv;
|
||||
PFNGLGETSTRINGPROC GetString;
|
||||
PFNGLGETSTRINGIPROC GetStringi;
|
||||
PFNGLGETUNIFORMLOCATIONPROC GetUniformLocation;
|
||||
PFNGLISENABLEDPROC IsEnabled;
|
||||
PFNGLLINKPROGRAMPROC LinkProgram;
|
||||
PFNGLPIXELSTOREIPROC PixelStorei;
|
||||
PFNGLPOLYGONMODEPROC PolygonMode;
|
||||
PFNGLREADPIXELSPROC ReadPixels;
|
||||
PFNGLSCISSORPROC Scissor;
|
||||
PFNGLSHADERSOURCEPROC ShaderSource;
|
||||
PFNGLTEXIMAGE2DPROC TexImage2D;
|
||||
PFNGLTEXPARAMETERIPROC TexParameteri;
|
||||
PFNGLUNIFORM1IPROC Uniform1i;
|
||||
PFNGLUNIFORMMATRIX4FVPROC UniformMatrix4fv;
|
||||
PFNGLUSEPROGRAMPROC UseProgram;
|
||||
PFNGLVERTEXATTRIBPOINTERPROC VertexAttribPointer;
|
||||
PFNGLVIEWPORTPROC Viewport;
|
||||
} gl;
|
||||
};
|
||||
|
||||
GL3W_API extern union GL3WProcs gl3wProcs;
|
||||
|
||||
/* OpenGL functions */
|
||||
#define glActiveTexture gl3wProcs.gl.ActiveTexture
|
||||
#define glAttachShader gl3wProcs.gl.AttachShader
|
||||
#define glBindBuffer gl3wProcs.gl.BindBuffer
|
||||
#define glBindSampler gl3wProcs.gl.BindSampler
|
||||
#define glBindTexture gl3wProcs.gl.BindTexture
|
||||
#define glBindVertexArray gl3wProcs.gl.BindVertexArray
|
||||
#define glBlendEquation gl3wProcs.gl.BlendEquation
|
||||
#define glBlendEquationSeparate gl3wProcs.gl.BlendEquationSeparate
|
||||
#define glBlendFuncSeparate gl3wProcs.gl.BlendFuncSeparate
|
||||
#define glBufferData gl3wProcs.gl.BufferData
|
||||
#define glClear gl3wProcs.gl.Clear
|
||||
#define glClearColor gl3wProcs.gl.ClearColor
|
||||
#define glCompileShader gl3wProcs.gl.CompileShader
|
||||
#define glCreateProgram gl3wProcs.gl.CreateProgram
|
||||
#define glCreateShader gl3wProcs.gl.CreateShader
|
||||
#define glDeleteBuffers gl3wProcs.gl.DeleteBuffers
|
||||
#define glDeleteProgram gl3wProcs.gl.DeleteProgram
|
||||
#define glDeleteShader gl3wProcs.gl.DeleteShader
|
||||
#define glDeleteTextures gl3wProcs.gl.DeleteTextures
|
||||
#define glDeleteVertexArrays gl3wProcs.gl.DeleteVertexArrays
|
||||
#define glDetachShader gl3wProcs.gl.DetachShader
|
||||
#define glDisable gl3wProcs.gl.Disable
|
||||
#define glDrawElements gl3wProcs.gl.DrawElements
|
||||
#define glDrawElementsBaseVertex gl3wProcs.gl.DrawElementsBaseVertex
|
||||
#define glEnable gl3wProcs.gl.Enable
|
||||
#define glEnableVertexAttribArray gl3wProcs.gl.EnableVertexAttribArray
|
||||
#define glGenBuffers gl3wProcs.gl.GenBuffers
|
||||
#define glGenTextures gl3wProcs.gl.GenTextures
|
||||
#define glGenVertexArrays gl3wProcs.gl.GenVertexArrays
|
||||
#define glGetAttribLocation gl3wProcs.gl.GetAttribLocation
|
||||
#define glGetIntegerv gl3wProcs.gl.GetIntegerv
|
||||
#define glGetProgramInfoLog gl3wProcs.gl.GetProgramInfoLog
|
||||
#define glGetProgramiv gl3wProcs.gl.GetProgramiv
|
||||
#define glGetShaderInfoLog gl3wProcs.gl.GetShaderInfoLog
|
||||
#define glGetShaderiv gl3wProcs.gl.GetShaderiv
|
||||
#define glGetString gl3wProcs.gl.GetString
|
||||
#define glGetStringi gl3wProcs.gl.GetStringi
|
||||
#define glGetUniformLocation gl3wProcs.gl.GetUniformLocation
|
||||
#define glIsEnabled gl3wProcs.gl.IsEnabled
|
||||
#define glLinkProgram gl3wProcs.gl.LinkProgram
|
||||
#define glPixelStorei gl3wProcs.gl.PixelStorei
|
||||
#define glPolygonMode gl3wProcs.gl.PolygonMode
|
||||
#define glReadPixels gl3wProcs.gl.ReadPixels
|
||||
#define glScissor gl3wProcs.gl.Scissor
|
||||
#define glShaderSource gl3wProcs.gl.ShaderSource
|
||||
#define glTexImage2D gl3wProcs.gl.TexImage2D
|
||||
#define glTexParameteri gl3wProcs.gl.TexParameteri
|
||||
#define glUniform1i gl3wProcs.gl.Uniform1i
|
||||
#define glUniformMatrix4fv gl3wProcs.gl.UniformMatrix4fv
|
||||
#define glUseProgram gl3wProcs.gl.UseProgram
|
||||
#define glVertexAttribPointer gl3wProcs.gl.VertexAttribPointer
|
||||
#define glViewport gl3wProcs.gl.Viewport
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef IMGL3W_IMPL
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
static HMODULE libgl;
|
||||
typedef PROC(__stdcall* GL3WglGetProcAddr)(LPCSTR);
|
||||
static GL3WglGetProcAddr wgl_get_proc_address;
|
||||
|
||||
static int open_libgl(void)
|
||||
{
|
||||
libgl = LoadLibraryA("opengl32.dll");
|
||||
if (!libgl)
|
||||
return GL3W_ERROR_LIBRARY_OPEN;
|
||||
wgl_get_proc_address = (GL3WglGetProcAddr)GetProcAddress(libgl, "wglGetProcAddress");
|
||||
return GL3W_OK;
|
||||
}
|
||||
|
||||
static void close_libgl(void) { FreeLibrary(libgl); }
|
||||
static GL3WglProc get_proc(const char *proc)
|
||||
{
|
||||
GL3WglProc res;
|
||||
res = (GL3WglProc)wgl_get_proc_address(proc);
|
||||
if (!res)
|
||||
res = (GL3WglProc)GetProcAddress(libgl, proc);
|
||||
return res;
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
#include <dlfcn.h>
|
||||
|
||||
static void *libgl;
|
||||
static int open_libgl(void)
|
||||
{
|
||||
libgl = dlopen("/System/Library/Frameworks/OpenGL.framework/OpenGL", RTLD_LAZY | RTLD_LOCAL);
|
||||
if (!libgl)
|
||||
return GL3W_ERROR_LIBRARY_OPEN;
|
||||
return GL3W_OK;
|
||||
}
|
||||
|
||||
static void close_libgl(void) { dlclose(libgl); }
|
||||
|
||||
static GL3WglProc get_proc(const char *proc)
|
||||
{
|
||||
GL3WglProc res;
|
||||
*(void **)(&res) = dlsym(libgl, proc);
|
||||
return res;
|
||||
}
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
|
||||
static void *libgl;
|
||||
static GL3WglProc (*glx_get_proc_address)(const GLubyte *);
|
||||
|
||||
static int open_libgl(void)
|
||||
{
|
||||
libgl = dlopen("libGL.so.1", RTLD_LAZY | RTLD_LOCAL);
|
||||
if (!libgl)
|
||||
return GL3W_ERROR_LIBRARY_OPEN;
|
||||
*(void **)(&glx_get_proc_address) = dlsym(libgl, "glXGetProcAddressARB");
|
||||
return GL3W_OK;
|
||||
}
|
||||
|
||||
static void close_libgl(void) { dlclose(libgl); }
|
||||
|
||||
static GL3WglProc get_proc(const char *proc)
|
||||
{
|
||||
GL3WglProc res;
|
||||
res = glx_get_proc_address((const GLubyte *)proc);
|
||||
if (!res)
|
||||
*(void **)(&res) = dlsym(libgl, proc);
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct { int major, minor; } version;
|
||||
|
||||
static int parse_version(void)
|
||||
{
|
||||
if (!glGetIntegerv)
|
||||
return GL3W_ERROR_INIT;
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &version.major);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &version.minor);
|
||||
if (version.major < 3)
|
||||
return GL3W_ERROR_OPENGL_VERSION;
|
||||
return GL3W_OK;
|
||||
}
|
||||
|
||||
static void load_procs(GL3WGetProcAddressProc proc);
|
||||
|
||||
int imgl3wInit(void)
|
||||
{
|
||||
int res = open_libgl();
|
||||
if (res)
|
||||
return res;
|
||||
atexit(close_libgl);
|
||||
return imgl3wInit2(get_proc);
|
||||
}
|
||||
|
||||
int imgl3wInit2(GL3WGetProcAddressProc proc)
|
||||
{
|
||||
load_procs(proc);
|
||||
return parse_version();
|
||||
}
|
||||
|
||||
int imgl3wIsSupported(int major, int minor)
|
||||
{
|
||||
if (major < 3)
|
||||
return 0;
|
||||
if (version.major == major)
|
||||
return version.minor >= minor;
|
||||
return version.major >= major;
|
||||
}
|
||||
|
||||
GL3WglProc imgl3wGetProcAddress(const char *proc) { return get_proc(proc); }
|
||||
|
||||
static const char *proc_names[] = {
|
||||
"glActiveTexture",
|
||||
"glAttachShader",
|
||||
"glBindBuffer",
|
||||
"glBindSampler",
|
||||
"glBindTexture",
|
||||
"glBindVertexArray",
|
||||
"glBlendEquation",
|
||||
"glBlendEquationSeparate",
|
||||
"glBlendFuncSeparate",
|
||||
"glBufferData",
|
||||
"glClear",
|
||||
"glClearColor",
|
||||
"glCompileShader",
|
||||
"glCreateProgram",
|
||||
"glCreateShader",
|
||||
"glDeleteBuffers",
|
||||
"glDeleteProgram",
|
||||
"glDeleteShader",
|
||||
"glDeleteTextures",
|
||||
"glDeleteVertexArrays",
|
||||
"glDetachShader",
|
||||
"glDisable",
|
||||
"glDrawElements",
|
||||
"glDrawElementsBaseVertex",
|
||||
"glEnable",
|
||||
"glEnableVertexAttribArray",
|
||||
"glGenBuffers",
|
||||
"glGenTextures",
|
||||
"glGenVertexArrays",
|
||||
"glGetAttribLocation",
|
||||
"glGetIntegerv",
|
||||
"glGetProgramInfoLog",
|
||||
"glGetProgramiv",
|
||||
"glGetShaderInfoLog",
|
||||
"glGetShaderiv",
|
||||
"glGetString",
|
||||
"glGetStringi",
|
||||
"glGetUniformLocation",
|
||||
"glIsEnabled",
|
||||
"glLinkProgram",
|
||||
"glPixelStorei",
|
||||
"glPolygonMode",
|
||||
"glReadPixels",
|
||||
"glScissor",
|
||||
"glShaderSource",
|
||||
"glTexImage2D",
|
||||
"glTexParameteri",
|
||||
"glUniform1i",
|
||||
"glUniformMatrix4fv",
|
||||
"glUseProgram",
|
||||
"glVertexAttribPointer",
|
||||
"glViewport",
|
||||
};
|
||||
|
||||
GL3W_API union GL3WProcs gl3wProcs;
|
||||
|
||||
static void load_procs(GL3WGetProcAddressProc proc)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < ARRAY_SIZE(proc_names); i++)
|
||||
gl3wProcs.ptr[i] = proc(proc_names[i]);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
805
lib/external/imgui/include/imgui_memory_editor.h
vendored
Normal file
805
lib/external/imgui/include/imgui_memory_editor.h
vendored
Normal file
@@ -0,0 +1,805 @@
|
||||
// Mini memory editor for Dear ImGui (to embed in your game/tools)
|
||||
// Get latest version at http://www.github.com/ocornut/imgui_club
|
||||
//
|
||||
// Right-click anywhere to access the Options menu!
|
||||
// You can adjust the keyboard repeat delay/rate in ImGuiIO.
|
||||
// The code assume a mono-space font for simplicity!
|
||||
// If you don't use the default font, use ImGui::PushFont()/PopFont() to switch to a mono-space font before caling this.
|
||||
//
|
||||
// Usage:
|
||||
// // Create a window and draw memory editor inside it:
|
||||
// static MemoryEditor mem_edit_1;
|
||||
// static char data[0x10000];
|
||||
// size_t data_size = 0x10000;
|
||||
// mem_edit_1.DrawWindow("Memory Editor", data, data_size);
|
||||
//
|
||||
// Usage:
|
||||
// // If you already have a window, use DrawContents() instead:
|
||||
// static MemoryEditor mem_edit_2;
|
||||
// ImGui::Begin("MyWindow")
|
||||
// mem_edit_2.DrawContents(this, sizeof(*this), (size_t)this);
|
||||
// ImGui::End();
|
||||
//
|
||||
// Changelog:
|
||||
// - v0.10: initial version
|
||||
// - v0.23 (2017/08/17): added to github. fixed right-arrow triggering a byte write.
|
||||
// - v0.24 (2018/06/02): changed DragInt("Rows" to use a %d data format (which is desirable since imgui 1.61).
|
||||
// - v0.25 (2018/07/11): fixed wording: all occurrences of "Rows" renamed to "Columns".
|
||||
// - v0.26 (2018/08/02): fixed clicking on hex region
|
||||
// - v0.30 (2018/08/02): added data preview for common data types
|
||||
// - v0.31 (2018/10/10): added OptUpperCaseHex option to select lower/upper casing display [@samhocevar]
|
||||
// - v0.32 (2018/10/10): changed signatures to use void* instead of unsigned char*
|
||||
// - v0.33 (2018/10/10): added OptShowOptions option to hide all the interactive option setting.
|
||||
// - v0.34 (2019/05/07): binary preview now applies endianness setting [@nicolasnoble]
|
||||
// - v0.35 (2020/01/29): using ImGuiDataType available since Dear ImGui 1.69.
|
||||
// - v0.36 (2020/05/05): minor tweaks, minor refactor.
|
||||
// - v0.40 (2020/10/04): fix misuse of ImGuiListClipper API, broke with Dear ImGui 1.79. made cursor position appears on left-side of edit box. option popup appears on mouse release. fix MSVC warnings where _CRT_SECURE_NO_WARNINGS wasn't working in recent versions.
|
||||
// - v0.41 (2020/10/05): fix when using with keyboard/gamepad navigation enabled.
|
||||
// - v0.42 (2020/10/14): fix for . character in ASCII view always being greyed out.
|
||||
//
|
||||
// Todo/Bugs:
|
||||
// - This is generally old code, it should work but please don't use this as reference!
|
||||
// - Arrows are being sent to the InputText() about to disappear which for LeftArrow makes the text cursor appear at position 1 for one frame.
|
||||
// - Using InputText() is awkward and maybe overkill here, consider implementing something custom.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h> // sprintf, scanf
|
||||
#include <stdint.h> // uint8_t, etc.
|
||||
|
||||
#include <hex.hpp>
|
||||
#include <hex/api/event.hpp>
|
||||
#include <hex/helpers/logger.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _PRISizeT "I"
|
||||
#define ImSnprintf _snprintf
|
||||
#else
|
||||
#define _PRISizeT "z"
|
||||
#define ImSnprintf snprintf
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4996) // warning C4996: 'sprintf': This function or variable may be unsafe.
|
||||
#endif
|
||||
|
||||
ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
|
||||
|
||||
struct MemoryEditor
|
||||
{
|
||||
enum DataFormat
|
||||
{
|
||||
DataFormat_Bin = 0,
|
||||
DataFormat_Dec = 1,
|
||||
DataFormat_Hex = 2,
|
||||
DataFormat_COUNT
|
||||
};
|
||||
|
||||
struct DecodeData {
|
||||
std::string data;
|
||||
size_t advance;
|
||||
ImColor color;
|
||||
};
|
||||
|
||||
// Settings
|
||||
bool ReadOnly; // = false // disable any editing.
|
||||
int Cols; // = 16 // number of columns to display.
|
||||
bool OptShowOptions; // = true // display options button/context menu. when disabled, options will be locked unless you provide your own UI for them.
|
||||
bool OptShowHexII; // = false // display values in HexII representation instead of regular hexadecimal: hide null/zero bytes, ascii values as ".X".
|
||||
bool OptShowAscii; // = true // display ASCII representation on the right side.
|
||||
bool OptShowAdvancedDecoding; // = true // display advanced decoding data on the right side.
|
||||
bool OptGreyOutZeroes; // = true // display null/zero bytes using the TextDisabled color.
|
||||
bool OptUpperCaseHex; // = true // display hexadecimal values as "FF" instead of "ff".
|
||||
bool OptShowExtraInfo; // = true // display extra information about size of data and current selection
|
||||
int OptMidColsCount; // = 8 // set to 0 to disable extra spacing between every mid-cols.
|
||||
int OptAddrDigitsCount; // = 0 // number of addr digits to display (default calculated based on maximum displayed addr).
|
||||
ImU32 HighlightColor; // // background color of highlighted bytes.
|
||||
ImU8 (*ReadFn)(const ImU8* data, size_t off); // = 0 // optional handler to read bytes.
|
||||
void (*WriteFn)(ImU8* data, size_t off, ImU8 d); // = 0 // optional handler to write bytes.
|
||||
bool (*HighlightFn)(const ImU8* data, size_t off, bool next);//= 0 // optional handler to return Highlight property (to support non-contiguous highlighting).
|
||||
void (*HoverFn)(const ImU8 *data, size_t off);
|
||||
DecodeData (*DecodeFn)(const ImU8 *data, size_t off);
|
||||
|
||||
// [Internal State]
|
||||
bool ContentsWidthChanged;
|
||||
size_t DataPreviewAddr;
|
||||
size_t DataPreviewAddrOld;
|
||||
size_t DataPreviewAddrEnd;
|
||||
size_t DataPreviewAddrEndOld;
|
||||
size_t DataEditingAddr;
|
||||
bool DataEditingTakeFocus;
|
||||
char DataInputBuf[32];
|
||||
char AddrInputBuf[32];
|
||||
size_t GotoAddr;
|
||||
size_t HighlightMin, HighlightMax;
|
||||
int PreviewEndianess;
|
||||
ImGuiDataType PreviewDataType;
|
||||
|
||||
MemoryEditor()
|
||||
{
|
||||
// Settings
|
||||
ReadOnly = false;
|
||||
Cols = 16;
|
||||
OptShowOptions = true;
|
||||
OptShowHexII = false;
|
||||
OptShowAscii = true;
|
||||
OptShowAdvancedDecoding = true;
|
||||
OptGreyOutZeroes = true;
|
||||
OptUpperCaseHex = true;
|
||||
OptMidColsCount = 8;
|
||||
OptAddrDigitsCount = 0;
|
||||
HighlightColor = IM_COL32(255, 255, 255, 50);
|
||||
ReadFn = NULL;
|
||||
WriteFn = NULL;
|
||||
HighlightFn = NULL;
|
||||
HoverFn = NULL;
|
||||
DecodeFn = NULL;
|
||||
|
||||
// State/Internals
|
||||
ContentsWidthChanged = false;
|
||||
DataPreviewAddr = DataEditingAddr = DataPreviewAddrEnd = (size_t)-1;
|
||||
DataPreviewAddrOld = DataPreviewAddrEndOld = (size_t)-1;
|
||||
DataEditingTakeFocus = false;
|
||||
memset(DataInputBuf, 0, sizeof(DataInputBuf));
|
||||
memset(AddrInputBuf, 0, sizeof(AddrInputBuf));
|
||||
GotoAddr = (size_t)-1;
|
||||
HighlightMin = HighlightMax = (size_t)-1;
|
||||
PreviewEndianess = 0;
|
||||
PreviewDataType = ImGuiDataType_S32;
|
||||
}
|
||||
|
||||
void GotoAddrAndHighlight(size_t addr_min, size_t addr_max)
|
||||
{
|
||||
GotoAddr = addr_min;
|
||||
HighlightMin = addr_min;
|
||||
HighlightMax = addr_max;
|
||||
}
|
||||
|
||||
void GotoAddrAndSelect(size_t addr_min, size_t addr_max)
|
||||
{
|
||||
GotoAddr = addr_min;
|
||||
DataPreviewAddr = addr_min;
|
||||
DataPreviewAddrEnd = addr_max;
|
||||
DataPreviewAddrOld = addr_min;
|
||||
DataPreviewAddrEndOld = addr_max;
|
||||
}
|
||||
|
||||
struct Sizes
|
||||
{
|
||||
int AddrDigitsCount;
|
||||
float LineHeight;
|
||||
float GlyphWidth;
|
||||
float HexCellWidth;
|
||||
float SpacingBetweenMidCols;
|
||||
float PosHexStart;
|
||||
float PosHexEnd;
|
||||
float PosAsciiStart;
|
||||
float PosAsciiEnd;
|
||||
float PosDecodingStart;
|
||||
float PosDecodingEnd;
|
||||
float WindowWidth;
|
||||
|
||||
Sizes() { memset(this, 0, sizeof(*this)); }
|
||||
};
|
||||
|
||||
void CalcSizes(Sizes& s, size_t mem_size, size_t base_display_addr)
|
||||
{
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
s.AddrDigitsCount = OptAddrDigitsCount;
|
||||
if (s.AddrDigitsCount == 0)
|
||||
for (size_t n = base_display_addr + mem_size - 1; n > 0; n >>= 4)
|
||||
s.AddrDigitsCount++;
|
||||
s.LineHeight = ImGui::GetTextLineHeight();
|
||||
s.GlyphWidth = ImGui::CalcTextSize("F").x + 1; // We assume the font is mono-space
|
||||
s.HexCellWidth = (float)(int)(s.GlyphWidth * 2.5f); // "FF " we include trailing space in the width to easily catch clicks everywhere
|
||||
s.SpacingBetweenMidCols = (float)(int)(s.HexCellWidth * 0.25f); // Every OptMidColsCount columns we add a bit of extra spacing
|
||||
s.PosHexStart = (s.AddrDigitsCount + 2) * s.GlyphWidth;
|
||||
s.PosHexEnd = s.PosHexStart + (s.HexCellWidth * Cols);
|
||||
s.PosAsciiStart = s.PosAsciiEnd = s.PosHexEnd;
|
||||
|
||||
if (OptShowAscii && OptShowAdvancedDecoding) {
|
||||
s.PosAsciiStart = s.PosHexEnd + s.GlyphWidth * 1;
|
||||
if (OptMidColsCount > 0)
|
||||
s.PosAsciiStart += (float)((Cols + OptMidColsCount - 1) / OptMidColsCount) * s.SpacingBetweenMidCols;
|
||||
s.PosAsciiEnd = s.PosAsciiStart + Cols * s.GlyphWidth;
|
||||
|
||||
s.PosDecodingStart = s.PosAsciiEnd + s.GlyphWidth * 1;
|
||||
if (OptMidColsCount > 0)
|
||||
s.PosDecodingStart += (float)((Cols + OptMidColsCount - 1) / OptMidColsCount) * s.SpacingBetweenMidCols;
|
||||
s.PosDecodingEnd = s.PosDecodingStart + Cols * s.GlyphWidth;
|
||||
} else if (OptShowAscii) {
|
||||
s.PosAsciiStart = s.PosHexEnd + s.GlyphWidth * 1;
|
||||
if (OptMidColsCount > 0)
|
||||
s.PosAsciiStart += (float)((Cols + OptMidColsCount - 1) / OptMidColsCount) * s.SpacingBetweenMidCols;
|
||||
s.PosAsciiEnd = s.PosAsciiStart + Cols * s.GlyphWidth;
|
||||
} else if (OptShowAdvancedDecoding) {
|
||||
s.PosDecodingStart = s.PosHexEnd + s.GlyphWidth * 1;
|
||||
if (OptMidColsCount > 0)
|
||||
s.PosDecodingStart += (float)((Cols + OptMidColsCount - 1) / OptMidColsCount) * s.SpacingBetweenMidCols;
|
||||
s.PosDecodingEnd = s.PosDecodingStart + Cols * s.GlyphWidth;
|
||||
}
|
||||
s.WindowWidth = s.PosAsciiEnd + style.ScrollbarSize + style.WindowPadding.x * 2 + s.GlyphWidth;
|
||||
}
|
||||
|
||||
// Standalone Memory Editor window
|
||||
void DrawWindow(const char* title, bool *p_open, void* mem_data, size_t mem_size, size_t base_display_addr = 0x0000)
|
||||
{
|
||||
Sizes s;
|
||||
CalcSizes(s, mem_size, base_display_addr);
|
||||
|
||||
if (ImGui::Begin(title, p_open, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNavInputs))
|
||||
{
|
||||
if (DataPreviewAddr != DataPreviewAddrOld || DataPreviewAddrEnd != DataPreviewAddrEndOld) {
|
||||
hex::Region selectionRegion = { std::min(DataPreviewAddr, DataPreviewAddrEnd) + base_display_addr, (std::max(DataPreviewAddr, DataPreviewAddrEnd) - std::min(DataPreviewAddr, DataPreviewAddrEnd)) + 1 };
|
||||
hex::EventManager::post<hex::EventRegionSelected>(selectionRegion);
|
||||
}
|
||||
|
||||
DataPreviewAddrOld = DataPreviewAddr;
|
||||
DataPreviewAddrEndOld = DataPreviewAddrEnd;
|
||||
|
||||
if (mem_size > 0)
|
||||
DrawContents(mem_data, mem_size, base_display_addr);
|
||||
|
||||
if (ContentsWidthChanged)
|
||||
{
|
||||
CalcSizes(s, mem_size, base_display_addr);
|
||||
ImGui::SetWindowSize(ImVec2(s.WindowWidth, ImGui::GetWindowSize().y));
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
|
||||
// Memory Editor contents only
|
||||
void DrawContents(void* mem_data_void, size_t mem_size, size_t base_display_addr = 0x0000)
|
||||
{
|
||||
if (Cols < 1)
|
||||
Cols = 1;
|
||||
|
||||
ImU8* mem_data = (ImU8*)mem_data_void;
|
||||
Sizes s;
|
||||
CalcSizes(s, mem_size, base_display_addr);
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
|
||||
// We begin into our scrolling region with the 'ImGuiWindowFlags_NoMove' in order to prevent click from moving the window.
|
||||
// This is used as a facility since our main click detection code doesn't assign an ActiveId so the click would normally be caught as a window-move.
|
||||
const float height_separator = style.ItemSpacing.y;
|
||||
float footer_height = 0;
|
||||
if (OptShowOptions)
|
||||
footer_height += height_separator + ImGui::GetFrameHeightWithSpacing() * 2;
|
||||
|
||||
ImGui::BeginChild("offset", ImVec2(0, s.LineHeight), false, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav);
|
||||
ImGui::Text("%*c ", s.AddrDigitsCount, ' ');
|
||||
for (int i = 0; i < Cols; i++) {
|
||||
float byte_pos_x = s.PosHexStart + s.HexCellWidth * i;
|
||||
if (OptMidColsCount > 0)
|
||||
byte_pos_x += (float)(i / OptMidColsCount) * s.SpacingBetweenMidCols;
|
||||
ImGui::SameLine(byte_pos_x);
|
||||
ImGui::Text("%02llX", i + (base_display_addr % Cols));
|
||||
}
|
||||
ImGui::EndChild();
|
||||
|
||||
ImGui::BeginChild("##scrolling", ImVec2(0, -footer_height), false, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
|
||||
|
||||
|
||||
|
||||
// We are not really using the clipper API correctly here, because we rely on visible_start_addr/visible_end_addr for our scrolling function.
|
||||
ImGuiListClipper clipper;
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
|
||||
const int line_total_count = (int)((mem_size + Cols - 1) / Cols);
|
||||
clipper.Begin(line_total_count, s.LineHeight);
|
||||
const size_t visible_start_addr = clipper.DisplayStart * Cols;
|
||||
const size_t visible_end_addr = clipper.DisplayEnd * Cols;
|
||||
const size_t visible_count = visible_end_addr - visible_start_addr;
|
||||
|
||||
bool data_next = false;
|
||||
|
||||
if (DataEditingAddr >= mem_size)
|
||||
DataEditingAddr = (size_t)-1;
|
||||
if (DataPreviewAddr >= mem_size)
|
||||
DataPreviewAddr = (size_t)-1;
|
||||
if (DataPreviewAddrEnd >= mem_size)
|
||||
DataPreviewAddrEnd = (size_t)-1;
|
||||
|
||||
size_t data_editing_addr_backup = DataEditingAddr;
|
||||
size_t data_preview_addr_backup = DataPreviewAddr;
|
||||
size_t data_editing_addr_next = (size_t)-1;
|
||||
size_t data_preview_addr_next = (size_t)-1;
|
||||
|
||||
if (ImGui::IsWindowFocused()) {
|
||||
// Move cursor but only apply on next frame so scrolling with be synchronized (because currently we can't change the scrolling while the window is being rendered)
|
||||
if (DataEditingAddr != (size_t)-1) {
|
||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow)) && DataEditingAddr >= (size_t)Cols) { data_editing_addr_next = DataEditingAddr - Cols; DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow)) && DataEditingAddr < mem_size - Cols) { data_editing_addr_next = DataEditingAddr + Cols; DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow)) && DataEditingAddr > 0) { data_editing_addr_next = DataEditingAddr - 1; DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow)) && DataEditingAddr < mem_size - 1) { data_editing_addr_next = DataEditingAddr + 1; DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_PageUp)) && DataEditingAddr > 0) { data_editing_addr_next = std::max<i64>(0, DataEditingAddr - visible_count); DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_PageDown)) && DataEditingAddr < mem_size - 1) { data_editing_addr_next = std::min<i64>(mem_size - 1, DataEditingAddr + visible_count); DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Home)) && DataEditingAddr > 0) { data_editing_addr_next = 0; DataEditingTakeFocus = true; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_End)) && DataEditingAddr < mem_size - 1) { data_editing_addr_next = mem_size - 1; DataEditingTakeFocus = true; }
|
||||
} else if (DataPreviewAddr != -1) {
|
||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow)) && DataPreviewAddr >= (size_t)Cols) { DataPreviewAddr = data_preview_addr_next = DataPreviewAddr - Cols; if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow)) && DataPreviewAddr < mem_size - Cols) { DataPreviewAddr = data_preview_addr_next = DataPreviewAddr + Cols; if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow)) && DataPreviewAddr > 0) { DataPreviewAddr = data_preview_addr_next = DataPreviewAddr - 1; if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow)) && DataPreviewAddr < mem_size - 1) { DataPreviewAddr = data_preview_addr_next = DataPreviewAddr + 1; if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_PageUp)) && DataPreviewAddr > 0) { DataPreviewAddr = data_preview_addr_next = std::max<i64>(0, DataPreviewAddr - visible_count); if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_PageDown)) && DataPreviewAddr < mem_size - 1) { DataPreviewAddr = data_preview_addr_next = std::min<i64>(mem_size - 1, DataPreviewAddr + visible_count); if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Home)) && DataPreviewAddr > 0) { DataPreviewAddr = data_preview_addr_next = 0; if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_End)) && DataPreviewAddr < mem_size - 1) { DataPreviewAddr = data_preview_addr_next = mem_size - 1; if (!ImGui::GetIO().KeyShift) DataPreviewAddrEnd = DataPreviewAddr; }
|
||||
}
|
||||
} else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
|
||||
DataPreviewAddr = DataPreviewAddrOld = DataPreviewAddrEnd = DataPreviewAddrEndOld = data_preview_addr_next = (size_t)-1;
|
||||
HighlightMin = HighlightMax = (size_t)-1;
|
||||
|
||||
hex::EventManager::post<hex::EventRegionSelected>(hex::Region{ (size_t)-1, 0 });
|
||||
}
|
||||
|
||||
if (data_preview_addr_next != (size_t)-1 && (data_preview_addr_next / Cols) != (data_preview_addr_backup / Cols))
|
||||
{
|
||||
// Track cursor movements
|
||||
const int scroll_offset = ((int)(data_preview_addr_next / Cols) - (int)(data_preview_addr_backup / Cols));
|
||||
const bool scroll_desired = (scroll_offset < 0 && data_preview_addr_next < visible_start_addr + Cols * 2) || (scroll_offset > 0 && data_preview_addr_next > visible_end_addr - Cols * 2);
|
||||
if (scroll_desired)
|
||||
ImGui::SetScrollY(ImGui::GetScrollY() + scroll_offset * s.LineHeight);
|
||||
}
|
||||
if (data_editing_addr_next != (size_t)-1 && (data_editing_addr_next / Cols) != (data_editing_addr_backup / Cols))
|
||||
{
|
||||
// Track cursor movements
|
||||
const int scroll_offset = ((int)(data_editing_addr_next / Cols) - (int)(data_editing_addr_backup / Cols));
|
||||
const bool scroll_desired = (scroll_offset < 0 && data_editing_addr_next < visible_start_addr + Cols * 2) || (scroll_offset > 0 && data_editing_addr_next > visible_end_addr - Cols * 2);
|
||||
if (scroll_desired)
|
||||
ImGui::SetScrollY(ImGui::GetScrollY() + scroll_offset * s.LineHeight);
|
||||
}
|
||||
|
||||
// Draw vertical separator
|
||||
ImVec2 window_pos = ImGui::GetWindowPos();
|
||||
float scrollX = ImGui::GetScrollX();
|
||||
|
||||
if (OptShowAscii)
|
||||
draw_list->AddLine(ImVec2(window_pos.x + s.PosAsciiStart - s.GlyphWidth - scrollX, window_pos.y), ImVec2(window_pos.x + s.PosAsciiStart - s.GlyphWidth - scrollX, window_pos.y + 9999), ImGui::GetColorU32(ImGuiCol_Border));
|
||||
if (OptShowAdvancedDecoding)
|
||||
draw_list->AddLine(ImVec2(window_pos.x + s.PosDecodingStart - s.GlyphWidth - scrollX, window_pos.y), ImVec2(window_pos.x + s.PosDecodingStart - s.GlyphWidth - scrollX, window_pos.y + 9999), ImGui::GetColorU32(ImGuiCol_Border));
|
||||
|
||||
const ImU32 color_text = ImGui::GetColorU32(ImGuiCol_Text);
|
||||
const ImU32 color_disabled = OptGreyOutZeroes ? ImGui::GetColorU32(ImGuiCol_TextDisabled) : color_text;
|
||||
|
||||
const char* format_address = OptUpperCaseHex ? "%0*" _PRISizeT "X: " : "%0*" _PRISizeT "x: ";
|
||||
const char* format_data = OptUpperCaseHex ? "%0*" _PRISizeT "X" : "%0*" _PRISizeT "x";
|
||||
const char* format_byte = OptUpperCaseHex ? "%02X" : "%02x";
|
||||
const char* format_byte_space = OptUpperCaseHex ? "%02X " : "%02x ";
|
||||
|
||||
bool tooltipShown = false;
|
||||
while (clipper.Step())
|
||||
{
|
||||
for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines
|
||||
{
|
||||
size_t addr = (size_t)(line_i * Cols);
|
||||
ImGui::Text(format_address, s.AddrDigitsCount, base_display_addr + addr);
|
||||
|
||||
// Draw Hexadecimal
|
||||
for (int n = 0; n < Cols && addr < mem_size; n++, addr++)
|
||||
{
|
||||
float byte_pos_x = s.PosHexStart + s.HexCellWidth * n;
|
||||
if (OptMidColsCount > 0)
|
||||
byte_pos_x += (float)(n / OptMidColsCount) * s.SpacingBetweenMidCols;
|
||||
ImGui::SameLine(byte_pos_x);
|
||||
|
||||
// Draw highlight
|
||||
bool is_highlight_from_user_range = (addr >= HighlightMin && addr < HighlightMax);
|
||||
bool is_highlight_from_user_func = (HighlightFn && HighlightFn(mem_data, addr, false));
|
||||
bool is_highlight_from_preview = (addr >= DataPreviewAddr && addr <= DataPreviewAddrEnd) || (addr >= DataPreviewAddrEnd && addr <= DataPreviewAddr);
|
||||
if (is_highlight_from_user_range || is_highlight_from_user_func || is_highlight_from_preview)
|
||||
{
|
||||
ImVec2 pos = ImGui::GetCursorScreenPos() - ImVec2(ImGui::GetStyle().CellPadding.x / 2, 0);
|
||||
float highlight_width = s.GlyphWidth * 2 + ImGui::GetStyle().CellPadding.x / 2;
|
||||
bool is_next_byte_highlighted = (addr + 1 < mem_size) &&
|
||||
((HighlightMax != (size_t)-1 && addr + 1 < HighlightMax) ||
|
||||
(HighlightFn && HighlightFn(mem_data, addr + 1, true)) ||
|
||||
((addr + 1) >= DataPreviewAddr && (addr + 1) <= DataPreviewAddrEnd) || ((addr + 1) >= DataPreviewAddrEnd && (addr + 1) <= DataPreviewAddr));
|
||||
if (is_next_byte_highlighted)
|
||||
{
|
||||
highlight_width = s.HexCellWidth;
|
||||
if (OptMidColsCount > 0 && n > 0 && (n + 1) < Cols && ((n + 1) % OptMidColsCount) == 0)
|
||||
highlight_width += s.SpacingBetweenMidCols;
|
||||
}
|
||||
|
||||
ImU32 color = HighlightColor;
|
||||
if ((is_highlight_from_user_range + is_highlight_from_user_func + is_highlight_from_preview) > 1)
|
||||
color = (ImAlphaBlendColors(HighlightColor, 0x60C08080) & 0x00FFFFFF) | 0x90000000;
|
||||
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + highlight_width, pos.y + s.LineHeight), color);
|
||||
|
||||
if (is_highlight_from_preview) {
|
||||
size_t min = std::min(DataPreviewAddr, DataPreviewAddrEnd);
|
||||
size_t max = std::max(DataPreviewAddr, DataPreviewAddrEnd);
|
||||
|
||||
// Draw vertical line at the left of first byte and the start of the line
|
||||
if (n == 0 || addr == min)
|
||||
draw_list->AddLine(pos, pos + ImVec2(0, s.LineHeight), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Text)), 1.0F);
|
||||
|
||||
// Draw vertical line at the right of the last byte and the end of the line
|
||||
if (n == Cols - 1 || addr == max) {
|
||||
draw_list->AddRectFilled(pos + ImVec2(highlight_width, 0), pos + ImVec2(highlight_width + 1, s.LineHeight), color);
|
||||
draw_list->AddLine(pos + ImVec2(highlight_width + 1, -1), pos + ImVec2(highlight_width + 1, s.LineHeight), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Text)), 1.0F);
|
||||
}
|
||||
|
||||
// Draw horizontal line at the top of the bytes
|
||||
if ((addr - Cols) < min)
|
||||
draw_list->AddLine(pos, pos + ImVec2(highlight_width + 1, 0), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Text)), 1.0F);
|
||||
|
||||
// Draw horizontal line at the bottom of the bytes
|
||||
if ((addr + Cols) == (max + 1) && OptMidColsCount > 0 && n > 0 && (n + 1) < Cols && ((n + 1) % OptMidColsCount) == 1)
|
||||
draw_list->AddLine(pos + ImVec2(-s.SpacingBetweenMidCols, s.LineHeight), pos + ImVec2(highlight_width + 1, s.LineHeight), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Text)), 1.0F);
|
||||
else if ((addr + Cols) > max)
|
||||
draw_list->AddLine(pos + ImVec2(0, s.LineHeight), pos + ImVec2(highlight_width + 1, s.LineHeight), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Text)), 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
if (DataEditingAddr == addr)
|
||||
{
|
||||
// Display text input on current byte
|
||||
bool data_write = false;
|
||||
ImGui::PushID((void*)addr);
|
||||
if (DataEditingTakeFocus)
|
||||
{
|
||||
ImGui::SetKeyboardFocusHere();
|
||||
ImGui::CaptureKeyboardFromApp(true);
|
||||
sprintf(AddrInputBuf, format_data, s.AddrDigitsCount, base_display_addr + addr);
|
||||
sprintf(DataInputBuf, format_byte, ReadFn ? ReadFn(mem_data, addr) : mem_data[addr]);
|
||||
}
|
||||
ImGui::PushItemWidth(s.GlyphWidth * 2);
|
||||
struct UserData
|
||||
{
|
||||
// FIXME: We should have a way to retrieve the text edit cursor position more easily in the API, this is rather tedious. This is such a ugly mess we may be better off not using InputText() at all here.
|
||||
static int Callback(ImGuiInputTextCallbackData* data)
|
||||
{
|
||||
UserData* user_data = (UserData*)data->UserData;
|
||||
if (!data->HasSelection())
|
||||
user_data->CursorPos = data->CursorPos;
|
||||
if (data->SelectionStart == 0 && data->SelectionEnd == data->BufTextLen)
|
||||
{
|
||||
// When not editing a byte, always rewrite its content (this is a bit tricky, since InputText technically "owns" the master copy of the buffer we edit it in there)
|
||||
data->DeleteChars(0, data->BufTextLen);
|
||||
data->InsertChars(0, user_data->CurrentBufOverwrite);
|
||||
data->SelectionStart = 0;
|
||||
data->SelectionEnd = 2;
|
||||
data->CursorPos = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
char CurrentBufOverwrite[3]; // Input
|
||||
int CursorPos; // Output
|
||||
};
|
||||
UserData user_data;
|
||||
user_data.CursorPos = -1;
|
||||
sprintf(user_data.CurrentBufOverwrite, format_byte, ReadFn ? ReadFn(mem_data, addr) : mem_data[addr]);
|
||||
ImGuiInputTextFlags flags = ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoHorizontalScroll | ImGuiInputTextFlags_AlwaysInsertMode | ImGuiInputTextFlags_CallbackAlways;
|
||||
if (ImGui::InputText("##data", DataInputBuf, 32, flags, UserData::Callback, &user_data))
|
||||
data_write = data_next = true;
|
||||
else if (!DataEditingTakeFocus && !ImGui::IsItemActive())
|
||||
DataEditingAddr = data_editing_addr_next = (size_t)-1;
|
||||
DataEditingTakeFocus = false;
|
||||
ImGui::PopItemWidth();
|
||||
if (user_data.CursorPos >= 2)
|
||||
data_write = data_next = true;
|
||||
if (data_editing_addr_next != (size_t)-1)
|
||||
data_write = data_next = false;
|
||||
unsigned int data_input_value = 0;
|
||||
if (data_write && sscanf(DataInputBuf, "%X", &data_input_value) == 1)
|
||||
{
|
||||
if (WriteFn)
|
||||
WriteFn(mem_data, addr, (ImU8)data_input_value);
|
||||
else
|
||||
mem_data[addr] = (ImU8)data_input_value;
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
else
|
||||
{
|
||||
// NB: The trailing space is not visible but ensure there's no gap that the mouse cannot click on.
|
||||
ImU8 b = ReadFn ? ReadFn(mem_data, addr) : mem_data[addr];
|
||||
|
||||
if (OptShowHexII)
|
||||
{
|
||||
if ((b >= 32 && b < 128))
|
||||
ImGui::Text(".%c ", b);
|
||||
else if (b == 0xFF && OptGreyOutZeroes)
|
||||
ImGui::TextDisabled("## ");
|
||||
else if (b == 0x00)
|
||||
ImGui::Text(" ");
|
||||
else
|
||||
ImGui::Text(format_byte_space, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (b == 0 && OptGreyOutZeroes)
|
||||
ImGui::TextDisabled("00 ");
|
||||
else
|
||||
ImGui::Text(format_byte_space, b);
|
||||
}
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
||||
{
|
||||
if (!ReadOnly && ImGui::IsMouseDoubleClicked(0)) {
|
||||
DataEditingTakeFocus = true;
|
||||
data_editing_addr_next = addr;
|
||||
}
|
||||
|
||||
DataPreviewAddr = addr;
|
||||
DataPreviewAddrEnd = addr;
|
||||
}
|
||||
if (ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
||||
DataPreviewAddrEnd = addr;
|
||||
}
|
||||
if (ImGui::IsItemHovered() && !tooltipShown) {
|
||||
if (HoverFn) {
|
||||
HoverFn(mem_data, addr);
|
||||
tooltipShown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (OptShowAscii)
|
||||
{
|
||||
// Draw ASCII values
|
||||
ImGui::SameLine(s.PosAsciiStart);
|
||||
ImVec2 pos = ImGui::GetCursorScreenPos();
|
||||
addr = line_i * Cols;
|
||||
|
||||
ImGui::PushID(-1);
|
||||
ImGui::SameLine();
|
||||
ImGui::Dummy(ImVec2(s.GlyphWidth, s.LineHeight));
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
for (int n = 0; n < Cols && addr < mem_size; n++, addr++)
|
||||
{
|
||||
if (addr == DataEditingAddr)
|
||||
{
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + s.GlyphWidth, pos.y + s.LineHeight), ImGui::GetColorU32(ImGuiCol_FrameBg));
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + s.GlyphWidth, pos.y + s.LineHeight), ImGui::GetColorU32(ImGuiCol_TextSelectedBg));
|
||||
}
|
||||
unsigned char c = ReadFn ? ReadFn(mem_data, addr) : mem_data[addr];
|
||||
char display_c = (c < 32 || c >= 128) ? '.' : c;
|
||||
draw_list->AddText(pos, (display_c == c) ? color_text : color_disabled, &display_c, &display_c + 1);
|
||||
|
||||
// Draw highlight
|
||||
bool is_highlight_from_user_range = (addr >= HighlightMin && addr < HighlightMax);
|
||||
bool is_highlight_from_user_func = (HighlightFn && HighlightFn(mem_data, addr, false));
|
||||
bool is_highlight_from_preview = (addr >= DataPreviewAddr && addr <= DataPreviewAddrEnd) || (addr >= DataPreviewAddrEnd && addr <= DataPreviewAddr);
|
||||
if (is_highlight_from_user_range || is_highlight_from_user_func || is_highlight_from_preview)
|
||||
{
|
||||
ImU32 color = HighlightColor;
|
||||
if ((is_highlight_from_user_range + is_highlight_from_user_func + is_highlight_from_preview) > 1)
|
||||
color = (ImAlphaBlendColors(HighlightColor, 0x60C08080) & 0x00FFFFFF) | 0x90000000;
|
||||
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + s.GlyphWidth, pos.y + s.LineHeight), color);
|
||||
}
|
||||
|
||||
|
||||
ImGui::PushID(line_i * Cols + n);
|
||||
ImGui::SameLine();
|
||||
ImGui::Dummy(ImVec2(s.GlyphWidth, s.LineHeight));
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
||||
{
|
||||
if (!ReadOnly && ImGui::IsMouseDoubleClicked(0)) {
|
||||
DataEditingTakeFocus = true;
|
||||
data_editing_addr_next = addr;
|
||||
}
|
||||
|
||||
DataPreviewAddr = addr;
|
||||
DataPreviewAddrEnd = addr;
|
||||
|
||||
}
|
||||
if (ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
||||
DataPreviewAddrEnd = addr;
|
||||
}
|
||||
|
||||
pos.x += s.GlyphWidth;
|
||||
}
|
||||
|
||||
ImGui::PushID(-1);
|
||||
ImGui::SameLine();
|
||||
ImGui::Dummy(ImVec2(s.GlyphWidth, s.LineHeight));
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
if (OptShowAdvancedDecoding && DecodeFn) {
|
||||
// Draw decoded bytes
|
||||
ImGui::SameLine(s.PosDecodingStart);
|
||||
ImVec2 pos = ImGui::GetCursorScreenPos();
|
||||
addr = line_i * Cols;
|
||||
|
||||
ImGui::PushID(-1);
|
||||
ImGui::SameLine();
|
||||
ImGui::Dummy(ImVec2(s.GlyphWidth, s.LineHeight));
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
for (int n = 0; n < Cols && addr < mem_size;)
|
||||
{
|
||||
auto decodedData = DecodeFn(mem_data, addr);
|
||||
|
||||
auto displayData = decodedData.data;
|
||||
auto glyphWidth = ImGui::CalcTextSize(displayData.c_str()).x + 1;
|
||||
|
||||
if (addr == DataEditingAddr)
|
||||
{
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + glyphWidth, pos.y + s.LineHeight), ImGui::GetColorU32(ImGuiCol_FrameBg));
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + glyphWidth, pos.y + s.LineHeight), ImGui::GetColorU32(ImGuiCol_TextSelectedBg));
|
||||
}
|
||||
|
||||
draw_list->AddText(pos, decodedData.color, displayData.c_str(), displayData.c_str() + displayData.length());
|
||||
|
||||
// Draw highlight
|
||||
bool is_highlight_from_user_range = (addr >= HighlightMin && addr < HighlightMax);
|
||||
bool is_highlight_from_user_func = (HighlightFn && HighlightFn(mem_data, addr, false));
|
||||
bool is_highlight_from_preview = (addr >= DataPreviewAddr && addr <= DataPreviewAddrEnd) || (addr >= DataPreviewAddrEnd && addr <= DataPreviewAddr);
|
||||
if (is_highlight_from_user_range || is_highlight_from_user_func || is_highlight_from_preview)
|
||||
{
|
||||
ImU32 color = HighlightColor;
|
||||
if ((is_highlight_from_user_range + is_highlight_from_user_func + is_highlight_from_preview) > 1)
|
||||
color = (ImAlphaBlendColors(HighlightColor, 0x60C08080) & 0x00FFFFFF) | 0x90000000;
|
||||
|
||||
draw_list->AddRectFilled(pos, ImVec2(pos.x + glyphWidth, pos.y + s.LineHeight), color);
|
||||
}
|
||||
|
||||
|
||||
ImGui::PushID(line_i * Cols + n);
|
||||
ImGui::SameLine();
|
||||
ImGui::Dummy(ImVec2(glyphWidth, s.LineHeight));
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(0) && !ImGui::GetIO().KeyShift)
|
||||
{
|
||||
if (!ReadOnly && ImGui::IsMouseDoubleClicked(0)) {
|
||||
DataEditingTakeFocus = true;
|
||||
data_editing_addr_next = addr;
|
||||
}
|
||||
|
||||
DataPreviewAddr = addr;
|
||||
DataPreviewAddrEnd = addr;
|
||||
|
||||
}
|
||||
if (ImGui::IsItemHovered() && ((ImGui::IsMouseClicked(0) && ImGui::GetIO().KeyShift) || ImGui::IsMouseDragging(0))) {
|
||||
DataPreviewAddrEnd = addr;
|
||||
}
|
||||
|
||||
pos.x += glyphWidth;
|
||||
|
||||
if (addr <= 1) {
|
||||
n++;
|
||||
addr++;
|
||||
} else {
|
||||
n += decodedData.advance;
|
||||
addr += decodedData.advance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopStyleVar(2);
|
||||
ImGui::EndChild();
|
||||
|
||||
if (data_next && DataEditingAddr < mem_size)
|
||||
{
|
||||
DataEditingAddr = DataPreviewAddr = DataPreviewAddrEnd = DataEditingAddr + 1;
|
||||
DataEditingTakeFocus = true;
|
||||
}
|
||||
else if (data_editing_addr_next != (size_t)-1)
|
||||
{
|
||||
DataEditingAddr = DataPreviewAddr = DataPreviewAddrEnd = data_editing_addr_next;
|
||||
}
|
||||
|
||||
if (OptShowOptions)
|
||||
{
|
||||
ImGui::Separator();
|
||||
DrawOptionsLine(s, mem_data, mem_size, base_display_addr);
|
||||
}
|
||||
|
||||
// Notify the main window of our ideal child content size (FIXME: we are missing an API to get the contents size from the child)
|
||||
ImGui::SetCursorPosX(s.WindowWidth);
|
||||
}
|
||||
|
||||
void DrawOptionsLine(const Sizes& s, void* mem_data, size_t mem_size, size_t base_display_addr)
|
||||
{
|
||||
IM_UNUSED(mem_data);
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
const char* format_range = OptUpperCaseHex ? "Range 0x%0*" _PRISizeT "X..0x%0*" _PRISizeT "X" : "Range 0x%0*" _PRISizeT "x..0x%0*" _PRISizeT "x";
|
||||
const char* format_selection = OptUpperCaseHex ? "Selection 0x%0*" _PRISizeT "X..0x%0*" _PRISizeT "X (%ld [0x%lX] %s)" : "Range 0x%0*" _PRISizeT "x..0x%0*" _PRISizeT "x (%ld [0x%lX] %s)";
|
||||
|
||||
if (this->OptShowExtraInfo) {
|
||||
ImGui::Text(format_range, s.AddrDigitsCount, base_display_addr, s.AddrDigitsCount, base_display_addr + mem_size - 1);
|
||||
if (DataPreviewAddr != (size_t)-1 && DataPreviewAddrEnd != (size_t)-1) {
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
|
||||
auto selectionStart = std::min(DataPreviewAddr, DataPreviewAddrEnd);
|
||||
auto selectionEnd = std::max(DataPreviewAddr, DataPreviewAddrEnd);
|
||||
|
||||
size_t regionSize = (selectionEnd - selectionStart) + 1;
|
||||
ImGui::Text(format_selection, s.AddrDigitsCount, base_display_addr + selectionStart, s.AddrDigitsCount, base_display_addr + selectionEnd, regionSize, regionSize, regionSize == 1 ? "byte" : "bytes");
|
||||
}
|
||||
}
|
||||
|
||||
if (GotoAddr != (size_t)-1)
|
||||
{
|
||||
if (GotoAddr < mem_size)
|
||||
{
|
||||
ImGui::BeginChild("##scrolling");
|
||||
ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + (GotoAddr / Cols) * ImGui::GetTextLineHeight());
|
||||
ImGui::EndChild();
|
||||
}
|
||||
GotoAddr = (size_t)-1;
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsBigEndian()
|
||||
{
|
||||
uint16_t x = 1;
|
||||
char c[2];
|
||||
memcpy(c, &x, 2);
|
||||
return c[0] != 0;
|
||||
}
|
||||
|
||||
static void* EndianessCopyBigEndian(void* _dst, void* _src, size_t s, int is_little_endian)
|
||||
{
|
||||
if (is_little_endian)
|
||||
{
|
||||
uint8_t* dst = (uint8_t*)_dst;
|
||||
uint8_t* src = (uint8_t*)_src + s - 1;
|
||||
for (int i = 0, n = (int)s; i < n; ++i)
|
||||
memcpy(dst++, src--, 1);
|
||||
return _dst;
|
||||
}
|
||||
else
|
||||
{
|
||||
return memcpy(_dst, _src, s);
|
||||
}
|
||||
}
|
||||
|
||||
static void* EndianessCopyLittleEndian(void* _dst, void* _src, size_t s, int is_little_endian)
|
||||
{
|
||||
if (is_little_endian)
|
||||
{
|
||||
return memcpy(_dst, _src, s);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t* dst = (uint8_t*)_dst;
|
||||
uint8_t* src = (uint8_t*)_src + s - 1;
|
||||
for (int i = 0, n = (int)s; i < n; ++i)
|
||||
memcpy(dst++, src--, 1);
|
||||
return _dst;
|
||||
}
|
||||
}
|
||||
|
||||
void* EndianessCopy(void* dst, void* src, size_t size) const
|
||||
{
|
||||
static void* (*fp)(void*, void*, size_t, int) = NULL;
|
||||
if (fp == NULL)
|
||||
fp = IsBigEndian() ? EndianessCopyBigEndian : EndianessCopyLittleEndian;
|
||||
return fp(dst, src, size, PreviewEndianess);
|
||||
}
|
||||
};
|
||||
|
||||
#undef _PRISizeT
|
||||
#undef ImSnprintf
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
389
lib/external/imgui/include/imnodes.h
vendored
Normal file
389
lib/external/imgui/include/imnodes.h
vendored
Normal file
@@ -0,0 +1,389 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
typedef int ImNodesCol; // -> enum ImNodesCol_
|
||||
typedef int ImNodesStyleVar; // -> enum ImNodesStyleVar_
|
||||
typedef int ImNodesStyleFlags; // -> enum ImNodesStyleFlags_
|
||||
typedef int ImNodesPinShape; // -> enum ImNodesPinShape_
|
||||
typedef int ImNodesAttributeFlags; // -> enum ImNodesAttributeFlags_
|
||||
typedef int ImNodesMiniMapLocation; // -> enum ImNodesMiniMapLocation_
|
||||
|
||||
enum ImNodesCol_
|
||||
{
|
||||
ImNodesCol_NodeBackground = 0,
|
||||
ImNodesCol_NodeBackgroundHovered,
|
||||
ImNodesCol_NodeBackgroundSelected,
|
||||
ImNodesCol_NodeOutline,
|
||||
ImNodesCol_TitleBar,
|
||||
ImNodesCol_TitleBarHovered,
|
||||
ImNodesCol_TitleBarSelected,
|
||||
ImNodesCol_Link,
|
||||
ImNodesCol_LinkHovered,
|
||||
ImNodesCol_LinkSelected,
|
||||
ImNodesCol_Pin,
|
||||
ImNodesCol_PinHovered,
|
||||
ImNodesCol_BoxSelector,
|
||||
ImNodesCol_BoxSelectorOutline,
|
||||
ImNodesCol_GridBackground,
|
||||
ImNodesCol_GridLine,
|
||||
ImNodesCol_MiniMapBackground,
|
||||
ImNodesCol_MiniMapBackgroundHovered,
|
||||
ImNodesCol_MiniMapOutline,
|
||||
ImNodesCol_MiniMapOutlineHovered,
|
||||
ImNodesCol_MiniMapNodeBackground,
|
||||
ImNodesCol_MiniMapNodeBackgroundHovered,
|
||||
ImNodesCol_MiniMapNodeBackgroundSelected,
|
||||
ImNodesCol_MiniMapNodeOutline,
|
||||
ImNodesCol_MiniMapLink,
|
||||
ImNodesCol_MiniMapLinkSelected,
|
||||
ImNodesCol_COUNT
|
||||
};
|
||||
|
||||
enum ImNodesStyleVar_
|
||||
{
|
||||
ImNodesStyleVar_GridSpacing = 0,
|
||||
ImNodesStyleVar_NodeCornerRounding,
|
||||
ImNodesStyleVar_NodePaddingHorizontal,
|
||||
ImNodesStyleVar_NodePaddingVertical,
|
||||
ImNodesStyleVar_NodeBorderThickness,
|
||||
ImNodesStyleVar_LinkThickness,
|
||||
ImNodesStyleVar_LinkLineSegmentsPerLength,
|
||||
ImNodesStyleVar_LinkHoverDistance,
|
||||
ImNodesStyleVar_PinCircleRadius,
|
||||
ImNodesStyleVar_PinQuadSideLength,
|
||||
ImNodesStyleVar_PinTriangleSideLength,
|
||||
ImNodesStyleVar_PinLineThickness,
|
||||
ImNodesStyleVar_PinHoverRadius,
|
||||
ImNodesStyleVar_PinOffset
|
||||
};
|
||||
|
||||
enum ImNodesStyleFlags_
|
||||
{
|
||||
ImNodesStyleFlags_None = 0,
|
||||
ImNodesStyleFlags_NodeOutline = 1 << 0,
|
||||
ImNodesStyleFlags_GridLines = 1 << 2
|
||||
};
|
||||
|
||||
enum ImNodesPinShape_
|
||||
{
|
||||
ImNodesPinShape_Circle,
|
||||
ImNodesPinShape_CircleFilled,
|
||||
ImNodesPinShape_Triangle,
|
||||
ImNodesPinShape_TriangleFilled,
|
||||
ImNodesPinShape_Quad,
|
||||
ImNodesPinShape_QuadFilled
|
||||
};
|
||||
|
||||
// This enum controls the way the attribute pins behave.
|
||||
enum ImNodesAttributeFlags_
|
||||
{
|
||||
ImNodesAttributeFlags_None = 0,
|
||||
// Allow detaching a link by left-clicking and dragging the link at a pin it is connected to.
|
||||
// NOTE: the user has to actually delete the link for this to work. A deleted link can be
|
||||
// detected by calling IsLinkDestroyed() after EndNodeEditor().
|
||||
ImNodesAttributeFlags_EnableLinkDetachWithDragClick = 1 << 0,
|
||||
// Visual snapping of an in progress link will trigger IsLink Created/Destroyed events. Allows
|
||||
// for previewing the creation of a link while dragging it across attributes. See here for demo:
|
||||
// https://github.com/Nelarius/imnodes/issues/41#issuecomment-647132113 NOTE: the user has to
|
||||
// actually delete the link for this to work. A deleted link can be detected by calling
|
||||
// IsLinkDestroyed() after EndNodeEditor().
|
||||
ImNodesAttributeFlags_EnableLinkCreationOnSnap = 1 << 1
|
||||
};
|
||||
|
||||
struct ImNodesIO
|
||||
{
|
||||
struct EmulateThreeButtonMouse
|
||||
{
|
||||
EmulateThreeButtonMouse();
|
||||
|
||||
// The keyboard modifier to use in combination with mouse left click to pan the editor view.
|
||||
// Set to NULL by default. To enable this feature, set the modifier to point to a boolean
|
||||
// indicating the state of a modifier. For example,
|
||||
//
|
||||
// ImNodes::GetIO().EmulateThreeButtonMouse.Modifier = &ImGui::GetIO().KeyAlt;
|
||||
const bool* Modifier;
|
||||
} EmulateThreeButtonMouse;
|
||||
|
||||
struct LinkDetachWithModifierClick
|
||||
{
|
||||
LinkDetachWithModifierClick();
|
||||
|
||||
// Pointer to a boolean value indicating when the desired modifier is pressed. Set to NULL
|
||||
// by default. To enable the feature, set the modifier to point to a boolean indicating the
|
||||
// state of a modifier. For example,
|
||||
//
|
||||
// ImNodes::GetIO().LinkDetachWithModifierClick.Modifier = &ImGui::GetIO().KeyCtrl;
|
||||
//
|
||||
// Left-clicking a link with this modifier pressed will detach that link. NOTE: the user has
|
||||
// to actually delete the link for this to work. A deleted link can be detected by calling
|
||||
// IsLinkDestroyed() after EndNodeEditor().
|
||||
const bool* Modifier;
|
||||
} LinkDetachWithModifierClick;
|
||||
|
||||
// Holding alt mouse button pans the node area, by default middle mouse button will be used
|
||||
// Set based on ImGuiMouseButton values
|
||||
int AltMouseButton;
|
||||
|
||||
ImNodesIO();
|
||||
};
|
||||
|
||||
struct ImNodesStyle
|
||||
{
|
||||
float GridSpacing;
|
||||
|
||||
float NodeCornerRounding;
|
||||
float NodePaddingHorizontal;
|
||||
float NodePaddingVertical;
|
||||
float NodeBorderThickness;
|
||||
|
||||
float LinkThickness;
|
||||
float LinkLineSegmentsPerLength;
|
||||
float LinkHoverDistance;
|
||||
|
||||
// The following variables control the look and behavior of the pins. The default size of each
|
||||
// pin shape is balanced to occupy approximately the same surface area on the screen.
|
||||
|
||||
// The circle radius used when the pin shape is either ImNodesPinShape_Circle or
|
||||
// ImNodesPinShape_CircleFilled.
|
||||
float PinCircleRadius;
|
||||
// The quad side length used when the shape is either ImNodesPinShape_Quad or
|
||||
// ImNodesPinShape_QuadFilled.
|
||||
float PinQuadSideLength;
|
||||
// The equilateral triangle side length used when the pin shape is either
|
||||
// ImNodesPinShape_Triangle or ImNodesPinShape_TriangleFilled.
|
||||
float PinTriangleSideLength;
|
||||
// The thickness of the line used when the pin shape is not filled.
|
||||
float PinLineThickness;
|
||||
// The radius from the pin's center position inside of which it is detected as being hovered
|
||||
// over.
|
||||
float PinHoverRadius;
|
||||
// Offsets the pins' positions from the edge of the node to the outside of the node.
|
||||
float PinOffset;
|
||||
|
||||
// By default, ImNodesStyleFlags_NodeOutline and ImNodesStyleFlags_Gridlines are enabled.
|
||||
ImNodesStyleFlags Flags;
|
||||
// Set these mid-frame using Push/PopColorStyle. You can index this color array with with a
|
||||
// ImNodesCol value.
|
||||
unsigned int Colors[ImNodesCol_COUNT];
|
||||
|
||||
ImNodesStyle();
|
||||
};
|
||||
|
||||
enum ImNodesMiniMapLocation_
|
||||
{
|
||||
ImNodesMiniMapLocation_BottomLeft,
|
||||
ImNodesMiniMapLocation_BottomRight,
|
||||
ImNodesMiniMapLocation_TopLeft,
|
||||
ImNodesMiniMapLocation_TopRight,
|
||||
};
|
||||
|
||||
struct ImGuiContext;
|
||||
struct ImVec2;
|
||||
|
||||
struct ImNodesContext;
|
||||
|
||||
// An editor context corresponds to a set of nodes in a single workspace (created with a single
|
||||
// Begin/EndNodeEditor pair)
|
||||
//
|
||||
// By default, the library creates an editor context behind the scenes, so using any of the imnodes
|
||||
// functions doesn't require you to explicitly create a context.
|
||||
struct ImNodesEditorContext;
|
||||
|
||||
// Callback type used to specify special behavior when hovering a node in the minimap
|
||||
typedef void (*ImNodesMiniMapNodeHoveringCallback)(int, void*);
|
||||
|
||||
namespace ImNodes
|
||||
{
|
||||
// Call this function if you are compiling imnodes in to a dll, separate from ImGui. Calling this
|
||||
// function sets the GImGui global variable, which is not shared across dll boundaries.
|
||||
void SetImGuiContext(ImGuiContext* ctx);
|
||||
|
||||
ImNodesContext* CreateContext();
|
||||
void DestroyContext(ImNodesContext* ctx = NULL); // NULL = destroy current context
|
||||
ImNodesContext* GetCurrentContext();
|
||||
void SetCurrentContext(ImNodesContext* ctx);
|
||||
|
||||
ImNodesEditorContext* EditorContextCreate();
|
||||
void EditorContextFree(ImNodesEditorContext*);
|
||||
void EditorContextSet(ImNodesEditorContext*);
|
||||
ImVec2 EditorContextGetPanning();
|
||||
void EditorContextResetPanning(const ImVec2& pos);
|
||||
void EditorContextMoveToNode(const int node_id);
|
||||
|
||||
ImNodesIO& GetIO();
|
||||
|
||||
// Returns the global style struct. See the struct declaration for default values.
|
||||
ImNodesStyle& GetStyle();
|
||||
// Style presets matching the dear imgui styles of the same name.
|
||||
void StyleColorsDark(); // on by default
|
||||
void StyleColorsClassic();
|
||||
void StyleColorsLight();
|
||||
|
||||
// The top-level function call. Call this before calling BeginNode/EndNode. Calling this function
|
||||
// will result the node editor grid workspace being rendered.
|
||||
void BeginNodeEditor();
|
||||
void EndNodeEditor();
|
||||
|
||||
// Add a navigable minimap to the editor; call before EndNodeEditor after all
|
||||
// nodes and links have been specified
|
||||
void MiniMap(
|
||||
const float minimap_size_fraction = 0.2f,
|
||||
const ImNodesMiniMapLocation location = ImNodesMiniMapLocation_TopLeft,
|
||||
const ImNodesMiniMapNodeHoveringCallback node_hovering_callback = NULL,
|
||||
void* node_hovering_callback_data = NULL);
|
||||
|
||||
// Use PushColorStyle and PopColorStyle to modify ImNodesStyle::Colors mid-frame.
|
||||
void PushColorStyle(ImNodesCol item, unsigned int color);
|
||||
void PopColorStyle();
|
||||
void PushStyleVar(ImNodesStyleVar style_item, float value);
|
||||
void PopStyleVar();
|
||||
|
||||
// id can be any positive or negative integer, but INT_MIN is currently reserved for internal use.
|
||||
void BeginNode(int id);
|
||||
void EndNode();
|
||||
|
||||
ImVec2 GetNodeDimensions(int id);
|
||||
|
||||
// Place your node title bar content (such as the node title, using ImGui::Text) between the
|
||||
// following function calls. These functions have to be called before adding any attributes, or the
|
||||
// layout of the node will be incorrect.
|
||||
void BeginNodeTitleBar();
|
||||
void EndNodeTitleBar();
|
||||
|
||||
// Attributes are ImGui UI elements embedded within the node. Attributes can have pin shapes
|
||||
// rendered next to them. Links are created between pins.
|
||||
//
|
||||
// The activity status of an attribute can be checked via the IsAttributeActive() and
|
||||
// IsAnyAttributeActive() function calls. This is one easy way of checking for any changes made to
|
||||
// an attribute's drag float UI, for instance.
|
||||
//
|
||||
// Each attribute id must be unique.
|
||||
|
||||
// Create an input attribute block. The pin is rendered on left side.
|
||||
void BeginInputAttribute(int id, ImNodesPinShape shape = ImNodesPinShape_CircleFilled);
|
||||
void EndInputAttribute();
|
||||
// Create an output attribute block. The pin is rendered on the right side.
|
||||
void BeginOutputAttribute(int id, ImNodesPinShape shape = ImNodesPinShape_CircleFilled);
|
||||
void EndOutputAttribute();
|
||||
// Create a static attribute block. A static attribute has no pin, and therefore can't be linked to
|
||||
// anything. However, you can still use IsAttributeActive() and IsAnyAttributeActive() to check for
|
||||
// attribute activity.
|
||||
void BeginStaticAttribute(int id);
|
||||
void EndStaticAttribute();
|
||||
|
||||
// Push a single AttributeFlags value. By default, only AttributeFlags_None is set.
|
||||
void PushAttributeFlag(ImNodesAttributeFlags flag);
|
||||
void PopAttributeFlag();
|
||||
|
||||
// Render a link between attributes.
|
||||
// The attributes ids used here must match the ids used in Begin(Input|Output)Attribute function
|
||||
// calls. The order of start_attr and end_attr doesn't make a difference for rendering the link.
|
||||
void Link(int id, int start_attribute_id, int end_attribute_id);
|
||||
|
||||
// Enable or disable the ability to click and drag a specific node.
|
||||
void SetNodeDraggable(int node_id, const bool draggable);
|
||||
|
||||
// The node's position can be expressed in three coordinate systems:
|
||||
// * screen space coordinates, -- the origin is the upper left corner of the window.
|
||||
// * editor space coordinates -- the origin is the upper left corner of the node editor window
|
||||
// * grid space coordinates, -- the origin is the upper left corner of the node editor window,
|
||||
// translated by the current editor panning vector (see EditorContextGetPanning() and
|
||||
// EditorContextResetPanning())
|
||||
|
||||
// Use the following functions to get and set the node's coordinates in these coordinate systems.
|
||||
|
||||
void SetNodeScreenSpacePos(int node_id, const ImVec2& screen_space_pos);
|
||||
void SetNodeEditorSpacePos(int node_id, const ImVec2& editor_space_pos);
|
||||
void SetNodeGridSpacePos(int node_id, const ImVec2& grid_pos);
|
||||
|
||||
ImVec2 GetNodeScreenSpacePos(const int node_id);
|
||||
ImVec2 GetNodeEditorSpacePos(const int node_id);
|
||||
ImVec2 GetNodeGridSpacePos(const int node_id);
|
||||
|
||||
// Returns true if the current node editor canvas is being hovered over by the mouse, and is not
|
||||
// blocked by any other windows.
|
||||
bool IsEditorHovered();
|
||||
// The following functions return true if a UI element is being hovered over by the mouse cursor.
|
||||
// Assigns the id of the UI element being hovered over to the function argument. Use these functions
|
||||
// after EndNodeEditor() has been called.
|
||||
bool IsNodeHovered(int* node_id);
|
||||
bool IsLinkHovered(int* link_id);
|
||||
bool IsPinHovered(int* attribute_id);
|
||||
|
||||
// Use The following two functions to query the number of selected nodes or links in the current
|
||||
// editor. Use after calling EndNodeEditor().
|
||||
int NumSelectedNodes();
|
||||
int NumSelectedLinks();
|
||||
// Get the selected node/link ids. The pointer argument should point to an integer array with at
|
||||
// least as many elements as the respective NumSelectedNodes/NumSelectedLinks function call
|
||||
// returned.
|
||||
void GetSelectedNodes(int* node_ids);
|
||||
void GetSelectedLinks(int* link_ids);
|
||||
// Clears the list of selected nodes/links. Useful if you want to delete a selected node or link.
|
||||
void ClearNodeSelection();
|
||||
void ClearLinkSelection();
|
||||
// Use the following functions to add or remove individual nodes or links from the current editors
|
||||
// selection. Note that all functions require the id to be an existing valid id for this editor.
|
||||
// Select-functions has the precondition that the object is currently considered unselected.
|
||||
// Clear-functions has the precondition that the object is currently considered selected.
|
||||
// Preconditions listed above can be checked via IsNodeSelected/IsLinkSelected if not already
|
||||
// known.
|
||||
void SelectNode(int node_id);
|
||||
void ClearNodeSelection(int node_id);
|
||||
bool IsNodeSelected(int node_id);
|
||||
void SelectLink(int link_id);
|
||||
void ClearLinkSelection(int link_id);
|
||||
bool IsLinkSelected(int link_id);
|
||||
|
||||
// Was the previous attribute active? This will continuously return true while the left mouse button
|
||||
// is being pressed over the UI content of the attribute.
|
||||
bool IsAttributeActive();
|
||||
// Was any attribute active? If so, sets the active attribute id to the output function argument.
|
||||
bool IsAnyAttributeActive(int* attribute_id = NULL);
|
||||
|
||||
// Use the following functions to query a change of state for an existing link, or new link. Call
|
||||
// these after EndNodeEditor().
|
||||
|
||||
// Did the user start dragging a new link from a pin?
|
||||
bool IsLinkStarted(int* started_at_attribute_id);
|
||||
// Did the user drop the dragged link before attaching it to a pin?
|
||||
// There are two different kinds of situations to consider when handling this event:
|
||||
// 1) a link which is created at a pin and then dropped
|
||||
// 2) an existing link which is detached from a pin and then dropped
|
||||
// Use the including_detached_links flag to control whether this function triggers when the user
|
||||
// detaches a link and drops it.
|
||||
bool IsLinkDropped(int* started_at_attribute_id = NULL, bool including_detached_links = true);
|
||||
// Did the user finish creating a new link?
|
||||
bool IsLinkCreated(
|
||||
int* started_at_attribute_id,
|
||||
int* ended_at_attribute_id,
|
||||
bool* created_from_snap = NULL);
|
||||
bool IsLinkCreated(
|
||||
int* started_at_node_id,
|
||||
int* started_at_attribute_id,
|
||||
int* ended_at_node_id,
|
||||
int* ended_at_attribute_id,
|
||||
bool* created_from_snap = NULL);
|
||||
|
||||
// Was an existing link detached from a pin by the user? The detached link's id is assigned to the
|
||||
// output argument link_id.
|
||||
bool IsLinkDestroyed(int* link_id);
|
||||
|
||||
// Use the following functions to write the editor context's state to a string, or directly to a
|
||||
// file. The editor context is serialized in the INI file format.
|
||||
|
||||
const char* SaveCurrentEditorStateToIniString(size_t* data_size = NULL);
|
||||
const char* SaveEditorStateToIniString(
|
||||
const ImNodesEditorContext* editor,
|
||||
size_t* data_size = NULL);
|
||||
|
||||
void LoadCurrentEditorStateFromIniString(const char* data, size_t data_size);
|
||||
void LoadEditorStateFromIniString(ImNodesEditorContext* editor, const char* data, size_t data_size);
|
||||
|
||||
void SaveCurrentEditorStateToIniFile(const char* file_name);
|
||||
void SaveEditorStateToIniFile(const ImNodesEditorContext* editor, const char* file_name);
|
||||
|
||||
void LoadCurrentEditorStateFromIniFile(const char* file_name);
|
||||
void LoadEditorStateFromIniFile(ImNodesEditorContext* editor, const char* file_name);
|
||||
} // namespace ImNodes
|
||||
482
lib/external/imgui/include/imnodes_internal.h
vendored
Normal file
482
lib/external/imgui/include/imnodes_internal.h
vendored
Normal file
@@ -0,0 +1,482 @@
|
||||
#pragma once
|
||||
|
||||
#include <imgui.h>
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
|
||||
// the structure of this file:
|
||||
//
|
||||
// [SECTION] internal enums
|
||||
// [SECTION] internal data structures
|
||||
// [SECTION] global and editor context structs
|
||||
// [SECTION] object pool implementation
|
||||
|
||||
struct ImNodesContext;
|
||||
|
||||
extern ImNodesContext* GImNodes;
|
||||
|
||||
// [SECTION] internal enums
|
||||
|
||||
typedef int ImNodesScope;
|
||||
typedef int ImNodesAttributeType;
|
||||
typedef int ImNodesUIState;
|
||||
typedef int ImNodesClickInteractionType;
|
||||
typedef int ImNodesLinkCreationType;
|
||||
|
||||
enum ImNodesScope_
|
||||
{
|
||||
ImNodesScope_None = 1,
|
||||
ImNodesScope_Editor = 1 << 1,
|
||||
ImNodesScope_Node = 1 << 2,
|
||||
ImNodesScope_Attribute = 1 << 3
|
||||
};
|
||||
|
||||
enum ImNodesAttributeType_
|
||||
{
|
||||
ImNodesAttributeType_None,
|
||||
ImNodesAttributeType_Input,
|
||||
ImNodesAttributeType_Output
|
||||
};
|
||||
|
||||
enum ImNodesUIState_
|
||||
{
|
||||
ImNodesUIState_None = 0,
|
||||
ImNodesUIState_LinkStarted = 1 << 0,
|
||||
ImNodesUIState_LinkDropped = 1 << 1,
|
||||
ImNodesUIState_LinkCreated = 1 << 2
|
||||
};
|
||||
|
||||
enum ImNodesClickInteractionType_
|
||||
{
|
||||
ImNodesClickInteractionType_Node,
|
||||
ImNodesClickInteractionType_Link,
|
||||
ImNodesClickInteractionType_LinkCreation,
|
||||
ImNodesClickInteractionType_Panning,
|
||||
ImNodesClickInteractionType_BoxSelection,
|
||||
ImNodesClickInteractionType_MiniMapPanning,
|
||||
ImNodesClickInteractionType_MiniMapZooming,
|
||||
ImNodesClickInteractionType_MiniMapSnapping,
|
||||
ImNodesClickInteractionType_ImGuiItem,
|
||||
ImNodesClickInteractionType_None
|
||||
};
|
||||
|
||||
enum ImNodesLinkCreationType_
|
||||
{
|
||||
ImNodesLinkCreationType_Standard,
|
||||
ImNodesLinkCreationType_FromDetach
|
||||
};
|
||||
|
||||
// Callback type used to specify special behavior when hovering a node in the minimap
|
||||
typedef void (*ImNodesMiniMapNodeHoveringCallback)(int, void*);
|
||||
|
||||
// [SECTION] internal data structures
|
||||
|
||||
// The object T must have the following interface:
|
||||
//
|
||||
// struct T
|
||||
// {
|
||||
// T();
|
||||
//
|
||||
// int id;
|
||||
// };
|
||||
template<typename T>
|
||||
struct ImObjectPool
|
||||
{
|
||||
ImVector<T> Pool;
|
||||
ImVector<bool> InUse;
|
||||
ImVector<int> FreeList;
|
||||
ImGuiStorage IdMap;
|
||||
|
||||
ImObjectPool() : Pool(), InUse(), FreeList(), IdMap() {}
|
||||
};
|
||||
|
||||
// Emulates std::optional<int> using the sentinel value `INVALID_INDEX`.
|
||||
struct ImOptionalIndex
|
||||
{
|
||||
ImOptionalIndex() : _Index(INVALID_INDEX) {}
|
||||
ImOptionalIndex(const int value) : _Index(value) {}
|
||||
|
||||
// Observers
|
||||
|
||||
inline bool HasValue() const { return _Index != INVALID_INDEX; }
|
||||
|
||||
inline int Value() const
|
||||
{
|
||||
assert(HasValue());
|
||||
return _Index;
|
||||
}
|
||||
|
||||
// Modifiers
|
||||
|
||||
inline ImOptionalIndex& operator=(const int value)
|
||||
{
|
||||
_Index = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void Reset() { _Index = INVALID_INDEX; }
|
||||
|
||||
inline bool operator==(const ImOptionalIndex& rhs) const { return _Index == rhs._Index; }
|
||||
|
||||
inline bool operator==(const int rhs) const { return _Index == rhs; }
|
||||
|
||||
inline bool operator!=(const ImOptionalIndex& rhs) const { return _Index != rhs._Index; }
|
||||
|
||||
inline bool operator!=(const int rhs) const { return _Index != rhs; }
|
||||
|
||||
static const int INVALID_INDEX = -1;
|
||||
|
||||
private:
|
||||
int _Index;
|
||||
};
|
||||
|
||||
struct ImNodeData
|
||||
{
|
||||
int Id;
|
||||
ImVec2 Origin; // The node origin is in editor space
|
||||
ImRect TitleBarContentRect;
|
||||
ImRect Rect;
|
||||
|
||||
struct
|
||||
{
|
||||
ImU32 Background, BackgroundHovered, BackgroundSelected, Outline, Titlebar, TitlebarHovered,
|
||||
TitlebarSelected;
|
||||
} ColorStyle;
|
||||
|
||||
struct
|
||||
{
|
||||
float CornerRounding;
|
||||
ImVec2 Padding;
|
||||
float BorderThickness;
|
||||
} LayoutStyle;
|
||||
|
||||
ImVector<int> PinIndices;
|
||||
bool Draggable;
|
||||
|
||||
ImNodeData(const int node_id)
|
||||
: Id(node_id), Origin(100.0f, 100.0f), TitleBarContentRect(),
|
||||
Rect(ImVec2(0.0f, 0.0f), ImVec2(0.0f, 0.0f)), ColorStyle(), LayoutStyle(), PinIndices(),
|
||||
Draggable(true)
|
||||
{
|
||||
}
|
||||
|
||||
~ImNodeData() { Id = INT_MIN; }
|
||||
};
|
||||
|
||||
struct ImPinData
|
||||
{
|
||||
int Id;
|
||||
int ParentNodeIdx;
|
||||
ImRect AttributeRect;
|
||||
ImNodesAttributeType Type;
|
||||
ImNodesPinShape Shape;
|
||||
ImVec2 Pos; // screen-space coordinates
|
||||
int Flags;
|
||||
|
||||
struct
|
||||
{
|
||||
ImU32 Background, Hovered;
|
||||
} ColorStyle;
|
||||
|
||||
ImPinData(const int pin_id)
|
||||
: Id(pin_id), ParentNodeIdx(), AttributeRect(), Type(ImNodesAttributeType_None),
|
||||
Shape(ImNodesPinShape_CircleFilled), Pos(), Flags(ImNodesAttributeFlags_None),
|
||||
ColorStyle()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct ImLinkData
|
||||
{
|
||||
int Id;
|
||||
int StartPinIdx, EndPinIdx;
|
||||
|
||||
struct
|
||||
{
|
||||
ImU32 Base, Hovered, Selected;
|
||||
} ColorStyle;
|
||||
|
||||
ImLinkData(const int link_id) : Id(link_id), StartPinIdx(), EndPinIdx(), ColorStyle() {}
|
||||
};
|
||||
|
||||
struct ImClickInteractionState
|
||||
{
|
||||
ImNodesClickInteractionType Type;
|
||||
|
||||
struct
|
||||
{
|
||||
int StartPinIdx;
|
||||
ImOptionalIndex EndPinIdx;
|
||||
ImNodesLinkCreationType Type;
|
||||
} LinkCreation;
|
||||
|
||||
struct
|
||||
{
|
||||
ImRect Rect;
|
||||
} BoxSelector;
|
||||
|
||||
ImClickInteractionState() : Type(ImNodesClickInteractionType_None) {}
|
||||
};
|
||||
|
||||
struct ImNodesColElement
|
||||
{
|
||||
ImU32 Color;
|
||||
ImNodesCol Item;
|
||||
|
||||
ImNodesColElement(const ImU32 c, const ImNodesCol s) : Color(c), Item(s) {}
|
||||
};
|
||||
|
||||
struct ImNodesStyleVarElement
|
||||
{
|
||||
ImNodesStyleVar Item;
|
||||
float Value;
|
||||
|
||||
ImNodesStyleVarElement(const float value, const ImNodesStyleVar variable)
|
||||
: Item(variable), Value(value)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// [SECTION] global and editor context structs
|
||||
|
||||
struct ImNodesEditorContext
|
||||
{
|
||||
ImObjectPool<ImNodeData> Nodes;
|
||||
ImObjectPool<ImPinData> Pins;
|
||||
ImObjectPool<ImLinkData> Links;
|
||||
|
||||
ImVector<int> NodeDepthOrder;
|
||||
|
||||
// ui related fields
|
||||
ImVec2 Panning;
|
||||
|
||||
ImVector<int> SelectedNodeIndices;
|
||||
ImVector<int> SelectedLinkIndices;
|
||||
|
||||
ImClickInteractionState ClickInteraction;
|
||||
|
||||
ImNodesEditorContext()
|
||||
: Nodes(), Pins(), Links(), Panning(0.f, 0.f), SelectedNodeIndices(), SelectedLinkIndices(),
|
||||
ClickInteraction()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct ImNodesContext
|
||||
{
|
||||
ImNodesEditorContext* DefaultEditorCtx;
|
||||
ImNodesEditorContext* EditorCtx;
|
||||
|
||||
// Canvas draw list and helper state
|
||||
ImDrawList* CanvasDrawList;
|
||||
ImGuiStorage NodeIdxToSubmissionIdx;
|
||||
ImVector<int> NodeIdxSubmissionOrder;
|
||||
ImVector<int> NodeIndicesOverlappingWithMouse;
|
||||
ImVector<int> OccludedPinIndices;
|
||||
|
||||
// Canvas extents
|
||||
ImVec2 CanvasOriginScreenSpace;
|
||||
ImRect CanvasRectScreenSpace;
|
||||
|
||||
// MiniMap state
|
||||
ImRect MiniMapRectScreenSpace;
|
||||
ImVec2 MiniMapRectSnappingOffset;
|
||||
float MiniMapZoom;
|
||||
ImNodesMiniMapNodeHoveringCallback MiniMapNodeHoveringCallback;
|
||||
void* MiniMapNodeHoveringCallbackUserData;
|
||||
|
||||
// Debug helpers
|
||||
ImNodesScope CurrentScope;
|
||||
|
||||
// Configuration state
|
||||
ImNodesIO Io;
|
||||
ImNodesStyle Style;
|
||||
ImVector<ImNodesColElement> ColorModifierStack;
|
||||
ImVector<ImNodesStyleVarElement> StyleModifierStack;
|
||||
ImGuiTextBuffer TextBuffer;
|
||||
|
||||
int CurrentAttributeFlags;
|
||||
ImVector<int> AttributeFlagStack;
|
||||
|
||||
// UI element state
|
||||
int CurrentNodeIdx;
|
||||
int CurrentPinIdx;
|
||||
int CurrentAttributeId;
|
||||
|
||||
ImOptionalIndex HoveredNodeIdx;
|
||||
ImOptionalIndex HoveredLinkIdx;
|
||||
ImOptionalIndex HoveredPinIdx;
|
||||
|
||||
ImOptionalIndex DeletedLinkIdx;
|
||||
ImOptionalIndex SnapLinkIdx;
|
||||
|
||||
// Event helper state
|
||||
// TODO: this should be a part of a state machine, and not a member of the global struct.
|
||||
// Unclear what parts of the code this relates to.
|
||||
int ImNodesUIState;
|
||||
|
||||
int ActiveAttributeId;
|
||||
bool ActiveAttribute;
|
||||
|
||||
// ImGui::IO cache
|
||||
|
||||
ImVec2 MousePos;
|
||||
|
||||
bool LeftMouseClicked;
|
||||
bool LeftMouseReleased;
|
||||
bool AltMouseClicked;
|
||||
bool LeftMouseDragging;
|
||||
bool AltMouseDragging;
|
||||
float AltMouseScrollDelta;
|
||||
};
|
||||
|
||||
namespace ImNodes
|
||||
{
|
||||
static inline ImNodesEditorContext& EditorContextGet()
|
||||
{
|
||||
// No editor context was set! Did you forget to call ImNodes::CreateContext()?
|
||||
assert(GImNodes->EditorCtx != NULL);
|
||||
return *GImNodes->EditorCtx;
|
||||
}
|
||||
|
||||
// [SECTION] ObjectPool implementation
|
||||
|
||||
template<typename T>
|
||||
static inline int ObjectPoolFind(const ImObjectPool<T>& objects, const int id)
|
||||
{
|
||||
const int index = objects.IdMap.GetInt(static_cast<ImGuiID>(id), -1);
|
||||
return index;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline void ObjectPoolUpdate(ImObjectPool<T>& objects)
|
||||
{
|
||||
objects.FreeList.clear();
|
||||
for (int i = 0; i < objects.InUse.size(); ++i)
|
||||
{
|
||||
if (!objects.InUse[i])
|
||||
{
|
||||
objects.IdMap.SetInt(objects.Pool[i].Id, -1);
|
||||
objects.FreeList.push_back(i);
|
||||
(objects.Pool.Data + i)->~T();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void ObjectPoolUpdate(ImObjectPool<ImNodeData>& nodes)
|
||||
{
|
||||
nodes.FreeList.clear();
|
||||
for (int i = 0; i < nodes.InUse.size(); ++i)
|
||||
{
|
||||
if (nodes.InUse[i])
|
||||
{
|
||||
nodes.Pool[i].PinIndices.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
const int previous_id = nodes.Pool[i].Id;
|
||||
const int previous_idx = nodes.IdMap.GetInt(previous_id, -1);
|
||||
|
||||
if (previous_idx != -1)
|
||||
{
|
||||
assert(previous_idx == i);
|
||||
// Remove node idx form depth stack the first time we detect that this idx slot is
|
||||
// unused
|
||||
ImVector<int>& depth_stack = EditorContextGet().NodeDepthOrder;
|
||||
const int* const elem = depth_stack.find(i);
|
||||
assert(elem != depth_stack.end());
|
||||
depth_stack.erase(elem);
|
||||
}
|
||||
|
||||
nodes.IdMap.SetInt(previous_id, -1);
|
||||
nodes.FreeList.push_back(i);
|
||||
(nodes.Pool.Data + i)->~ImNodeData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline void ObjectPoolReset(ImObjectPool<T>& objects)
|
||||
{
|
||||
if (!objects.InUse.empty())
|
||||
{
|
||||
memset(objects.InUse.Data, 0, objects.InUse.size_in_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline int ObjectPoolFindOrCreateIndex(ImObjectPool<T>& objects, const int id)
|
||||
{
|
||||
int index = objects.IdMap.GetInt(static_cast<ImGuiID>(id), -1);
|
||||
|
||||
// Construct new object
|
||||
if (index == -1)
|
||||
{
|
||||
if (objects.FreeList.empty())
|
||||
{
|
||||
index = objects.Pool.size();
|
||||
IM_ASSERT(objects.Pool.size() == objects.InUse.size());
|
||||
const int new_size = objects.Pool.size() + 1;
|
||||
objects.Pool.resize(new_size);
|
||||
objects.InUse.resize(new_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = objects.FreeList.back();
|
||||
objects.FreeList.pop_back();
|
||||
}
|
||||
IM_PLACEMENT_NEW(objects.Pool.Data + index) T(id);
|
||||
objects.IdMap.SetInt(static_cast<ImGuiID>(id), index);
|
||||
}
|
||||
|
||||
// Flag it as used
|
||||
objects.InUse[index] = true;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline int ObjectPoolFindOrCreateIndex(ImObjectPool<ImNodeData>& nodes, const int node_id)
|
||||
{
|
||||
int node_idx = nodes.IdMap.GetInt(static_cast<ImGuiID>(node_id), -1);
|
||||
|
||||
// Construct new node
|
||||
if (node_idx == -1)
|
||||
{
|
||||
if (nodes.FreeList.empty())
|
||||
{
|
||||
node_idx = nodes.Pool.size();
|
||||
IM_ASSERT(nodes.Pool.size() == nodes.InUse.size());
|
||||
const int new_size = nodes.Pool.size() + 1;
|
||||
nodes.Pool.resize(new_size);
|
||||
nodes.InUse.resize(new_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
node_idx = nodes.FreeList.back();
|
||||
nodes.FreeList.pop_back();
|
||||
}
|
||||
IM_PLACEMENT_NEW(nodes.Pool.Data + node_idx) ImNodeData(node_id);
|
||||
nodes.IdMap.SetInt(static_cast<ImGuiID>(node_id), node_idx);
|
||||
|
||||
ImNodesEditorContext& editor = EditorContextGet();
|
||||
editor.NodeDepthOrder.push_back(node_idx);
|
||||
}
|
||||
|
||||
// Flag node as used
|
||||
nodes.InUse[node_idx] = true;
|
||||
|
||||
return node_idx;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline T& ObjectPoolFindOrCreateObject(ImObjectPool<T>& objects, const int id)
|
||||
{
|
||||
const int index = ObjectPoolFindOrCreateIndex(objects, id);
|
||||
return objects.Pool[index];
|
||||
}
|
||||
} // namespace ImNodes
|
||||
927
lib/external/imgui/include/implot.h
vendored
Normal file
927
lib/external/imgui/include/implot.h
vendored
Normal file
@@ -0,0 +1,927 @@
|
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2021 Evan Pezent
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// ImPlot v0.11 WIP
|
||||
|
||||
#pragma once
|
||||
#include "imgui.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Macros and Defines
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
|
||||
// Using ImPlot via a shared library is not recommended, because we don't guarantee
|
||||
// backward nor forward ABI compatibility and also function call overhead. If you
|
||||
// do use ImPlot as a DLL, be sure to call SetImGuiContext (see Miscellanous section).
|
||||
#ifndef IMPLOT_API
|
||||
#define IMPLOT_API
|
||||
#endif
|
||||
|
||||
// ImPlot version string
|
||||
#define IMPLOT_VERSION "0.11 WIP"
|
||||
// Indicates variable should deduced automatically.
|
||||
#define IMPLOT_AUTO -1
|
||||
// Special color used to indicate that a color should be deduced automatically.
|
||||
#define IMPLOT_AUTO_COL ImVec4(0,0,0,-1)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward Declarations and Basic Types
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Forward declarations
|
||||
struct ImPlotContext; // ImPlot context (opaque struct, see implot_internal.h)
|
||||
|
||||
// Enums/Flags
|
||||
typedef int ImPlotFlags; // -> enum ImPlotFlags_
|
||||
typedef int ImPlotAxisFlags; // -> enum ImPlotAxisFlags_
|
||||
typedef int ImPlotSubplotFlags; // -> enum ImPlotSubplotFlags_
|
||||
typedef int ImPlotCol; // -> enum ImPlotCol_
|
||||
typedef int ImPlotStyleVar; // -> enum ImPlotStyleVar_
|
||||
typedef int ImPlotMarker; // -> enum ImPlotMarker_
|
||||
typedef int ImPlotColormap; // -> enum ImPlotColormap_
|
||||
typedef int ImPlotLocation; // -> enum ImPlotLocation_
|
||||
typedef int ImPlotOrientation; // -> enum ImPlotOrientation_
|
||||
typedef int ImPlotYAxis; // -> enum ImPlotYAxis_;
|
||||
typedef int ImPlotBin; // -> enum ImPlotBin_
|
||||
|
||||
// Options for plots (see BeginPlot).
|
||||
enum ImPlotFlags_ {
|
||||
ImPlotFlags_None = 0, // default
|
||||
ImPlotFlags_NoTitle = 1 << 0, // the plot title will not be displayed (titles are also hidden if preceeded by double hashes, e.g. "##MyPlot")
|
||||
ImPlotFlags_NoLegend = 1 << 1, // the legend will not be displayed
|
||||
ImPlotFlags_NoMenus = 1 << 2, // the user will not be able to open context menus with right-click
|
||||
ImPlotFlags_NoBoxSelect = 1 << 3, // the user will not be able to box-select with right-click drag
|
||||
ImPlotFlags_NoMousePos = 1 << 4, // the mouse position, in plot coordinates, will not be displayed inside of the plot
|
||||
ImPlotFlags_NoHighlight = 1 << 5, // plot items will not be highlighted when their legend entry is hovered
|
||||
ImPlotFlags_NoChild = 1 << 6, // a child window region will not be used to capture mouse scroll (can boost performance for single ImGui window applications)
|
||||
ImPlotFlags_Equal = 1 << 7, // primary x and y axes will be constrained to have the same units/pixel (does not apply to auxiliary y-axes)
|
||||
ImPlotFlags_YAxis2 = 1 << 8, // enable a 2nd y-axis on the right side
|
||||
ImPlotFlags_YAxis3 = 1 << 9, // enable a 3rd y-axis on the right side
|
||||
ImPlotFlags_Query = 1 << 10, // the user will be able to draw query rects with middle-mouse or CTRL + right-click drag
|
||||
ImPlotFlags_Crosshairs = 1 << 11, // the default mouse cursor will be replaced with a crosshair when hovered
|
||||
ImPlotFlags_AntiAliased = 1 << 12, // plot lines will be software anti-aliased (not recommended for high density plots, prefer MSAA)
|
||||
ImPlotFlags_CanvasOnly = ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMousePos
|
||||
};
|
||||
|
||||
// Options for plot axes (see BeginPlot).
|
||||
enum ImPlotAxisFlags_ {
|
||||
ImPlotAxisFlags_None = 0, // default
|
||||
ImPlotAxisFlags_NoLabel = 1 << 0, // the axis label will not be displayed (axis labels also hidden if the supplied string name is NULL)
|
||||
ImPlotAxisFlags_NoGridLines = 1 << 1, // no grid lines will be displayed
|
||||
ImPlotAxisFlags_NoTickMarks = 1 << 2, // no tick marks will be displayed
|
||||
ImPlotAxisFlags_NoTickLabels = 1 << 3, // no text labels will be displayed
|
||||
ImPlotAxisFlags_Foreground = 1 << 4, // grid lines will be displayed in the foreground (i.e. on top of data) in stead of the background
|
||||
ImPlotAxisFlags_LogScale = 1 << 5, // a logartithmic (base 10) axis scale will be used (mutually exclusive with ImPlotAxisFlags_Time)
|
||||
ImPlotAxisFlags_Time = 1 << 6, // axis will display date/time formatted labels (mutually exclusive with ImPlotAxisFlags_LogScale)
|
||||
ImPlotAxisFlags_Invert = 1 << 7, // the axis will be inverted
|
||||
ImPlotAxisFlags_NoInitialFit = 1 << 8, // axis will not be initially fit to data extents on the first rendered frame (also the case if SetNextPlotLimits explicitly called)
|
||||
ImPlotAxisFlags_AutoFit = 1 << 9, // axis will be auto-fitting to data extents
|
||||
ImPlotAxisFlags_RangeFit = 1 << 10, // axis will only fit points if the point is in the visible range of the **orthoganol** axis
|
||||
ImPlotAxisFlags_LockMin = 1 << 11, // the axis minimum value will be locked when panning/zooming
|
||||
ImPlotAxisFlags_LockMax = 1 << 12, // the axis maximum value will be locked when panning/zooming
|
||||
ImPlotAxisFlags_Lock = ImPlotAxisFlags_LockMin | ImPlotAxisFlags_LockMax,
|
||||
ImPlotAxisFlags_NoDecorations = ImPlotAxisFlags_NoLabel | ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_NoTickMarks | ImPlotAxisFlags_NoTickLabels
|
||||
};
|
||||
|
||||
// Options for subplots (see BeginSubplot).
|
||||
enum ImPlotSubplotFlags_ {
|
||||
ImPlotSubplotFlags_None = 0, // default
|
||||
ImPlotSubplotFlags_NoTitle = 1 << 0, // the subplot title will not be displayed (titles are also hidden if preceeded by double hashes, e.g. "##MySubplot")
|
||||
ImPlotSubplotFlags_NoLegend = 1 << 1, // the legend will not be displayed (only applicable if ImPlotSubplotFlags_ShareItems is enabled)
|
||||
ImPlotSubplotFlags_NoMenus = 1 << 2, // the user will not be able to open context menus with right-click
|
||||
ImPlotSubplotFlags_NoResize = 1 << 3, // resize splitters between subplot cells will be not be provided
|
||||
ImPlotSubplotFlags_NoAlign = 1 << 4, // subplot edges will not be aligned vertically or horizontally
|
||||
ImPlotSubplotFlags_ShareItems = 1 << 5, // items across all subplots will be shared and rendered into a single legend entry
|
||||
ImPlotSubplotFlags_LinkRows = 1 << 6, // link the y-axis limits of all plots in each row (does not apply auxiliary y-axes)
|
||||
ImPlotSubplotFlags_LinkCols = 1 << 7, // link the x-axis limits of all plots in each column
|
||||
ImPlotSubplotFlags_LinkAllX = 1 << 8, // link the x-axis limits in every plot in the subplot
|
||||
ImPlotSubplotFlags_LinkAllY = 1 << 9 , // link the y-axis limits in every plot in the subplot (does not apply to auxiliary y-axes)
|
||||
ImPlotSubplotFlags_ColMajor = 1 << 10 // subplots are added in column major order instead of the default row major order
|
||||
};
|
||||
|
||||
// Plot styling colors.
|
||||
enum ImPlotCol_ {
|
||||
// item styling colors
|
||||
ImPlotCol_Line, // plot line/outline color (defaults to next unused color in current colormap)
|
||||
ImPlotCol_Fill, // plot fill color for bars (defaults to the current line color)
|
||||
ImPlotCol_MarkerOutline, // marker outline color (defaults to the current line color)
|
||||
ImPlotCol_MarkerFill, // marker fill color (defaults to the current line color)
|
||||
ImPlotCol_ErrorBar, // error bar color (defaults to ImGuiCol_Text)
|
||||
// plot styling colors
|
||||
ImPlotCol_FrameBg, // plot frame background color (defaults to ImGuiCol_FrameBg)
|
||||
ImPlotCol_PlotBg, // plot area background color (defaults to ImGuiCol_WindowBg)
|
||||
ImPlotCol_PlotBorder, // plot area border color (defaults to ImGuiCol_Border)
|
||||
ImPlotCol_LegendBg, // legend background color (defaults to ImGuiCol_PopupBg)
|
||||
ImPlotCol_LegendBorder, // legend border color (defaults to ImPlotCol_PlotBorder)
|
||||
ImPlotCol_LegendText, // legend text color (defaults to ImPlotCol_InlayText)
|
||||
ImPlotCol_TitleText, // plot title text color (defaults to ImGuiCol_Text)
|
||||
ImPlotCol_InlayText, // color of text appearing inside of plots (defaults to ImGuiCol_Text)
|
||||
ImPlotCol_XAxis, // x-axis label and tick lables color (defaults to ImGuiCol_Text)
|
||||
ImPlotCol_XAxisGrid, // x-axis grid color (defaults to 25% ImPlotCol_XAxis)
|
||||
ImPlotCol_YAxis, // y-axis label and tick labels color (defaults to ImGuiCol_Text)
|
||||
ImPlotCol_YAxisGrid, // y-axis grid color (defaults to 25% ImPlotCol_YAxis)
|
||||
ImPlotCol_YAxis2, // 2nd y-axis label and tick labels color (defaults to ImGuiCol_Text)
|
||||
ImPlotCol_YAxisGrid2, // 2nd y-axis grid/label color (defaults to 25% ImPlotCol_YAxis2)
|
||||
ImPlotCol_YAxis3, // 3rd y-axis label and tick labels color (defaults to ImGuiCol_Text)
|
||||
ImPlotCol_YAxisGrid3, // 3rd y-axis grid/label color (defaults to 25% ImPlotCol_YAxis3)
|
||||
ImPlotCol_Selection, // box-selection color (defaults to yellow)
|
||||
ImPlotCol_Query, // box-query color (defaults to green)
|
||||
ImPlotCol_Crosshairs, // crosshairs color (defaults to ImPlotCol_PlotBorder)
|
||||
ImPlotCol_COUNT
|
||||
};
|
||||
|
||||
// Plot styling variables.
|
||||
enum ImPlotStyleVar_ {
|
||||
// item styling variables
|
||||
ImPlotStyleVar_LineWeight, // float, plot item line weight in pixels
|
||||
ImPlotStyleVar_Marker, // int, marker specification
|
||||
ImPlotStyleVar_MarkerSize, // float, marker size in pixels (roughly the marker's "radius")
|
||||
ImPlotStyleVar_MarkerWeight, // float, plot outline weight of markers in pixels
|
||||
ImPlotStyleVar_FillAlpha, // float, alpha modifier applied to all plot item fills
|
||||
ImPlotStyleVar_ErrorBarSize, // float, error bar whisker width in pixels
|
||||
ImPlotStyleVar_ErrorBarWeight, // float, error bar whisker weight in pixels
|
||||
ImPlotStyleVar_DigitalBitHeight, // float, digital channels bit height (at 1) in pixels
|
||||
ImPlotStyleVar_DigitalBitGap, // float, digital channels bit padding gap in pixels
|
||||
// plot styling variables
|
||||
ImPlotStyleVar_PlotBorderSize, // float, thickness of border around plot area
|
||||
ImPlotStyleVar_MinorAlpha, // float, alpha multiplier applied to minor axis grid lines
|
||||
ImPlotStyleVar_MajorTickLen, // ImVec2, major tick lengths for X and Y axes
|
||||
ImPlotStyleVar_MinorTickLen, // ImVec2, minor tick lengths for X and Y axes
|
||||
ImPlotStyleVar_MajorTickSize, // ImVec2, line thickness of major ticks
|
||||
ImPlotStyleVar_MinorTickSize, // ImVec2, line thickness of minor ticks
|
||||
ImPlotStyleVar_MajorGridSize, // ImVec2, line thickness of major grid lines
|
||||
ImPlotStyleVar_MinorGridSize, // ImVec2, line thickness of minor grid lines
|
||||
ImPlotStyleVar_PlotPadding, // ImVec2, padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
|
||||
ImPlotStyleVar_LabelPadding, // ImVec2, padding between axes labels, tick labels, and plot edge
|
||||
ImPlotStyleVar_LegendPadding, // ImVec2, legend padding from plot edges
|
||||
ImPlotStyleVar_LegendInnerPadding, // ImVec2, legend inner padding from legend edges
|
||||
ImPlotStyleVar_LegendSpacing, // ImVec2, spacing between legend entries
|
||||
ImPlotStyleVar_MousePosPadding, // ImVec2, padding between plot edge and interior info text
|
||||
ImPlotStyleVar_AnnotationPadding, // ImVec2, text padding around annotation labels
|
||||
ImPlotStyleVar_FitPadding, // ImVec2, additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1f,0.1f) adds 10% to the fit extents of X and Y)
|
||||
ImPlotStyleVar_PlotDefaultSize, // ImVec2, default size used when ImVec2(0,0) is passed to BeginPlot
|
||||
ImPlotStyleVar_PlotMinSize, // ImVec2, minimum size plot frame can be when shrunk
|
||||
ImPlotStyleVar_COUNT
|
||||
};
|
||||
|
||||
// Marker specifications.
|
||||
enum ImPlotMarker_ {
|
||||
ImPlotMarker_None = -1, // no marker
|
||||
ImPlotMarker_Circle, // a circle marker
|
||||
ImPlotMarker_Square, // a square maker
|
||||
ImPlotMarker_Diamond, // a diamond marker
|
||||
ImPlotMarker_Up, // an upward-pointing triangle marker
|
||||
ImPlotMarker_Down, // an downward-pointing triangle marker
|
||||
ImPlotMarker_Left, // an leftward-pointing triangle marker
|
||||
ImPlotMarker_Right, // an rightward-pointing triangle marker
|
||||
ImPlotMarker_Cross, // a cross marker (not fillable)
|
||||
ImPlotMarker_Plus, // a plus marker (not fillable)
|
||||
ImPlotMarker_Asterisk, // a asterisk marker (not fillable)
|
||||
ImPlotMarker_COUNT
|
||||
};
|
||||
|
||||
// Built-in colormaps
|
||||
enum ImPlotColormap_ {
|
||||
ImPlotColormap_Deep = 0, // a.k.a. seaborn deep (qual=true, n=10) (default)
|
||||
ImPlotColormap_Dark = 1, // a.k.a. matplotlib "Set1" (qual=true, n=9 )
|
||||
ImPlotColormap_Pastel = 2, // a.k.a. matplotlib "Pastel1" (qual=true, n=9 )
|
||||
ImPlotColormap_Paired = 3, // a.k.a. matplotlib "Paired" (qual=true, n=12)
|
||||
ImPlotColormap_Viridis = 4, // a.k.a. matplotlib "viridis" (qual=false, n=11)
|
||||
ImPlotColormap_Plasma = 5, // a.k.a. matplotlib "plasma" (qual=false, n=11)
|
||||
ImPlotColormap_Hot = 6, // a.k.a. matplotlib/MATLAB "hot" (qual=false, n=11)
|
||||
ImPlotColormap_Cool = 7, // a.k.a. matplotlib/MATLAB "cool" (qual=false, n=11)
|
||||
ImPlotColormap_Pink = 8, // a.k.a. matplotlib/MATLAB "pink" (qual=false, n=11)
|
||||
ImPlotColormap_Jet = 9, // a.k.a. MATLAB "jet" (qual=false, n=11)
|
||||
ImPlotColormap_Twilight = 10, // a.k.a. matplotlib "twilight" (qual=false, n=11)
|
||||
ImPlotColormap_RdBu = 11, // red/blue, Color Brewer (qual=false, n=11)
|
||||
ImPlotColormap_BrBG = 12, // brown/blue-green, Color Brewer (qual=false, n=11)
|
||||
ImPlotColormap_PiYG = 13, // pink/yellow-green, Color Brewer (qual=false, n=11)
|
||||
ImPlotColormap_Spectral = 14, // color spectrum, Color Brewer (qual=false, n=11)
|
||||
ImPlotColormap_Greys = 15, // white/black (qual=false, n=2 )
|
||||
};
|
||||
|
||||
// Used to position items on a plot (e.g. legends, labels, etc.)
|
||||
enum ImPlotLocation_ {
|
||||
ImPlotLocation_Center = 0, // center-center
|
||||
ImPlotLocation_North = 1 << 0, // top-center
|
||||
ImPlotLocation_South = 1 << 1, // bottom-center
|
||||
ImPlotLocation_West = 1 << 2, // center-left
|
||||
ImPlotLocation_East = 1 << 3, // center-right
|
||||
ImPlotLocation_NorthWest = ImPlotLocation_North | ImPlotLocation_West, // top-left
|
||||
ImPlotLocation_NorthEast = ImPlotLocation_North | ImPlotLocation_East, // top-right
|
||||
ImPlotLocation_SouthWest = ImPlotLocation_South | ImPlotLocation_West, // bottom-left
|
||||
ImPlotLocation_SouthEast = ImPlotLocation_South | ImPlotLocation_East // bottom-right
|
||||
};
|
||||
|
||||
// Used to orient items on a plot (e.g. legends, labels, etc.)
|
||||
enum ImPlotOrientation_ {
|
||||
ImPlotOrientation_Horizontal, // left/right
|
||||
ImPlotOrientation_Vertical // up/down
|
||||
};
|
||||
|
||||
// Enums for different y-axes.
|
||||
enum ImPlotYAxis_ {
|
||||
ImPlotYAxis_1 = 0, // left (default)
|
||||
ImPlotYAxis_2 = 1, // first on right side
|
||||
ImPlotYAxis_3 = 2 // second on right side
|
||||
};
|
||||
|
||||
// Enums for different automatic histogram binning methods (k = bin count or w = bin width)
|
||||
enum ImPlotBin_ {
|
||||
ImPlotBin_Sqrt = -1, // k = sqrt(n)
|
||||
ImPlotBin_Sturges = -2, // k = 1 + log2(n)
|
||||
ImPlotBin_Rice = -3, // k = 2 * cbrt(n)
|
||||
ImPlotBin_Scott = -4, // w = 3.49 * sigma / cbrt(n)
|
||||
};
|
||||
|
||||
// Double precision version of ImVec2 used by ImPlot. Extensible by end users.
|
||||
struct ImPlotPoint {
|
||||
double x, y;
|
||||
ImPlotPoint() { x = y = 0.0; }
|
||||
ImPlotPoint(double _x, double _y) { x = _x; y = _y; }
|
||||
ImPlotPoint(const ImVec2& p) { x = p.x; y = p.y; }
|
||||
double operator[] (size_t idx) const { return (&x)[idx]; }
|
||||
double& operator[] (size_t idx) { return (&x)[idx]; }
|
||||
#ifdef IMPLOT_POINT_CLASS_EXTRA
|
||||
IMPLOT_POINT_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h
|
||||
// to convert back and forth between your math types and ImPlotPoint.
|
||||
#endif
|
||||
};
|
||||
|
||||
// A range defined by a min/max value. Used for plot axes ranges.
|
||||
struct ImPlotRange {
|
||||
double Min, Max;
|
||||
ImPlotRange() { Min = 0; Max = 0; }
|
||||
ImPlotRange(double _min, double _max) { Min = _min; Max = _max; }
|
||||
bool Contains(double value) const { return value >= Min && value <= Max; };
|
||||
double Size() const { return Max - Min; };
|
||||
};
|
||||
|
||||
// Combination of two ranges for X and Y axes.
|
||||
struct ImPlotLimits {
|
||||
ImPlotRange X, Y;
|
||||
ImPlotLimits() { }
|
||||
ImPlotLimits(double x_min, double x_max, double y_min, double y_max) { X.Min = x_min; X.Max = x_max; Y.Min = y_min; Y.Max = y_max; }
|
||||
bool Contains(const ImPlotPoint& p) const { return Contains(p.x, p.y); }
|
||||
bool Contains(double x, double y) const { return X.Contains(x) && Y.Contains(y); }
|
||||
ImPlotPoint Min() const { return ImPlotPoint(X.Min, Y.Min); }
|
||||
ImPlotPoint Max() const { return ImPlotPoint(X.Max, Y.Max); }
|
||||
};
|
||||
|
||||
// Plot style structure
|
||||
struct ImPlotStyle {
|
||||
// item styling variables
|
||||
float LineWeight; // = 1, item line weight in pixels
|
||||
int Marker; // = ImPlotMarker_None, marker specification
|
||||
float MarkerSize; // = 4, marker size in pixels (roughly the marker's "radius")
|
||||
float MarkerWeight; // = 1, outline weight of markers in pixels
|
||||
float FillAlpha; // = 1, alpha modifier applied to plot fills
|
||||
float ErrorBarSize; // = 5, error bar whisker width in pixels
|
||||
float ErrorBarWeight; // = 1.5, error bar whisker weight in pixels
|
||||
float DigitalBitHeight; // = 8, digital channels bit height (at y = 1.0f) in pixels
|
||||
float DigitalBitGap; // = 4, digital channels bit padding gap in pixels
|
||||
// plot styling variables
|
||||
float PlotBorderSize; // = 1, line thickness of border around plot area
|
||||
float MinorAlpha; // = 0.25 alpha multiplier applied to minor axis grid lines
|
||||
ImVec2 MajorTickLen; // = 10,10 major tick lengths for X and Y axes
|
||||
ImVec2 MinorTickLen; // = 5,5 minor tick lengths for X and Y axes
|
||||
ImVec2 MajorTickSize; // = 1,1 line thickness of major ticks
|
||||
ImVec2 MinorTickSize; // = 1,1 line thickness of minor ticks
|
||||
ImVec2 MajorGridSize; // = 1,1 line thickness of major grid lines
|
||||
ImVec2 MinorGridSize; // = 1,1 line thickness of minor grid lines
|
||||
ImVec2 PlotPadding; // = 10,10 padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
|
||||
ImVec2 LabelPadding; // = 5,5 padding between axes labels, tick labels, and plot edge
|
||||
ImVec2 LegendPadding; // = 10,10 legend padding from plot edges
|
||||
ImVec2 LegendInnerPadding; // = 5,5 legend inner padding from legend edges
|
||||
ImVec2 LegendSpacing; // = 5,0 spacing between legend entries
|
||||
ImVec2 MousePosPadding; // = 10,10 padding between plot edge and interior mouse location text
|
||||
ImVec2 AnnotationPadding; // = 2,2 text padding around annotation labels
|
||||
ImVec2 FitPadding; // = 0,0 additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1f,0.1f) adds 10% to the fit extents of X and Y)
|
||||
ImVec2 PlotDefaultSize; // = 400,300 default size used when ImVec2(0,0) is passed to BeginPlot
|
||||
ImVec2 PlotMinSize; // = 200,150 minimum size plot frame can be when shrunk
|
||||
// style colors
|
||||
ImVec4 Colors[ImPlotCol_COUNT]; // Array of styling colors. Indexable with ImPlotCol_ enums.
|
||||
// colormap
|
||||
ImPlotColormap Colormap; // The current colormap. Set this to either an ImPlotColormap_ enum or an index returned by AddColormap.
|
||||
// settings/flags
|
||||
bool AntiAliasedLines; // = false, enable global anti-aliasing on plot lines (overrides ImPlotFlags_AntiAliased)
|
||||
bool UseLocalTime; // = false, axis labels will be formatted for your timezone when ImPlotAxisFlag_Time is enabled
|
||||
bool UseISO8601; // = false, dates will be formatted according to ISO 8601 where applicable (e.g. YYYY-MM-DD, YYYY-MM, --MM-DD, etc.)
|
||||
bool Use24HourClock; // = false, times will be formatted using a 24 hour clock
|
||||
IMPLOT_API ImPlotStyle();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ImPlot End-User API
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace ImPlot {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ImPlot Context
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Creates a new ImPlot context. Call this after ImGui::CreateContext.
|
||||
IMPLOT_API ImPlotContext* CreateContext();
|
||||
// Destroys an ImPlot context. Call this before ImGui::DestroyContext. NULL = destroy current context.
|
||||
IMPLOT_API void DestroyContext(ImPlotContext* ctx = NULL);
|
||||
// Returns the current ImPlot context. NULL if no context has ben set.
|
||||
IMPLOT_API ImPlotContext* GetCurrentContext();
|
||||
// Sets the current ImPlot context.
|
||||
IMPLOT_API void SetCurrentContext(ImPlotContext* ctx);
|
||||
|
||||
// Sets the current **ImGui** context. This is ONLY necessary if you are compiling
|
||||
// ImPlot as a DLL (not recommended) separate from your ImGui compilation. It
|
||||
// sets the global variable GImGui, which is not shared across DLL boundaries.
|
||||
// See GImGui documentation in imgui.cpp for more details.
|
||||
IMPLOT_API void SetImGuiContext(ImGuiContext* ctx);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Begin/End Plot
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Starts a 2D plotting context. If this function returns true, EndPlot() MUST
|
||||
// be called! You are encouraged to use the following convention:
|
||||
//
|
||||
// if (BeginPlot(...)) {
|
||||
// ImPlot::PlotLine(...);
|
||||
// ...
|
||||
// EndPlot();
|
||||
// }
|
||||
//
|
||||
// Important notes:
|
||||
//
|
||||
// - #title_id must be unique to the current ImGui ID scope. If you need to avoid ID
|
||||
// collisions or don't want to display a title in the plot, use double hashes
|
||||
// (e.g. "MyPlot##HiddenIdText" or "##NoTitle").
|
||||
// - If #x_label and/or #y_label are provided, axes labels will be displayed.
|
||||
// - #size is the **frame** size of the plot widget, not the plot area. The default
|
||||
// size of plots (i.e. when ImVec2(0,0)) can be modified in your ImPlotStyle
|
||||
// (default is 400x300 px).
|
||||
// - Auxiliary y-axes must be enabled with ImPlotFlags_YAxis2/3 to be displayed.
|
||||
// - See ImPlotFlags and ImPlotAxisFlags for more available options.
|
||||
|
||||
IMPLOT_API bool BeginPlot(const char* title_id,
|
||||
const char* x_label = NULL,
|
||||
const char* y_label = NULL,
|
||||
const ImVec2& size = ImVec2(-1,0),
|
||||
ImPlotFlags flags = ImPlotFlags_None,
|
||||
ImPlotAxisFlags x_flags = ImPlotAxisFlags_None,
|
||||
ImPlotAxisFlags y_flags = ImPlotAxisFlags_None,
|
||||
ImPlotAxisFlags y2_flags = ImPlotAxisFlags_NoGridLines,
|
||||
ImPlotAxisFlags y3_flags = ImPlotAxisFlags_NoGridLines,
|
||||
const char* y2_label = NULL,
|
||||
const char* y3_label = NULL);
|
||||
|
||||
// Only call EndPlot() if BeginPlot() returns true! Typically called at the end
|
||||
// of an if statement conditioned on BeginPlot(). See example above.
|
||||
IMPLOT_API void EndPlot();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Begin/EndSubplots
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Starts a subdivided plotting context. If the function returns true,
|
||||
// EndSubplots() MUST be called! Call BeginPlot/EndPlot AT MOST [rows*cols]
|
||||
// times in between the begining and end of the subplot context. Plots are
|
||||
// added in row major order.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// if (BeginSubplots("My Subplot",2,3,ImVec2(800,400)) {
|
||||
// for (int i = 0; i < 6; ++i) {
|
||||
// if (BeginPlot(...)) {
|
||||
// ImPlot::PlotLine(...);
|
||||
// ...
|
||||
// EndPlot();
|
||||
// }
|
||||
// }
|
||||
// EndSubplots();
|
||||
// }
|
||||
//
|
||||
// Procudes:
|
||||
//
|
||||
// [0][1][2]
|
||||
// [3][4][5]
|
||||
//
|
||||
// Important notes:
|
||||
//
|
||||
// - #title_id must be unique to the current ImGui ID scope. If you need to avoid ID
|
||||
// collisions or don't want to display a title in the plot, use double hashes
|
||||
// (e.g. "MyPlot##HiddenIdText" or "##NoTitle").
|
||||
// - #rows and #cols must be greater than 0.
|
||||
// - #size is the size of the entire grid of subplots, not the individual plots
|
||||
// - #row_ratios and #col_ratios must have AT LEAST #rows and #cols elements,
|
||||
// respectively. These are the sizes of the rows and columns expressed in ratios.
|
||||
// If the user adjusts the dimensions, the arrays are updated with new ratios.
|
||||
//
|
||||
// Important notes regarding BeginPlot from inside of BeginSubplots:
|
||||
//
|
||||
// - The #title_id parameter of _BeginPlot_ (see above) does NOT have to be
|
||||
// unique when called inside of a subplot context. Subplot IDs are hashed
|
||||
// for your convenience so you don't have call PushID or generate unique title
|
||||
// strings. Simply pass an empty string to BeginPlot unless you want to title
|
||||
// each subplot.
|
||||
// - The #size parameter of _BeginPlot_ (see above) is ignored when inside of a
|
||||
// subplot context. The actual size of the subplot will be based on the
|
||||
// #size value you pass to _BeginSubplots_ and #row/#col_ratios if provided.
|
||||
|
||||
IMPLOT_API bool BeginSubplots(const char* title_id,
|
||||
int rows,
|
||||
int cols,
|
||||
const ImVec2& size,
|
||||
ImPlotSubplotFlags flags = ImPlotSubplotFlags_None,
|
||||
float* row_ratios = NULL,
|
||||
float* col_ratios = NULL);
|
||||
|
||||
// Only call EndSubplots() if BeginSubplots() returns true! Typically called at the end
|
||||
// of an if statement conditioned on BeginSublots(). See example above.
|
||||
IMPLOT_API void EndSubplots();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Plot Items
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The template functions below are explicitly instantiated in implot_items.cpp.
|
||||
// They are not intended to be used generically with custom types. You will get
|
||||
// a linker error if you try! All functions support the following scalar types:
|
||||
//
|
||||
// float, double, ImS8, ImU8, ImS16, ImU16, ImS32, ImU32, ImS64, ImU64
|
||||
//
|
||||
//
|
||||
// If you need to plot custom or non-homogenous data you have a few options:
|
||||
//
|
||||
// 1. If your data is a simple struct/class (e.g. Vector2f), you can use striding.
|
||||
// This is the most performant option if applicable.
|
||||
//
|
||||
// struct Vector2f { float X, Y; };
|
||||
// ...
|
||||
// Vector2f data[42];
|
||||
// ImPlot::PlotLine("line", &data[0].x, &data[0].y, 42, 0, sizeof(Vector2f)); // or sizeof(float)*2
|
||||
//
|
||||
// 2. Write a custom getter C function or C++ lambda and pass it and optionally your data to
|
||||
// an ImPlot function post-fixed with a G (e.g. PlotScatterG). This has a slight performance
|
||||
// cost, but probably not enough to worry about unless your data is very large. Examples:
|
||||
//
|
||||
// ImPlotPoint MyDataGetter(void* data, int idx) {
|
||||
// MyData* my_data = (MyData*)data;
|
||||
// ImPlotPoint p;
|
||||
// p.x = my_data->GetTime(idx);
|
||||
// p.y = my_data->GetValue(idx);
|
||||
// return p
|
||||
// }
|
||||
// ...
|
||||
// auto my_lambda = [](void*, int idx) {
|
||||
// double t = idx / 999.0;
|
||||
// return ImPlotPoint(t, 0.5+0.5*std::sin(2*PI*10*t));
|
||||
// };
|
||||
// ...
|
||||
// if (ImPlot::BeginPlot("MyPlot")) {
|
||||
// MyData my_data;
|
||||
// ImPlot::PlotScatterG("scatter", MyDataGetter, &my_data, my_data.Size());
|
||||
// ImPlot::PlotLineG("line", my_lambda, nullptr, 1000);
|
||||
// ImPlot::EndPlot();
|
||||
// }
|
||||
//
|
||||
// NB: All types are converted to double before plotting. You may lose information
|
||||
// if you try plotting extremely large 64-bit integral types. Proceed with caution!
|
||||
|
||||
// Plots a standard 2D line plot.
|
||||
template <typename T> IMPLOT_API void PlotLine(const char* label_id, const T* values, int count, double xscale=1, double x0=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotLine(const char* label_id, const T* xs, const T* ys, int count, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotLineG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, int offset=0);
|
||||
|
||||
// Plots a standard 2D scatter plot. Default marker is ImPlotMarker_Circle.
|
||||
template <typename T> IMPLOT_API void PlotScatter(const char* label_id, const T* values, int count, double xscale=1, double x0=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotScatter(const char* label_id, const T* xs, const T* ys, int count, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotScatterG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, int offset=0);
|
||||
|
||||
// Plots a a stairstep graph. The y value is continued constantly from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i].
|
||||
template <typename T> IMPLOT_API void PlotStairs(const char* label_id, const T* values, int count, double xscale=1, double x0=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotStairs(const char* label_id, const T* xs, const T* ys, int count, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotStairsG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, int offset=0);
|
||||
|
||||
// Plots a shaded (filled) region between two lines, or a line and a horizontal reference. Set y_ref to +/-INFINITY for infinite fill extents.
|
||||
template <typename T> IMPLOT_API void PlotShaded(const char* label_id, const T* values, int count, double y_ref=0, double xscale=1, double x0=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotShaded(const char* label_id, const T* xs, const T* ys, int count, double y_ref=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotShaded(const char* label_id, const T* xs, const T* ys1, const T* ys2, int count, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotShadedG(const char* label_id, ImPlotPoint (*getter1)(void* data, int idx), void* data1, ImPlotPoint (*getter2)(void* data, int idx), void* data2, int count, int offset=0);
|
||||
|
||||
// Plots a vertical bar graph. #width and #shift are in X units.
|
||||
template <typename T> IMPLOT_API void PlotBars(const char* label_id, const T* values, int count, double width=0.67, double shift=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotBars(const char* label_id, const T* xs, const T* ys, int count, double width, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotBarsG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, double width, int offset=0);
|
||||
|
||||
// Plots a horizontal bar graph. #height and #shift are in Y units.
|
||||
template <typename T> IMPLOT_API void PlotBarsH(const char* label_id, const T* values, int count, double height=0.67, double shift=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotBarsH(const char* label_id, const T* xs, const T* ys, int count, double height, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotBarsHG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, double height, int offset=0);
|
||||
|
||||
// Plots vertical error bar. The label_id should be the same as the label_id of the associated line or bar plot.
|
||||
template <typename T> IMPLOT_API void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* err, int count, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* neg, const T* pos, int count, int offset=0, int stride=sizeof(T));
|
||||
|
||||
// Plots horizontal error bars. The label_id should be the same as the label_id of the associated line or bar plot.
|
||||
template <typename T> IMPLOT_API void PlotErrorBarsH(const char* label_id, const T* xs, const T* ys, const T* err, int count, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotErrorBarsH(const char* label_id, const T* xs, const T* ys, const T* neg, const T* pos, int count, int offset=0, int stride=sizeof(T));
|
||||
|
||||
/// Plots vertical stems.
|
||||
template <typename T> IMPLOT_API void PlotStems(const char* label_id, const T* values, int count, double y_ref=0, double xscale=1, double x0=0, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotStems(const char* label_id, const T* xs, const T* ys, int count, double y_ref=0, int offset=0, int stride=sizeof(T));
|
||||
|
||||
/// Plots infinite vertical or horizontal lines (e.g. for references or asymptotes).
|
||||
template <typename T> IMPLOT_API void PlotVLines(const char* label_id, const T* xs, int count, int offset=0, int stride=sizeof(T));
|
||||
template <typename T> IMPLOT_API void PlotHLines(const char* label_id, const T* ys, int count, int offset=0, int stride=sizeof(T));
|
||||
|
||||
// Plots a pie chart. If the sum of values > 1 or normalize is true, each value will be normalized. Center and radius are in plot units. #label_fmt can be set to NULL for no labels.
|
||||
template <typename T> IMPLOT_API void PlotPieChart(const char* const label_ids[], const T* values, int count, double x, double y, double radius, bool normalize=false, const char* label_fmt="%.1f", double angle0=90);
|
||||
|
||||
// Plots a 2D heatmap chart. Values are expected to be in row-major order. Leave #scale_min and scale_max both at 0 for automatic color scaling, or set them to a predefined range. #label_fmt can be set to NULL for no labels.
|
||||
template <typename T> IMPLOT_API void PlotHeatmap(const char* label_id, const T* values, int rows, int cols, double scale_min=0, double scale_max=0, const char* label_fmt="%.1f", const ImPlotPoint& bounds_min=ImPlotPoint(0,0), const ImPlotPoint& bounds_max=ImPlotPoint(1,1));
|
||||
|
||||
// Plots a horizontal histogram. #bins can be a positive integer or an ImPlotBin_ method. If #cumulative is true, each bin contains its count plus the counts of all previous bins.
|
||||
// If #density is true, the PDF is visualized. If both are true, the CDF is visualized. If #range is left unspecified, the min/max of #values will be used as the range.
|
||||
// If #range is specified, outlier values outside of the range are not binned. However, outliers still count toward normalizing and cumulative counts unless #outliers is false. The largest bin count or density is returned.
|
||||
template <typename T> IMPLOT_API double PlotHistogram(const char* label_id, const T* values, int count, int bins=ImPlotBin_Sturges, bool cumulative=false, bool density=false, ImPlotRange range=ImPlotRange(), bool outliers=true, double bar_scale=1.0);
|
||||
|
||||
// Plots two dimensional, bivariate histogram as a heatmap. #x_bins and #y_bins can be a positive integer or an ImPlotBin. If #density is true, the PDF is visualized.
|
||||
// If #range is left unspecified, the min/max of #xs an #ys will be used as the ranges. If #range is specified, outlier values outside of range are not binned.
|
||||
// However, outliers still count toward the normalizing count for density plots unless #outliers is false. The largest bin count or density is returned.
|
||||
template <typename T> IMPLOT_API double PlotHistogram2D(const char* label_id, const T* xs, const T* ys, int count, int x_bins=ImPlotBin_Sturges, int y_bins=ImPlotBin_Sturges, bool density=false, ImPlotLimits range=ImPlotLimits(), bool outliers=true);
|
||||
|
||||
// Plots digital data. Digital plots do not respond to y drag or zoom, and are always referenced to the bottom of the plot.
|
||||
template <typename T> IMPLOT_API void PlotDigital(const char* label_id, const T* xs, const T* ys, int count, int offset=0, int stride=sizeof(T));
|
||||
IMPLOT_API void PlotDigitalG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, int offset=0);
|
||||
|
||||
// Plots an axis-aligned image. #bounds_min/bounds_max are in plot coordinates (y-up) and #uv0/uv1 are in texture coordinates (y-down).
|
||||
IMPLOT_API void PlotImage(const char* label_id, ImTextureID user_texture_id, const ImPlotPoint& bounds_min, const ImPlotPoint& bounds_max, const ImVec2& uv0=ImVec2(0,0), const ImVec2& uv1=ImVec2(1,1), const ImVec4& tint_col=ImVec4(1,1,1,1));
|
||||
|
||||
// Plots a centered text label at point x,y with an optional pixel offset. Text color can be changed with ImPlot::PushStyleColor(ImPlotCol_InlayText, ...).
|
||||
IMPLOT_API void PlotText(const char* text, double x, double y, bool vertical=false, const ImVec2& pix_offset=ImVec2(0,0));
|
||||
|
||||
// Plots a dummy item (i.e. adds a legend entry colored by ImPlotCol_Line)
|
||||
IMPLOT_API void PlotDummy(const char* label_id);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Plot Utils
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The following functions MUST be called BEFORE BeginPlot!
|
||||
|
||||
// Set the axes range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the axes limits will be locked.
|
||||
IMPLOT_API void SetNextPlotLimits(double xmin, double xmax, double ymin, double ymax, ImGuiCond cond = ImGuiCond_Once);
|
||||
// Set the X axis range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the X axis limits will be locked.
|
||||
IMPLOT_API void SetNextPlotLimitsX(double xmin, double xmax, ImGuiCond cond = ImGuiCond_Once);
|
||||
// Set the Y axis range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the Y axis limits will be locked.
|
||||
IMPLOT_API void SetNextPlotLimitsY(double ymin, double ymax, ImGuiCond cond = ImGuiCond_Once, ImPlotYAxis y_axis = ImPlotYAxis_1);
|
||||
// Links the next plot limits to external values. Set to NULL for no linkage. The pointer data must remain valid until the matching call to EndPlot.
|
||||
IMPLOT_API void LinkNextPlotLimits(double* xmin, double* xmax, double* ymin, double* ymax, double* ymin2 = NULL, double* ymax2 = NULL, double* ymin3 = NULL, double* ymax3 = NULL);
|
||||
// Fits the next plot axes to all plotted data if they are unlocked (equivalent to double-clicks).
|
||||
IMPLOT_API void FitNextPlotAxes(bool x = true, bool y = true, bool y2 = true, bool y3 = true);
|
||||
|
||||
// Set the X axis ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true.
|
||||
IMPLOT_API void SetNextPlotTicksX(const double* values, int n_ticks, const char* const labels[] = NULL, bool keep_default = false);
|
||||
IMPLOT_API void SetNextPlotTicksX(double x_min, double x_max, int n_ticks, const char* const labels[] = NULL, bool keep_default = false);
|
||||
// Set the Y axis ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true.
|
||||
IMPLOT_API void SetNextPlotTicksY(const double* values, int n_ticks, const char* const labels[] = NULL, bool keep_default = false, ImPlotYAxis y_axis = ImPlotYAxis_1);
|
||||
IMPLOT_API void SetNextPlotTicksY(double y_min, double y_max, int n_ticks, const char* const labels[] = NULL, bool keep_default = false, ImPlotYAxis y_axis = ImPlotYAxis_1);
|
||||
|
||||
// Set the format for numeric X axis labels (default="%g"). Formated values will be doubles (i.e. don't supply %d, %i, etc.). Not applicable if ImPlotAxisFlags_Time enabled.
|
||||
IMPLOT_API void SetNextPlotFormatX(const char* fmt);
|
||||
// Set the format for numeric Y axis labels (default="%g"). Formated values will be doubles (i.e. don't supply %d, %i, etc.).
|
||||
IMPLOT_API void SetNextPlotFormatY(const char* fmt, ImPlotYAxis y_axis=ImPlotYAxis_1);
|
||||
|
||||
// The following functions MUST be called BETWEEN Begin/EndPlot!
|
||||
|
||||
// Select which Y axis will be used for subsequent plot elements. The default is ImPlotYAxis_1, or the first (left) Y axis. Enable 2nd and 3rd axes with ImPlotFlags_YAxisX.
|
||||
IMPLOT_API void SetPlotYAxis(ImPlotYAxis y_axis);
|
||||
// Hides or shows the next plot item (i.e. as if it were toggled from the legend). Use ImGuiCond_Always if you need to forcefully set this every frame.
|
||||
IMPLOT_API void HideNextItem(bool hidden = true, ImGuiCond cond = ImGuiCond_Once);
|
||||
|
||||
// Convert pixels to a position in the current plot's coordinate system. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
|
||||
IMPLOT_API ImPlotPoint PixelsToPlot(const ImVec2& pix, ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
IMPLOT_API ImPlotPoint PixelsToPlot(float x, float y, ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
// Convert a position in the current plot's coordinate system to pixels. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
|
||||
IMPLOT_API ImVec2 PlotToPixels(const ImPlotPoint& plt, ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
IMPLOT_API ImVec2 PlotToPixels(double x, double y, ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
// Get the current Plot position (top-left) in pixels.
|
||||
IMPLOT_API ImVec2 GetPlotPos();
|
||||
// Get the curent Plot size in pixels.
|
||||
IMPLOT_API ImVec2 GetPlotSize();
|
||||
// Returns true if the plot area in the current plot is hovered.
|
||||
IMPLOT_API bool IsPlotHovered();
|
||||
// Returns true if the XAxis plot area in the current plot is hovered.
|
||||
IMPLOT_API bool IsPlotXAxisHovered();
|
||||
// Returns true if the YAxis[n] plot area in the current plot is hovered.
|
||||
IMPLOT_API bool IsPlotYAxisHovered(ImPlotYAxis y_axis = 0);
|
||||
// Returns the mouse position in x,y coordinates of the current plot. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
|
||||
IMPLOT_API ImPlotPoint GetPlotMousePos(ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
// Returns the current plot axis range. A negative y_axis uses the current value of SetPlotYAxis (ImPlotYAxis_1 initially).
|
||||
IMPLOT_API ImPlotLimits GetPlotLimits(ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
|
||||
// Returns true if the current plot is being box selected.
|
||||
IMPLOT_API bool IsPlotSelected();
|
||||
// Returns the current plot box selection bounds.
|
||||
IMPLOT_API ImPlotLimits GetPlotSelection(ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
|
||||
// Returns true if the current plot is being queried or has an active query. Query must be enabled with ImPlotFlags_Query.
|
||||
IMPLOT_API bool IsPlotQueried();
|
||||
// Returns the current plot query bounds. Query must be enabled with ImPlotFlags_Query.
|
||||
IMPLOT_API ImPlotLimits GetPlotQuery(ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
// Set the current plot query bounds. Query must be enabled with ImPlotFlags_Query.
|
||||
IMPLOT_API void SetPlotQuery(const ImPlotLimits& query, ImPlotYAxis y_axis = IMPLOT_AUTO);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Algined Plots
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Consider using Begin/EndSubplots first. They are more feature rich and
|
||||
// accomplish the same behaviour by default. The functions below offer lower
|
||||
// level control of plot alignment.
|
||||
|
||||
// Align axis padding over multiple plots in a single row or column. If this function returns true, EndAlignedPlots() must be called. #group_id must be unique.
|
||||
IMPLOT_API bool BeginAlignedPlots(const char* group_id, ImPlotOrientation orientation = ImPlotOrientation_Vertical);
|
||||
// Only call EndAlignedPlots() if BeginAlignedPlots() returns true!
|
||||
IMPLOT_API void EndAlignedPlots();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Plot Tools
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The following functions MUST be called BETWEEN Begin/EndPlot!
|
||||
|
||||
// Shows an annotation callout at a chosen point.
|
||||
IMPLOT_API void Annotate(double x, double y, const ImVec2& pix_offset, const char* fmt, ...) IM_FMTARGS(4);
|
||||
IMPLOT_API void Annotate(double x, double y, const ImVec2& pix_offset, const ImVec4& color, const char* fmt, ...) IM_FMTARGS(5);
|
||||
IMPLOT_API void AnnotateV(double x, double y, const ImVec2& pix_offset, const char* fmt, va_list args) IM_FMTLIST(4);
|
||||
IMPLOT_API void AnnotateV(double x, double y, const ImVec2& pix_offset, const ImVec4& color, const char* fmt, va_list args) IM_FMTLIST(5);
|
||||
|
||||
// Same as above, but the annotation will always be clamped to stay inside the plot area.
|
||||
IMPLOT_API void AnnotateClamped(double x, double y, const ImVec2& pix_offset, const char* fmt, ...) IM_FMTARGS(4);
|
||||
IMPLOT_API void AnnotateClamped(double x, double y, const ImVec2& pix_offset, const ImVec4& color, const char* fmt, ...) IM_FMTARGS(5);
|
||||
IMPLOT_API void AnnotateClampedV(double x, double y, const ImVec2& pix_offset, const char* fmt, va_list args) IM_FMTLIST(4);
|
||||
IMPLOT_API void AnnotateClampedV(double x, double y, const ImVec2& pix_offset, const ImVec4& color, const char* fmt, va_list args) IM_FMTLIST(5);
|
||||
|
||||
// Shows a draggable vertical guide line at an x-value. #col defaults to ImGuiCol_Text.
|
||||
IMPLOT_API bool DragLineX(const char* id, double* x_value, bool show_label = true, const ImVec4& col = IMPLOT_AUTO_COL, float thickness = 1);
|
||||
// Shows a draggable horizontal guide line at a y-value. #col defaults to ImGuiCol_Text.
|
||||
IMPLOT_API bool DragLineY(const char* id, double* y_value, bool show_label = true, const ImVec4& col = IMPLOT_AUTO_COL, float thickness = 1);
|
||||
// Shows a draggable point at x,y. #col defaults to ImGuiCol_Text.
|
||||
IMPLOT_API bool DragPoint(const char* id, double* x, double* y, bool show_label = true, const ImVec4& col = IMPLOT_AUTO_COL, float radius = 4);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Legend Utils and Tools
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The following functions MUST be called BETWEEN Begin/EndPlot!
|
||||
|
||||
// Set the location of the current plot's (or subplot's) legend.
|
||||
IMPLOT_API void SetLegendLocation(ImPlotLocation location, ImPlotOrientation orientation = ImPlotOrientation_Vertical, bool outside = false);
|
||||
// Set the location of the current plot's mouse position text (default = South|East).
|
||||
IMPLOT_API void SetMousePosLocation(ImPlotLocation location);
|
||||
// Returns true if a plot item legend entry is hovered.
|
||||
IMPLOT_API bool IsLegendEntryHovered(const char* label_id);
|
||||
|
||||
// Begin a popup for a legend entry.
|
||||
IMPLOT_API bool BeginLegendPopup(const char* label_id, ImGuiMouseButton mouse_button = 1);
|
||||
// End a popup for a legend entry.
|
||||
IMPLOT_API void EndLegendPopup();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Drag and Drop Utils
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The following functions MUST be called BETWEEN Begin/EndPlot!
|
||||
|
||||
// Turns the current plot's plotting area into a drag and drop target. Don't forget to call EndDragDropTarget!
|
||||
IMPLOT_API bool BeginDragDropTarget();
|
||||
// Turns the current plot's X-axis into a drag and drop target. Don't forget to call EndDragDropTarget!
|
||||
IMPLOT_API bool BeginDragDropTargetX();
|
||||
// Turns the current plot's Y-Axis into a drag and drop target. Don't forget to call EndDragDropTarget!
|
||||
IMPLOT_API bool BeginDragDropTargetY(ImPlotYAxis axis = ImPlotYAxis_1);
|
||||
// Turns the current plot's legend into a drag and drop target. Don't forget to call EndDragDropTarget!
|
||||
IMPLOT_API bool BeginDragDropTargetLegend();
|
||||
// Ends a drag and drop target (currently just an alias for ImGui::EndDragDropTarget).
|
||||
IMPLOT_API void EndDragDropTarget();
|
||||
|
||||
// NB: By default, plot and axes drag and drop *sources* require holding the Ctrl modifier to initiate the drag.
|
||||
// You can change the modifier if desired. If ImGuiKeyModFlags_None is provided, the axes will be locked from panning.
|
||||
|
||||
// Turns the current plot's plotting area into a drag and drop source. Don't forget to call EndDragDropSource!
|
||||
IMPLOT_API bool BeginDragDropSource(ImGuiKeyModFlags key_mods = ImGuiKeyModFlags_Ctrl, ImGuiDragDropFlags flags = 0);
|
||||
// Turns the current plot's X-axis into a drag and drop source. Don't forget to call EndDragDropSource!
|
||||
IMPLOT_API bool BeginDragDropSourceX(ImGuiKeyModFlags key_mods = ImGuiKeyModFlags_Ctrl, ImGuiDragDropFlags flags = 0);
|
||||
// Turns the current plot's Y-axis into a drag and drop source. Don't forget to call EndDragDropSource!
|
||||
IMPLOT_API bool BeginDragDropSourceY(ImPlotYAxis axis = ImPlotYAxis_1, ImGuiKeyModFlags key_mods = ImGuiKeyModFlags_Ctrl, ImGuiDragDropFlags flags = 0);
|
||||
// Turns an item in the current plot's legend into drag and drop source. Don't forget to call EndDragDropSource!
|
||||
IMPLOT_API bool BeginDragDropSourceItem(const char* label_id, ImGuiDragDropFlags flags = 0);
|
||||
// Ends a drag and drop source (currently just an alias for ImGui::EndDragDropSource).
|
||||
IMPLOT_API void EndDragDropSource();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Plot and Item Styling
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Styling colors in ImPlot works similarly to styling colors in ImGui, but
|
||||
// with one important difference. Like ImGui, all style colors are stored in an
|
||||
// indexable array in ImPlotStyle. You can permanently modify these values through
|
||||
// GetStyle().Colors, or temporarily modify them with Push/Pop functions below.
|
||||
// However, by default all style colors in ImPlot default to a special color
|
||||
// IMPLOT_AUTO_COL. The behavior of this color depends upon the style color to
|
||||
// which it as applied:
|
||||
//
|
||||
// 1) For style colors associated with plot items (e.g. ImPlotCol_Line),
|
||||
// IMPLOT_AUTO_COL tells ImPlot to color the item with the next unused
|
||||
// color in the current colormap. Thus, every item will have a different
|
||||
// color up to the number of colors in the colormap, at which point the
|
||||
// colormap will roll over. For most use cases, you should not need to
|
||||
// set these style colors to anything but IMPLOT_COL_AUTO; you are
|
||||
// probably better off changing the current colormap. However, if you
|
||||
// need to explicitly color a particular item you may either Push/Pop
|
||||
// the style color around the item in question, or use the SetNextXXXStyle
|
||||
// API below. If you permanently set one of these style colors to a specific
|
||||
// color, or forget to call Pop, then all subsequent items will be styled
|
||||
// with the color you set.
|
||||
//
|
||||
// 2) For style colors associated with plot styling (e.g. ImPlotCol_PlotBg),
|
||||
// IMPLOT_AUTO_COL tells ImPlot to set that color from color data in your
|
||||
// **ImGuiStyle**. The ImGuiCol_ that these style colors default to are
|
||||
// detailed above, and in general have been mapped to produce plots visually
|
||||
// consistent with your current ImGui style. Of course, you are free to
|
||||
// manually set these colors to whatever you like, and further can Push/Pop
|
||||
// them around individual plots for plot-specific styling (e.g. coloring axes).
|
||||
|
||||
// Provides access to plot style structure for permanant modifications to colors, sizes, etc.
|
||||
IMPLOT_API ImPlotStyle& GetStyle();
|
||||
|
||||
// Style plot colors for current ImGui style (default).
|
||||
IMPLOT_API void StyleColorsAuto(ImPlotStyle* dst = NULL);
|
||||
// Style plot colors for ImGui "Classic".
|
||||
IMPLOT_API void StyleColorsClassic(ImPlotStyle* dst = NULL);
|
||||
// Style plot colors for ImGui "Dark".
|
||||
IMPLOT_API void StyleColorsDark(ImPlotStyle* dst = NULL);
|
||||
// Style plot colors for ImGui "Light".
|
||||
IMPLOT_API void StyleColorsLight(ImPlotStyle* dst = NULL);
|
||||
|
||||
// Use PushStyleX to temporarily modify your ImPlotStyle. The modification
|
||||
// will last until the matching call to PopStyleX. You MUST call a pop for
|
||||
// every push, otherwise you will leak memory! This behaves just like ImGui.
|
||||
|
||||
// Temporarily modify a style color. Don't forget to call PopStyleColor!
|
||||
IMPLOT_API void PushStyleColor(ImPlotCol idx, ImU32 col);
|
||||
IMPLOT_API void PushStyleColor(ImPlotCol idx, const ImVec4& col);
|
||||
// Undo temporary style color modification(s). Undo multiple pushes at once by increasing count.
|
||||
IMPLOT_API void PopStyleColor(int count = 1);
|
||||
|
||||
// Temporarily modify a style variable of float type. Don't forget to call PopStyleVar!
|
||||
IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, float val);
|
||||
// Temporarily modify a style variable of int type. Don't forget to call PopStyleVar!
|
||||
IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, int val);
|
||||
// Temporarily modify a style variable of ImVec2 type. Don't forget to call PopStyleVar!
|
||||
IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, const ImVec2& val);
|
||||
// Undo temporary style variable modification(s). Undo multiple pushes at once by increasing count.
|
||||
IMPLOT_API void PopStyleVar(int count = 1);
|
||||
|
||||
// The following can be used to modify the style of the next plot item ONLY. They do
|
||||
// NOT require calls to PopStyleX. Leave style attributes you don't want modified to
|
||||
// IMPLOT_AUTO or IMPLOT_AUTO_COL. Automatic styles will be deduced from the current
|
||||
// values in your ImPlotStyle or from Colormap data.
|
||||
|
||||
// Set the line color and weight for the next item only.
|
||||
IMPLOT_API void SetNextLineStyle(const ImVec4& col = IMPLOT_AUTO_COL, float weight = IMPLOT_AUTO);
|
||||
// Set the fill color for the next item only.
|
||||
IMPLOT_API void SetNextFillStyle(const ImVec4& col = IMPLOT_AUTO_COL, float alpha_mod = IMPLOT_AUTO);
|
||||
// Set the marker style for the next item only.
|
||||
IMPLOT_API void SetNextMarkerStyle(ImPlotMarker marker = IMPLOT_AUTO, float size = IMPLOT_AUTO, const ImVec4& fill = IMPLOT_AUTO_COL, float weight = IMPLOT_AUTO, const ImVec4& outline = IMPLOT_AUTO_COL);
|
||||
// Set the error bar style for the next item only.
|
||||
IMPLOT_API void SetNextErrorBarStyle(const ImVec4& col = IMPLOT_AUTO_COL, float size = IMPLOT_AUTO, float weight = IMPLOT_AUTO);
|
||||
|
||||
// Gets the last item primary color (i.e. its legend icon color)
|
||||
IMPLOT_API ImVec4 GetLastItemColor();
|
||||
|
||||
// Returns the null terminated string name for an ImPlotCol.
|
||||
IMPLOT_API const char* GetStyleColorName(ImPlotCol idx);
|
||||
// Returns the null terminated string name for an ImPlotMarker.
|
||||
IMPLOT_API const char* GetMarkerName(ImPlotMarker idx);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Colormaps
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Item styling is based on colormaps when the relevant ImPlotCol_XXX is set to
|
||||
// IMPLOT_AUTO_COL (default). Several built-in colormaps are available. You can
|
||||
// add and then push/pop your own colormaps as well. To permanently set a colormap,
|
||||
// modify the Colormap index member of your ImPlotStyle.
|
||||
|
||||
// Colormap data will be ignored and a custom color will be used if you have done one of the following:
|
||||
// 1) Modified an item style color in your ImPlotStyle to anything other than IMPLOT_AUTO_COL.
|
||||
// 2) Pushed an item style color using PushStyleColor().
|
||||
// 3) Set the next item style with a SetNextXXXStyle function.
|
||||
|
||||
// Add a new colormap. The color data will be copied. The colormap can be used by pushing either the returned index or the
|
||||
// string name with PushColormap. The colormap name must be unique and the size must be greater than 1. You will receive
|
||||
// an assert otherwise! By default colormaps are considered to be qualitative (i.e. discrete). If you want to create a
|
||||
// continuous colormap, set #qual=false. This will treat the colors you provide as keys, and ImPlot will build a linearly
|
||||
// interpolated lookup table. The memory footprint of this table will be exactly ((size-1)*255+1)*4 bytes.
|
||||
IMPLOT_API ImPlotColormap AddColormap(const char* name, const ImVec4* cols, int size, bool qual=true);
|
||||
IMPLOT_API ImPlotColormap AddColormap(const char* name, const ImU32* cols, int size, bool qual=true);
|
||||
|
||||
// Returns the number of available colormaps (i.e. the built-in + user-added count).
|
||||
IMPLOT_API int GetColormapCount();
|
||||
// Returns a null terminated string name for a colormap given an index. Returns NULL if index is invalid.
|
||||
IMPLOT_API const char* GetColormapName(ImPlotColormap cmap);
|
||||
// Returns an index number for a colormap given a valid string name. Returns -1 if name is invalid.
|
||||
IMPLOT_API ImPlotColormap GetColormapIndex(const char* name);
|
||||
|
||||
// Temporarily switch to one of the built-in (i.e. ImPlotColormap_XXX) or user-added colormaps (i.e. a return value of AddColormap). Don't forget to call PopColormap!
|
||||
IMPLOT_API void PushColormap(ImPlotColormap cmap);
|
||||
// Push a colormap by string name. Use built-in names such as "Default", "Deep", "Jet", etc. or a string you provided to AddColormap. Don't forget to call PopColormap!
|
||||
IMPLOT_API void PushColormap(const char* name);
|
||||
// Undo temporary colormap modification(s). Undo multiple pushes at once by increasing count.
|
||||
IMPLOT_API void PopColormap(int count = 1);
|
||||
|
||||
// Returns the next color from the current colormap and advances the colormap for the current plot.
|
||||
// Can also be used with no return value to skip colors if desired. You need to call this between Begin/EndPlot!
|
||||
IMPLOT_API ImVec4 NextColormapColor();
|
||||
|
||||
// Colormap utils. If cmap = IMPLOT_AUTO (default), the current colormap is assumed.
|
||||
// Pass an explicit colormap index (built-in or user-added) to specify otherwise.
|
||||
|
||||
// Returns the size of a colormap.
|
||||
IMPLOT_API int GetColormapSize(ImPlotColormap cmap = IMPLOT_AUTO);
|
||||
// Returns a color from a colormap given an index >= 0 (modulo will be performed).
|
||||
IMPLOT_API ImVec4 GetColormapColor(int idx, ImPlotColormap cmap = IMPLOT_AUTO);
|
||||
// Sample a color from the current colormap given t between 0 and 1.
|
||||
IMPLOT_API ImVec4 SampleColormap(float t, ImPlotColormap cmap = IMPLOT_AUTO);
|
||||
|
||||
// Shows a vertical color scale with linear spaced ticks using the specified color map. Use double hashes to hide label (e.g. "##NoLabel").
|
||||
IMPLOT_API void ColormapScale(const char* label, double scale_min, double scale_max, const ImVec2& size = ImVec2(0,0), ImPlotColormap cmap = IMPLOT_AUTO, const char* fmt = "%g");
|
||||
// Shows a horizontal slider with a colormap gradient background. Optionally returns the color sampled at t in [0 1].
|
||||
IMPLOT_API bool ColormapSlider(const char* label, float* t, ImVec4* out = NULL, const char* format = "", ImPlotColormap cmap = IMPLOT_AUTO);
|
||||
// Shows a button with a colormap gradient brackground.
|
||||
IMPLOT_API bool ColormapButton(const char* label, const ImVec2& size = ImVec2(0,0), ImPlotColormap cmap = IMPLOT_AUTO);
|
||||
|
||||
// When items in a plot sample their color from a colormap, the color is cached and does not change
|
||||
// unless explicitly overriden. Therefore, if you change the colormap after the item has already been plotted,
|
||||
// item colors will NOT update. If you need item colors to resample the new colormap, then use this
|
||||
// function to bust the cached colors. If #plot_title_id is NULL, then every item in EVERY existing plot
|
||||
// will be cache busted. Otherwise only the plot specified by #plot_title_id will be busted. For the
|
||||
// latter, this function must be called in the same ImGui ID scope that the plot is in. You should rarely if ever
|
||||
// need this function, but it is available for applications that require runtime colormap swaps (e.g. Heatmaps demo).
|
||||
IMPLOT_API void BustColorCache(const char* plot_title_id = NULL);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Miscellaneous
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Render icons similar to those that appear in legends (nifty for data lists).
|
||||
IMPLOT_API void ItemIcon(const ImVec4& col);
|
||||
IMPLOT_API void ItemIcon(ImU32 col);
|
||||
IMPLOT_API void ColormapIcon(ImPlotColormap cmap);
|
||||
|
||||
// Get the plot draw list for custom rendering to the current plot area. Call between Begin/EndPlot.
|
||||
IMPLOT_API ImDrawList* GetPlotDrawList();
|
||||
// Push clip rect for rendering to current plot area. The rect can be expanded or contracted by #expand pixels. Call between Begin/EndPlot.
|
||||
IMPLOT_API void PushPlotClipRect(float expand=0);
|
||||
// Pop plot clip rect. Call between Begin/EndPlot.
|
||||
IMPLOT_API void PopPlotClipRect();
|
||||
|
||||
// Shows ImPlot style selector dropdown menu.
|
||||
IMPLOT_API bool ShowStyleSelector(const char* label);
|
||||
// Shows ImPlot colormap selector dropdown menu.
|
||||
IMPLOT_API bool ShowColormapSelector(const char* label);
|
||||
// Shows ImPlot style editor block (not a window).
|
||||
IMPLOT_API void ShowStyleEditor(ImPlotStyle* ref = NULL);
|
||||
// Add basic help/info block for end users (not a window).
|
||||
IMPLOT_API void ShowUserGuide();
|
||||
// Shows ImPlot metrics/debug information window.
|
||||
IMPLOT_API void ShowMetricsWindow(bool* p_popen = NULL);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Demo (add implot_demo.cpp to your sources!)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Shows the ImPlot demo window.
|
||||
IMPLOT_API void ShowDemoWindow(bool* p_open = NULL);
|
||||
|
||||
} // namespace ImPlot
|
||||
1358
lib/external/imgui/include/implot_internal.h
vendored
Normal file
1358
lib/external/imgui/include/implot_internal.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@
|
||||
// Minor features
|
||||
// Martins Mozeiko
|
||||
// github:IntellectualKitty
|
||||
//
|
||||
//
|
||||
// Bugfixes / warning fixes
|
||||
// Jeremy Jaussaud
|
||||
// Fabian Giesen
|
||||
@@ -441,7 +441,7 @@ static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int widt
|
||||
}
|
||||
}
|
||||
tail = tail->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fr.prev_link = best;
|
||||
@@ -602,38 +602,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
// [DEAR IMGUI]
|
||||
// This is a slightly modified version of stb_textedit.h 1.13.
|
||||
// This is a slightly modified version of stb_textedit.h 1.13.
|
||||
// Those changes would need to be pushed into nothings/stb:
|
||||
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
||||
// Grep for [DEAR IMGUI] to find the changes.
|
||||
@@ -19,7 +19,7 @@
|
||||
// texts, as its performance does not scale and it has limited undo).
|
||||
//
|
||||
// Non-trivial behaviors are modelled after Windows text controls.
|
||||
//
|
||||
//
|
||||
//
|
||||
// LICENSE
|
||||
//
|
||||
@@ -217,20 +217,20 @@
|
||||
// call this with the mouse x,y on a mouse down; it will update the cursor
|
||||
// and reset the selection start/end to the cursor point. the x,y must
|
||||
// be relative to the text widget, with (0,0) being the top left.
|
||||
//
|
||||
//
|
||||
// drag:
|
||||
// call this with the mouse x,y on a mouse drag/up; it will update the
|
||||
// cursor and the selection end point
|
||||
//
|
||||
//
|
||||
// cut:
|
||||
// call this to delete the current selection; returns true if there was
|
||||
// one. you should FIRST copy the current selection to the system paste buffer.
|
||||
// (To copy, just copy the current selection out of the string yourself.)
|
||||
//
|
||||
//
|
||||
// paste:
|
||||
// call this to paste text at the current cursor point or over the current
|
||||
// selection if there is one.
|
||||
//
|
||||
//
|
||||
// key:
|
||||
// call this for keyboard inputs sent to the textfield. you can use it
|
||||
// for "key down" events or for "translated" key events. if you need to
|
||||
@@ -241,7 +241,7 @@
|
||||
// clear. STB_TEXTEDIT_KEYTYPE defaults to int, but you can #define it to
|
||||
// anything other type you wante before including.
|
||||
//
|
||||
//
|
||||
//
|
||||
// When rendering, you can read the cursor position and selection state from
|
||||
// the STB_TexteditState.
|
||||
//
|
||||
@@ -716,9 +716,11 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta
|
||||
state->has_preferred_x = 0;
|
||||
return 1;
|
||||
}
|
||||
// remove the undo since we didn't actually insert the characters
|
||||
if (state->undostate.undo_point)
|
||||
--state->undostate.undo_point;
|
||||
// [DEAR IMGUI]
|
||||
//// remove the undo since we didn't actually insert the characters
|
||||
//if (state->undostate.undo_point)
|
||||
// --state->undostate.undo_point;
|
||||
// note: paste failure will leave deleted selection, may be restored with an undo (see https://github.com/nothings/stb/issues/734 for details)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -764,7 +766,7 @@ retry:
|
||||
state->insert_mode = !state->insert_mode;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
case STB_TEXTEDIT_K_UNDO:
|
||||
stb_text_undo(str, state);
|
||||
state->has_preferred_x = 0;
|
||||
@@ -779,7 +781,7 @@ retry:
|
||||
// if currently there's a selection, move cursor to start of selection
|
||||
if (STB_TEXT_HAS_SELECTION(state))
|
||||
stb_textedit_move_to_first(state);
|
||||
else
|
||||
else
|
||||
if (state->cursor > 0)
|
||||
--state->cursor;
|
||||
state->has_preferred_x = 0;
|
||||
@@ -828,7 +830,7 @@ retry:
|
||||
|
||||
#ifdef STB_TEXTEDIT_MOVEWORDRIGHT
|
||||
case STB_TEXTEDIT_K_WORDRIGHT:
|
||||
if (STB_TEXT_HAS_SELECTION(state))
|
||||
if (STB_TEXT_HAS_SELECTION(state))
|
||||
stb_textedit_move_to_last(str, state);
|
||||
else {
|
||||
state->cursor = STB_TEXTEDIT_MOVEWORDRIGHT(str, state->cursor);
|
||||
@@ -922,7 +924,7 @@ retry:
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case STB_TEXTEDIT_K_UP:
|
||||
case STB_TEXTEDIT_K_UP | STB_TEXTEDIT_K_SHIFT:
|
||||
case STB_TEXTEDIT_K_PGUP:
|
||||
@@ -1014,7 +1016,7 @@ retry:
|
||||
}
|
||||
state->has_preferred_x = 0;
|
||||
break;
|
||||
|
||||
|
||||
#ifdef STB_TEXTEDIT_K_TEXTSTART2
|
||||
case STB_TEXTEDIT_K_TEXTSTART2:
|
||||
#endif
|
||||
@@ -1031,7 +1033,7 @@ retry:
|
||||
state->select_start = state->select_end = 0;
|
||||
state->has_preferred_x = 0;
|
||||
break;
|
||||
|
||||
|
||||
#ifdef STB_TEXTEDIT_K_TEXTSTART2
|
||||
case STB_TEXTEDIT_K_TEXTSTART2 | STB_TEXTEDIT_K_SHIFT:
|
||||
#endif
|
||||
@@ -1410,38 +1412,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -51,7 +51,7 @@
|
||||
// Rob Loach Cort Stratton
|
||||
// Kenney Phillis Jr. github:oyvindjam
|
||||
// Brian Costabile github:vassvik
|
||||
//
|
||||
//
|
||||
// VERSION HISTORY
|
||||
//
|
||||
// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics()
|
||||
@@ -212,7 +212,7 @@
|
||||
//
|
||||
// Advancing for the next character:
|
||||
// Call GlyphHMetrics, and compute 'current_point += SF * advance'.
|
||||
//
|
||||
//
|
||||
//
|
||||
// ADVANCED USAGE
|
||||
//
|
||||
@@ -257,7 +257,7 @@
|
||||
// Curve tessellation 120 LOC \__ 550 LOC Bitmap creation
|
||||
// Bitmap management 100 LOC /
|
||||
// Baked bitmap interface 70 LOC /
|
||||
// Font name matching & access 150 LOC ---- 150
|
||||
// Font name matching & access 150 LOC ---- 150
|
||||
// C runtime library abstraction 60 LOC ---- 60
|
||||
//
|
||||
//
|
||||
@@ -350,7 +350,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
// Output:
|
||||
//
|
||||
@@ -364,9 +364,9 @@ int main(int argc, char **argv)
|
||||
// :@@. M@M
|
||||
// @@@o@@@@
|
||||
// :M@@V:@@.
|
||||
//
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
// Complete program: print "Hello World!" banner, with bugs
|
||||
//
|
||||
#if 0
|
||||
@@ -667,7 +667,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, cons
|
||||
// Calling these functions in sequence is roughly equivalent to calling
|
||||
// stbtt_PackFontRanges(). If you more control over the packing of multiple
|
||||
// fonts, or if you want to pack custom data into a font texture, take a look
|
||||
// at the source to of stbtt_PackFontRanges() and create a custom version
|
||||
// at the source to of stbtt_PackFontRanges() and create a custom version
|
||||
// using these functions, e.g. call GatherRects multiple times,
|
||||
// building up a single array of rects, then call PackRects once,
|
||||
// then call RenderIntoRects repeatedly. This may result in a
|
||||
@@ -975,7 +975,7 @@ STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, floa
|
||||
// and computing from that can allow drop-out prevention).
|
||||
//
|
||||
// The algorithm has not been optimized at all, so expect it to be slow
|
||||
// if computing lots of characters or very large sizes.
|
||||
// if computing lots of characters or very large sizes.
|
||||
|
||||
|
||||
|
||||
@@ -1732,7 +1732,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
||||
if (i != 0)
|
||||
num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
|
||||
|
||||
// now start the new one
|
||||
// now start the new one
|
||||
start_off = !(flags & 1);
|
||||
if (start_off) {
|
||||
// if we start off with an off-curve point, then when we need to find a point on the curve
|
||||
@@ -1785,7 +1785,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
||||
int comp_num_verts = 0, i;
|
||||
stbtt_vertex *comp_verts = 0, *tmp = 0;
|
||||
float mtx[6] = {1,0,0,1,0,0}, m, n;
|
||||
|
||||
|
||||
flags = ttSHORT(comp); comp+=2;
|
||||
gidx = ttSHORT(comp); comp+=2;
|
||||
|
||||
@@ -1815,7 +1815,7 @@ static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, s
|
||||
mtx[2] = ttSHORT(comp)/16384.0f; comp+=2;
|
||||
mtx[3] = ttSHORT(comp)/16384.0f; comp+=2;
|
||||
}
|
||||
|
||||
|
||||
// Find transformation scales.
|
||||
m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]);
|
||||
n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]);
|
||||
@@ -2746,7 +2746,7 @@ static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, i
|
||||
float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
|
||||
STBTT_assert(z != NULL);
|
||||
if (!z) return z;
|
||||
|
||||
|
||||
// round dx down to avoid overshooting
|
||||
if (dxdy < 0)
|
||||
z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy);
|
||||
@@ -2824,7 +2824,7 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
e = e->next;
|
||||
}
|
||||
}
|
||||
@@ -3554,7 +3554,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info
|
||||
{
|
||||
int ix0,iy0,ix1,iy1;
|
||||
stbtt__bitmap gbm;
|
||||
stbtt_vertex *vertices;
|
||||
stbtt_vertex *vertices;
|
||||
int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices);
|
||||
|
||||
if (scale_x == 0) scale_x = scale_y;
|
||||
@@ -3577,7 +3577,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info
|
||||
if (height) *height = gbm.h;
|
||||
if (xoff ) *xoff = ix0;
|
||||
if (yoff ) *yoff = iy0;
|
||||
|
||||
|
||||
if (gbm.w && gbm.h) {
|
||||
gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata);
|
||||
if (gbm.pixels) {
|
||||
@@ -3588,7 +3588,7 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info
|
||||
}
|
||||
STBTT_free(vertices, info->userdata);
|
||||
return gbm.pixels;
|
||||
}
|
||||
}
|
||||
|
||||
STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff)
|
||||
{
|
||||
@@ -3600,7 +3600,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigne
|
||||
int ix0,iy0;
|
||||
stbtt_vertex *vertices;
|
||||
int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices);
|
||||
stbtt__bitmap gbm;
|
||||
stbtt__bitmap gbm;
|
||||
|
||||
stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0);
|
||||
gbm.pixels = output;
|
||||
@@ -3622,7 +3622,7 @@ STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *
|
||||
STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff)
|
||||
{
|
||||
return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff);
|
||||
}
|
||||
}
|
||||
|
||||
STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float *sub_x, float *sub_y, int codepoint)
|
||||
{
|
||||
@@ -3637,7 +3637,7 @@ STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, uns
|
||||
STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff)
|
||||
{
|
||||
return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff);
|
||||
}
|
||||
}
|
||||
|
||||
STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint)
|
||||
{
|
||||
@@ -3762,7 +3762,7 @@ static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *no
|
||||
con->y = 0;
|
||||
con->bottom_y = 0;
|
||||
STBTT__NOTUSED(nodes);
|
||||
STBTT__NOTUSED(num_nodes);
|
||||
STBTT__NOTUSED(num_nodes);
|
||||
}
|
||||
|
||||
static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects)
|
||||
@@ -4147,7 +4147,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char
|
||||
n = 0;
|
||||
for (i=0; i < num_ranges; ++i)
|
||||
n += ranges[i].num_chars;
|
||||
|
||||
|
||||
rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);
|
||||
if (rects == NULL)
|
||||
return 0;
|
||||
@@ -4158,7 +4158,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char
|
||||
n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);
|
||||
|
||||
stbtt_PackFontRangesPackRects(spc, rects, n);
|
||||
|
||||
|
||||
return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects);
|
||||
|
||||
STBTT_free(rects, spc->user_allocator_context);
|
||||
@@ -4302,7 +4302,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
|
||||
int winding = 0;
|
||||
|
||||
orig[0] = x;
|
||||
//orig[1] = y; // [DEAR IMGUI] commmented double assignment
|
||||
//orig[1] = y; // [DEAR IMGUI] commented double assignment
|
||||
|
||||
// make sure y never passes through a vertex of the shape
|
||||
y_frac = (float) STBTT_fmod(y, 1.0f);
|
||||
@@ -4319,7 +4319,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
|
||||
int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y;
|
||||
if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) {
|
||||
float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0;
|
||||
if (x_inter < x)
|
||||
if (x_inter < x)
|
||||
winding += (y0 < y1) ? 1 : -1;
|
||||
}
|
||||
}
|
||||
@@ -4345,7 +4345,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
|
||||
y1 = (int)verts[i ].y;
|
||||
if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) {
|
||||
float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0;
|
||||
if (x_inter < x)
|
||||
if (x_inter < x)
|
||||
winding += (y0 < y1) ? 1 : -1;
|
||||
}
|
||||
} else {
|
||||
@@ -4357,7 +4357,7 @@ static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex
|
||||
if (hits[1][0] < 0)
|
||||
winding += (hits[1][1] < 0 ? -1 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return winding;
|
||||
@@ -4438,7 +4438,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
|
||||
|
||||
// invert for y-downwards bitmaps
|
||||
scale_y = -scale_y;
|
||||
|
||||
|
||||
{
|
||||
int x,y,i,j;
|
||||
float *precompute;
|
||||
@@ -4587,7 +4587,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc
|
||||
STBTT_free(verts, info->userdata);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff)
|
||||
{
|
||||
@@ -4605,7 +4605,7 @@ STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata)
|
||||
//
|
||||
|
||||
// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string
|
||||
static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2)
|
||||
static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2)
|
||||
{
|
||||
stbtt_int32 i=0;
|
||||
|
||||
@@ -4644,7 +4644,7 @@ static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, s
|
||||
return i;
|
||||
}
|
||||
|
||||
static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2)
|
||||
static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2)
|
||||
{
|
||||
return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2);
|
||||
}
|
||||
@@ -4773,7 +4773,7 @@ STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset,
|
||||
|
||||
STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index)
|
||||
{
|
||||
return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index);
|
||||
return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index);
|
||||
}
|
||||
|
||||
STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data)
|
||||
@@ -4866,38 +4866,38 @@ This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
*/
|
||||
7897
lib/external/imgui/include/stb_image.h
vendored
Normal file
7897
lib/external/imgui/include/stb_image.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2875
lib/external/imgui/source/TextEditor.cpp
vendored
Normal file
2875
lib/external/imgui/source/TextEditor.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5075
lib/external/imgui/source/cimgui.cpp
vendored
Normal file
5075
lib/external/imgui/source/cimgui.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user