mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
Compare commits
735 Commits
alxsa-behi
...
b24cf08467
Author | SHA1 | Date | |
---|---|---|---|
|
b24cf08467 | ||
|
d8d73266bc | ||
|
356c2baec5 | ||
|
aea7042aa1 | ||
|
97944a5415 | ||
|
a5182a010f | ||
|
9c2c5ff183 | ||
|
f09007507f | ||
|
2b91551f4e | ||
|
4221bb76da | ||
|
cbe56ff388 | ||
|
7cec3f52b9 | ||
|
81c67e5614 | ||
|
67fa72a94e | ||
|
6587256c3a | ||
|
ad9dbf2c8b | ||
|
2f0bfc569b | ||
|
36330a271a | ||
|
baa4825880 | ||
|
8c910c2b6b | ||
|
a025cfe41b | ||
|
41035c7589 | ||
|
7275569079 | ||
|
dfafb7c6f2 | ||
|
25d1b7f8c3 | ||
|
0edf615333 | ||
|
daf23e1a50 | ||
|
b633b4b9c7 | ||
|
cfa3fd6bb7 | ||
|
669685d1d8 | ||
|
f032153596 | ||
|
13639b1d3d | ||
|
eb0bfe7bdb | ||
|
393ca59e79 | ||
|
3a698a05a1 | ||
|
f4a7da1ee3 | ||
|
bb9d8df855 | ||
|
78e68efd06 | ||
|
2fa82d51ee | ||
|
f223dae9fe | ||
|
9daf5d2e5d | ||
|
789af76a32 | ||
|
f9ba343558 | ||
|
014aa5ae6f | ||
|
47eac319b1 | ||
|
3bde6195f6 | ||
|
b0689f565b | ||
|
1e46438ced | ||
|
2b32496195 | ||
|
de62139894 | ||
|
f774ad7f16 | ||
|
f53a843c3d | ||
|
46d9a09698 | ||
|
355d695607 | ||
|
714e9041d8 | ||
|
24c8f86c85 | ||
|
f50145c155 | ||
|
7f8298467b | ||
|
23a9758a7b | ||
|
0af9261980 | ||
|
77d25750a7 | ||
|
155e951fa6 | ||
|
5a22a9b931 | ||
|
2187f0a49c | ||
|
91418131a0 | ||
|
645d23cd37 | ||
|
28fa2e5fc7 | ||
|
c13bf1af19 | ||
|
9337c55599 | ||
|
947995248a | ||
|
abcfbfbca5 | ||
|
b121ddd6f8 | ||
|
ba1de3b68e | ||
|
6552e3200d | ||
|
4d97212cf9 | ||
|
54b64252df | ||
|
c79db4c15a | ||
|
cecb937a0b | ||
|
fe4dbeb911 | ||
|
fdb4111e3f | ||
|
72533aaf8e | ||
|
ccc4eacac3 | ||
|
8e9b7bfce6 | ||
|
17552c0e11 | ||
|
f428089947 | ||
|
6260590cf4 | ||
|
c5e77fb8bb | ||
|
b50781730c | ||
|
2b669917c2 | ||
|
7d22110cfb | ||
|
86cc15cbf0 | ||
|
865e6363e1 | ||
|
789d82355c | ||
|
82cb3ae6fe | ||
|
1a7f673b7d | ||
|
8f57d4bdff | ||
|
aa9e437d42 | ||
|
ec4daa643e | ||
|
308963c271 | ||
|
4d0fef9482 | ||
|
d5f3fa77db | ||
|
dbf0c39bb3 | ||
|
56f72c24ba | ||
|
a0676125a1 | ||
|
c472800eae | ||
|
a9cab5d374 | ||
|
63b4d69e48 | ||
|
70bf795dfb | ||
|
a7c4320312 | ||
|
ae7bbbedbf | ||
|
5bc2f26cb0 | ||
|
cacb8d2035 | ||
|
c8ed51bb52 | ||
|
264a65e0b3 | ||
|
e27353216c | ||
|
49fc3ad0bd | ||
|
5b71d1a10d | ||
|
06bcef3273 | ||
|
17b23b6f26 | ||
|
413114f9d0 | ||
|
c2f0afb4bd | ||
|
b945d77ed7 | ||
|
7c04605d14 | ||
|
25edb3cc64 | ||
|
b773c3ac48 | ||
|
9551519f23 | ||
|
a9d2700631 | ||
|
5375ca63d5 | ||
|
78acdd8882 | ||
|
b5dda733dc | ||
|
e17567d001 | ||
|
4a0ea33bc5 | ||
|
a2d106e3fa | ||
|
4ebd340688 | ||
|
15f047f6c0 | ||
|
484d0fbcf4 | ||
|
b70186bc99 | ||
|
4a656a1db0 | ||
|
cb565344e9 | ||
|
c8971ac2ae | ||
|
3ec63979d8 | ||
|
c72e36c6a2 | ||
|
5ccc525281 | ||
|
84eaa94842 | ||
|
bc7cc0b698 | ||
|
602300ec8e | ||
|
64e276c3b5 | ||
|
96394377e6 | ||
|
a926e013da | ||
|
2d74278860 | ||
|
e1e4c0f400 | ||
|
5fc3c29f5c | ||
|
de4fb3470c | ||
|
ddfce634a8 | ||
|
527f4964fe | ||
|
be2e47114d | ||
|
11b81e25a4 | ||
|
4ca05cb38d | ||
|
bb9aad1e87 | ||
|
4dceeb174a | ||
|
9819457f31 | ||
|
7c947ef1af | ||
|
03beda6e2a | ||
|
a7d867c8bc | ||
|
6584f92748 | ||
|
593f0abf09 | ||
|
a734b4a3a4 | ||
|
0fd280db5c | ||
|
443d0a2f7b | ||
|
ed01c1b7f4 | ||
|
904f283932 | ||
|
9026d18039 | ||
|
8a5825b66f | ||
|
71caf7eb05 | ||
|
bf6092c728 | ||
|
6d74a880f9 | ||
|
1a953c5c73 | ||
|
1564efb519 | ||
|
3e96397770 | ||
|
c8cf2219ce | ||
|
2865aa7f03 | ||
|
013f9c7f0c | ||
|
8ea6e4031e | ||
|
69359a16c1 | ||
|
4d84ac748b | ||
|
1dcc8585ef | ||
|
8a3fb8c08e | ||
|
4509ec92f5 | ||
|
ee43316839 | ||
|
0782b9166b | ||
|
5a34856e38 | ||
|
9ec28cec54 | ||
|
d6d959c6c9 | ||
|
83c18ee0f2 | ||
|
5a5e0b6fee | ||
|
acf0920d82 | ||
|
58efcf6312 | ||
|
e3c8910da7 | ||
|
01c1949dd5 | ||
|
599a6c7afe | ||
|
16bb162894 | ||
|
65258d6183 | ||
|
6e80f98390 | ||
|
e18eaff1dc | ||
|
a4c780f6c9 | ||
|
0665e3fb5c | ||
|
9f9bf1003d | ||
|
8b560f835e | ||
|
2a9eb5aa66 | ||
|
002b22c150 | ||
|
d27c580144 | ||
|
4738472fcd | ||
|
4eb106f2bf | ||
|
53b18653bc | ||
|
2012eef75c | ||
|
fb31ddf322 | ||
|
0f309f9a8d | ||
|
05e90b1cde | ||
|
e4cb1e485e | ||
|
03f7cf58b8 | ||
|
5f4329d324 | ||
|
1a144f35a6 | ||
|
8287302b50 | ||
|
98dbff1e99 | ||
|
53a1d07ffd | ||
|
0191e0a485 | ||
|
fc4eb6730c | ||
|
459090836a | ||
|
81c844d2ca | ||
|
51ba945eb1 | ||
|
87def70e1e | ||
|
35257782ca | ||
|
238718b667 | ||
|
95cbadd277 | ||
|
88d6dfea04 | ||
|
6b1834ec9e | ||
|
10319fc883 | ||
|
624f049e66 | ||
|
0c5e5c0094 | ||
|
50978f18b6 | ||
|
cb4316d07a | ||
|
a530892fb5 | ||
|
ad3ec69183 | ||
|
6c1c497ce0 | ||
|
b1e52381f5 | ||
|
27a89a0c8a | ||
|
a636aea98d | ||
|
62727a654c | ||
|
2e05a4b1d9 | ||
|
0faa10ddd6 | ||
|
d16fe453b6 | ||
|
e5c04e449e | ||
|
8a3603828b | ||
|
4b252bddec | ||
|
b42ba20657 | ||
|
c5ddbf5732 | ||
|
1e5be02d8c | ||
|
cf9d39c3d7 | ||
|
1365b8a08b | ||
|
51ffd78d2a | ||
|
d985b9b377 | ||
|
760ef381fe | ||
|
19e230e9cb | ||
|
04622852fa | ||
|
2f6b75913b | ||
|
883498916a | ||
|
8e2a0381d7 | ||
|
c732dfd4ca | ||
|
38c379cd92 | ||
|
9a780bc7d4 | ||
|
db18d739e5 | ||
|
2c44689fe2 | ||
|
cc4821ffcb | ||
|
35b972c854 | ||
|
2a3d54bee9 | ||
|
c0d2a7fadd | ||
|
a5aaed7929 | ||
|
4ed035affd | ||
|
44d90a389e | ||
|
4f3aee5e83 | ||
|
9519901150 | ||
|
d8712a525b | ||
|
640fb89f13 | ||
|
24ca35625b | ||
|
769b911018 | ||
|
84b450b7bd | ||
|
4ec1368af9 | ||
|
520aeacd8c | ||
|
0fb3c8bb67 | ||
|
1f0f8d1a2c | ||
|
be667ac007 | ||
|
16a1283f07 | ||
|
1f79e4314e | ||
|
55627934c5 | ||
|
61c67d012b | ||
|
faf0fd7401 | ||
|
eeeaca928b | ||
|
73979309ab | ||
|
97bf7e1bfa | ||
|
95f1d768c3 | ||
|
66cdecb0fa | ||
|
8280058c5a | ||
|
2821dbab58 | ||
|
7c7587bb2d | ||
|
3e5fce27cb | ||
|
4128c789f9 | ||
|
0b8397ff56 | ||
|
9b0f426fbd | ||
|
674939e225 | ||
|
a60487aedd | ||
|
2dac66d979 | ||
|
f4a2158458 | ||
|
28bf061f4d | ||
|
0b5aa01bb9 | ||
|
f45244f991 | ||
|
39185d43ba | ||
|
6c86e80019 | ||
|
3e6fed839a | ||
|
6e91826865 | ||
|
20083bcabe | ||
|
ac63b1d8fb | ||
|
d1dca0a881 | ||
|
8a771a2a51 | ||
|
33f6117539 | ||
|
b80a2341cf | ||
|
3ad4b063b0 | ||
|
de2b54faa6 | ||
|
30d31ac709 | ||
|
5d308e9ed9 | ||
|
e52b49e0a3 | ||
|
565804f26e | ||
|
c734c0f33f | ||
|
1a96fb55f9 | ||
|
922e409045 | ||
|
3211ab1408 | ||
|
2c91604509 | ||
|
f02910d00f | ||
|
2346acbfc2 | ||
|
7764eab3f6 | ||
|
ca43c6f20c | ||
|
05cde48a3e | ||
|
4bf7ed4265 | ||
|
0aa7af0f11 | ||
|
d2beafd0e9 | ||
|
fa683ca0ce | ||
|
4fa0a63ca4 | ||
|
d2720dca0c | ||
|
d72bc4704e | ||
|
eb30705545 | ||
|
807e263b87 | ||
|
fae39c792d | ||
|
3290dd9b8f | ||
|
137bf01928 | ||
|
8f895aaa8c | ||
|
b4952addb9 | ||
|
5856941814 | ||
|
1e5639a47d | ||
|
e8b6f05659 | ||
|
6eaf357af9 | ||
|
da16988ee0 | ||
|
f9809354d5 | ||
|
ad03d6c94a | ||
|
f6704a84fa | ||
|
5c35946c51 | ||
|
6245e4ee70 | ||
|
0c6d7c15bc | ||
|
0d7cea41ad | ||
|
c63d7bc226 | ||
|
3d14a2652d | ||
|
8993939008 | ||
|
3c85dfe6e9 | ||
|
96be4a79d3 | ||
|
381bee5dbb | ||
|
0f12dcc772 | ||
|
293300cafd | ||
|
898ab7c9c6 | ||
|
f3a8e0c041 | ||
|
2b779c6a11 | ||
|
735ae9f123 | ||
|
09203bb93e | ||
|
1d5a1c9972 | ||
|
fb04b7cb8f | ||
|
6fe919c6e2 | ||
|
1c7a43a021 | ||
|
4b67eb9cd0 | ||
|
baa5e0690e | ||
|
ffa2946b18 | ||
|
8710127641 | ||
|
cfb1b539f2 | ||
|
11b35908fa | ||
|
6ddb33135c | ||
|
125e355c44 | ||
|
edc6f5a4b1 | ||
|
246d73de04 | ||
|
c2195a24ca | ||
|
977bcae71e | ||
|
31293376ee | ||
|
42e72b29c1 | ||
|
31a267a8f1 | ||
|
193cf720c6 | ||
|
94dcb39659 | ||
|
af6bb31f89 | ||
|
fe10197298 | ||
|
e67068d92f | ||
|
54f39cef6d | ||
|
ada86282de | ||
|
afb8867bce | ||
|
9f17f97198 | ||
|
41a464cb9a | ||
|
4a93a04a6b | ||
|
a1cd2a2588 | ||
|
60ed90e10a | ||
|
03443ffcc1 | ||
|
4f6036e3e6 | ||
|
20d37cbe45 | ||
|
949f9b586b | ||
|
ee50e5f1c7 | ||
|
4fb5857123 | ||
|
53f714f8bc | ||
|
52ffd75330 | ||
|
6a7911655b | ||
|
522d73a922 | ||
|
a5d282fc80 | ||
|
87f670b5d1 | ||
|
0022e9738e | ||
|
634dd304d7 | ||
|
d0af548894 | ||
|
a8934067a9 | ||
|
3b11006eed | ||
|
f333aa354b | ||
|
9a118dd887 | ||
|
f5518cd69a | ||
|
0570ea2b0b | ||
|
891e55829c | ||
|
b43e4df63f | ||
|
a6545f3511 | ||
|
b4eda82a93 | ||
|
3f13511015 | ||
|
d261d466e9 | ||
|
162725bd8c | ||
|
3d91452507 | ||
|
d8a264283b | ||
|
bb1d96528d | ||
|
ede124ff85 | ||
|
aa9aa9e489 | ||
|
f890c5ab68 | ||
|
9eee96328b | ||
|
634ebf97e7 | ||
|
79a92ce439 | ||
|
eefc2bea1a | ||
|
f7cfd4ef39 | ||
|
0c1963ca7c | ||
|
0868cf3cd3 | ||
|
bb26b9f81d | ||
|
052eb474cc | ||
|
abf026fc54 | ||
|
9bf03bc8f6 | ||
|
202ae26c80 | ||
|
973ae3eef2 | ||
|
b04841d993 | ||
|
437ba0aa46 | ||
|
caa0df8e22 | ||
|
5b765fc665 | ||
|
f5fa753dc2 | ||
|
d59c230560 | ||
|
3e9585839e | ||
|
a6b09d8029 | ||
|
56a5dea720 | ||
|
c3079a7ad4 | ||
|
50e96b181f | ||
|
c35abbe090 | ||
|
6211ec8d2c | ||
|
1730c62187 | ||
|
ff157df094 | ||
|
03172b7196 | ||
|
e5260cd60f | ||
|
56838c1194 | ||
|
841b5ddfb9 | ||
|
0d50753cca | ||
|
6cc054ee4e | ||
|
bbb0be8413 | ||
|
92c096d699 | ||
|
9308de3137 | ||
|
946a362d9b | ||
|
decc8dec6c | ||
|
048c86ffcf | ||
|
8470ec8b10 | ||
|
f35cc4693c | ||
|
632cbd9ed3 | ||
|
5b97d96349 | ||
|
b24fc1b74b | ||
|
ebec92aec7 | ||
|
861e406393 | ||
|
b65bd2bd4c | ||
|
2e12de6747 | ||
|
9f789e68d5 | ||
|
6124b56b3e | ||
|
839064a6c6 | ||
|
56cc7e363b | ||
|
aee3bd23d6 | ||
|
c3d01854b3 | ||
|
d932d02fbe | ||
|
4255227fff | ||
|
a87ee3c241 | ||
|
124993d770 | ||
|
ff9a14b7d0 | ||
|
f96a7192cd | ||
|
d4aac4a3e5 | ||
|
5da4b89002 | ||
|
b960be9735 | ||
|
2d57b1764d | ||
|
6651d4eb7f | ||
|
795cf081cc | ||
|
7fad4ad323 | ||
|
9e2b378414 | ||
|
92e68453df | ||
|
c114e96096 | ||
|
b4e27fbf83 | ||
|
33dfccde51 | ||
|
2f87f8e51e | ||
|
6574f6ff30 | ||
|
92150e07ba | ||
|
37ff61d0ac | ||
|
d0d4c769e3 | ||
|
aa0a25d82a | ||
|
cb13ce0da3 | ||
|
f520df6f4a | ||
|
3a2d9c477e | ||
|
261f407008 | ||
|
d9b9a7f8bd | ||
|
4514e61fd1 | ||
|
e3b58d5180 | ||
|
67dcac45ef | ||
|
2a106339c5 | ||
|
27fead082a | ||
|
2265f823fd | ||
|
8d598c1c52 | ||
|
c72fe4ef11 | ||
|
3bf6aaa0fa | ||
|
1b49b83078 | ||
|
35383741f1 | ||
|
b49f4a3631 | ||
|
d5d6b5e726 | ||
|
771fcb576f | ||
|
0f91efa3d5 | ||
|
bf03d71ad2 | ||
|
943e418055 | ||
|
228a0f9e72 | ||
|
855d07193b | ||
|
bca8540d40 | ||
|
3969c002ee | ||
|
6645f245cb | ||
|
d22ae667e0 | ||
|
4a9b98fc05 | ||
|
19e83a0eb5 | ||
|
877d5b0c1a | ||
|
8e11b1bfb4 | ||
|
780e848120 | ||
|
f0ff4a9098 | ||
|
e9b2b1ad7b | ||
|
7e280c9b58 | ||
|
007e8e6615 | ||
|
d65d55d64a | ||
|
b85f517c22 | ||
|
7f70656c05 | ||
|
b89ae68d07 | ||
|
e1b2b44f3b | ||
|
34285d4459 | ||
|
0f09167e50 | ||
|
fa19794d74 | ||
|
bf096c5174 | ||
|
1ec86c7d6a | ||
|
bd33d8dd7e | ||
|
170bd79572 | ||
|
b7163f0715 | ||
|
1a9bea59f1 | ||
|
3c02c8bcb7 | ||
|
a65440478c | ||
|
211d415f1c | ||
|
a960e8f4d1 | ||
|
56e8275690 | ||
|
c25418f38a | ||
|
effedb9248 | ||
|
f157206146 | ||
|
59ab053ab9 | ||
|
04fa596dd1 | ||
|
f767cdb771 | ||
|
8766a228af | ||
|
d58b17cb10 | ||
|
4e0dd10341 | ||
|
494f3a1452 | ||
|
2e5ac18d78 | ||
|
c860ffe2a8 | ||
|
9a1984a707 | ||
|
d2a7586b67 | ||
|
863152f1af | ||
|
d6766cc374 | ||
|
629d9ebe67 | ||
|
687382b98d | ||
|
a2c6667c69 | ||
|
e9090f9b55 | ||
|
f989b4f50c | ||
|
7e68ad6ffd | ||
|
836cabe0a6 | ||
|
a65d7a64a2 | ||
|
ba31ef35d4 | ||
|
778f81984f | ||
|
ba60cab0a6 | ||
|
cdcdda4060 | ||
|
98a1009c4a | ||
|
3b6bb46d36 | ||
|
33bfd5a12b | ||
|
bf4cfd9932 | ||
|
f85f9e6497 | ||
|
6c6253223d | ||
|
40adbff456 | ||
|
8277817b62 | ||
|
3d9e95a2f4 | ||
|
a269410d6b | ||
|
6ab5402195 | ||
|
74617fc63a | ||
|
c8be1d9817 | ||
|
867dd017fb | ||
|
4a9b772689 | ||
|
7ea10c6475 | ||
|
78186c7a16 | ||
|
05f85e79d1 | ||
|
7f7ee96717 | ||
|
a9f5694906 | ||
|
893f268e60 | ||
|
a3aca3c171 | ||
|
69e9efe534 | ||
|
43de81fb25 | ||
|
ce5efe29d6 | ||
|
74d79ba0c6 | ||
|
4694c9178a | ||
|
faca688dba | ||
|
00c08e81d4 | ||
|
caa61e5925 | ||
|
5a68c4b9b6 | ||
|
09e8e45d07 | ||
|
bbe5c16862 | ||
|
4022a123e9 | ||
|
88d6c95ef4 | ||
|
27f0594ef6 | ||
|
df880e3da9 | ||
|
5c9a950752 | ||
|
caf460177a | ||
|
ed1d4a37a0 | ||
|
6b69fca88d | ||
|
4985991552 | ||
|
db10cdab26 | ||
|
4ae861f5ac | ||
|
6c44745861 | ||
|
c35dbcfc3b | ||
|
84186a932b | ||
|
e1184f8d58 | ||
|
2e390fee01 | ||
|
c1c5c82683 | ||
|
d0455ffda3 | ||
|
07ef945646 | ||
|
e9ea400eee | ||
|
34ab2099bb | ||
|
a221a7006c | ||
|
dbdc9bc43c | ||
|
3b6a2138a7 | ||
|
bcad28a5d1 | ||
|
aebbbd1142 | ||
|
374c94434b | ||
|
5f80a4ee9b | ||
|
029cd0ea5e | ||
|
0794087a67 | ||
|
bd6218a12f | ||
|
bc095d5c83 | ||
|
d731a8fc0d | ||
|
b416994ed0 | ||
|
a7be8ec6cd | ||
|
c5427bec21 | ||
|
8a2dd28082 | ||
|
4faa5a6153 | ||
|
70eb95bff8 | ||
|
e0b2bcba27 | ||
|
901d1cd9d9 | ||
|
f7ef01f44a | ||
|
79374e0bc1 | ||
|
75aa40f3cb | ||
|
ed896b069d | ||
|
fc68405c45 | ||
|
74e0f1d87e | ||
|
f78475b594 | ||
|
ea61460c6f | ||
|
80f9caf418 | ||
|
cc76f4d459 | ||
|
96c78dcf9c | ||
|
9bb39b7cf4 | ||
|
d7687ee7e6 | ||
|
9e1c1e314a | ||
|
2aee80b77f | ||
|
215fcc9652 | ||
|
df0edc982a | ||
|
7c949960a4 | ||
|
df8063c861 | ||
|
f99415c281 | ||
|
db8ead54f8 | ||
|
0551b4be1d | ||
|
a066a27f86 | ||
|
83dcd00794 | ||
|
180736f772 | ||
|
3c7dd6db3b | ||
|
94aa995711 | ||
|
f4bdd69f73 | ||
|
7b03ca6fd1 | ||
|
b3d7d9b8df | ||
|
2a55604e6f | ||
|
619b321141 | ||
|
5af0758994 | ||
|
ae076dd584 | ||
|
b4efde182d | ||
|
4c76ea387a | ||
|
963dde2b08 | ||
|
fe4cbb6512 | ||
|
40e147af11 | ||
|
0f79d3e850 | ||
|
daea3c2298 | ||
|
1376d25453 | ||
|
65949e731c | ||
|
3a2ca2b6ff | ||
|
ab6569168a | ||
|
8e85e98b1c | ||
|
d40b2552c7 | ||
|
8cb4c382eb | ||
|
99ce27af43 | ||
|
d7ec15ce75 | ||
|
0de80db0d0 | ||
|
373dab8ee1 |
586
.gitlab-ci.yml
586
.gitlab-ci.yml
@@ -3,8 +3,9 @@ spec:
|
||||
distribution_pipeline:
|
||||
description: 'Pipelines that creates installable GIMP'
|
||||
options:
|
||||
- GIMP_CI_APPIMAGE #trigger the appimage making.
|
||||
- GIMP_CI_APPIMAGE #trigger the appimage making (base & fast).
|
||||
- GIMP_CI_FLATPAK #trigger the flatpak build and publishing (base but slow)
|
||||
- GIMP_CI_SNAP #trigger the snap build (base but slow)
|
||||
- GIMP_CI_WIN_INSTALLER #trigger all native MSYS2 builds then creates Inno Windows installer (base but slow)
|
||||
- GIMP_CI_MS_STORE #trigger arm64 and x64 native MSYS2 builds then creates a .msixbundle (base but slow)
|
||||
- none
|
||||
@@ -12,7 +13,7 @@ spec:
|
||||
test_pipeline:
|
||||
description: 'Pipelines used only for testing'
|
||||
options:
|
||||
- GIMP_CI_MESON_GCC #trigger the Debian GCC build (rare usefulness)
|
||||
- GIMP_CI_MESON_CLANG #trigger the Debian Clang build (rare usefulness)
|
||||
- GIMP_CI_RASTER_ICONS #trigger the Debian Clang build without vector icons (rare usefulness)
|
||||
- GIMP_CI_CPPCHECK #trigger cppcheck (static code analysis)
|
||||
- none
|
||||
@@ -29,7 +30,8 @@ workflow:
|
||||
##################################################
|
||||
|
||||
## 1. On MERGE REQUESTS, the following are triggered:
|
||||
## - Abbreviated Linux Clang build (base & fast)
|
||||
## - Abbreviated Linux build
|
||||
## - Building quality tests (static code analysis)
|
||||
## - clang-format (static code analysis)
|
||||
## - Execution tests (dynamic code analysis)
|
||||
.pipeline_merge: &CI_MERGE
|
||||
@@ -42,20 +44,22 @@ workflow:
|
||||
# GitLab is quite sensitive about rules 'if' order so be careful
|
||||
|
||||
## 3. On COMMITS except tags.
|
||||
## - Linux Clang build (base & fast)
|
||||
## - Linux build
|
||||
## - Building quality tests (static code analysis)
|
||||
## - Execution tests (dynamic code analysis)
|
||||
## - Source tarball (base & fast)
|
||||
## - Developer documentation (base & fast)
|
||||
## - Source tarball
|
||||
## - Developer documentation
|
||||
.pipeline_commit: &CI_COMMIT
|
||||
if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_TAG == null'
|
||||
interruptible: true
|
||||
variables: {}
|
||||
|
||||
## 4. RELEASES.
|
||||
## - Source tarball (base & fast)
|
||||
## - Developer documentation (base & fast)
|
||||
## - Inno Windows installer (base but slow)
|
||||
## - MS Store .msixupload (base but slow)
|
||||
## - Source tarball
|
||||
## - Developer documentation
|
||||
## - Linux .appimage
|
||||
## - Inno Windows installer
|
||||
## - MS Store .msixupload
|
||||
.pipeline_release: &CI_RELEASE
|
||||
if: '$CI_COMMIT_TAG != null'
|
||||
interruptible: false
|
||||
@@ -76,10 +80,12 @@ workflow:
|
||||
- 'runner_system_failure'
|
||||
- 'scheduler_failure'
|
||||
needs: []
|
||||
# Default Docker image (unless otherwise defined)
|
||||
image: debian:${DEB_VERSION}
|
||||
# Default Docker image (keep variables: DEB_VERSION: consistent with devel-docs/os-support.txt)
|
||||
image: $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}
|
||||
variables:
|
||||
DEB_VERSION: "bookworm"
|
||||
UMFPACK: libumfpack5
|
||||
RUNNER: "x86_64_v3"
|
||||
# Common cloning procedure
|
||||
GIT_DEPTH: "1"
|
||||
GIT_SUBMODULE_STRATEGY: none
|
||||
@@ -93,37 +99,40 @@ workflow:
|
||||
|
||||
stages:
|
||||
- dependencies
|
||||
- gimp
|
||||
- build
|
||||
- analysis
|
||||
- distribution
|
||||
|
||||
## AppImage CI (Debian) ##
|
||||
.debian:
|
||||
|
||||
## Common GNU/Linux 64-bit CI (Debian) ##
|
||||
.debian-nonreloc:
|
||||
extends: .default
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:AppImage.*/'
|
||||
interruptible: true
|
||||
- if: '$GIMP_CI_APPIMAGE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_APPIMAGE.*/'
|
||||
- <<: *CI_MERGE
|
||||
- <<: *CI_COMMIT
|
||||
variables: {}
|
||||
- if: '$GIMP_CI_MESON_CLANG != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_CLANG.*/'
|
||||
variables:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
CC_LD: lld
|
||||
CXX_LD: lld
|
||||
TOOLCHAIN: "clang lld"
|
||||
VARIANT: -clang
|
||||
- if: '$GIMP_CI_RASTER_ICONS != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_RASTER_ICONS.*/'
|
||||
variables:
|
||||
MESON_OPTIONS: "-Dvector-icons=false"
|
||||
VARIANT: "-raster"
|
||||
- <<: *CI_RELEASE
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: [aarch64, x86_64_v2]
|
||||
tags:
|
||||
- $RUNNER
|
||||
image: $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}
|
||||
variables:
|
||||
CC: "clang"
|
||||
CXX: "clang++"
|
||||
CC_LD: lld
|
||||
CXX_LD: lld
|
||||
before_script:
|
||||
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install-${RUNNER}"
|
||||
timeout: 20m
|
||||
timeout: 30m
|
||||
|
||||
.debian_environ: &ENVIRON
|
||||
# See: https://testing.developer.gimp.org/core/setup/build/#preparing-for-building
|
||||
- printf "\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\n"
|
||||
- gcc -print-multi-os-directory 2>/dev/null | grep ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
|
||||
- gcc -print-multiarch 2>/dev/null | grep . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/')
|
||||
- gcc -print-multi-os-directory 2>/dev/null | grep -q ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
|
||||
- gcc -print-multiarch 2>/dev/null | grep -q . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/') || export LIB_SUBDIR=
|
||||
## Build-time vars
|
||||
- export PKG_CONFIG_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
- export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
|
||||
@@ -133,44 +142,37 @@ stages:
|
||||
- export GI_TYPELIB_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
|
||||
- printf "\e[0Ksection_end:`date +%s`:environ\r\e[0K\n"
|
||||
|
||||
deps-debian:
|
||||
extends: .debian
|
||||
deps-debian-nonreloc:
|
||||
extends: .debian-nonreloc
|
||||
stage: dependencies
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
entrypoint: [""]
|
||||
image: quay.io/buildah/stable
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
UMFPACK: libumfpack5
|
||||
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
|
||||
script:
|
||||
- export container=docker
|
||||
- mkdir -p /kaniko/.docker
|
||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- export BUILDAH_FORMAT=docker
|
||||
- export STORAGE_DRIVER=vfs
|
||||
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
||||
# Install deps
|
||||
- echo "FROM debian:${DEB_VERSION}" > Dockerfile
|
||||
- echo "WORKDIR $CI_PROJECT_DIR" >> Dockerfile
|
||||
- echo "RUN printf \"\e[0Ksection_start:0000000001:deps_install[collapsed=true]\r\e[0KInstalling dependencies provided by Debian $DEB_VERSION\n\"" >> Dockerfile
|
||||
- echo "RUN apt-get update -qq" >> Dockerfile
|
||||
## 'ca-certificates' is NOT a gimp dep, it is installed only to our Docker image work
|
||||
- echo "RUN apt-get install -qq -y --no-install-recommends ca-certificates" >> Dockerfile
|
||||
## Build-time only dependencies
|
||||
- echo "RUN apt-get install -qq -y --no-install-recommends \\" >> Dockerfile
|
||||
- echo "appstream
|
||||
- echo "${TOOLCHAIN:-build-essential}
|
||||
appstream
|
||||
bison
|
||||
ccache
|
||||
clang
|
||||
desktop-file-utils
|
||||
flex
|
||||
gi-docgen
|
||||
git
|
||||
gobject-introspection
|
||||
libgtk-3-bin
|
||||
lld
|
||||
meson
|
||||
valac
|
||||
xauth
|
||||
xsltproc
|
||||
xvfb" >> Dockerfile
|
||||
xsltproc" >> Dockerfile
|
||||
## Runtime dependencies
|
||||
- echo "RUN apt-get install -qq -y --no-install-recommends \\" >> Dockerfile
|
||||
- echo "at-spi2-core
|
||||
@@ -180,9 +182,10 @@ deps-debian:
|
||||
glib-networking
|
||||
graphviz
|
||||
graphviz-dev
|
||||
gvfs
|
||||
iso-codes
|
||||
libaa1-dev
|
||||
libappstream-glib-dev
|
||||
libappstream-dev
|
||||
libarchive-dev
|
||||
libbz2-dev
|
||||
libcfitsio-dev
|
||||
@@ -193,6 +196,7 @@ deps-debian:
|
||||
libgtk-3-dev
|
||||
libgudev-1.0-dev
|
||||
libheif-dev
|
||||
$LIBHEIF_PLUGINS
|
||||
libjson-glib-dev
|
||||
libjxl-dev
|
||||
liblcms2-dev
|
||||
@@ -205,9 +209,7 @@ deps-debian:
|
||||
libopenjp2-7-dev
|
||||
libpoppler-glib-dev
|
||||
libqoi-dev
|
||||
libraw-dev
|
||||
librsvg2-dev
|
||||
libspiro-dev
|
||||
libsuitesparse-dev
|
||||
libtiff-dev
|
||||
$UMFPACK
|
||||
@@ -225,33 +227,34 @@ deps-debian:
|
||||
# Prepare environ
|
||||
- echo "FROM $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}" > Dockerfile2;
|
||||
- echo "RUN printf \"\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\n\"" >> Dockerfile2;
|
||||
- export LIB_DIR="lib";
|
||||
- export LIB_SUBDIR=$([ "$(uname -m)" = 'aarch64' ] && echo "aarch64-linux-gnu/" || echo "x86_64-linux-gnu/");
|
||||
- echo "ENV PKG_CONFIG_PATH=\"${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}\"" >> Dockerfile2;
|
||||
- echo "ENV PKG_CONFIG_PATH=\"${GIMP_PREFIX}/lib/$([ "$(uname -m)" = 'aarch64' ] && echo "aarch64-linux-gnu/" || echo "x86_64-linux-gnu/")pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}\"" >> Dockerfile2;
|
||||
- echo "ENV XDG_DATA_DIRS=\"${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}\"" >> Dockerfile2;
|
||||
- echo "ENV CC=\"$CC\"" >> Dockerfile2;
|
||||
- echo "ENV CXX=\"$CXX\"" >> Dockerfile2;
|
||||
- echo "ENV CC_LD=\"$CC_LD\"" >> Dockerfile2;
|
||||
- echo "ENV CXX_LD=\"$CXX_LD\"" >> Dockerfile2;
|
||||
- if [ "$VARIANT" = "-clang" ]; then
|
||||
echo "ENV CC=\"$CC\"" >> Dockerfile2;
|
||||
echo "ENV CXX=\"$CXX\"" >> Dockerfile2;
|
||||
echo "ENV CC_LD=\"$CC_LD\"" >> Dockerfile2;
|
||||
echo "ENV CXX_LD=\"$CXX_LD\"" >> Dockerfile2;
|
||||
fi
|
||||
- echo "ENV CLICOLOR_FORCE=\"1\"" >> Dockerfile2;
|
||||
- echo "RUN printf \"\e[0Ksection_end:`date +%s`:environ\r\e[0K\n\"" >> Dockerfile2;
|
||||
# Build some dependencies
|
||||
## Build babl
|
||||
- echo "RUN printf \"\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl\n\"" >> Dockerfile2;
|
||||
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" $CI_PROJECT_DIR/babl >> Dockerfile2;
|
||||
- echo "RUN meson setup $CI_PROJECT_DIR/babl/_build-${RUNNER} $CI_PROJECT_DIR/babl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION" >> Dockerfile2;
|
||||
- echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER}" >> Dockerfile2;
|
||||
- echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER} install" >> Dockerfile2;
|
||||
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" babl >> Dockerfile2;
|
||||
- echo "RUN meson setup babl/_build-${RUNNER} babl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION" >> Dockerfile2;
|
||||
- echo "RUN ninja -C babl/_build-${RUNNER}" >> Dockerfile2;
|
||||
- echo "RUN ninja -C babl/_build-${RUNNER} install" >> Dockerfile2;
|
||||
- echo "RUN printf \"\e[0Ksection_end:`date +%s`:babl_build\r\e[0K\n\"" >> Dockerfile2;
|
||||
## Build GEGL
|
||||
- echo "RUN printf \"\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl\n\"" >> Dockerfile2;
|
||||
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/gegl.git | grep -oi \"GEGL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git" $CI_PROJECT_DIR/gegl >> Dockerfile2;
|
||||
- echo "RUN meson setup $CI_PROJECT_DIR/gegl/_build-${RUNNER} $CI_PROJECT_DIR/gegl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION $WORKSHOP_OPTION" >> Dockerfile2;
|
||||
- echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER}" >> Dockerfile2;
|
||||
- echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER} install" >> Dockerfile2;
|
||||
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/gegl.git | grep -oi \"GEGL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git" gegl >> Dockerfile2;
|
||||
- echo "RUN meson setup gegl/_build-${RUNNER} gegl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION -Dworkshop=true" >> Dockerfile2;
|
||||
- echo "RUN ninja -C gegl/_build-${RUNNER}" >> Dockerfile2;
|
||||
- echo "RUN ninja -C gegl/_build-${RUNNER} install" >> Dockerfile2;
|
||||
- echo "RUN printf \"\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K\n\"" >> Dockerfile2;
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} --cache=true --cache-ttl=120h --image-fs-extract-retry 1 --verbosity=warn
|
||||
- if [ -f 'Dockerfile2' ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile2 --destination build-debian-${DEB_VERSION}-${RUNNER}-temp --cache=false --no-push --verbosity=warn; fi
|
||||
#FIXME: '2>&1 | grep -v STEP' since buildah is too verbose. See: https://github.com/containers/buildah/issues/6362
|
||||
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile --tag $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} --layers --cache-from $CI_REGISTRY_IMAGE/cache --cache-to $CI_REGISTRY_IMAGE/cache --cache-ttl=120h 2>&1 | grep -v STEP && buildah push --log-level error $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} 2>&1 | grep -v STEP
|
||||
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile2 --no-cache 2>&1 | grep -v STEP
|
||||
artifacts:
|
||||
paths:
|
||||
- _install-${RUNNER}/
|
||||
@@ -261,17 +264,95 @@ deps-debian:
|
||||
- gegl/_build-${RUNNER}/config.h
|
||||
expire_in: 2 hours
|
||||
|
||||
gimp-debian-nonreloc:
|
||||
extends: .debian-nonreloc
|
||||
needs: ["deps-debian-nonreloc"]
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- *ENVIRON
|
||||
# Check building
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP\n"
|
||||
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
|
||||
-Dfile-plug-ins-test=true
|
||||
$MESON_OPTIONS
|
||||
- cd _build-${RUNNER}
|
||||
- ninja
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K\n"
|
||||
# Check execution
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_test[collapsed=true]\r\e[0KTesting GIMP execution\n"
|
||||
- ninja test
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_test\r\e[0K\n"
|
||||
# Check source
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_tar[collapsed=true]\r\e[0KChecking GIMP source\n"
|
||||
- if [ $(git diff |wc -l) -ne 0 ]; then
|
||||
printf "ERROR. A generated file was updated without the source:\n";
|
||||
git diff;
|
||||
exit 1;
|
||||
fi
|
||||
- if [ "$VARIANT" != "-clang" ] && [ "$VARIANT" != "-raster" ] && [ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]; then
|
||||
ninja dist > ninja_dist.log 2>&1 || { cat ninja_dist.log; exit 1; };
|
||||
fi
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_tar\r\e[0K\n"
|
||||
# Check install
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_install[collapsed=true]\r\e[0KChecking GIMP installation\n"
|
||||
- ninja install > ninja_install.log 2>&1 || { cat ninja_install.log; exit 1; };
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K\n"
|
||||
artifacts:
|
||||
paths:
|
||||
- _install-${RUNNER}/
|
||||
- _build-${RUNNER}/meson-logs/meson-log.txt
|
||||
- _build-${RUNNER}/meson-dist/
|
||||
- _build-${RUNNER}/config.h
|
||||
reports:
|
||||
junit: "_build-${RUNNER}/meson-logs/testlog.junit.xml"
|
||||
expire_in: 2 days
|
||||
|
||||
|
||||
## AppImage CI (Debian) ##
|
||||
.debian:
|
||||
extends: .debian-nonreloc
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:AppImage.*/'
|
||||
interruptible: true
|
||||
- if: '$GIMP_CI_APPIMAGE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_APPIMAGE.*/'
|
||||
- <<: *CI_RELEASE
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: [aarch64, x86_64_v3]
|
||||
tags:
|
||||
- $RUNNER
|
||||
variables:
|
||||
#FIXME: remove this variables: key and go back to relying on .default DEB_VERSION on GIMP 3.3/3.4
|
||||
DEB_VERSION: "trixie"
|
||||
UMFPACK: libumfpack6
|
||||
LIBHEIF_PLUGINS: "libheif-plugin-dav1d libheif-plugin-aomenc libheif-plugin-libde265 libheif-plugin-x265 libheif-plugin-j2kdec libheif-plugin-j2kenc"
|
||||
|
||||
deps-debian:
|
||||
extends: .debian
|
||||
stage: !reference [deps-debian-nonreloc, stage]
|
||||
image: !reference [deps-debian-nonreloc, image]
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
|
||||
script:
|
||||
- !reference [deps-debian-nonreloc, script]
|
||||
artifacts: !reference [deps-debian-nonreloc, artifacts]
|
||||
|
||||
gimp-debian:
|
||||
extends: .debian
|
||||
needs: ["deps-debian"]
|
||||
stage: gimp
|
||||
stage: !reference [gimp-debian-nonreloc, stage]
|
||||
variables:
|
||||
#FIXME: remove this variables: key and go back to relying on gimp-debian-nonreloc variables: on GIMP 3.3/3.4
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- *ENVIRON
|
||||
# Build GIMP
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP\n"
|
||||
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
|
||||
-Dgi-docgen=disabled
|
||||
-Dpkgconfig.relocatable=true
|
||||
-Drelocatable-bundle=yes
|
||||
-Dcheck-update=yes
|
||||
@@ -294,131 +375,122 @@ gimp-debian:
|
||||
expire_in: 2 days
|
||||
|
||||
|
||||
## GNU/Linux 64-bit CIs (Debian) ##
|
||||
.debian-x64:
|
||||
extends: .debian
|
||||
rules:
|
||||
- <<: *CI_MERGE
|
||||
- <<: *CI_COMMIT
|
||||
- if: '$GIMP_CI_MESON_CLANG != null'
|
||||
variables: {}
|
||||
- if: '$GIMP_CI_MESON_GCC != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_GCC.*/'
|
||||
variables:
|
||||
CC: "cc"
|
||||
CXX: "c++"
|
||||
CC_LD: bfd
|
||||
CXX_LD: bfd
|
||||
VARIANT: "-gcc"
|
||||
- if: '$GIMP_CI_RASTER_ICONS != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_RASTER_ICONS.*/'
|
||||
variables:
|
||||
MESON_OPTIONS: "-Dvector-icons=false"
|
||||
VARIANT: "-raster"
|
||||
- if: '$GIMP_CI_SOURCES != null'
|
||||
- <<: *CI_RELEASE
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: x86_64_v2
|
||||
tags: []
|
||||
|
||||
deps-debian-x64:
|
||||
extends: .debian-x64
|
||||
stage: !reference [deps-debian, stage]
|
||||
image: !reference [deps-debian, image]
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
WORKSHOP_OPTION: '-Dworkshop=true'
|
||||
script:
|
||||
- !reference [deps-debian, script]
|
||||
artifacts: !reference [deps-debian, artifacts]
|
||||
|
||||
gimp-debian-x64:
|
||||
extends: .debian-x64
|
||||
needs: ["deps-debian-x64"]
|
||||
stage: !reference [gimp-debian, stage]
|
||||
variables: !reference [gimp-debian, variables]
|
||||
script:
|
||||
- *ENVIRON
|
||||
# Check building
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP\n"
|
||||
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
|
||||
-Dfile-plug-ins-test=true
|
||||
$MESON_OPTIONS
|
||||
- cd _build-${RUNNER}
|
||||
- ninja
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K\n"
|
||||
# Check execution
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_test[collapsed=true]\r\e[0KTesting GIMP execution\n"
|
||||
- ninja test
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_test\r\e[0K\n"
|
||||
# Check source
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_tar[collapsed=true]\r\e[0KChecking GIMP source\n"
|
||||
- if [ $(git diff |wc -l) -ne 0 ]; then
|
||||
printf "ERROR. A generated file was updated without the source:\n";
|
||||
git diff;
|
||||
exit 1;
|
||||
fi
|
||||
- if [ "$VARIANT" != "-gcc" ] && [ "$VARIANT" != "-raster" ] && [ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]; then
|
||||
ninja dist > ninja_dist.log 2>&1 || { cat ninja_dist.log; exit 1; };
|
||||
fi
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_tar\r\e[0K\n"
|
||||
# Check install
|
||||
- printf "\e[0Ksection_start:`date +%s`:gimp_install[collapsed=true]\r\e[0KChecking GIMP installation\n"
|
||||
- ninja install > ninja_install.log 2>&1 || { cat ninja_install.log; exit 1; };
|
||||
- printf "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K\n"
|
||||
artifacts:
|
||||
paths:
|
||||
- _install-${RUNNER}/
|
||||
- _build-${RUNNER}/meson-logs/meson-log.txt
|
||||
- _build-${RUNNER}/meson-dist/
|
||||
- _build-${RUNNER}/config.h
|
||||
reports:
|
||||
junit: "_build-${RUNNER}/meson-logs/testlog.junit.xml"
|
||||
expire_in: 2 days
|
||||
|
||||
|
||||
## Flatpak CI ##
|
||||
.flatpak-x64:
|
||||
## Flatpak CI (Fedora) ##
|
||||
.flatpak:
|
||||
extends: .default
|
||||
#We need to specify this since .flatpak from flatpak_ci_initiative.yml sets to true
|
||||
interruptible: false
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Flatpak.*/'
|
||||
interruptible: true
|
||||
- if: '$GIMP_CI_FLATPAK != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_FLATPAK.*/'
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: [flatpak-aarch64, flatpak-x86_64]
|
||||
tags:
|
||||
- flatpak
|
||||
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
|
||||
- $RUNNER
|
||||
image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master
|
||||
variables:
|
||||
RUN_TESTS: 0
|
||||
MESON_DIST: 0
|
||||
before_script:
|
||||
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install"
|
||||
timeout: 40m
|
||||
timeout: 30m
|
||||
|
||||
deps-flatpak-x64:
|
||||
extends: .flatpak-x64
|
||||
deps-flatpak:
|
||||
extends: .flatpak
|
||||
stage: dependencies
|
||||
#https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1502
|
||||
#cache:
|
||||
#key: ${CI_JOB_NAME_SLUG}
|
||||
#paths:
|
||||
#- .flatpak-builder/
|
||||
script:
|
||||
- sh build/linux/flatpak/1_build-deps-flatpak.sh
|
||||
- sh build/linux/flatpak/1_build-deps-flatpakbuilder.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- .flatpak-builder.tar
|
||||
- flatpak-builder.log
|
||||
- _build-$RUNNER.tar.zst
|
||||
- babl-meson-log.tar
|
||||
- gegl-meson-log.tar
|
||||
expire_in: 2 hours
|
||||
|
||||
gimp-flatpak-x64:
|
||||
extends: .flatpak-x64
|
||||
needs: ["deps-flatpak-x64"]
|
||||
stage: gimp
|
||||
gimp-flatpak:
|
||||
extends: .flatpak
|
||||
needs: ["deps-flatpak"]
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- sh build/linux/flatpak/2_build-gimp-flatpak.sh
|
||||
- sh build/linux/flatpak/2_build-gimp-flatpakbuilder.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- repo.tar
|
||||
- temp*.flatpak
|
||||
- repo*.tar
|
||||
- gimp-flatpak-builder.log
|
||||
- gimp-meson-log.tar
|
||||
expire_in: 2 days
|
||||
|
||||
|
||||
## Snap CI (Ubuntu) ##
|
||||
.snap:
|
||||
extends: .default
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Snap.*/'
|
||||
interruptible: true
|
||||
- if: '$GIMP_CI_SNAP != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_SNAP.*/'
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: [aarch64, x86_64_v3]
|
||||
tags:
|
||||
- $RUNNER
|
||||
image: $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER}
|
||||
variables:
|
||||
SNAPCRAFT_BASE_VERSION: "8_core24"
|
||||
RUNNER: x86_64_v3
|
||||
timeout: 30m
|
||||
|
||||
deps-snap:
|
||||
extends: .snap
|
||||
stage: dependencies
|
||||
image: quay.io/buildah/stable
|
||||
script:
|
||||
- export BUILDAH_FORMAT=docker
|
||||
- export STORAGE_DRIVER=vfs
|
||||
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
||||
# Install deps
|
||||
- echo "FROM ghcr.io/canonical/snapcraft:${SNAPCRAFT_BASE_VERSION}" > Dockerfile
|
||||
- echo "ENTRYPOINT [\"\"]" >> Dockerfile
|
||||
- echo "WORKDIR $CI_PROJECT_DIR" >> Dockerfile
|
||||
- echo "ENV GITLAB_CI=1" >> Dockerfile
|
||||
- echo "ENV RUNNER=$RUNNER" >> Dockerfile
|
||||
- echo "RUN apt-get update -y" >> Dockerfile
|
||||
- echo "RUN apt-get install -y curl jq squashfs-tools sudo" >> Dockerfile
|
||||
# https://github.com/canonical/snapcraft-rocks/issues/37
|
||||
- echo "RUN cp -r /usr/lib/python3.*/site-packages/extensions/* /usr/share/snapcraft/extensions/" >> Dockerfile
|
||||
# https://github.com/canonical/snapcraft-rocks/issues/33
|
||||
- echo "RUN ln -s /usr/libexec/snapcraft/craftctl /usr/bin/craftctl" >> Dockerfile
|
||||
- echo "RUN sh build/linux/snap/1_build-deps-snapcraft.sh --install-snaps" >> Dockerfile;
|
||||
# Build babl and GEGL
|
||||
- echo "FROM $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER}" > Dockerfile2;
|
||||
- echo "RUN sh build/linux/snap/1_build-deps-snapcraft.sh" >> Dockerfile2;
|
||||
#FIXME: '2>&1 | grep -v STEP' since buildah is too verbose. See: https://github.com/containers/buildah/issues/6362
|
||||
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile --tag $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER} --layers --cache-from $CI_REGISTRY_IMAGE/cache --cache-to $CI_REGISTRY_IMAGE/cache --cache-ttl=120h 2>&1 | grep -v STEP && buildah push --log-level error $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER} 2>&1 | grep -v STEP
|
||||
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile2 --no-cache 2>&1 | grep -v STEP
|
||||
artifacts:
|
||||
paths:
|
||||
- _install-$RUNNER.tar
|
||||
- _build-$RUNNER.tar
|
||||
- babl-meson-log.tar
|
||||
- gegl-meson-log.tar
|
||||
expire_in: 2 hours
|
||||
|
||||
gimp-snap:
|
||||
extends: .snap
|
||||
needs: ["deps-snap"]
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- sh build/linux/snap/2_build-gimp-snapcraft.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- temp*.snap
|
||||
- gimp-snapcraft.log
|
||||
- gimp-meson-log.tar
|
||||
expire_in: 2 days
|
||||
|
||||
@@ -427,16 +499,20 @@ gimp-flatpak-x64:
|
||||
.win:
|
||||
extends: .default
|
||||
rules:
|
||||
#Developers (on GNOME/gimp namespace) can create multi-arch installers (.exe or .msixbundle)
|
||||
#Non developers (e.g. on MRs), however, can create x64-only installers (.exe or .msix)
|
||||
- if: '$RUNNER == "windows-aarch64" && $CI_PROJECT_NAMESPACE != "GNOME"'
|
||||
when: never
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Windows Installer.*/ && $CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/'
|
||||
interruptible: true
|
||||
variables:
|
||||
INSTALLER_OPTION: '-Dwindows-installer=true'
|
||||
STORE_OPTION: '-Dms-store=true'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Windows Installer.*/'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Windows Installer.*/ && $CI_JOB_NAME !~ /.*store.*/'
|
||||
interruptible: true
|
||||
variables:
|
||||
INSTALLER_OPTION: '-Dwindows-installer=true'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/ && $CI_JOB_NAME =~ /.*64.*/ && $CI_JOB_NAME !~ /.*installer.*/'
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/ && $CI_JOB_NAME !~ /.*mingw32.*/ && $CI_JOB_NAME !~ /.*installer.*/'
|
||||
interruptible: true
|
||||
variables:
|
||||
STORE_OPTION: '-Dms-store=true'
|
||||
@@ -444,10 +520,10 @@ gimp-flatpak-x64:
|
||||
variables:
|
||||
INSTALLER_OPTION: '-Dwindows-installer=true'
|
||||
STORE_OPTION: '-Dms-store=true'
|
||||
- if: '$GIMP_CI_WIN_INSTALLER != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_WIN_INSTALLER.*/'
|
||||
- if: '($GIMP_CI_WIN_INSTALLER != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_WIN_INSTALLER.*/) && $CI_JOB_NAME !~ /.*store.*/'
|
||||
variables:
|
||||
INSTALLER_OPTION: '-Dwindows-installer=true'
|
||||
- if: '$GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/ && $CI_JOB_NAME =~ /.*64.*/ && $CI_JOB_NAME !~ /.*installer.*/'
|
||||
- if: '($GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/) && $CI_JOB_NAME !~ /.*mingw32.*/ && $CI_JOB_NAME !~ /.*installer.*/'
|
||||
variables:
|
||||
STORE_OPTION: '-Dms-store=true'
|
||||
- <<: *CI_RELEASE
|
||||
@@ -456,91 +532,85 @@ gimp-flatpak-x64:
|
||||
STORE_OPTION: '-Dms-store=true'
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: windows-aarch64
|
||||
MSYSTEM_PREFIX: clangarm64
|
||||
- RUNNER: win32-ps
|
||||
MSYSTEM_PREFIX: clang64
|
||||
- RUNNER: [windows-aarch64, win32-ps]
|
||||
tags:
|
||||
- $RUNNER
|
||||
variables:
|
||||
MSYS_ROOT: 'C:/msys64'
|
||||
CC: cc
|
||||
CXX: c++
|
||||
#meson.build forces non-relocatable .pc. See: https://github.com/mesonbuild/meson/issues/14346
|
||||
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
|
||||
before_script:
|
||||
# FIXME:'gimpenv' have buggy code about Windows paths. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/12284
|
||||
- $GIMP_PREFIX = "$PWD\_install-$MSYSTEM_PREFIX".Replace('\', '/')
|
||||
timeout: 40m
|
||||
- if (-not $env:MSYSTEM_PREFIX) { $env:MSYSTEM_PREFIX = if ((Get-WmiObject Win32_ComputerSystem).SystemType -like 'ARM64*') { 'clangarm64' } else { 'clang64' }}
|
||||
- $GIMP_PREFIX = "$PWD\_install-$env:MSYSTEM_PREFIX"
|
||||
timeout: 30m
|
||||
|
||||
.win_environ: &WIN_ENVIRON
|
||||
# See: https://testing.developer.gimp.org/core/setup/build/windows/#prepare-for-building
|
||||
- Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):win_environ[collapsed=true]$([char]13)$([char]27)[0KPreparing build environment"
|
||||
## Build-time vars
|
||||
- $env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$MSYS_ROOT/$MSYSTEM_PREFIX/lib/pkgconfig;$MSYS_ROOT/$MSYSTEM_PREFIX/share/pkgconfig"
|
||||
- $env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$MSYS_ROOT/$MSYSTEM_PREFIX/share"
|
||||
- $env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share/pkgconfig"
|
||||
- $env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share"
|
||||
## Runtime vars
|
||||
- $env:PATH = "$GIMP_PREFIX/bin;$MSYS_ROOT/$MSYSTEM_PREFIX/bin;" + $env:PATH
|
||||
- $env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$MSYS_ROOT/$MSYSTEM_PREFIX/lib/girepository-1.0"
|
||||
- $env:PATH = "$GIMP_PREFIX/bin;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/bin;$env:PATH"
|
||||
- $env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/girepository-1.0"
|
||||
- Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):win_environ$([char]13)$([char]27)[0K"
|
||||
|
||||
deps-win:
|
||||
extends: .win
|
||||
stage: dependencies
|
||||
script:
|
||||
- build/windows/1_build-deps-msys2.ps1
|
||||
- build\windows\1_build-deps-msys2.ps1
|
||||
artifacts:
|
||||
paths:
|
||||
- _install-$MSYSTEM_PREFIX/
|
||||
- babl/_build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
|
||||
- gegl/_build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
|
||||
- _install-*/
|
||||
- babl/_build-*/meson-logs/meson-log.txt
|
||||
- gegl/_build-*/meson-logs/meson-log.txt
|
||||
expire_in: 2 hours
|
||||
|
||||
gimp-win:
|
||||
extends: .win
|
||||
needs: ["deps-win"]
|
||||
stage: gimp
|
||||
needs:
|
||||
- job: deps-win
|
||||
#to allow running outside 'GNOME/gimp' namespace (on MRs)
|
||||
optional: true
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- build/windows/2_build-gimp-msys2.ps1
|
||||
- build\windows\2_build-gimp-msys2.ps1
|
||||
artifacts:
|
||||
paths:
|
||||
- gimp-$MSYSTEM_PREFIX/
|
||||
- _build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
|
||||
- _build-$MSYSTEM_PREFIX/done-dll.list
|
||||
- gimp-*/
|
||||
- _build-*/meson-logs/meson-log.txt
|
||||
- _build-*/done-dll.list
|
||||
# Needed by dist-installer-weekly and dist-store-weekly
|
||||
- _build-$MSYSTEM_PREFIX/config.h
|
||||
- _build-$MSYSTEM_PREFIX/plug-ins/file_associations.list
|
||||
- _build-$MSYSTEM_PREFIX/build/windows/installer/
|
||||
- _build-$MSYSTEM_PREFIX/build/windows/store/
|
||||
- _build-*/config.h
|
||||
- _build-*/plug-ins/file_associations.list
|
||||
- _build-*/build/windows/installer/
|
||||
- _build-*/build/windows/store/
|
||||
expire_in: 2 days
|
||||
|
||||
|
||||
## WINDOWS x86 legacy CI (native MSYS2) ##
|
||||
.win-x86:
|
||||
.win-eol:
|
||||
extends: .win
|
||||
rules:
|
||||
- !reference [.win, rules]
|
||||
- if: '$GIMP_CI_MSYS2_WIN32 != null'
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: win32-ps
|
||||
MSYSTEM_PREFIX: mingw32
|
||||
- RUNNER: [win32-ps]
|
||||
variables:
|
||||
MSYSTEM_PREFIX: mingw32
|
||||
MINGW_PACKAGE_PREFIX: mingw-w64-i686
|
||||
CC: cc
|
||||
CXX: c++
|
||||
|
||||
deps-win-x86:
|
||||
extends: .win-x86
|
||||
deps-win-eol:
|
||||
extends: .win-eol
|
||||
stage: !reference [deps-win, stage]
|
||||
script:
|
||||
- !reference [deps-win, script]
|
||||
artifacts: !reference [deps-win, artifacts]
|
||||
|
||||
gimp-win-x86:
|
||||
extends: .win-x86
|
||||
needs: ["deps-win-x86"]
|
||||
gimp-win-eol:
|
||||
extends: .win-eol
|
||||
needs: ["deps-win-eol"]
|
||||
stage: !reference [gimp-win, stage]
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
@@ -555,22 +625,18 @@ gimp-win-x86:
|
||||
file-plug-in-tests:
|
||||
# FIXME: Do we need another job testing this under Windows? MSYS2 usually has
|
||||
# the latest deps. It might be a good idea to test that too, maybe weekly?
|
||||
extends: .debian-x64
|
||||
extends: .debian-nonreloc
|
||||
rules:
|
||||
# Don't run on release since the plug-in doesn't get installed in releases
|
||||
- <<: *CI_MERGE
|
||||
- <<: *CI_COMMIT
|
||||
needs: ["gimp-debian-x64"]
|
||||
needs: ["gimp-debian-nonreloc"]
|
||||
stage: analysis
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
GIMP_TESTS_DATA_FOLDER: "$CI_PROJECT_DIR/_data/gimp-test-images/"
|
||||
GIMP_TESTS_LOG_FILE: "$CI_PROJECT_DIR/_log/import-tests.log"
|
||||
REGRESSION_STRING: "Total number of regressions: 0"
|
||||
cache:
|
||||
key: $CI_JOB_NAME
|
||||
paths:
|
||||
- _data
|
||||
script:
|
||||
- API_VER=$(grep GIMP_PKGCONFIG_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
|
||||
- APP_VER=$(grep GIMP_APP_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
|
||||
@@ -603,6 +669,8 @@ meson-health:
|
||||
- <<: *CI_MERGE
|
||||
- <<: *CI_COMMIT
|
||||
stage: analysis
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
script:
|
||||
- apt-get update -qq
|
||||
- apt-get install -qq -y --no-install-recommends git shellcheck devscripts
|
||||
@@ -627,6 +695,19 @@ clang-format:
|
||||
- fetch_origin.log
|
||||
expire_in: 2 days
|
||||
|
||||
branches-check:
|
||||
extends: .default
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
|
||||
stage: analysis
|
||||
variables:
|
||||
GIT_DEPTH: "0"
|
||||
script:
|
||||
- apt-get update -qq
|
||||
- apt-get install -qq -y --no-install-recommends git
|
||||
- sh .gitlab/check_dead_branches.sh
|
||||
allow_failure: true
|
||||
|
||||
cppcheck:
|
||||
extends: .default
|
||||
rules:
|
||||
@@ -636,7 +717,7 @@ cppcheck:
|
||||
- apt-get update
|
||||
- apt-get install -y cppcheck
|
||||
- cppcheck -q -j8 --enable=all --force --output-file=cppcheck.xml --xml --xml-version=2
|
||||
-i _build -i babl -i gegl -i _install -i .local -i .cache -i gimp-x64 .
|
||||
-i _build -i babl -i gegl -i _install .
|
||||
- mkdir report
|
||||
- cppcheck-htmlreport --source-dir=. --title=gimp --file=cppcheck.xml --report-dir=report
|
||||
artifacts:
|
||||
@@ -650,10 +731,10 @@ cppcheck:
|
||||
sources-debian:
|
||||
extends: .default
|
||||
rules:
|
||||
# Don't run on MRs since non-merged/non-upstream code can't be distributed by us
|
||||
- <<: *CI_COMMIT
|
||||
- if: '$GIMP_CI_SOURCES != null'
|
||||
- <<: *CI_RELEASE
|
||||
needs: ["gimp-debian-x64"]
|
||||
needs: ["gimp-debian-nonreloc"]
|
||||
stage: distribution
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
@@ -672,10 +753,10 @@ sources-debian:
|
||||
dev-docs:
|
||||
extends: .default
|
||||
rules:
|
||||
# Don't run on MRs since non-merged/non-upstream code can't be distributed by us
|
||||
- <<: *CI_COMMIT
|
||||
- if: '$GIMP_CI_SOURCES != null'
|
||||
- <<: *CI_RELEASE
|
||||
needs: ["deps-debian-x64", "gimp-debian-x64"]
|
||||
needs: ["deps-debian-nonreloc", "gimp-debian-nonreloc"]
|
||||
stage: distribution
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
@@ -741,39 +822,58 @@ dist-appimage-weekly:
|
||||
expire_in: 8 days
|
||||
|
||||
include:
|
||||
project: 'GNOME/citemplates'
|
||||
file: 'flatpak/flatpak_ci_initiative.yml'
|
||||
project: GNOME/citemplates
|
||||
file: flatpak/flatpak_ci_initiative.yml
|
||||
ref: 42fbc2526a7680b6a4f284a210e63e3973ea6dae
|
||||
|
||||
dist-flatpak-weekly:
|
||||
extends:
|
||||
- .default
|
||||
- .publish_nightly
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Flatpak.*/'
|
||||
interruptible: true
|
||||
- if: '$GIMP_CI_FLATPAK != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_FLATPAK.*/'
|
||||
needs: ["gimp-flatpak-x64"]
|
||||
- !reference [.flatpak, rules]
|
||||
needs: ["gimp-flatpak"]
|
||||
stage: distribution
|
||||
script:
|
||||
- sh build/linux/flatpak/3_dist-gimp-flatpak.sh
|
||||
- sh build/linux/flatpak/3_dist-gimp-flatpakbuilder.sh
|
||||
artifacts:
|
||||
expose_as: 'Linux flatpak'
|
||||
paths:
|
||||
- build/linux/flatpak/_Output/
|
||||
expire_in: 8 days
|
||||
|
||||
dist-snap-weekly:
|
||||
extends: .default
|
||||
rules:
|
||||
- !reference [.snap, rules]
|
||||
needs: ["gimp-snap"]
|
||||
stage: distribution
|
||||
image: !reference [.snap, image]
|
||||
variables: !reference [.snap, variables]
|
||||
script:
|
||||
- sh build/linux/snap/3_dist-gimp-snapcraft.sh
|
||||
artifacts:
|
||||
expose_as: 'Linux snap'
|
||||
paths:
|
||||
- build/linux/snap/_Output/
|
||||
expire_in: 8 days
|
||||
|
||||
dist-installer-weekly:
|
||||
extends: .default
|
||||
rules:
|
||||
- !reference [.win, rules]
|
||||
needs: ["gimp-win", "gimp-win-x86"]
|
||||
needs:
|
||||
- job: gimp-win
|
||||
#to allow running outside 'GNOME/gimp' namespace (on MRs)
|
||||
optional: true
|
||||
- job: gimp-win-eol
|
||||
stage: distribution
|
||||
tags:
|
||||
- windows-aarch64
|
||||
- win32-ps
|
||||
variables:
|
||||
MSYS_ROOT: 'C:/msys64'
|
||||
script:
|
||||
- build/windows/installer/3_dist-gimp-inno.ps1
|
||||
- build\windows\installer\3_dist-gimp-inno.ps1
|
||||
artifacts:
|
||||
expose_as: 'Windows exe'
|
||||
paths:
|
||||
@@ -784,11 +884,11 @@ dist-installer-weekly:
|
||||
dist-store-weekly:
|
||||
extends: .default
|
||||
rules:
|
||||
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/'
|
||||
interruptible: true
|
||||
- if: '$GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/'
|
||||
- <<: *CI_RELEASE
|
||||
needs: ["gimp-win"]
|
||||
- !reference [.win, rules]
|
||||
needs:
|
||||
- job: gimp-win
|
||||
#to allow running outside 'GNOME/gimp' namespace (on MRs)
|
||||
optional: true
|
||||
stage: distribution
|
||||
tags:
|
||||
- win32-ps
|
||||
|
42
.gitlab/check_dead_branches.sh
Normal file
42
.gitlab/check_dead_branches.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
printf "\e[0Ksection_start:`date +%s`:branch_check[collapsed=false]\r\e[0KChecking for dead branches\n"
|
||||
git branch -r | grep -v 'origin/HEAD' | grep -v "origin/$CI_DEFAULT_BRANCH" | while IFS= read remote_branch; do
|
||||
remote_branch=$(printf "%s\n" "$remote_branch" | sed 's/^ *//;s/ *$//')
|
||||
branch_name=$(printf "%s\n" "$remote_branch" | sed 's|origin/||')
|
||||
|
||||
# NOT CHECKING
|
||||
## Skip old stable branches
|
||||
if echo "$branch_name" | grep -q "^gimp-[0-9]-" || [ "$branch_name" = "gnome-2-2" ] || [ "$branch_name" = "gnome-2-4" ]; then
|
||||
printf "\033[33m(SKIP)\033[0m: $branch_name is a snapshot of $CI_DEFAULT_BRANCH but no problem\n"
|
||||
continue
|
||||
fi
|
||||
## Skip recently created branches
|
||||
if [ "$(git rev-parse "$remote_branch")" = "$(git rev-parse "$CI_COMMIT_SHA")" ]; then
|
||||
printf "\033[33m(SKIP)\033[0m: $branch_name is identical to $CI_DEFAULT_BRANCH but no problem\n"
|
||||
continue
|
||||
fi
|
||||
|
||||
# CHECKING
|
||||
## Check: merge-base
|
||||
if git merge-base --is-ancestor "$remote_branch" "$CI_COMMIT_SHA"; then
|
||||
printf "\033[31m(ERROR)\033[0m: $branch_name is fully merged into $CI_DEFAULT_BRANCH (via git merge-base)\n"
|
||||
touch 'dead_branch'
|
||||
continue
|
||||
fi
|
||||
## Fallback check: cherry
|
||||
cherry_output=$(git cherry "$CI_COMMIT_SHA" "$remote_branch")
|
||||
if [ -z "$(printf "%s\n" "$cherry_output" | grep '^+')" ]; then
|
||||
printf "\033[31m(ERROR)\033[0m: $branch_name is fully merged into $CI_DEFAULT_BRANCH (via git cherry)\n"
|
||||
touch 'dead_branch'
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -f "dead_branch" ]; then
|
||||
printf " Please delete the merged branches\n"
|
||||
exit 1
|
||||
else
|
||||
printf '(INFO): All branches are organized.\n'
|
||||
fi
|
||||
printf "\e[0Ksection_end:`date +%s`:branch_check\r\e[0K\n"
|
@@ -24,7 +24,7 @@ https://gitlab.gnome.org/GNOME/gimp/-/issues/?sort=updated_desc&state=all&label_
|
||||
- "Be considerate and respectful". This is our main rule.
|
||||
E.g. avoid negative emotional writing which only generates more upsetting
|
||||
interactions.
|
||||
- Stay on topic by writting only one bug per report created.
|
||||
- Stay on topic by writing only one bug per report created.
|
||||
- Add full (not cropped) screenshots or other files using the clip button on GitLab. -->
|
||||
|
||||
### Reproduction
|
||||
|
@@ -9,4 +9,7 @@
|
||||
"*Allow commits from members who can merge to the target branch.*"
|
||||
|
||||
- No AI-generated contents allowed (neither code nor text, images…).
|
||||
Only human created works please! -->
|
||||
Only human created works please!
|
||||
|
||||
- You can request the devs to allow installable packages to be
|
||||
generated from this MR by writing ~Package: in the comments -->
|
||||
|
@@ -5,7 +5,18 @@
|
||||
|
||||
# CHECK SCRIPTS RUNNED BY MESON (ALL OSes)
|
||||
printf "\e[0Ksection_start:`date +%s`:nonunix_test[collapsed=false]\r\e[0KChecking for non-Unix compatibility\n"
|
||||
diff=$(git diff -U0 --no-color "${newest_common_ancestor_sha}" -- '*.build' '*.py' | grep -E '^\+[^+]' | sed 's/^+//')
|
||||
diff=$(git diff -U0 --no-color --submodule=diff "${newest_common_ancestor_sha}" \
|
||||
| awk '
|
||||
/^diff --git a\/.*\.(build|py)/ {
|
||||
sub(/^diff --git a\//, "", $0)
|
||||
sub(/ b\/.*$/, "", $0)
|
||||
file = $0
|
||||
next
|
||||
}
|
||||
/^\+[^+]/ && file != "" {
|
||||
print file ":" substr($0, 2)
|
||||
}
|
||||
')
|
||||
|
||||
## List of commonly used utilities on Unix world
|
||||
## See the context: https://gitlab.gnome.org/GNOME/gimp/-/issues/11385
|
||||
@@ -168,10 +179,21 @@ printf "\e[0Ksection_end:`date +%s`:nonunix_test\r\e[0K\n"
|
||||
# 1) contain bash shebang or are called by bash;
|
||||
# 2) contain bashisms.
|
||||
printf "\e[0Ksection_start:`date +%s`:unix_test[collapsed=false]\r\e[0KChecking for Unix portability (optional)\n"
|
||||
diff=$(git diff -U0 --no-color "${newest_common_ancestor_sha}" | grep -E '^\+[^+]' | sed 's/^+//')
|
||||
diff=$(git diff -U0 --no-color --submodule=diff "${newest_common_ancestor_sha}" \
|
||||
| awk '
|
||||
/^diff --git a\// {
|
||||
sub(/^diff --git a\//, "", $0)
|
||||
sub(/ b\/.*$/, "", $0)
|
||||
file = $0
|
||||
next
|
||||
}
|
||||
/^\+[^+]/ && file != "" {
|
||||
print file ":" substr($0, 2)
|
||||
}
|
||||
')
|
||||
|
||||
## Check shebang and external call (1)
|
||||
echo "$diff" | grep -E '^#!\s*/usr/bin/env\s+bash|^#!\s*/(usr/bin|bin)/bash(\s|$)' && found_bashism='extrinsic_bashism'
|
||||
echo "$diff" | grep -E '#!\s*/usr/bin/env\s+bash|#!\s*/(usr/bin|bin)/bash(\s|$)' && found_bashism='extrinsic_bashism'
|
||||
echo "$diff" | grep -E "bash\s+.*\.sh" && found_bashism='extrinsic_bashism'
|
||||
|
||||
## Check content with shellcheck and checkbashisms (2)
|
||||
|
2
AUTHORS
2
AUTHORS
@@ -23,6 +23,7 @@ The following people have contributed code to GIMP:
|
||||
Rob Antonishen
|
||||
Nicola Archibald
|
||||
Timm Bäder
|
||||
Gabriele Barbero
|
||||
Luis Barrancos
|
||||
Jerry Baker
|
||||
John Beale
|
||||
@@ -204,6 +205,7 @@ The following people have contributed code to GIMP:
|
||||
Federico Mena Quintero
|
||||
Loren Merritt
|
||||
Jim Meyer
|
||||
Ondřej Míchal
|
||||
James Mitchell
|
||||
Hirotsuna Mizuno
|
||||
Chris Mohler
|
||||
|
19
INSTALL.in
19
INSTALL.in
@@ -147,18 +147,11 @@ help in that regard:
|
||||
incompatible with the version 2 (which is still experimental anyway
|
||||
and has no stable release at time of writing).
|
||||
|
||||
11. We also need the mypaint-brushes data package:
|
||||
11. We also need the mypaint-brushes v2 data package:
|
||||
|
||||
https://github.com/mypaint/mypaint-brushes
|
||||
|
||||
If installing from repository, install from branch "v1.3.x" or the
|
||||
last tag "v1.y.z" (e.g. "v1.3.1" at time of writing).
|
||||
In particular do NOT install from `master` branch which installs
|
||||
brushes incompatible with GIMP (the `master` branch and v2 brushes
|
||||
are targeted to software using recent libmypaint which GIMP wasn't
|
||||
ported to yet).
|
||||
|
||||
Also this is a data packages and therefore it will install the
|
||||
Note that this is a data packages and therefore it will install the
|
||||
pkg-config file inside `$PREFIX/share/pkgconfig/`. If you install
|
||||
mypaint-brushes from repository in a non-standard prefix, you will
|
||||
have to make sure your $PKG_CONFIG_PATH environment variable also
|
||||
@@ -208,7 +201,7 @@ help in that regard:
|
||||
* HEIC: e.g. libde265 and libx265 support (for
|
||||
respectively decoding and encoding of HEVC).
|
||||
* AVIF: e.g. libaom decoder and encoder (for AV1 encoding and
|
||||
decoding), prefered over rav1e.
|
||||
decoding), preferred over rav1e.
|
||||
* HEJ2: OpenJPEG (for JPEG2000 inside HEIF).
|
||||
|
||||
If you don't compile libheif with the correct flags (see libheif
|
||||
@@ -245,7 +238,7 @@ help in that regard:
|
||||
|
||||
Package Name Version
|
||||
|
||||
appstream-glib @APPSTREAM_GLIB_REQUIRED_VERSION@
|
||||
appstream @APPSTREAM_REQUIRED_VERSION@
|
||||
ATK @ATK_REQUIRED_VERSION@
|
||||
babl @BABL_REQUIRED_VERSION@
|
||||
cairo @CAIRO_REQUIRED_VERSION@
|
||||
@@ -271,7 +264,7 @@ help in that regard:
|
||||
librsvg @RSVG_REQUIRED_VERSION@
|
||||
libtiff @LIBTIFF_REQUIRED_VERSION@
|
||||
Little CMS @LCMS_REQUIRED_VERSION@
|
||||
mypaint-brushes-1.0
|
||||
mypaint-brushes-2.0
|
||||
pangocairo @PANGO_REQUIRED_VERSION@
|
||||
poppler-data @POPPLER_DATA_REQUIRED_VERSION@
|
||||
PyGObject
|
||||
@@ -496,5 +489,5 @@ reconfiguration:
|
||||
% ninja reconfigure
|
||||
|
||||
Verify that the optional features you wanted are now shown as `true`,
|
||||
otherwise follow similar advices than above to make sure they are
|
||||
otherwise follow similar advice as above to make sure they are
|
||||
visible to your setup.
|
||||
|
207
NEWS
207
NEWS
@@ -6,6 +6,82 @@
|
||||
This is the development branch of GIMP.
|
||||
|
||||
|
||||
Overview of Changes from GIMP 3.1.4 to GIMP 3.2-RC1
|
||||
===================================================
|
||||
|
||||
Core:
|
||||
|
||||
- macOS: "Quit" from the dock's right-click menu will now follow our
|
||||
standard Quit procedure, by intercepting the
|
||||
applicationShouldTerminate signal, instead of forcing the
|
||||
application to close (hence losing unsaved changes).
|
||||
- "Add Layer Mask" will now have an "Edit mask immediately" checkbox
|
||||
allowing to decide whether to go into Edit Mask state or not. This
|
||||
setting is saved across repetitive actions, as all other settings in
|
||||
this dialog.
|
||||
|
||||
Graphical User Interface:
|
||||
|
||||
- "Monitor Linked Image" and "Discard Link Information" menu items
|
||||
added to Layer menu when the selected layer is a link layer.
|
||||
- The GimpColorHexEntry will now update the chosen color as you type.
|
||||
- Use a standard, yet extended, AppMenu on macOS.
|
||||
|
||||
Plug-Ins:
|
||||
|
||||
- file-compressor: add zip decompression support. This allows support
|
||||
for .hgt.zip files, as well as other formats compressed with zip.
|
||||
|
||||
API:
|
||||
|
||||
- The following libgimpbase API are now deprecated:
|
||||
* gimp_pixpipe_params_init
|
||||
* gimp_pixpipe_params_parse
|
||||
* gimp_pixpipe_params_build
|
||||
* gimp_pixpipe_params_free
|
||||
- New libgimp functions:
|
||||
* gimp_vector_layer_get_enable_fill
|
||||
* gimp_vector_layer_get_enable_stroke
|
||||
* gimp_vector_layer_get_fill_color
|
||||
* gimp_vector_layer_get_path
|
||||
* gimp_vector_layer_get_stroke_cap_style
|
||||
* gimp_vector_layer_get_stroke_color
|
||||
* gimp_vector_layer_get_stroke_dash_offset
|
||||
* gimp_vector_layer_get_stroke_dash_pattern
|
||||
* gimp_vector_layer_get_stroke_join_style
|
||||
* gimp_vector_layer_get_stroke_miter_limit
|
||||
* gimp_vector_layer_get_stroke_width
|
||||
* gimp_vector_layer_get_stroke_width_unit
|
||||
* gimp_vector_layer_set_enable_fill
|
||||
* gimp_vector_layer_set_enable_stroke
|
||||
* gimp_vector_layer_set_fill_color
|
||||
* gimp_vector_layer_set_stroke_cap_style
|
||||
* gimp_vector_layer_set_stroke_color
|
||||
* gimp_vector_layer_set_stroke_dash_offset
|
||||
* gimp_vector_layer_set_stroke_dash_pattern
|
||||
* gimp_vector_layer_set_stroke_join_style
|
||||
* gimp_vector_layer_set_stroke_miter_limit
|
||||
* gimp_vector_layer_set_stroke_width
|
||||
* gimp_vector_layer_set_stroke_width_unit
|
||||
* gimp_item_is_vector_layer
|
||||
* gimp_item_id_is_link_layer
|
||||
* gimp_item_is_link_layer
|
||||
* gimp_link_layer_discard
|
||||
* gimp_link_layer_get_by_id
|
||||
* gimp_link_layer_get_file
|
||||
* gimp_link_layer_get_type
|
||||
* gimp_link_layer_monitor
|
||||
* gimp_link_layer_new
|
||||
* gimp_link_layer_set_file
|
||||
* gimp_param_link_layer_get_type
|
||||
* gimp_param_spec_link_layer
|
||||
* gimp_procedure_add_link_layer_argument
|
||||
* gimp_procedure_add_link_layer_aux_argument
|
||||
* gimp_procedure_add_link_layer_return_value
|
||||
* gimp_link_layer_get_mime_type
|
||||
- New libgimp class: GimpLinkLayer
|
||||
|
||||
|
||||
Overview of Changes from GIMP 3.1.2 to GIMP 3.1.4
|
||||
=================================================
|
||||
|
||||
@@ -19,7 +95,47 @@ Core:
|
||||
- Internal classes, config items and actions renamed from "vectors" to
|
||||
"path".
|
||||
- Some cleanup of outdated disabled unit tests and other warnings.
|
||||
- Restructuration of internal GimpControllerManager API.
|
||||
- Restructuration of internal GimpControllerManager and
|
||||
GimpContainerView API.
|
||||
- GimpContainerListView now uses a GtkListBox. A Playground switch was
|
||||
added to use the new widgets in all views that can be switched
|
||||
between list and grid view (brushes, patterns etc.). This won't
|
||||
likely get out of Playground before GIMP 4 because it is far too
|
||||
slow right now (and apparently we'll need GTK4 for making it fast as
|
||||
our current lists).
|
||||
- Various code have been moving away from GtkTreeView and some new
|
||||
internal classes were added as a preparation for GTK4 port.
|
||||
- GEX format updated to use standard <custom/> instead of <metadata/>
|
||||
per update in the AppStream specs in the last few years. This
|
||||
doesn't make any compatibility issue since this format is purely
|
||||
internal only for now, not public.
|
||||
- New setting "Update metadata automatically" in Preferences > Image
|
||||
Import & Export > Export Policies. When enabled, add and update
|
||||
metadata automatically. When disabled, only the minimum necessary
|
||||
metadata changes are made, without changing modification date,
|
||||
synchronizing tags, or updating the software and change history
|
||||
metadata. This new setting is enabled by default.
|
||||
- Fix palette import to properly import colors with alpha values from
|
||||
palettes.
|
||||
- New layer types:
|
||||
* vector layers
|
||||
* link layers
|
||||
- Fill/Stroke editor are now live-previewing color changes for vector
|
||||
layer fill/stroke and text layer outlines.
|
||||
|
||||
Tools:
|
||||
|
||||
- MyPaint brush tool was ported to the newer MyPaintSurface2 API. A
|
||||
consequence is that we now depend on mypaint-brushes-2.0 instead of
|
||||
mypaint-brushes-1.0.
|
||||
- Seamless Clone (Playground): made to work again, but is still too
|
||||
slow to move out of Playground.
|
||||
- The Paths tool has updated UI to create vector layers.
|
||||
- Text tool: bold, italic and underline can now be applied with
|
||||
commonly used shortcuts (Ctrl+b, i and u respectively).
|
||||
- Vector and Link layers cannot be painted on, and filters cannot be
|
||||
merged on them. They now need to be explicitly downgraded to raster
|
||||
layers.
|
||||
|
||||
Graphical User Interface:
|
||||
|
||||
@@ -28,10 +144,97 @@ Graphical User Interface:
|
||||
set.
|
||||
- Make the comment text area sensitive in Export procedure dialogs
|
||||
depending on whether "Save Comment" checkbox is checked or not.
|
||||
- In various GUI using a GtkStack (Input Controller dialogue,
|
||||
Preferences dialogue, and Welcome dialogue), we now turn off
|
||||
animations when it is set OFF system-wide.
|
||||
- "System" color scheme now also works on macOS.
|
||||
- GimpSpinScale cursors now changed to "pointer" when hovering the
|
||||
slider area and "col-resize" when actually grabbing the cursor.
|
||||
- The Welcome dialog will now recognize your standard shortcuts to
|
||||
create a new file, open a file or open one of the 10 most recent
|
||||
files.
|
||||
|
||||
PDB:
|
||||
Plug-Ins:
|
||||
|
||||
- TIFF - Add support for the following features, based on unofficial
|
||||
documentation and user-provided sample files:
|
||||
* Sets the selected layer based on the image-level metadata.
|
||||
* Sets the visibility of the background layer based on the image
|
||||
level metadata.
|
||||
* Sets the blend mode and color tag of each layer, based on extended
|
||||
layer-level metadata. Legacy blend modes are used, based on
|
||||
user feedback and comparison with Sketchbook.
|
||||
* Creates group layers and stores layers in them. Layers are read from
|
||||
top to bottom, and layer groups are added and filled based on layer
|
||||
level metadata.
|
||||
- Animation Playback was redesigned to more closely resemble standard
|
||||
playback UIs. The redesign also changes the progress bar to a
|
||||
GtkScale, so users can more easily move to different frames on the
|
||||
timeline.
|
||||
- New GEGL Filter Browser plug-in to list and inspect all available
|
||||
filters for development purpose.
|
||||
- New import support:
|
||||
* PAA textures: initial import support (includes RGBA 4444, 5551,
|
||||
8888, and Grayscale with Alpha channel. It does not yet cover DXT1
|
||||
- 5 texture import support).
|
||||
* Seattle Filmworks photos (earliest format SFW93A, and the most
|
||||
common format SFW94A). Both formats are essentially mangled JPEGs,
|
||||
though mangled in different ways.
|
||||
* HRZ Slow Scan Television Images (restored, as it used to be
|
||||
implemented and removed in 2004).
|
||||
- Raw Image data plug-in dialog redesigned to be on a two-column
|
||||
layout to avoid over-high dialog.
|
||||
- Print: in sandboxed environments (Flatpak, Snap), the print Settings
|
||||
are now displayed as a second dialog after the portal print dialog.
|
||||
This 2-step workflow is a work-around to the inability to tweak the
|
||||
print dialog when the print portal is in use.
|
||||
|
||||
API:
|
||||
|
||||
- GimpTRCType enum type made available in libgimp and PDB.
|
||||
- gimp-file-save properly sets associated save or exported files.
|
||||
- New PDB/libgimp functions:
|
||||
* gimp_drawable_filter_operation_get_available()
|
||||
* gimp_drawable_filter_operation_get_details()
|
||||
* gimp_drawable_filter_operation_get_pspecs()
|
||||
* gimp_context_get_paint_fade_length()
|
||||
* gimp_context_get_paint_fade_repeat()
|
||||
* gimp_context_set_paint_fade_length()
|
||||
* gimp_context_set_paint_fade_repeat()
|
||||
* gimp_item_id_is_vector_layer()
|
||||
* gimp_param_spec_vector_layer()
|
||||
* gimp_procedure_add_vector_layer_argument()
|
||||
* gimp_procedure_add_vector_layer_aux_argument()
|
||||
* gimp_procedure_add_vector_layer_return_value()
|
||||
* gimp_vector_layer_discard()
|
||||
* gimp_vector_layer_get_by_id()
|
||||
* gimp_vector_layer_new()
|
||||
* gimp_vector_layer_refresh()
|
||||
- GimpSizeEntry (libgimpwidget) can now parse mathematical expressions
|
||||
in their reference value spin buttons too.
|
||||
- GimpColorScales (libgimpwidget) will now set its decimals to 0 when
|
||||
creating u8 RGB color selectors. This change will help further
|
||||
distinguish between the 0...00 and 0..255 views in the Color
|
||||
Selectors. It will also better convey to users that u8 is an integer
|
||||
value rather than a floating point.
|
||||
- Favor existing image comment instead of always loading comment from
|
||||
metadata.
|
||||
- Improve handling of comment metadata with
|
||||
"charset=[ascii|InvalidCharsetId]" prefixes.
|
||||
- New GIMP_METADATA_SAVE_UPDATE value in enum type
|
||||
GimpMetadataSaveFlags (libgimpbase).
|
||||
- Modernize setting "Exif.Image.DateTime" metadata by setting the
|
||||
timezone additionally.
|
||||
|
||||
Build:
|
||||
|
||||
- Add nightly Snap package.
|
||||
- Add nightly Aarch64 flatpak.
|
||||
- appstream-glib dependency replaced with libappstream
|
||||
- Installer uses latest InnoSetup now.
|
||||
- New configure option -Dwin-debugging allowing to choose DWARF debug
|
||||
symbols on Windows instead of the native (CodeView) symbols. This
|
||||
will be useful for people wishing to debug with GDB in particular.
|
||||
|
||||
|
||||
Overview of Changes from GIMP 3.0.4 to GIMP 3.1.2
|
||||
|
@@ -104,6 +104,7 @@
|
||||
/* global variables */
|
||||
|
||||
GimpActionFactory *global_action_factory = NULL;
|
||||
GHashTable *aux_filter_hash_table = NULL;
|
||||
|
||||
|
||||
/* private variables */
|
||||
@@ -270,6 +271,8 @@ actions_init (Gimp *gimp)
|
||||
action_groups[i].icon_name,
|
||||
action_groups[i].setup_func,
|
||||
action_groups[i].update_func);
|
||||
|
||||
aux_filter_hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -280,6 +283,23 @@ actions_exit (Gimp *gimp)
|
||||
g_return_if_fail (global_action_factory->gimp == gimp);
|
||||
|
||||
g_clear_object (&global_action_factory);
|
||||
g_hash_table_unref (aux_filter_hash_table);
|
||||
}
|
||||
|
||||
/* XXX Temporary code to store the list of filter operations with an
|
||||
* "aux" input. This won't be necessary anymore once these filters can
|
||||
* be applied non-destructively too in the future.
|
||||
*/
|
||||
void
|
||||
actions_filter_set_aux (const gchar *action_name)
|
||||
{
|
||||
g_hash_table_add (aux_filter_hash_table, (gpointer) g_strdup (action_name));
|
||||
}
|
||||
|
||||
gboolean
|
||||
actions_filter_get_aux (const gchar *action_name)
|
||||
{
|
||||
return g_hash_table_lookup (aux_filter_hash_table, action_name) != NULL;
|
||||
}
|
||||
|
||||
Gimp *
|
||||
@@ -490,10 +510,9 @@ action_data_sel_count (gpointer data)
|
||||
{
|
||||
if (GIMP_IS_CONTAINER_EDITOR (data))
|
||||
{
|
||||
GimpContainerEditor *editor;
|
||||
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
|
||||
|
||||
editor = GIMP_CONTAINER_EDITOR (data);
|
||||
return gimp_container_view_get_selected (editor->view, NULL, NULL);
|
||||
return gimp_container_view_get_selected (editor->view, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -24,6 +24,9 @@ extern GimpActionFactory *global_action_factory;
|
||||
void actions_init (Gimp *gimp);
|
||||
void actions_exit (Gimp *gimp);
|
||||
|
||||
void actions_filter_set_aux (const gchar *action_name);
|
||||
gboolean actions_filter_get_aux (const gchar *action_name);
|
||||
|
||||
Gimp * action_data_get_gimp (gpointer data);
|
||||
GimpContext * action_data_get_context (gpointer data);
|
||||
GimpImage * action_data_get_image (gpointer data);
|
||||
|
@@ -307,13 +307,8 @@ gint n_dialogs_dockable_actions = G_N_ELEMENTS (dialogs_dockable_actions);
|
||||
static const GimpStringActionEntry dialogs_toplevel_actions[] =
|
||||
{
|
||||
{ "dialogs-preferences", GIMP_ICON_PREFERENCES_SYSTEM,
|
||||
#if defined(PLATFORM_OSX)
|
||||
NC_("dialogs-action", "_Settings..."),
|
||||
NC_("dialogs-action", "_Settings..."),
|
||||
#else
|
||||
NC_("dialogs-action", "_Preferences"),
|
||||
NC_("dialogs-action", "_Preferences"),
|
||||
#endif
|
||||
{ NULL },
|
||||
NC_("dialogs-action", "Open the preferences dialog"),
|
||||
"gimp-preferences-dialog",
|
||||
@@ -360,8 +355,6 @@ static const GimpStringActionEntry dialogs_toplevel_actions[] =
|
||||
{ "dialogs-about", GIMP_ICON_HELP_ABOUT,
|
||||
#if defined(G_OS_WIN32)
|
||||
NC_("dialogs-action", "About GIMP"),
|
||||
#elif defined(PLATFORM_OSX)
|
||||
NC_("dialogs-action", "About"),
|
||||
#else /* UNIX: use GNOME HIG */
|
||||
NC_("dialogs-action", "_About"),
|
||||
#endif
|
||||
|
@@ -174,34 +174,34 @@ drawable_actions_update (GimpActionGroup *group,
|
||||
{
|
||||
GimpItem *item;
|
||||
|
||||
if (gimp_item_get_visible (iter->data))
|
||||
has_visible = TRUE;
|
||||
|
||||
if (gimp_item_can_lock_content (iter->data))
|
||||
{
|
||||
if (! gimp_item_get_lock_content (iter->data))
|
||||
locked = FALSE;
|
||||
can_lock = TRUE;
|
||||
}
|
||||
|
||||
if (gimp_item_can_lock_position (iter->data))
|
||||
{
|
||||
if (! gimp_item_get_lock_position (iter->data))
|
||||
locked_pos = FALSE;
|
||||
can_lock_pos = TRUE;
|
||||
}
|
||||
|
||||
if (gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)))
|
||||
none_children = FALSE;
|
||||
|
||||
if (! gimp_drawable_is_rgb (iter->data))
|
||||
all_rgb = FALSE;
|
||||
|
||||
if (GIMP_IS_LAYER_MASK (iter->data))
|
||||
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (iter->data)));
|
||||
else
|
||||
item = GIMP_ITEM (iter->data);
|
||||
|
||||
if (gimp_item_get_visible (item))
|
||||
has_visible = TRUE;
|
||||
|
||||
if (gimp_item_can_lock_content (item))
|
||||
{
|
||||
if (! gimp_item_get_lock_content (item))
|
||||
locked = FALSE;
|
||||
can_lock = TRUE;
|
||||
}
|
||||
|
||||
if (gimp_item_can_lock_position (item))
|
||||
{
|
||||
if (! gimp_item_get_lock_position (item))
|
||||
locked_pos = FALSE;
|
||||
can_lock_pos = TRUE;
|
||||
}
|
||||
|
||||
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||
none_children = FALSE;
|
||||
|
||||
if (! gimp_drawable_is_rgb (iter->data))
|
||||
all_rgb = FALSE;
|
||||
|
||||
if (gimp_item_is_content_locked (item, NULL))
|
||||
all_writable = FALSE;
|
||||
|
||||
|
@@ -59,6 +59,7 @@ static void file_actions_last_opened_update (GimpContainer *container,
|
||||
static void file_actions_last_opened_reorder (GimpContainer *container,
|
||||
GimpImagefile *unused1,
|
||||
gint unused2,
|
||||
gint unused3,
|
||||
GimpActionGroup *group);
|
||||
static void file_actions_close_all_update (GimpContainer *images,
|
||||
GimpObject *unused,
|
||||
@@ -81,6 +82,12 @@ static const GimpActionEntry file_actions[] =
|
||||
file_open_as_layers_cmd_callback,
|
||||
GIMP_HELP_FILE_OPEN_AS_LAYER },
|
||||
|
||||
{ "file-open-as-link-layers", GIMP_ICON_LAYER,
|
||||
NC_("file-action", "Op_en as Link Layer..."), NULL, { "<primary><alt><shift>O", NULL },
|
||||
NC_("file-action", "Open an image file as Link layer"),
|
||||
file_open_as_link_layer_cmd_callback,
|
||||
GIMP_HELP_FILE_OPEN_AS_LINK_LAYER },
|
||||
|
||||
{ "file-open-location", GIMP_ICON_WEB,
|
||||
NC_("file-action", "Open _Location..."), NULL, { NULL },
|
||||
NC_("file-action", "Open an image file from a specified location"),
|
||||
@@ -434,6 +441,7 @@ static void
|
||||
file_actions_last_opened_reorder (GimpContainer *container,
|
||||
GimpImagefile *unused1,
|
||||
gint unused2,
|
||||
gint unused3,
|
||||
GimpActionGroup *group)
|
||||
{
|
||||
file_actions_last_opened_update (container, unused1, group);
|
||||
|
@@ -73,7 +73,8 @@ static void file_open_dialog_show (Gimp *gimp,
|
||||
const gchar *title,
|
||||
GimpImage *image,
|
||||
GFile *file,
|
||||
gboolean open_as_layers);
|
||||
gboolean open_as_layers,
|
||||
gboolean open_as_link);
|
||||
static GtkWidget * file_save_dialog_show (Gimp *gimp,
|
||||
GimpImage *image,
|
||||
GtkWidget *parent,
|
||||
@@ -118,7 +119,7 @@ file_open_cmd_callback (GimpAction *action,
|
||||
|
||||
file_open_dialog_show (gimp, widget,
|
||||
_("Open Image"),
|
||||
image, NULL, FALSE);
|
||||
image, NULL, FALSE, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -140,7 +141,29 @@ file_open_as_layers_cmd_callback (GimpAction *action,
|
||||
|
||||
file_open_dialog_show (gimp, widget,
|
||||
_("Open Image as Layers"),
|
||||
image, NULL, TRUE);
|
||||
image, NULL, TRUE, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
file_open_as_link_layer_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GtkWidget *widget;
|
||||
GimpDisplay *display;
|
||||
GimpImage *image = NULL;
|
||||
return_if_no_gimp (gimp, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
display = action_data_get_display (data);
|
||||
|
||||
if (display)
|
||||
image = gimp_display_get_image (display);
|
||||
|
||||
file_open_dialog_show (gimp, widget,
|
||||
_("Open Image as Link Layer"),
|
||||
image, NULL, TRUE, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -577,7 +600,7 @@ file_file_open_dialog (Gimp *gimp,
|
||||
{
|
||||
file_open_dialog_show (gimp, parent,
|
||||
_("Open Image"),
|
||||
NULL, file, FALSE);
|
||||
NULL, file, FALSE, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -589,7 +612,8 @@ file_open_dialog_show (Gimp *gimp,
|
||||
const gchar *title,
|
||||
GimpImage *image,
|
||||
GFile *file,
|
||||
gboolean open_as_layers)
|
||||
gboolean open_as_layers,
|
||||
gboolean open_as_link)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
@@ -621,7 +645,7 @@ file_open_dialog_show (Gimp *gimp,
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||
|
||||
gimp_open_dialog_set_image (GIMP_OPEN_DIALOG (dialog),
|
||||
image, open_as_layers);
|
||||
image, open_as_layers, open_as_link);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
||||
@@ -841,9 +865,9 @@ file_revert_confirm_response (GtkWidget *dialog,
|
||||
|
||||
new_image = file_open_image (gimp, gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (display),
|
||||
file, 0, 0, FALSE, NULL,
|
||||
file, 0, 0, TRUE, FALSE, NULL,
|
||||
GIMP_RUN_INTERACTIVE,
|
||||
&status, NULL, &error);
|
||||
NULL, &status, NULL, &error);
|
||||
|
||||
if (new_image)
|
||||
{
|
||||
|
@@ -24,6 +24,9 @@ void file_open_cmd_callback (GimpAction *action,
|
||||
void file_open_as_layers_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void file_open_as_link_layer_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void file_open_location_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
|
@@ -29,13 +29,18 @@
|
||||
|
||||
#include "core/gimp-filter-history.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpgrouplayer.h"
|
||||
#include "core/gimplinklayer.h"
|
||||
#include "core/gimplayermask.h"
|
||||
|
||||
#include "path/gimpvectorlayer.h"
|
||||
|
||||
#include "pdb/gimpprocedure.h"
|
||||
|
||||
#include "widgets/gimpaction.h"
|
||||
#include "widgets/gimpactiongroup.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpstringaction.h"
|
||||
#include "widgets/gimpuimanager.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
@@ -48,11 +53,12 @@
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void filters_actions_set_tooltips (GimpActionGroup *group,
|
||||
const GimpStringActionEntry *entries,
|
||||
gint n_entries);
|
||||
static void filters_actions_history_changed (Gimp *gimp,
|
||||
GimpActionGroup *group);
|
||||
static void filters_actions_set_tooltips (GimpActionGroup *group,
|
||||
const GimpStringActionEntry *entries,
|
||||
gint n_entries);
|
||||
static void filters_actions_history_changed (Gimp *gimp,
|
||||
GimpActionGroup *group);
|
||||
static gboolean filters_is_non_interactive (const gchar *action_name);
|
||||
|
||||
|
||||
/* private variables */
|
||||
@@ -748,6 +754,7 @@ static const GimpEnumActionEntry filters_repeat_actions[] =
|
||||
void
|
||||
filters_actions_setup (GimpActionGroup *group)
|
||||
{
|
||||
static gboolean first_setup = TRUE;
|
||||
GimpProcedureActionEntry *entries;
|
||||
gint n_entries;
|
||||
gint i;
|
||||
@@ -776,8 +783,23 @@ filters_actions_setup (GimpActionGroup *group)
|
||||
filters_actions_set_tooltips (group, filters_interactive_actions,
|
||||
G_N_ELEMENTS (filters_interactive_actions));
|
||||
|
||||
/* XXX Hardcoded list to prevent expensive node/graph creation of a
|
||||
* well-known list of operations.
|
||||
* This whole code will disappear when we'll support filters with aux
|
||||
* input non-destructively anyway.
|
||||
*/
|
||||
if (first_setup)
|
||||
{
|
||||
actions_filter_set_aux ("filters-variable-blur");
|
||||
actions_filter_set_aux ("filters-oilify");
|
||||
actions_filter_set_aux ("filters-lens-blur");
|
||||
actions_filter_set_aux ("filters-gaussian-blur-selective");
|
||||
actions_filter_set_aux ("filters-displace");
|
||||
actions_filter_set_aux ("filters-bump-map");
|
||||
}
|
||||
|
||||
gegl_actions = g_strv_builder_new ();
|
||||
op_classes = gimp_gegl_get_op_classes ();
|
||||
op_classes = gimp_gegl_get_op_classes (TRUE);
|
||||
|
||||
for (iter = op_classes; iter; iter = iter->next)
|
||||
{
|
||||
@@ -789,6 +811,9 @@ filters_actions_setup (GimpActionGroup *group)
|
||||
const gchar *op_name;
|
||||
gchar *label;
|
||||
|
||||
if (filters_actions_gegl_op_blocklisted (op_class->name))
|
||||
continue;
|
||||
|
||||
formatted_op_name = g_strdup (op_class->name);
|
||||
gimp_make_valid_action_name (formatted_op_name);
|
||||
action_name = g_strdup_printf ("filters-%s", formatted_op_name);
|
||||
@@ -799,7 +824,7 @@ filters_actions_setup (GimpActionGroup *group)
|
||||
* operations end up generating the same action name. Typically we
|
||||
* don't want a third-party operation called "my-op" to have the same
|
||||
* action name than "my_op" (which is to say that one will be
|
||||
* overrided by the other).
|
||||
* overridden by the other).
|
||||
*/
|
||||
g_free (action_name);
|
||||
action_name = g_strdup_printf ("filters-%s-%d", formatted_op_name, i++);
|
||||
@@ -858,6 +883,23 @@ filters_actions_setup (GimpActionGroup *group)
|
||||
g_free (short_label);
|
||||
}
|
||||
|
||||
/* Identify third-party filters based on operations with an
|
||||
* auxiliary pad in first setup because of slowness on Windows.
|
||||
* See #14781.
|
||||
*/
|
||||
if (first_setup)
|
||||
{
|
||||
GeglNode *node = gegl_node_new ();
|
||||
|
||||
gegl_node_set (node,
|
||||
"operation", op_class->name,
|
||||
NULL);
|
||||
|
||||
if (gegl_node_has_pad (node, "aux"))
|
||||
actions_filter_set_aux (action_name);
|
||||
|
||||
g_clear_object (&node);
|
||||
}
|
||||
g_strv_builder_add (gegl_actions, action_name);
|
||||
|
||||
g_free (label);
|
||||
@@ -907,6 +949,8 @@ filters_actions_setup (GimpActionGroup *group)
|
||||
group, 0);
|
||||
|
||||
filters_actions_history_changed (group->gimp, group);
|
||||
|
||||
first_setup = FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -914,11 +958,14 @@ filters_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GList *actions;
|
||||
GList *iter;
|
||||
gboolean writable = FALSE;
|
||||
gboolean gray = FALSE;
|
||||
gboolean alpha = FALSE;
|
||||
gboolean supports_alpha = FALSE;
|
||||
gboolean is_group = FALSE;
|
||||
gboolean force_nde = FALSE;
|
||||
|
||||
image = action_data_get_image (data);
|
||||
|
||||
@@ -946,6 +993,11 @@ filters_actions_update (GimpActionGroup *group,
|
||||
|
||||
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
|
||||
is_group = TRUE;
|
||||
|
||||
if (GIMP_IS_GROUP_LAYER (drawable) ||
|
||||
gimp_item_is_vector_layer (GIMP_ITEM (drawable)) ||
|
||||
gimp_item_is_link_layer (GIMP_ITEM (drawable)))
|
||||
force_nde = TRUE;
|
||||
}
|
||||
|
||||
g_list_free (drawables);
|
||||
@@ -954,134 +1006,82 @@ filters_actions_update (GimpActionGroup *group,
|
||||
#define SET_SENSITIVE(action,condition) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
|
||||
|
||||
SET_SENSITIVE ("filters-alien-map", writable);
|
||||
SET_SENSITIVE ("filters-antialias", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-apply-canvas", writable);
|
||||
SET_SENSITIVE ("filters-apply-lens", writable);
|
||||
SET_SENSITIVE ("filters-bayer-matrix", writable);
|
||||
SET_SENSITIVE ("filters-bloom", writable);
|
||||
SET_SENSITIVE ("filters-brightness-contrast", writable);
|
||||
SET_SENSITIVE ("filters-bump-map", writable && !is_group);
|
||||
actions = gimp_action_group_list_actions (group);
|
||||
for (iter = actions; iter; iter = iter->next)
|
||||
{
|
||||
GimpAction *action = iter->data;
|
||||
const gchar *action_name;
|
||||
|
||||
action_name = gimp_action_get_name (action);
|
||||
|
||||
if (filters_is_non_interactive (action_name))
|
||||
{
|
||||
/* Even I'm not sure they should, right now non-interactive
|
||||
* actions are always applied destructively. So these filters
|
||||
* are incompatible with layers where non-destructivity is
|
||||
* mandatory.
|
||||
*/
|
||||
SET_SENSITIVE (action_name, writable && ! force_nde);
|
||||
}
|
||||
else if (GIMP_IS_STRING_ACTION (action))
|
||||
{
|
||||
const gchar *opname;
|
||||
|
||||
opname = GIMP_STRING_ACTION (action)->value;
|
||||
|
||||
if (opname == NULL)
|
||||
/* These are the filters-recent-*, repeat and reshow handled
|
||||
* below.
|
||||
*/
|
||||
continue;
|
||||
|
||||
if (g_strcmp0 (opname, "gegl:gegl") == 0)
|
||||
{
|
||||
/* GEGL graph filter can only be run destructively, unless
|
||||
* the GIMP_ALLOW_GEGL_GRAPH_LAYER_EFFECT environment
|
||||
* variable is set.
|
||||
*/
|
||||
SET_SENSITIVE (gimp_action_get_name (action), writable &&
|
||||
(g_getenv ("GIMP_ALLOW_GEGL_GRAPH_LAYER_EFFECT") != NULL || ! force_nde));
|
||||
}
|
||||
else if (gegl_has_operation (opname))
|
||||
{
|
||||
gboolean sensitive = writable;
|
||||
|
||||
if (sensitive && force_nde)
|
||||
/* Operations with auxiliary inputs can only be applied
|
||||
* destructively. Therefore they must be deactivated on
|
||||
* types of layers where filters can only be applied
|
||||
* non-destructively.
|
||||
*/
|
||||
sensitive = ! actions_filter_get_aux (action_name);
|
||||
|
||||
SET_SENSITIVE (gimp_action_get_name (action), sensitive);
|
||||
}
|
||||
}
|
||||
}
|
||||
g_list_free (actions);
|
||||
|
||||
/* Special-cased filters */
|
||||
SET_SENSITIVE ("filters-c2g", writable && !gray);
|
||||
SET_SENSITIVE ("filters-cartoon", writable);
|
||||
SET_SENSITIVE ("filters-channel-mixer", writable);
|
||||
SET_SENSITIVE ("filters-checkerboard", writable);
|
||||
SET_SENSITIVE ("filters-color-balance", writable && !gray);
|
||||
SET_SENSITIVE ("filters-color-enhance", writable && !gray);
|
||||
SET_SENSITIVE ("filters-color-exchange", writable);
|
||||
SET_SENSITIVE ("filters-color-enhance", writable && !force_nde && !gray);
|
||||
SET_SENSITIVE ("filters-colorize", writable && !gray);
|
||||
SET_SENSITIVE ("filters-dither", writable);
|
||||
SET_SENSITIVE ("filters-color-rotate", writable);
|
||||
SET_SENSITIVE ("filters-color-temperature", writable && !gray);
|
||||
SET_SENSITIVE ("filters-color-to-alpha", writable && supports_alpha);
|
||||
SET_SENSITIVE ("filters-component-extract", writable);
|
||||
SET_SENSITIVE ("filters-convolution-matrix", writable);
|
||||
SET_SENSITIVE ("filters-cubism", writable);
|
||||
SET_SENSITIVE ("filters-curves", writable);
|
||||
SET_SENSITIVE ("filters-deinterlace", writable);
|
||||
SET_SENSITIVE ("filters-desaturate", writable && !gray);
|
||||
SET_SENSITIVE ("filters-difference-of-gaussians", writable);
|
||||
SET_SENSITIVE ("filters-diffraction-patterns", writable);
|
||||
SET_SENSITIVE ("filters-dilate", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-displace", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-distance-map", writable);
|
||||
|
||||
SET_SENSITIVE ("filters-dropshadow", writable && alpha);
|
||||
SET_SENSITIVE ("filters-edge", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-edge-laplace", writable);
|
||||
SET_SENSITIVE ("filters-edge-neon", writable);
|
||||
SET_SENSITIVE ("filters-edge-sobel", writable);
|
||||
SET_SENSITIVE ("filters-emboss", writable);
|
||||
SET_SENSITIVE ("filters-engrave", writable);
|
||||
SET_SENSITIVE ("filters-erode", writable);
|
||||
SET_SENSITIVE ("filters-exposure", writable);
|
||||
SET_SENSITIVE ("filters-fattal-2002", writable);
|
||||
SET_SENSITIVE ("filters-focus-blur", writable);
|
||||
SET_SENSITIVE ("filters-fractal-trace", writable);
|
||||
SET_SENSITIVE ("filters-gaussian-blur", writable);
|
||||
SET_SENSITIVE ("filters-gaussian-blur-selective", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-gegl-graph", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-grid", writable);
|
||||
SET_SENSITIVE ("filters-high-pass", writable);
|
||||
SET_SENSITIVE ("filters-hue-chroma", writable);
|
||||
SET_SENSITIVE ("filters-hue-saturation", writable && !gray);
|
||||
SET_SENSITIVE ("filters-illusion", writable);
|
||||
SET_SENSITIVE ("filters-invert-linear", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-invert-perceptual", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-invert-value", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-image-gradient", writable);
|
||||
SET_SENSITIVE ("filters-kaleidoscope", writable);
|
||||
SET_SENSITIVE ("filters-lens-blur", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-lens-distortion", writable);
|
||||
SET_SENSITIVE ("filters-lens-flare", writable);
|
||||
SET_SENSITIVE ("filters-levels", writable);
|
||||
SET_SENSITIVE ("filters-linear-sinusoid", writable);
|
||||
SET_SENSITIVE ("filters-little-planet", writable);
|
||||
SET_SENSITIVE ("filters-long-shadow", writable && alpha);
|
||||
SET_SENSITIVE ("filters-mantiuk-2006", writable);
|
||||
SET_SENSITIVE ("filters-maze", writable);
|
||||
SET_SENSITIVE ("filters-mean-curvature-blur", writable);
|
||||
SET_SENSITIVE ("filters-median-blur", writable);
|
||||
SET_SENSITIVE ("filters-mono-mixer", writable && !gray);
|
||||
SET_SENSITIVE ("filters-mosaic", writable);
|
||||
SET_SENSITIVE ("filters-motion-blur-circular", writable);
|
||||
SET_SENSITIVE ("filters-motion-blur-linear", writable);
|
||||
SET_SENSITIVE ("filters-motion-blur-zoom", writable);
|
||||
SET_SENSITIVE ("filters-newsprint", writable);
|
||||
SET_SENSITIVE ("filters-noise-cell", writable);
|
||||
SET_SENSITIVE ("filters-noise-cie-lch", writable);
|
||||
SET_SENSITIVE ("filters-noise-hsv", writable && !gray);
|
||||
SET_SENSITIVE ("filters-noise-hurl", writable);
|
||||
SET_SENSITIVE ("filters-noise-perlin", writable);
|
||||
SET_SENSITIVE ("filters-noise-pick", writable);
|
||||
SET_SENSITIVE ("filters-noise-reduction", writable);
|
||||
SET_SENSITIVE ("filters-noise-rgb", writable);
|
||||
SET_SENSITIVE ("filters-noise-simplex", writable);
|
||||
SET_SENSITIVE ("filters-noise-slur", writable);
|
||||
SET_SENSITIVE ("filters-noise-solid", writable);
|
||||
SET_SENSITIVE ("filters-noise-spread", writable);
|
||||
SET_SENSITIVE ("filters-normal-map", writable);
|
||||
SET_SENSITIVE ("filters-offset", writable);
|
||||
SET_SENSITIVE ("filters-oilify", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-panorama-projection", writable);
|
||||
SET_SENSITIVE ("filters-photocopy", writable);
|
||||
SET_SENSITIVE ("filters-pixelize", writable);
|
||||
SET_SENSITIVE ("filters-plasma", writable);
|
||||
SET_SENSITIVE ("filters-polar-coordinates", writable);
|
||||
SET_SENSITIVE ("filters-posterize", writable);
|
||||
SET_SENSITIVE ("filters-recursive-transform", writable);
|
||||
SET_SENSITIVE ("filters-red-eye-removal", writable && !gray);
|
||||
SET_SENSITIVE ("filters-reinhard-2005", writable);
|
||||
SET_SENSITIVE ("filters-rgb-clip", writable);
|
||||
SET_SENSITIVE ("filters-ripple", writable);
|
||||
SET_SENSITIVE ("filters-saturation", writable && !gray);
|
||||
SET_SENSITIVE ("filters-semi-flatten", writable && alpha);
|
||||
SET_SENSITIVE ("filters-sepia", writable && !gray);
|
||||
SET_SENSITIVE ("filters-shadows-highlights", writable);
|
||||
SET_SENSITIVE ("filters-shift", writable);
|
||||
SET_SENSITIVE ("filters-sinus", writable);
|
||||
SET_SENSITIVE ("filters-slic", writable);
|
||||
SET_SENSITIVE ("filters-snn-mean", writable);
|
||||
SET_SENSITIVE ("filters-softglow", writable);
|
||||
SET_SENSITIVE ("filters-spherize", writable);
|
||||
SET_SENSITIVE ("filters-spiral", writable);
|
||||
SET_SENSITIVE ("filters-stretch-contrast", writable);
|
||||
SET_SENSITIVE ("filters-stretch-contrast-hsv", writable);
|
||||
SET_SENSITIVE ("filters-stress", writable);
|
||||
SET_SENSITIVE ("filters-supernova", writable);
|
||||
SET_SENSITIVE ("filters-threshold", writable);
|
||||
SET_SENSITIVE ("filters-threshold-alpha", writable && alpha);
|
||||
SET_SENSITIVE ("filters-tile-glass", writable);
|
||||
SET_SENSITIVE ("filters-tile-paper", writable);
|
||||
SET_SENSITIVE ("filters-tile-seamless", writable);
|
||||
SET_SENSITIVE ("filters-unsharp-mask", writable);
|
||||
SET_SENSITIVE ("filters-value-propagate", writable);
|
||||
SET_SENSITIVE ("filters-variable-blur", writable && !is_group);
|
||||
SET_SENSITIVE ("filters-video-degradation", writable);
|
||||
SET_SENSITIVE ("filters-vignette", writable);
|
||||
SET_SENSITIVE ("filters-waterpixels", writable);
|
||||
SET_SENSITIVE ("filters-waves", writable);
|
||||
SET_SENSITIVE ("filters-whirl-pinch", writable);
|
||||
SET_SENSITIVE ("filters-wind", writable);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
|
||||
@@ -1120,6 +1120,36 @@ filters_actions_update (GimpActionGroup *group,
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
filters_actions_gegl_op_blocklisted (const gchar *operation_name)
|
||||
{
|
||||
for (gint i = 0; i < G_N_ELEMENTS (filters_actions); i++)
|
||||
{
|
||||
const GimpStringActionEntry *action_entry = &filters_actions[i];
|
||||
|
||||
if (g_strcmp0 (operation_name, action_entry->value) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for (gint i = 0; i < G_N_ELEMENTS (filters_settings_actions); i++)
|
||||
{
|
||||
const GimpStringActionEntry *action_entry = &filters_settings_actions[i];
|
||||
|
||||
if (g_strcmp0 (operation_name, action_entry->value) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for (gint i = 0; i < G_N_ELEMENTS (filters_interactive_actions); i++)
|
||||
{
|
||||
const GimpStringActionEntry *action_entry = &filters_interactive_actions[i];
|
||||
|
||||
if (g_strcmp0 (operation_name, action_entry->value) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
filters_actions_set_tooltips (GimpActionGroup *group,
|
||||
const GimpStringActionEntry *entries,
|
||||
@@ -1303,3 +1333,19 @@ filters_actions_history_changed (Gimp *gimp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
filters_is_non_interactive (const gchar *action_name)
|
||||
{
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (filters_actions); i++)
|
||||
if (g_strcmp0 (filters_actions[i].name, action_name) == 0)
|
||||
return TRUE;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (filters_settings_actions); i++)
|
||||
if (g_strcmp0 (filters_settings_actions[i].name, action_name) == 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
void filters_actions_setup (GimpActionGroup *group);
|
||||
void filters_actions_update (GimpActionGroup *group,
|
||||
gpointer data);
|
||||
void filters_actions_setup (GimpActionGroup *group);
|
||||
void filters_actions_update (GimpActionGroup *group,
|
||||
gpointer data);
|
||||
gboolean filters_actions_gegl_op_blocklisted (const gchar *operation_name);
|
||||
|
@@ -30,9 +30,12 @@
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
#include "core/gimplayer-floating-selection.h"
|
||||
#include "core/gimplinklayer.h"
|
||||
|
||||
#include "text/gimptextlayer.h"
|
||||
|
||||
#include "path/gimpvectorlayer.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpactiongroup.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
@@ -60,6 +63,12 @@ static const GimpActionEntry layers_actions[] =
|
||||
layers_edit_text_cmd_callback,
|
||||
GIMP_HELP_LAYER_EDIT },
|
||||
|
||||
{ "layers-edit-vector", GIMP_ICON_TOOL_PATH,
|
||||
NC_("layers-action", "Path Tool"), NULL, { NULL },
|
||||
NC_("layers-action", "Activate the path tool on this vector layer's path"),
|
||||
layers_edit_vector_cmd_callback,
|
||||
GIMP_HELP_TOOL_PATH },
|
||||
|
||||
{ "layers-edit-attributes", GIMP_ICON_EDIT,
|
||||
NC_("layers-action", "_Edit Layer Attributes..."), NULL, { NULL },
|
||||
NC_("layers-action", "Edit the layer's name"),
|
||||
@@ -173,6 +182,18 @@ static const GimpActionEntry layers_actions[] =
|
||||
image_flatten_image_cmd_callback,
|
||||
GIMP_HELP_IMAGE_FLATTEN },
|
||||
|
||||
{ "layers-link-discard", GIMP_ICON_TOOL_TEXT,
|
||||
NC_("layers-action", "_Discard Link Information"), NULL, { NULL },
|
||||
NC_("layers-action", "Turn this link layer into a normal layer"),
|
||||
layers_link_discard_cmd_callback,
|
||||
GIMP_HELP_LAYER_TEXT_DISCARD },
|
||||
|
||||
{ "layers-link-monitor", GIMP_ICON_TOOL_TEXT,
|
||||
NC_("layers-action", "_Monitor Linked Image"), NULL, { NULL },
|
||||
NC_("layers-action", "Discard any transformation and monitor the linked file again"),
|
||||
layers_link_monitor_cmd_callback,
|
||||
GIMP_HELP_LAYER_TEXT_DISCARD },
|
||||
|
||||
{ "layers-text-discard", GIMP_ICON_TOOL_TEXT,
|
||||
NC_("layers-action", "_Discard Text Information"), NULL, { NULL },
|
||||
NC_("layers-action", "Turn these text layers into normal layers"),
|
||||
@@ -191,6 +212,18 @@ static const GimpActionEntry layers_actions[] =
|
||||
layers_text_along_path_cmd_callback,
|
||||
GIMP_HELP_LAYER_TEXT_ALONG_PATH },
|
||||
|
||||
{ "layers-vector-fill-stroke", NULL,
|
||||
NC_("layers-action", "Fill / Stroke..."), NULL, { NULL },
|
||||
NC_("layers-action", "Edit the fill and stroke of this vector layer"),
|
||||
layers_vector_fill_stroke_cmd_callback,
|
||||
GIMP_HELP_LAYER_VECTOR_FILL_STROKE },
|
||||
|
||||
{ "layers-vector-discard", NULL,
|
||||
NC_("layers-action", "Discard Vector Information"), NULL, { NULL },
|
||||
NC_("layers-action", "Turn this vector layer into a normal layer"),
|
||||
layers_vector_discard_cmd_callback,
|
||||
GIMP_HELP_LAYER_VECTOR_DISCARD },
|
||||
|
||||
{ "layers-resize", GIMP_ICON_OBJECT_RESIZE,
|
||||
NC_("layers-action", "Layer B_oundary Size..."), NULL, { NULL },
|
||||
NC_("layers-action", "Adjust the layer dimensions"),
|
||||
@@ -757,6 +790,8 @@ layers_actions_update (GimpActionGroup *group,
|
||||
gboolean lock_alpha = TRUE;
|
||||
gboolean can_lock_alpha = FALSE;
|
||||
gboolean text_layer = FALSE;
|
||||
gboolean vector_layer = FALSE;
|
||||
gboolean link_layer = FALSE;
|
||||
gboolean bs_mutable = FALSE; /* At least 1 selected layers' blend space is mutable. */
|
||||
gboolean cs_mutable = FALSE; /* At least 1 selected layers' composite space is mutable. */
|
||||
gboolean cm_mutable = FALSE; /* At least 1 selected layers' composite mode is mutable. */
|
||||
@@ -977,7 +1012,10 @@ layers_actions_update (GimpActionGroup *group,
|
||||
|
||||
gimp_action_group_set_action_active (group, action, TRUE);
|
||||
|
||||
text_layer = gimp_item_is_text_layer (GIMP_ITEM (layer));
|
||||
text_layer = gimp_item_is_text_layer (GIMP_ITEM (layer));
|
||||
vector_layer = gimp_item_is_vector_layer (GIMP_ITEM (layer));
|
||||
if (GIMP_IS_LINK_LAYER (layer))
|
||||
link_layer = gimp_link_layer_is_monitored (GIMP_LINK_LAYER (layer));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -993,6 +1031,7 @@ layers_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("layers-edit", !ac && ((layer && !fs) || text_layer));
|
||||
SET_VISIBLE ("layers-edit-text", text_layer && !ac);
|
||||
SET_SENSITIVE ("layers-edit-text", text_layer && !ac);
|
||||
SET_VISIBLE ("layers-edit-vector", vector_layer && !ac);
|
||||
SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
|
||||
|
||||
if (layer && gimp_layer_is_floating_sel (layer))
|
||||
@@ -1042,6 +1081,12 @@ layers_actions_update (GimpActionGroup *group,
|
||||
SET_VISIBLE ("layers-text-to-path", n_text_layers > 0 && !ac);
|
||||
SET_VISIBLE ("layers-text-along-path", text_layer && !ac);
|
||||
|
||||
SET_VISIBLE ("layers-vector-fill-stroke", vector_layer && !ac);
|
||||
SET_VISIBLE ("layers-vector-discard", vector_layer && !ac);
|
||||
|
||||
SET_VISIBLE ("layers-link-discard", link_layer && !ac);
|
||||
SET_VISIBLE ("layers-link-monitor", GIMP_IS_LINK_LAYER (layer) && ! link_layer && !ac);
|
||||
|
||||
SET_SENSITIVE ("layers-resize", n_selected_layers == 1 && all_writable && all_movable && !ac);
|
||||
SET_SENSITIVE ("layers-resize-to-image", all_writable && all_movable && !ac);
|
||||
SET_SENSITIVE ("layers-scale", n_selected_layers == 1 && all_writable && all_movable && !ac);
|
||||
|
@@ -48,6 +48,8 @@
|
||||
#include "core/gimplayerpropundo.h"
|
||||
#include "core/gimplayer-floating-selection.h"
|
||||
#include "core/gimplayer-new.h"
|
||||
#include "core/gimplink.h"
|
||||
#include "core/gimplinklayer.h"
|
||||
#include "core/gimplist.h"
|
||||
#include "core/gimppickable.h"
|
||||
#include "core/gimppickable-auto-shrink.h"
|
||||
@@ -58,6 +60,8 @@
|
||||
#include "path/gimppath.h"
|
||||
#include "path/gimppath-warp.h"
|
||||
#include "path/gimpstroke.h"
|
||||
#include "path/gimpvectorlayer.h"
|
||||
#include "path/gimpvectorlayeroptions.h"
|
||||
|
||||
#include "text/gimptext.h"
|
||||
#include "text/gimptext-path.h"
|
||||
@@ -66,12 +70,14 @@
|
||||
#include "widgets/gimpaction.h"
|
||||
#include "widgets/gimpdock.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpopendialog.h"
|
||||
#include "widgets/gimpprogressdialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpimagewindow.h"
|
||||
|
||||
#include "tools/gimppathtool.h"
|
||||
#include "tools/gimptexttool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
@@ -80,6 +86,7 @@
|
||||
#include "dialogs/layer-options-dialog.h"
|
||||
#include "dialogs/resize-dialog.h"
|
||||
#include "dialogs/scale-dialog.h"
|
||||
#include "dialogs/vector-layer-options-dialog.h"
|
||||
|
||||
#include "actions.h"
|
||||
#include "items-commands.h"
|
||||
@@ -101,6 +108,7 @@ static void layers_new_callback (GtkWidget *dialog,
|
||||
GimpLayerCompositeMode layer_composite_mode,
|
||||
gdouble layer_opacity,
|
||||
GimpFillType layer_fill_type,
|
||||
GimpLink *link,
|
||||
gint layer_width,
|
||||
gint layer_height,
|
||||
gint layer_offset_x,
|
||||
@@ -124,6 +132,7 @@ static void layers_edit_attributes_callback (GtkWidget *dialog,
|
||||
GimpLayerCompositeMode layer_composite_mode,
|
||||
gdouble layer_opacity,
|
||||
GimpFillType layer_fill_type,
|
||||
GimpLink *link,
|
||||
gint layer_width,
|
||||
gint layer_height,
|
||||
gint layer_offset_x,
|
||||
@@ -141,6 +150,7 @@ static void layers_add_mask_callback (GtkWidget *dialog,
|
||||
GimpAddMaskType add_mask_type,
|
||||
GimpChannel *channel,
|
||||
gboolean invert,
|
||||
gboolean edit_mask,
|
||||
gpointer user_data);
|
||||
static void layers_scale_callback (GtkWidget *dialog,
|
||||
GimpViewable *viewable,
|
||||
@@ -200,6 +210,10 @@ layers_edit_cmd_callback (GimpAction *action,
|
||||
{
|
||||
layers_edit_text_cmd_callback (action, value, data);
|
||||
}
|
||||
else if (gimp_item_is_vector_layer (GIMP_ITEM (layers->data)))
|
||||
{
|
||||
layers_vector_fill_stroke_cmd_callback (action, value, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
layers_edit_attributes_cmd_callback (action, value, data);
|
||||
@@ -251,6 +265,52 @@ layers_edit_text_cmd_callback (GimpAction *action,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_edit_vector_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GList *layers;
|
||||
GtkWidget *widget;
|
||||
GimpTool *active_tool;
|
||||
return_if_no_layers (image, layers, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
if (g_list_length (layers) != 1)
|
||||
return;
|
||||
|
||||
layer = layers->data;
|
||||
|
||||
if (! gimp_item_is_vector_layer (GIMP_ITEM (layer)))
|
||||
{
|
||||
layers_edit_attributes_cmd_callback (action, value, data);
|
||||
return;
|
||||
}
|
||||
|
||||
active_tool = tool_manager_get_active (image->gimp);
|
||||
|
||||
if (! GIMP_IS_PATH_TOOL (active_tool))
|
||||
{
|
||||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (image->gimp->tool_info_list,
|
||||
"gimp-path-tool");
|
||||
|
||||
if (GIMP_IS_TOOL_INFO (tool_info))
|
||||
{
|
||||
gimp_context_set_tool (action_data_get_context (data), tool_info);
|
||||
active_tool = tool_manager_get_active (image->gimp);
|
||||
}
|
||||
}
|
||||
|
||||
if (GIMP_IS_PATH_TOOL (active_tool))
|
||||
gimp_path_tool_set_path (GIMP_PATH_TOOL (active_tool),
|
||||
GIMP_VECTOR_LAYER (layer)->options->path);
|
||||
}
|
||||
|
||||
void
|
||||
layers_edit_attributes_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
@@ -1045,6 +1105,42 @@ layers_delete_cmd_callback (GimpAction *action,
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_link_discard_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GList *layers;
|
||||
GList *iter;
|
||||
return_if_no_layers (image, layers, data);
|
||||
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_PROPERTIES,
|
||||
_("Discard Links"));
|
||||
for (iter = layers; iter; iter = iter->next)
|
||||
if (GIMP_IS_LINK_LAYER (iter->data))
|
||||
gimp_link_layer_discard (GIMP_LINK_LAYER (iter->data));
|
||||
gimp_image_undo_group_end (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_link_monitor_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GList *layers;
|
||||
GList *iter;
|
||||
return_if_no_layers (image, layers, data);
|
||||
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_PROPERTIES,
|
||||
_("Monitor Links"));
|
||||
for (iter = layers; iter; iter = iter->next)
|
||||
if (GIMP_IS_LINK_LAYER (iter->data))
|
||||
gimp_link_layer_monitor (GIMP_LINK_LAYER (iter->data));
|
||||
gimp_image_undo_group_end (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_text_discard_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
@@ -1473,6 +1569,7 @@ layers_mask_add_cmd_callback (GimpAction *action,
|
||||
widget,
|
||||
config->layer_add_mask_type,
|
||||
config->layer_add_mask_invert,
|
||||
config->layer_add_mask_edit_mask,
|
||||
layers_add_mask_callback,
|
||||
NULL);
|
||||
|
||||
@@ -1548,7 +1645,9 @@ layers_mask_add_last_vals_cmd_callback (GimpAction *action,
|
||||
if (config->layer_add_mask_invert)
|
||||
gimp_channel_invert (GIMP_CHANNEL (mask), FALSE);
|
||||
|
||||
gimp_layer_add_mask (iter->data, mask, TRUE, NULL);
|
||||
gimp_layer_add_mask (iter->data, mask,
|
||||
config->layer_add_mask_edit_mask,
|
||||
TRUE, NULL);
|
||||
}
|
||||
|
||||
gimp_image_undo_group_end (image);
|
||||
@@ -1665,7 +1764,7 @@ layers_mask_show_cmd_callback (GimpAction *action,
|
||||
{
|
||||
/* if switching "show mask" on, and any selected layer's
|
||||
* mask is already visible, bail out because that's
|
||||
* exactly the logic we use in the ui for multile
|
||||
* exactly the logic we use in the ui for multiple
|
||||
* visible layer masks.
|
||||
*/
|
||||
return;
|
||||
@@ -1716,7 +1815,7 @@ layers_mask_disable_cmd_callback (GimpAction *action,
|
||||
{
|
||||
/* if switching "disable mask" on, and any selected
|
||||
* layer's mask is already disabled, bail out because
|
||||
* that's exactly the logic we use in the ui for multile
|
||||
* that's exactly the logic we use in the ui for multiple
|
||||
* disabled layer masks.
|
||||
*/
|
||||
return;
|
||||
@@ -2263,6 +2362,7 @@ layers_new_callback (GtkWidget *dialog,
|
||||
GimpLayerCompositeMode layer_composite_mode,
|
||||
gdouble layer_opacity,
|
||||
GimpFillType layer_fill_type,
|
||||
GimpLink *link,
|
||||
gint layer_width,
|
||||
gint layer_height,
|
||||
gint layer_offset_x,
|
||||
@@ -2283,6 +2383,8 @@ layers_new_callback (GtkWidget *dialog,
|
||||
gint n_layers = g_list_length (layers);
|
||||
gboolean run_once = (n_layers == 0);
|
||||
|
||||
g_return_if_fail (link == NULL);
|
||||
|
||||
g_object_set (config,
|
||||
"layer-new-name", layer_name,
|
||||
"layer-new-mode", layer_mode,
|
||||
@@ -2379,6 +2481,7 @@ layers_edit_attributes_callback (GtkWidget *dialog,
|
||||
GimpLayerCompositeMode layer_composite_mode,
|
||||
gdouble layer_opacity,
|
||||
GimpFillType unused1,
|
||||
GimpLink *link,
|
||||
gint unused2,
|
||||
gint unused3,
|
||||
gint layer_offset_x,
|
||||
@@ -2407,7 +2510,8 @@ layers_edit_attributes_callback (GtkWidget *dialog,
|
||||
layer_lock_pixels != gimp_item_get_lock_content (item) ||
|
||||
layer_lock_position != gimp_item_get_lock_position (item) ||
|
||||
layer_lock_visibility != gimp_item_get_lock_visibility (item) ||
|
||||
layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
|
||||
layer_lock_alpha != gimp_layer_get_lock_alpha (layer) ||
|
||||
link)
|
||||
{
|
||||
gimp_image_undo_group_start (image,
|
||||
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
|
||||
@@ -2468,6 +2572,9 @@ layers_edit_attributes_callback (GtkWidget *dialog,
|
||||
if (layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
|
||||
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, TRUE);
|
||||
|
||||
if (GIMP_IS_LINK_LAYER (layer) && link)
|
||||
gimp_link_layer_set_link (GIMP_LINK_LAYER (layer), link, TRUE);
|
||||
|
||||
gimp_image_undo_group_end (image);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
@@ -2488,6 +2595,7 @@ layers_add_mask_callback (GtkWidget *dialog,
|
||||
GimpAddMaskType add_mask_type,
|
||||
GimpChannel *channel,
|
||||
gboolean invert,
|
||||
gboolean edit_mask,
|
||||
gpointer user_data)
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (layers->data));
|
||||
@@ -2497,8 +2605,9 @@ layers_add_mask_callback (GtkWidget *dialog,
|
||||
GError *error = NULL;
|
||||
|
||||
g_object_set (config,
|
||||
"layer-add-mask-type", add_mask_type,
|
||||
"layer-add-mask-invert", invert,
|
||||
"layer-add-mask-type", add_mask_type,
|
||||
"layer-add-mask-invert", invert,
|
||||
"layer-add-mask-edit-mask", edit_mask,
|
||||
NULL);
|
||||
|
||||
gimp_image_undo_group_start (image,
|
||||
@@ -2514,7 +2623,7 @@ layers_add_mask_callback (GtkWidget *dialog,
|
||||
if (config->layer_add_mask_invert)
|
||||
gimp_channel_invert (GIMP_CHANNEL (mask), FALSE);
|
||||
|
||||
if (! gimp_layer_add_mask (iter->data, mask, TRUE, &error))
|
||||
if (! gimp_layer_add_mask (iter->data, mask, edit_mask, TRUE, &error))
|
||||
{
|
||||
gimp_message_literal (image->gimp,
|
||||
G_OBJECT (dialog), GIMP_MESSAGE_WARNING,
|
||||
@@ -2591,6 +2700,56 @@ layers_scale_callback (GtkWidget *dialog,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_vector_fill_stroke_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GList *layers;
|
||||
GtkWidget *widget;
|
||||
return_if_no_layers (image, layers, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
if (g_list_length (layers) != 1)
|
||||
return;
|
||||
|
||||
layer = layers->data;
|
||||
|
||||
if (GIMP_IS_VECTOR_LAYER (layer))
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = vector_layer_options_dialog_new (GIMP_VECTOR_LAYER (layer),
|
||||
action_data_get_context (data),
|
||||
_("Fill / Stroke"),
|
||||
"gimp-vector-layer-stroke",
|
||||
GIMP_HELP_LAYER_VECTOR_FILL_STROKE,
|
||||
widget);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_vector_discard_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GList *layers;
|
||||
return_if_no_layers (image, layers, data);
|
||||
|
||||
if (g_list_length (layers) != 1)
|
||||
return;
|
||||
|
||||
layer = layers->data;
|
||||
|
||||
if (GIMP_IS_VECTOR_LAYER (layer))
|
||||
gimp_vector_layer_discard (GIMP_VECTOR_LAYER (layer));
|
||||
}
|
||||
|
||||
static void
|
||||
layers_resize_callback (GtkWidget *dialog,
|
||||
GimpViewable *viewable,
|
||||
|
@@ -24,6 +24,9 @@ void layers_edit_cmd_callback (GimpAction *action,
|
||||
void layers_edit_text_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_edit_vector_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_edit_attributes_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
@@ -74,6 +77,12 @@ void layers_merge_group_cmd_callback (GimpAction *action,
|
||||
void layers_delete_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_link_discard_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_link_monitor_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_text_discard_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
@@ -83,6 +92,12 @@ void layers_text_to_path_cmd_callback (GimpAction *action,
|
||||
void layers_text_along_path_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_vector_fill_stroke_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void layers_vector_discard_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
|
||||
void layers_resize_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
|
@@ -101,6 +101,6 @@ libappactions = static_library('appactions',
|
||||
include_directories: [ rootInclude, rootAppInclude, ],
|
||||
c_args: '-DG_LOG_DOMAIN="Gimp-Actions"',
|
||||
dependencies: [
|
||||
gegl, gdk_pixbuf, gtk3,
|
||||
gegl, gdk_pixbuf, gtk3, gexiv2,
|
||||
],
|
||||
)
|
||||
|
@@ -117,9 +117,7 @@ palettes_merge_callback (GtkWidget *widget,
|
||||
context = gimp_container_view_get_context (editor->view);
|
||||
factory = gimp_data_factory_view_get_data_factory (view);
|
||||
|
||||
gimp_container_view_get_selected (editor->view, &selected, NULL);
|
||||
|
||||
if (g_list_length (selected) < 2)
|
||||
if (gimp_container_view_get_selected (editor->view, &selected) < 2)
|
||||
{
|
||||
gimp_message_literal (context->gimp,
|
||||
G_OBJECT (editor), GIMP_MESSAGE_WARNING,
|
||||
|
@@ -149,7 +149,12 @@ static const GimpActionEntry paths_actions[] =
|
||||
{ "paths-import", GIMP_ICON_DOCUMENT_OPEN,
|
||||
NC_("paths-action", "I_mport Path..."), NULL, { NULL }, NULL,
|
||||
paths_import_cmd_callback,
|
||||
GIMP_HELP_PATH_IMPORT }
|
||||
GIMP_HELP_PATH_IMPORT },
|
||||
|
||||
{ "paths-to-vector-layer", NULL,
|
||||
NC_("paths-action", "Path to Vector Layer"), NULL, { NULL }, NULL,
|
||||
path_to_vector_layer_cmd_callback,
|
||||
GIMP_HELP_PATH_TO_VECTOR_LAYER },
|
||||
};
|
||||
|
||||
static const GimpToggleActionEntry paths_toggle_actions[] =
|
||||
@@ -429,6 +434,8 @@ paths_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("paths-export", n_selected_paths > 0);
|
||||
SET_SENSITIVE ("paths-import", image);
|
||||
|
||||
SET_SENSITIVE ("paths-to-vector-layer", n_selected_paths == 1);
|
||||
|
||||
SET_SENSITIVE ("paths-selection-to-path", image && !mask_empty);
|
||||
SET_SENSITIVE ("paths-selection-to-path-advanced", image && !mask_empty);
|
||||
SET_SENSITIVE ("paths-fill", n_selected_paths > 0 &&
|
||||
|
@@ -47,6 +47,7 @@
|
||||
#include "path/gimppath.h"
|
||||
#include "path/gimppath-export.h"
|
||||
#include "path/gimppath-import.h"
|
||||
#include "path/gimpvectorlayer.h"
|
||||
|
||||
#include "widgets/gimpaction.h"
|
||||
#include "widgets/gimpclipboard.h"
|
||||
@@ -469,6 +470,7 @@ paths_delete_cmd_callback (GimpAction *action,
|
||||
{
|
||||
GimpImage *image;
|
||||
GList *paths;
|
||||
gboolean attached_to_vector_layer = FALSE;
|
||||
return_if_no_paths (image, paths, data);
|
||||
|
||||
paths = g_list_copy (paths);
|
||||
@@ -478,11 +480,21 @@ paths_delete_cmd_callback (GimpAction *action,
|
||||
_("Remove Paths"));
|
||||
|
||||
for (GList *iter = paths; iter; iter = iter->next)
|
||||
gimp_image_remove_path (image, iter->data, TRUE, NULL);
|
||||
{
|
||||
/* Verify path is not attached to vector layer */
|
||||
if (! gimp_path_attached_to_vector_layer (GIMP_PATH (iter->data), image))
|
||||
gimp_image_remove_path (image, iter->data, TRUE, NULL);
|
||||
else
|
||||
attached_to_vector_layer = TRUE;
|
||||
}
|
||||
|
||||
gimp_image_undo_group_end (image);
|
||||
gimp_image_flush (image);
|
||||
g_list_free (paths);
|
||||
|
||||
if (attached_to_vector_layer)
|
||||
gimp_message_literal (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||
_("Paths attached to vector layers weren't deleted"));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -509,6 +521,28 @@ paths_merge_visible_cmd_callback (GimpAction *action,
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
path_to_vector_layer_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GList *paths;
|
||||
GimpVectorLayer *layer;
|
||||
return_if_no_paths (image, paths, data);
|
||||
|
||||
layer = gimp_vector_layer_new (image, paths->data,
|
||||
gimp_get_user_context (image->gimp));
|
||||
gimp_image_add_layer (image,
|
||||
GIMP_LAYER (layer),
|
||||
GIMP_IMAGE_ACTIVE_PARENT,
|
||||
-1,
|
||||
TRUE);
|
||||
gimp_vector_layer_refresh (layer);
|
||||
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
paths_to_selection_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
|
@@ -50,6 +50,9 @@ void paths_duplicate_cmd_callback (GimpAction *action,
|
||||
void paths_delete_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void path_to_vector_layer_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void paths_merge_visible_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
|
@@ -61,6 +61,21 @@ static const GimpActionEntry text_tool_actions[] =
|
||||
text_tool_paste_cmd_callback,
|
||||
GIMP_HELP_TEXT_TOOL_PASTE },
|
||||
|
||||
{ "text-tool-toggle-bold", GIMP_ICON_FORMAT_TEXT_BOLD,
|
||||
NC_("text-tool-action", "_Bold"), NULL, { "<primary>B", NULL }, NULL,
|
||||
text_tool_toggle_bold_cmd_callback,
|
||||
NULL },
|
||||
|
||||
{ "text-tool-toggle-italic", GIMP_ICON_FORMAT_TEXT_ITALIC,
|
||||
NC_("text-tool-action", "_Italic"), NULL, { "<primary>I", NULL }, NULL,
|
||||
text_tool_toggle_italic_cmd_callback,
|
||||
NULL },
|
||||
|
||||
{ "text-tool-toggle-underline", GIMP_ICON_FORMAT_TEXT_UNDERLINE,
|
||||
NC_("text-tool-action", "_Underline"), NULL, { "<primary>U", NULL }, NULL,
|
||||
text_tool_toggle_underline_cmd_callback,
|
||||
NULL },
|
||||
|
||||
{ "text-tool-delete", GIMP_ICON_EDIT_DELETE,
|
||||
NC_("text-tool-action", "_Delete"), NULL, { NULL }, NULL,
|
||||
text_tool_delete_cmd_callback,
|
||||
@@ -189,14 +204,17 @@ text_tool_actions_update (GimpActionGroup *group,
|
||||
#define SET_ACTIVE(action,condition) \
|
||||
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("text-tool-cut", text_sel);
|
||||
SET_SENSITIVE ("text-tool-copy", text_sel);
|
||||
SET_SENSITIVE ("text-tool-paste", clip);
|
||||
SET_SENSITIVE ("text-tool-delete", text_sel);
|
||||
SET_SENSITIVE ("text-tool-clear", text_layer);
|
||||
SET_SENSITIVE ("text-tool-load", image);
|
||||
SET_SENSITIVE ("text-tool-text-to-path", text_layer);
|
||||
SET_SENSITIVE ("text-tool-text-along-path", text_layer && g_list_length (paths) == 1);
|
||||
SET_SENSITIVE ("text-tool-cut", text_sel);
|
||||
SET_SENSITIVE ("text-tool-copy", text_sel);
|
||||
SET_SENSITIVE ("text-tool-paste", clip);
|
||||
SET_SENSITIVE ("text-tool-toggle-bold", text_sel);
|
||||
SET_SENSITIVE ("text-tool-toggle-italic", text_sel);
|
||||
SET_SENSITIVE ("text-tool-toggle-underline", text_sel);
|
||||
SET_SENSITIVE ("text-tool-delete", text_sel);
|
||||
SET_SENSITIVE ("text-tool-clear", text_layer);
|
||||
SET_SENSITIVE ("text-tool-load", image);
|
||||
SET_SENSITIVE ("text-tool-text-to-path", text_layer);
|
||||
SET_SENSITIVE ("text-tool-text-along-path", text_layer && g_list_length (paths) == 1);
|
||||
|
||||
direction = gimp_text_tool_get_direction (text_tool);
|
||||
for (i = 0; i < G_N_ELEMENTS (text_tool_direction_actions); i++)
|
||||
|
@@ -84,6 +84,36 @@ text_tool_paste_cmd_callback (GimpAction *action,
|
||||
gimp_text_tool_paste_clipboard (text_tool);
|
||||
}
|
||||
|
||||
void
|
||||
text_tool_toggle_bold_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpTextTool *text_tool = GIMP_TEXT_TOOL (data);
|
||||
|
||||
gimp_text_tool_toggle_tag (text_tool, text_tool->buffer->bold_tag);
|
||||
}
|
||||
|
||||
void
|
||||
text_tool_toggle_italic_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpTextTool *text_tool = GIMP_TEXT_TOOL (data);
|
||||
|
||||
gimp_text_tool_toggle_tag (text_tool, text_tool->buffer->italic_tag);
|
||||
}
|
||||
|
||||
void
|
||||
text_tool_toggle_underline_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpTextTool *text_tool = GIMP_TEXT_TOOL (data);
|
||||
|
||||
gimp_text_tool_toggle_tag (text_tool, text_tool->buffer->underline_tag);
|
||||
}
|
||||
|
||||
void
|
||||
text_tool_delete_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
|
@@ -27,6 +27,16 @@ void text_tool_copy_cmd_callback (GimpAction *action,
|
||||
void text_tool_paste_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void text_tool_toggle_bold_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void text_tool_toggle_italic_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void text_tool_toggle_underline_cmd_callback
|
||||
(GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void text_tool_delete_cmd_callback (GimpAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
|
@@ -59,7 +59,8 @@ static void windows_actions_display_remove (GimpContainer *conta
|
||||
GimpActionGroup *group);
|
||||
static void windows_actions_display_reorder (GimpContainer *container,
|
||||
GimpDisplay *display,
|
||||
gint position,
|
||||
gint old_index,
|
||||
gint new_index,
|
||||
GimpActionGroup *group);
|
||||
static void windows_actions_image_notify (GimpDisplay *display,
|
||||
const GParamSpec *unused,
|
||||
@@ -336,6 +337,7 @@ windows_actions_display_remove (GimpContainer *container,
|
||||
static void
|
||||
windows_actions_display_reorder (GimpContainer *container,
|
||||
GimpDisplay *display,
|
||||
gint old_index,
|
||||
gint new_index,
|
||||
GimpActionGroup *group)
|
||||
{
|
||||
|
@@ -121,6 +121,7 @@ enum
|
||||
PROP_EXPORT_METADATA_EXIF,
|
||||
PROP_EXPORT_METADATA_XMP,
|
||||
PROP_EXPORT_METADATA_IPTC,
|
||||
PROP_EXPORT_UPDATE_METADATA,
|
||||
PROP_DEBUG_POLICY,
|
||||
PROP_CHECK_UPDATES,
|
||||
PROP_CHECK_UPDATE_TIMESTAMP,
|
||||
@@ -793,6 +794,13 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_EXPORT_UPDATE_METADATA,
|
||||
"export-update-metadata",
|
||||
"Update metadata automatically",
|
||||
EXPORT_UPDATE_METADATA_BLURB,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_PROP_ENUM (object_class, PROP_DEBUG_POLICY,
|
||||
"debug-policy",
|
||||
"Try generating backtrace upon errors",
|
||||
@@ -1143,8 +1151,10 @@ gimp_core_config_set_property (GObject *object,
|
||||
case PROP_LAST_KNOWN_RELEASE:
|
||||
if (core_config->last_known_release != g_value_get_string (value))
|
||||
{
|
||||
g_set_str (&core_config->last_known_release,
|
||||
g_value_get_string (value));
|
||||
const gchar *version = g_value_get_string (value);
|
||||
|
||||
if (gimp_version_cmp (version, NULL) > 0)
|
||||
g_set_str (&core_config->last_known_release, version);
|
||||
}
|
||||
break;
|
||||
case PROP_CONFIG_VERSION:
|
||||
@@ -1192,6 +1202,9 @@ gimp_core_config_set_property (GObject *object,
|
||||
case PROP_EXPORT_METADATA_IPTC:
|
||||
core_config->export_metadata_iptc = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_EXPORT_UPDATE_METADATA:
|
||||
core_config->export_update_metadata = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_DEBUG_POLICY:
|
||||
core_config->debug_policy = g_value_get_enum (value);
|
||||
break;
|
||||
@@ -1460,6 +1473,9 @@ gimp_core_config_get_property (GObject *object,
|
||||
case PROP_EXPORT_METADATA_IPTC:
|
||||
g_value_set_boolean (value, core_config->export_metadata_iptc);
|
||||
break;
|
||||
case PROP_EXPORT_UPDATE_METADATA:
|
||||
g_value_set_boolean (value, core_config->export_update_metadata);
|
||||
break;
|
||||
case PROP_DEBUG_POLICY:
|
||||
g_value_set_enum (value, core_config->debug_policy);
|
||||
break;
|
||||
|
@@ -104,6 +104,7 @@ struct _GimpCoreConfig
|
||||
gboolean export_metadata_exif;
|
||||
gboolean export_metadata_xmp;
|
||||
gboolean export_metadata_iptc;
|
||||
gboolean export_update_metadata;
|
||||
GimpDebugPolicy debug_policy;
|
||||
#ifdef G_OS_WIN32
|
||||
GimpWin32PointerInputAPI win32_pointer_input_api;
|
||||
|
@@ -81,6 +81,7 @@ enum
|
||||
|
||||
PROP_LAYER_ADD_MASK_TYPE,
|
||||
PROP_LAYER_ADD_MASK_INVERT,
|
||||
PROP_LAYER_ADD_MASK_EDIT_MASK,
|
||||
|
||||
PROP_LAYER_MERGE_TYPE,
|
||||
PROP_LAYER_MERGE_ACTIVE_GROUP_ONLY,
|
||||
@@ -389,6 +390,13 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_LAYER_ADD_MASK_EDIT_MASK,
|
||||
"layer-add-mask-edit-mask",
|
||||
"Default layer mask: edit mask immediately",
|
||||
LAYER_ADD_MASK_EDIT_MASK,
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_PROP_ENUM (object_class, PROP_LAYER_MERGE_TYPE,
|
||||
"layer-merge-type",
|
||||
"Default layer merge type",
|
||||
@@ -716,6 +724,9 @@ gimp_dialog_config_set_property (GObject *object,
|
||||
case PROP_LAYER_ADD_MASK_INVERT:
|
||||
config->layer_add_mask_invert = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_LAYER_ADD_MASK_EDIT_MASK:
|
||||
config->layer_add_mask_edit_mask = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_LAYER_MERGE_TYPE:
|
||||
config->layer_merge_type = g_value_get_enum (value);
|
||||
@@ -908,6 +919,9 @@ gimp_dialog_config_get_property (GObject *object,
|
||||
case PROP_LAYER_ADD_MASK_INVERT:
|
||||
g_value_set_boolean (value, config->layer_add_mask_invert);
|
||||
break;
|
||||
case PROP_LAYER_ADD_MASK_EDIT_MASK:
|
||||
g_value_set_boolean (value, config->layer_add_mask_edit_mask);
|
||||
break;
|
||||
|
||||
case PROP_LAYER_MERGE_TYPE:
|
||||
g_value_set_enum (value, config->layer_merge_type);
|
||||
|
@@ -78,6 +78,7 @@ struct _GimpDialogConfig
|
||||
|
||||
GimpAddMaskType layer_add_mask_type;
|
||||
gboolean layer_add_mask_invert;
|
||||
gboolean layer_add_mask_edit_mask;
|
||||
|
||||
GimpMergeType layer_merge_type;
|
||||
gboolean layer_merge_active_group_only;
|
||||
|
@@ -92,6 +92,7 @@ enum
|
||||
PROP_PLAYGROUND_NPD_TOOL,
|
||||
PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL,
|
||||
PROP_PLAYGROUND_PAINT_SELECT_TOOL,
|
||||
PROP_PLAYGROUND_USE_LIST_BOX,
|
||||
|
||||
PROP_HIDE_DOCKS,
|
||||
PROP_SINGLE_WINDOW_MODE,
|
||||
@@ -470,6 +471,14 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
|
||||
GIMP_PARAM_STATIC_STRINGS |
|
||||
GIMP_CONFIG_PARAM_RESTART);
|
||||
|
||||
GIMP_CONFIG_PROP_BOOLEAN (object_class,
|
||||
PROP_PLAYGROUND_USE_LIST_BOX,
|
||||
"playground-use-list-box",
|
||||
"Playground Use List Box",
|
||||
PLAYGROUND_USE_LIST_BOX_BLURB,
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_property (object_class, PROP_HIDE_DOCKS,
|
||||
g_param_spec_boolean ("hide-docks",
|
||||
NULL,
|
||||
@@ -753,6 +762,9 @@ gimp_gui_config_set_property (GObject *object,
|
||||
case PROP_PLAYGROUND_PAINT_SELECT_TOOL:
|
||||
gui_config->playground_paint_select_tool = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_PLAYGROUND_USE_LIST_BOX:
|
||||
gui_config->playground_use_list_box = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_HIDE_DOCKS:
|
||||
gui_config->hide_docks = g_value_get_boolean (value);
|
||||
@@ -934,6 +946,9 @@ gimp_gui_config_get_property (GObject *object,
|
||||
case PROP_PLAYGROUND_PAINT_SELECT_TOOL:
|
||||
g_value_set_boolean (value, gui_config->playground_paint_select_tool);
|
||||
break;
|
||||
case PROP_PLAYGROUND_USE_LIST_BOX:
|
||||
g_value_set_boolean (value, gui_config->playground_use_list_box);
|
||||
break;
|
||||
|
||||
case PROP_HIDE_DOCKS:
|
||||
g_value_set_boolean (value, gui_config->hide_docks);
|
||||
|
@@ -86,6 +86,7 @@ struct _GimpGuiConfig
|
||||
gboolean playground_npd_tool;
|
||||
gboolean playground_seamless_clone_tool;
|
||||
gboolean playground_paint_select_tool;
|
||||
gboolean playground_use_list_box;
|
||||
|
||||
/* saved in sessionrc */
|
||||
gboolean hide_docks;
|
||||
|
@@ -257,6 +257,15 @@ _("Export XMP metadata by default.")
|
||||
#define EXPORT_METADATA_IPTC_BLURB \
|
||||
_("Export IPTC metadata by default.")
|
||||
|
||||
/* Translators: tooltip for configuration option (checkbox).
|
||||
* It determines what metadata is updated when exporting.
|
||||
*/
|
||||
#define EXPORT_UPDATE_METADATA_BLURB \
|
||||
_("When enabled, add and update metadata automatically. When disabled, " \
|
||||
"only the minimum necessary metadata changes are made, without changing " \
|
||||
"modification date, synchronizing tags, or updating the software and " \
|
||||
"change history metadata.")
|
||||
|
||||
#define GENERATE_BACKTRACE_BLURB \
|
||||
_("Try generating debug data for bug reporting when appropriate.")
|
||||
|
||||
@@ -510,6 +519,9 @@ _("Enable the Seamless Clone tool.")
|
||||
#define PLAYGROUND_PAINT_SELECT_TOOL_BLURB \
|
||||
_("Enable the Paint Select tool.")
|
||||
|
||||
#define PLAYGROUND_USE_LIST_BOX_BLURB \
|
||||
_("Use the new GtkListBox widget for simple lists.")
|
||||
|
||||
#define SPACE_BAR_ACTION_BLURB \
|
||||
_("What to do when the space bar is pressed in the image window.")
|
||||
|
||||
@@ -647,6 +659,9 @@ _("Sets the default mask for the 'Add Layer Mask' dialog.")
|
||||
#define LAYER_ADD_MASK_INVERT_BLURB \
|
||||
_("Sets the default 'invert mask' state for the 'Add Layer Mask' dialog.")
|
||||
|
||||
#define LAYER_ADD_MASK_EDIT_MASK \
|
||||
_("Sets the default 'edit mask' state for the 'Add Layer Mask' dialog.")
|
||||
|
||||
#define LAYER_MERGE_TYPE_BLURB \
|
||||
_("Sets the default merge type for the 'Merge Visible Layers' dialog.")
|
||||
|
||||
|
@@ -44,7 +44,7 @@ libappconfig = static_library('appconfig',
|
||||
include_directories: [ rootInclude, rootAppInclude, ],
|
||||
c_args: '-DG_LOG_DOMAIN="Gimp-Config"',
|
||||
dependencies: [
|
||||
cairo, gegl, gdk_pixbuf, gio, gio_specific, libmypaint,
|
||||
cairo, gegl, gdk_pixbuf, gexiv2, gio, gio_specific, libmypaint,
|
||||
],
|
||||
)
|
||||
|
||||
@@ -53,7 +53,7 @@ test('app-config',
|
||||
[ 'test-config.c', app_debug_files, ],
|
||||
|
||||
dependencies: [
|
||||
appstream_glib,
|
||||
appstream,
|
||||
libapp_dep,
|
||||
],
|
||||
link_with: [
|
||||
|
@@ -1257,6 +1257,7 @@ gimp_undo_type_get_type (void)
|
||||
{ GIMP_UNDO_LAYER_MODE, "GIMP_UNDO_LAYER_MODE", "layer-mode" },
|
||||
{ GIMP_UNDO_LAYER_OPACITY, "GIMP_UNDO_LAYER_OPACITY", "layer-opacity" },
|
||||
{ GIMP_UNDO_LAYER_LOCK_ALPHA, "GIMP_UNDO_LAYER_LOCK_ALPHA", "layer-lock-alpha" },
|
||||
{ GIMP_UNDO_LINK_LAYER, "GIMP_UNDO_LINK_LAYER", "link-layer" },
|
||||
{ GIMP_UNDO_GROUP_LAYER_SUSPEND_RESIZE, "GIMP_UNDO_GROUP_LAYER_SUSPEND_RESIZE", "group-layer-suspend-resize" },
|
||||
{ GIMP_UNDO_GROUP_LAYER_RESUME_RESIZE, "GIMP_UNDO_GROUP_LAYER_RESUME_RESIZE", "group-layer-resume-resize" },
|
||||
{ GIMP_UNDO_GROUP_LAYER_SUSPEND_MASK, "GIMP_UNDO_GROUP_LAYER_SUSPEND_MASK", "group-layer-suspend-mask" },
|
||||
@@ -1267,6 +1268,8 @@ gimp_undo_type_get_type (void)
|
||||
{ GIMP_UNDO_TEXT_LAYER, "GIMP_UNDO_TEXT_LAYER", "text-layer" },
|
||||
{ GIMP_UNDO_TEXT_LAYER_MODIFIED, "GIMP_UNDO_TEXT_LAYER_MODIFIED", "text-layer-modified" },
|
||||
{ GIMP_UNDO_TEXT_LAYER_CONVERT, "GIMP_UNDO_TEXT_LAYER_CONVERT", "text-layer-convert" },
|
||||
{ GIMP_UNDO_VECTOR_LAYER, "GIMP_UNDO_VECTOR_LAYER", "vector-layer" },
|
||||
{ GIMP_UNDO_VECTOR_LAYER_MODIFIED, "GIMP_UNDO_VECTOR_LAYER_MODIFIED", "vector-layer-modified" },
|
||||
{ GIMP_UNDO_LAYER_MASK_ADD, "GIMP_UNDO_LAYER_MASK_ADD", "layer-mask-add" },
|
||||
{ GIMP_UNDO_LAYER_MASK_REMOVE, "GIMP_UNDO_LAYER_MASK_REMOVE", "layer-mask-remove" },
|
||||
{ GIMP_UNDO_LAYER_MASK_APPLY, "GIMP_UNDO_LAYER_MASK_APPLY", "layer-mask-apply" },
|
||||
@@ -1370,6 +1373,7 @@ gimp_undo_type_get_type (void)
|
||||
{ GIMP_UNDO_LAYER_MODE, NC_("undo-type", "Set layer mode"), NULL },
|
||||
{ GIMP_UNDO_LAYER_OPACITY, NC_("undo-type", "Set layer opacity"), NULL },
|
||||
{ GIMP_UNDO_LAYER_LOCK_ALPHA, NC_("undo-type", "Lock/Unlock alpha channel"), NULL },
|
||||
{ GIMP_UNDO_LINK_LAYER, NC_("undo-type", "Link layer"), NULL },
|
||||
{ GIMP_UNDO_GROUP_LAYER_SUSPEND_RESIZE, NC_("undo-type", "Suspend group layer resize"), NULL },
|
||||
{ GIMP_UNDO_GROUP_LAYER_RESUME_RESIZE, NC_("undo-type", "Resume group layer resize"), NULL },
|
||||
{ GIMP_UNDO_GROUP_LAYER_SUSPEND_MASK, NC_("undo-type", "Suspend group layer mask"), NULL },
|
||||
@@ -1380,6 +1384,8 @@ gimp_undo_type_get_type (void)
|
||||
{ GIMP_UNDO_TEXT_LAYER, NC_("undo-type", "Text layer"), NULL },
|
||||
{ GIMP_UNDO_TEXT_LAYER_MODIFIED, NC_("undo-type", "Text layer modification"), NULL },
|
||||
{ GIMP_UNDO_TEXT_LAYER_CONVERT, NC_("undo-type", "Convert text layer"), NULL },
|
||||
{ GIMP_UNDO_VECTOR_LAYER, NC_("undo-type", "Vector layer"), NULL },
|
||||
{ GIMP_UNDO_VECTOR_LAYER_MODIFIED, NC_("undo-type", "Vector layer modification"), NULL },
|
||||
{ GIMP_UNDO_LAYER_MASK_ADD, NC_("undo-type", "Add layer masks"), NULL },
|
||||
{ GIMP_UNDO_LAYER_MASK_REMOVE, NC_("undo-type", "Delete layer masks"), NULL },
|
||||
{ GIMP_UNDO_LAYER_MASK_APPLY, NC_("undo-type", "Apply layer masks"), NULL },
|
||||
|
@@ -480,7 +480,7 @@ typedef enum /*< pdb-skip >*/
|
||||
|
||||
GType gimp_trc_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum /*< pdb-skip >*/
|
||||
typedef enum
|
||||
{
|
||||
GIMP_TRC_LINEAR, /*< desc="Linear" >*/
|
||||
GIMP_TRC_NON_LINEAR, /*< desc="Non-Linear" >*/
|
||||
@@ -609,6 +609,7 @@ typedef enum /*< pdb-skip >*/
|
||||
GIMP_UNDO_LAYER_MODE, /*< desc="Set layer mode" >*/
|
||||
GIMP_UNDO_LAYER_OPACITY, /*< desc="Set layer opacity" >*/
|
||||
GIMP_UNDO_LAYER_LOCK_ALPHA, /*< desc="Lock/Unlock alpha channel" >*/
|
||||
GIMP_UNDO_LINK_LAYER, /*< desc="Link layer" >*/
|
||||
GIMP_UNDO_GROUP_LAYER_SUSPEND_RESIZE, /*< desc="Suspend group layer resize" >*/
|
||||
GIMP_UNDO_GROUP_LAYER_RESUME_RESIZE, /*< desc="Resume group layer resize" >*/
|
||||
GIMP_UNDO_GROUP_LAYER_SUSPEND_MASK, /*< desc="Suspend group layer mask" >*/
|
||||
@@ -619,6 +620,8 @@ typedef enum /*< pdb-skip >*/
|
||||
GIMP_UNDO_TEXT_LAYER, /*< desc="Text layer" >*/
|
||||
GIMP_UNDO_TEXT_LAYER_MODIFIED, /*< desc="Text layer modification" >*/
|
||||
GIMP_UNDO_TEXT_LAYER_CONVERT, /*< desc="Convert text layer" >*/
|
||||
GIMP_UNDO_VECTOR_LAYER, /*< desc="Vector layer" >*/
|
||||
GIMP_UNDO_VECTOR_LAYER_MODIFIED, /*< desc="Vector layer modification" >*/
|
||||
GIMP_UNDO_LAYER_MASK_ADD, /*< desc="Add layer masks" >*/
|
||||
GIMP_UNDO_LAYER_MASK_REMOVE, /*< desc="Delete layer masks" >*/
|
||||
GIMP_UNDO_LAYER_MASK_APPLY, /*< desc="Apply layer masks" >*/
|
||||
|
@@ -90,6 +90,7 @@ typedef struct _GimpViewable GimpViewable;
|
||||
typedef struct _GimpFilter GimpFilter;
|
||||
typedef struct _GimpItem GimpItem;
|
||||
typedef struct _GimpAuxItem GimpAuxItem;
|
||||
typedef struct _GimpLink GimpLink;
|
||||
|
||||
typedef struct _Gimp Gimp;
|
||||
typedef struct _GimpImage GimpImage;
|
||||
@@ -167,6 +168,7 @@ typedef struct _GimpLayerMask GimpLayerMask;
|
||||
typedef struct _GimpSelection GimpSelection;
|
||||
typedef struct _GimpLayer GimpLayer;
|
||||
typedef struct _GimpGroupLayer GimpGroupLayer;
|
||||
typedef struct _GimpLinkLayer GimpLinkLayer;
|
||||
|
||||
|
||||
/* auxiliary image items */
|
||||
|
@@ -353,7 +353,7 @@ gimp_transform_resize_crop (const GimpVector2 *orig_points,
|
||||
|
||||
if (r.area == 0)
|
||||
{
|
||||
/* saveguard if something went wrong, adjust and give warning */
|
||||
/* safeguard if something went wrong, adjust and give warning */
|
||||
gimp_transform_resize_adjust (orig_points, n_points,
|
||||
x1, y1, x2, y2);
|
||||
g_printerr ("no rectangle found by algorithm, no cropping done\n");
|
||||
|
@@ -224,18 +224,14 @@ gimp_user_install_run (GimpUserInstall *install,
|
||||
|
||||
if (install->migrate)
|
||||
{
|
||||
gchar *verstring;
|
||||
|
||||
/* TODO: these 2 strings should be merged into one, but it was not
|
||||
* possible to do it at implementation time, in order not to break
|
||||
* string freeze.
|
||||
*/
|
||||
verstring = g_strdup_printf ("%d.%d", install->old_major, install->old_minor);
|
||||
user_install_log (install,
|
||||
_("It seems you have used GIMP %s before. "
|
||||
/* TRANSLATORS: the %d.%d replacement strings
|
||||
* will be a series version (e.g. 2.10). The %s
|
||||
* replacement will be a directory.
|
||||
*/
|
||||
_("It seems you have used GIMP %d.%d before. "
|
||||
"GIMP will now migrate your user settings to '%s'."),
|
||||
verstring, dirname);
|
||||
g_free (verstring);
|
||||
install->old_major, install->old_minor, dirname);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -102,6 +102,14 @@ static void appstream_text_characters (GMarkupParseContext *contex
|
||||
static const gchar* gimp_extension_get_tag_lang (const gchar **attribute_names,
|
||||
const gchar **attribute_values);
|
||||
|
||||
static gboolean gimp_version_break (const gchar *v,
|
||||
gint *major,
|
||||
gint *minor,
|
||||
gint *micro,
|
||||
gint *rc,
|
||||
gboolean *is_git);
|
||||
|
||||
|
||||
gint
|
||||
gimp_get_pid (void)
|
||||
{
|
||||
@@ -597,7 +605,7 @@ gimp_get_fill_params (GimpContext *context,
|
||||
* @start_y:
|
||||
* @end_x:
|
||||
* @end_y:
|
||||
* @n_snap_lines: Number evenly disributed lines to snap to.
|
||||
* @n_snap_lines: Number evenly distributed lines to snap to.
|
||||
* @offset_angle: The angle by which to offset the lines, in degrees.
|
||||
* @xres: The horizontal resolution.
|
||||
* @yres: The vertical resolution.
|
||||
@@ -1551,6 +1559,74 @@ gimp_view_size_get_smaller (gint view_size)
|
||||
return GIMP_VIEW_SIZE_TINY;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_version_cmp:
|
||||
* @v1: a string representing a version, ex. "2.10.22".
|
||||
* @v2: a string representing another version, ex. "2.99.2".
|
||||
*
|
||||
* If @v2 is %NULL, @v1 is compared to the currently running version.
|
||||
*
|
||||
* Returns: an integer less than, equal to, or greater than zero if @v1
|
||||
* is found to represent a version respectively, lower than,
|
||||
* matching, or greater than @v2.
|
||||
*/
|
||||
gint
|
||||
gimp_version_cmp (const gchar *v1,
|
||||
const gchar *v2)
|
||||
{
|
||||
gint major1;
|
||||
gint minor1;
|
||||
gint micro1;
|
||||
gint rc1;
|
||||
gboolean is_git1;
|
||||
gint major2 = GIMP_MAJOR_VERSION;
|
||||
gint minor2 = GIMP_MINOR_VERSION;
|
||||
gint micro2 = GIMP_MICRO_VERSION;
|
||||
gint rc2 = 0;
|
||||
gboolean is_git2 = FALSE;
|
||||
|
||||
#if defined(GIMP_RC_VERSION)
|
||||
rc2 = GIMP_RC_VERSION;
|
||||
#if defined(GIMP_IS_RC_GIT)
|
||||
is_git2 = TRUE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_return_val_if_fail (v1 != NULL, -1);
|
||||
|
||||
if (! gimp_version_break (v1, &major1, &minor1, µ1, &rc1, &is_git1))
|
||||
{
|
||||
/* If version is not properly parsed, something is wrong with
|
||||
* upstream version number or parsing. This should not happen.
|
||||
*/
|
||||
g_printerr ("%s: version not properly formatted: %s\n",
|
||||
G_STRFUNC, v1);
|
||||
|
||||
return -1;
|
||||
}
|
||||
if (v2 && ! gimp_version_break (v2, &major2, &minor2, µ2, &rc2, &is_git2))
|
||||
{
|
||||
g_printerr ("%s: version not properly formatted: %s\n",
|
||||
G_STRFUNC, v2);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (major1 == major2 && minor1 == minor2 && micro1 == micro2 &&
|
||||
rc1 == rc2 && is_git1 == is_git2)
|
||||
return 0;
|
||||
else if (major1 > major2 ||
|
||||
(major1 == major2 && minor1 > minor2) ||
|
||||
(major1 == major2 && minor1 == minor2 && micro1 > micro2) ||
|
||||
/* RC 0 is the real release, so it's "higher" than any other. */
|
||||
(major1 == major2 && minor1 == minor2 && micro1 == micro2 && rc1 == 0 && rc2 > 0) ||
|
||||
(major1 == major2 && minor1 == minor2 && micro1 == micro2 && rc1 > rc2 && rc2 > 0) ||
|
||||
(major1 == major2 && minor1 == minor2 && micro1 == micro2 && rc1 == rc2 && is_git1))
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Private functions */
|
||||
|
||||
|
||||
@@ -1787,3 +1863,70 @@ gimp_extension_get_tag_lang (const gchar **attribute_names,
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_version_break (const gchar *v,
|
||||
gint *major,
|
||||
gint *minor,
|
||||
gint *micro,
|
||||
gint *rc,
|
||||
gboolean *is_git)
|
||||
{
|
||||
gchar **versions;
|
||||
|
||||
*major = 0;
|
||||
*minor = 0;
|
||||
*micro = 0;
|
||||
*rc = 0;
|
||||
*is_git = FALSE;
|
||||
|
||||
if (v == NULL)
|
||||
return FALSE;
|
||||
|
||||
versions = g_strsplit_set (v, ".", 3);
|
||||
if (versions[0] != NULL)
|
||||
{
|
||||
*major = g_ascii_strtoll (versions[0], NULL, 10);
|
||||
if (versions[1] != NULL)
|
||||
{
|
||||
*minor = g_ascii_strtoll (versions[1], NULL, 10);
|
||||
if (versions[2] != NULL)
|
||||
{
|
||||
gchar **micro_rc_git;
|
||||
|
||||
*micro = g_ascii_strtoll (versions[2], NULL, 10);
|
||||
|
||||
micro_rc_git = g_strsplit_set (versions[2], "-", 2);
|
||||
|
||||
if (g_strv_length (micro_rc_git) > 1 &&
|
||||
strlen (micro_rc_git[1]) > 2 &&
|
||||
micro_rc_git[1][0] == 'R' &&
|
||||
micro_rc_git[1][1] == 'C')
|
||||
{
|
||||
gchar **rc_git;
|
||||
|
||||
*rc = g_ascii_strtoll (micro_rc_git[1] + 2, NULL, 10);
|
||||
|
||||
rc_git = g_strsplit_set (micro_rc_git[1], "+", 2);
|
||||
|
||||
if (g_strv_length (rc_git) > 1 &&
|
||||
strlen (rc_git[1]) == 3 &&
|
||||
rc_git[1][0] == 'g' &&
|
||||
rc_git[1][1] == 'i' &&
|
||||
rc_git[1][2] == 't')
|
||||
{
|
||||
*is_git = TRUE;
|
||||
}
|
||||
|
||||
g_strfreev (rc_git);
|
||||
}
|
||||
|
||||
g_strfreev (micro_rc_git);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (versions);
|
||||
|
||||
return (*major > 0 || *minor > 0 || *micro > 0);
|
||||
}
|
||||
|
@@ -145,10 +145,13 @@ GimpImage * gimp_create_image_from_buffer (Gimp *gimp,
|
||||
GeglBuffer *buffer,
|
||||
const gchar *image_name);
|
||||
|
||||
gint gimp_view_size_get_larger (gint view_size);
|
||||
gint gimp_view_size_get_smaller (gint view_size);
|
||||
gint gimp_view_size_get_larger (gint view_size);
|
||||
gint gimp_view_size_get_smaller (gint view_size);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
gboolean gimp_win32_have_wintab (void);
|
||||
gboolean gimp_win32_have_windows_ink (void);
|
||||
#endif
|
||||
|
||||
gint gimp_version_cmp (const gchar *v1,
|
||||
const gchar *v2);
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include "gimp-units.h"
|
||||
#include "gimp-utils.h"
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpbrushgenerated.h"
|
||||
#include "gimpbuffer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdynamics.h"
|
||||
@@ -75,6 +76,8 @@
|
||||
#include "gimptoolinfo.h"
|
||||
#include "gimptreeproxy.h"
|
||||
|
||||
#include "text/gimpfont.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
@@ -1269,6 +1272,34 @@ gimp_get_temp_file (Gimp *gimp,
|
||||
return file;
|
||||
}
|
||||
|
||||
GimpDataFactory *
|
||||
gimp_get_data_factory (Gimp *gimp,
|
||||
GType data_type)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (g_type_is_a (data_type, GIMP_TYPE_DATA), NULL);
|
||||
|
||||
if (g_type_is_a (data_type, GIMP_TYPE_BRUSH_GENERATED))
|
||||
return gimp->brush_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_BRUSH))
|
||||
return gimp->brush_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_PATTERN))
|
||||
return gimp->pattern_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_GRADIENT))
|
||||
return gimp->gradient_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_PALETTE))
|
||||
return gimp->palette_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_FONT))
|
||||
return gimp->font_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_DYNAMICS))
|
||||
return gimp->dynamics_factory;
|
||||
else if (g_type_is_a (data_type, GIMP_TYPE_MYBRUSH))
|
||||
return gimp->mybrush_factory;
|
||||
|
||||
/* If we reach this, it means we forgot a data factory in our list! */
|
||||
g_return_val_if_reached (NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_exit_idle_cleanup_stray_images (Gimp *gimp)
|
||||
{
|
||||
|
@@ -251,3 +251,7 @@ void gimp_image_opened (Gimp *gimp,
|
||||
|
||||
GFile * gimp_get_temp_file (Gimp *gimp,
|
||||
const gchar *extension);
|
||||
|
||||
GimpDataFactory *
|
||||
gimp_get_data_factory (Gimp *gimp,
|
||||
GType data_type);
|
||||
|
@@ -80,8 +80,7 @@ static GimpTempBuf * gimp_brush_get_new_preview (GimpViewable *vie
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_brush_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
|
||||
@@ -276,8 +275,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background)
|
||||
GeglColor *fg_color)
|
||||
{
|
||||
GimpBrush *brush = GIMP_BRUSH (viewable);
|
||||
const GimpTempBuf *mask_buf = brush->priv->mask;
|
||||
@@ -373,10 +371,10 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
|
||||
}
|
||||
else
|
||||
{
|
||||
guint8 rgb[3] = {0, 0, 0};
|
||||
guint8 rgb[3] = { 0, 0, 0 };
|
||||
|
||||
if (color != NULL)
|
||||
gegl_color_get_pixel (color, babl_format ("R'G'B' u8"), rgb);
|
||||
if (fg_color)
|
||||
gegl_color_get_pixel (fg_color, babl_format ("R'G'B' u8"), rgb);
|
||||
|
||||
for (y = 0; y < mask_height; y++)
|
||||
{
|
||||
|
@@ -271,7 +271,7 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
|
||||
break;
|
||||
|
||||
case PIPE_SELECT_ANGULAR:
|
||||
/* Coords angle is already nomalized,
|
||||
/* Coords angle is already normalized,
|
||||
* offset by 90 degrees is still needed
|
||||
* because hoses were made PS compatible*/
|
||||
ix = (gint) RINT ((1.0 - current_coords->direction + 0.25) * pipe->rank[i]) % pipe->rank[i];
|
||||
@@ -351,8 +351,10 @@ gimp_brush_pipe_set_params (GimpBrushPipe *pipe,
|
||||
{
|
||||
GimpPixPipeParams params;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gimp_pixpipe_params_init (¶ms);
|
||||
gimp_pixpipe_params_parse (paramstring, ¶ms);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
pipe->dimension = params.dim;
|
||||
pipe->rank = g_new0 (gint, pipe->dimension);
|
||||
@@ -384,7 +386,9 @@ gimp_brush_pipe_set_params (GimpBrushPipe *pipe,
|
||||
pipe->index[i] = 0;
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gimp_pixpipe_params_free (¶ms);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
pipe->params = g_strdup (paramstring);
|
||||
}
|
||||
|
@@ -64,14 +64,12 @@ static GimpTempBuf * gimp_buffer_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static GdkPixbuf * gimp_buffer_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_buffer_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
|
||||
@@ -232,8 +230,7 @@ gimp_buffer_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpBuffer *buffer = GIMP_BUFFER (viewable);
|
||||
const Babl *format = gimp_buffer_get_format (buffer);
|
||||
@@ -268,8 +265,7 @@ gimp_buffer_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpBuffer *buffer = GIMP_BUFFER (viewable);
|
||||
GdkPixbuf *pixbuf;
|
||||
|
@@ -106,6 +106,10 @@ static void gimp_container_real_add (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
static void gimp_container_real_remove (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
static void gimp_container_real_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index);
|
||||
|
||||
static GType gimp_container_get_item_type (GListModel *list);
|
||||
static guint gimp_container_get_n_items (GListModel *list);
|
||||
@@ -169,9 +173,10 @@ gimp_container_class_init (GimpContainerClass *klass)
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GimpContainerClass, reorder),
|
||||
NULL, NULL,
|
||||
gimp_marshal_VOID__OBJECT_INT,
|
||||
G_TYPE_NONE, 2,
|
||||
gimp_marshal_VOID__OBJECT_INT_INT,
|
||||
G_TYPE_NONE, 3,
|
||||
GIMP_TYPE_OBJECT,
|
||||
G_TYPE_INT,
|
||||
G_TYPE_INT);
|
||||
|
||||
container_signals[FREEZE] =
|
||||
@@ -198,7 +203,7 @@ gimp_container_class_init (GimpContainerClass *klass)
|
||||
|
||||
klass->add = gimp_container_real_add;
|
||||
klass->remove = gimp_container_real_remove;
|
||||
klass->reorder = NULL;
|
||||
klass->reorder = gimp_container_real_reorder;
|
||||
klass->freeze = NULL;
|
||||
klass->thaw = NULL;
|
||||
|
||||
@@ -357,6 +362,14 @@ gimp_container_real_remove (GimpContainer *container,
|
||||
container->priv->n_children--;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_container_real_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* GListModel functions */
|
||||
|
||||
@@ -775,6 +788,8 @@ gimp_container_insert (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint index)
|
||||
{
|
||||
gboolean success = FALSE;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||
g_return_val_if_fail (object != NULL, FALSE);
|
||||
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
|
||||
@@ -795,12 +810,18 @@ gimp_container_insert (GimpContainer *container,
|
||||
|
||||
if (gimp_container_add (container, object))
|
||||
{
|
||||
return gimp_container_reorder (container, object, index);
|
||||
/* set success to TRUE even if reorder() fails, because the
|
||||
* object has in fact been added
|
||||
*/
|
||||
success = TRUE;
|
||||
|
||||
gimp_container_reorder (container, object, index);
|
||||
}
|
||||
|
||||
container->priv->suspend_items_changed--;
|
||||
|
||||
if (container->priv->freeze_count == 0 &&
|
||||
if (success &&
|
||||
container->priv->freeze_count == 0 &&
|
||||
container->priv->suspend_items_changed == 0)
|
||||
{
|
||||
gint index = gimp_container_get_child_index (container, object);
|
||||
@@ -808,7 +829,7 @@ gimp_container_insert (GimpContainer *container,
|
||||
g_list_model_items_changed (G_LIST_MODEL (container), index, 0, 1);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return success;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -816,7 +837,7 @@ gimp_container_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint new_index)
|
||||
{
|
||||
gint index;
|
||||
gint old_index;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||
g_return_val_if_fail (object != NULL, FALSE);
|
||||
@@ -830,19 +851,19 @@ gimp_container_reorder (GimpContainer *container,
|
||||
if (new_index == -1)
|
||||
new_index = container->priv->n_children - 1;
|
||||
|
||||
index = gimp_container_get_child_index (container, object);
|
||||
old_index = gimp_container_get_child_index (container, object);
|
||||
|
||||
if (index == -1)
|
||||
if (old_index == -1)
|
||||
{
|
||||
g_warning ("%s: container %p does not contain object %p",
|
||||
G_STRFUNC, container, object);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (index != new_index)
|
||||
if (old_index != new_index)
|
||||
{
|
||||
g_signal_emit (container, container_signals[REORDER], 0,
|
||||
object, new_index);
|
||||
object, old_index, new_index);
|
||||
|
||||
if (container->priv->freeze_count == 0 &&
|
||||
container->priv->suspend_items_changed == 0)
|
||||
@@ -850,9 +871,9 @@ gimp_container_reorder (GimpContainer *container,
|
||||
gint new_index = gimp_container_get_child_index (container, object);
|
||||
|
||||
g_list_model_items_changed (G_LIST_MODEL (container),
|
||||
MIN (index, new_index),
|
||||
ABS (index - new_index) + 1,
|
||||
ABS (index - new_index) + 1);
|
||||
MIN (old_index, new_index),
|
||||
ABS (old_index - new_index) + 1,
|
||||
ABS (old_index - new_index) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -884,12 +905,12 @@ gimp_container_thaw (GimpContainer *container)
|
||||
|
||||
if (container->priv->freeze_count == 0)
|
||||
{
|
||||
g_signal_emit (container, container_signals[THAW], 0);
|
||||
|
||||
g_list_model_items_changed (G_LIST_MODEL (container), 0,
|
||||
container->priv->n_children_before_freeze,
|
||||
container->priv->n_children);
|
||||
container->priv->n_children_before_freeze = 0;
|
||||
|
||||
g_signal_emit (container, container_signals[THAW], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@ struct _GimpContainerClass
|
||||
GimpObject *object);
|
||||
void (* reorder) (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index);
|
||||
void (* freeze) (GimpContainer *container);
|
||||
void (* thaw) (GimpContainer *container);
|
||||
|
@@ -87,8 +87,7 @@ static GimpTempBuf * gimp_curve_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_curve_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
|
||||
@@ -524,8 +523,7 @@ gimp_curve_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -77,6 +77,14 @@ struct _GimpDataFactoryPrivate
|
||||
GimpAsyncSet *async_set;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const gchar *name;
|
||||
const gchar *collection;
|
||||
gboolean is_internal;
|
||||
} SearchData;
|
||||
|
||||
|
||||
#define GET_PRIVATE(obj) (((GimpDataFactory *) (obj))->priv)
|
||||
|
||||
|
||||
@@ -109,6 +117,9 @@ static void gimp_data_factory_path_notify (GObject *ob
|
||||
static GFile * gimp_data_factory_get_save_dir (GimpDataFactory *factory,
|
||||
GError **error);
|
||||
|
||||
static gboolean gimp_data_factory_search_in_container (GimpData *data,
|
||||
SearchData *search_data);
|
||||
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GimpDataFactory, gimp_data_factory,
|
||||
GIMP_TYPE_OBJECT)
|
||||
@@ -650,6 +661,47 @@ gimp_data_factory_data_cancel (GimpDataFactory *factory)
|
||||
GIMP_DATA_FACTORY_GET_CLASS (factory)->data_cancel (factory);
|
||||
}
|
||||
|
||||
GimpData *
|
||||
gimp_data_factory_get_data (GimpDataFactory *factory,
|
||||
const gchar *name,
|
||||
const gchar *collection,
|
||||
gboolean is_internal)
|
||||
{
|
||||
GimpContainer *container;
|
||||
GimpObject *data;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
|
||||
|
||||
container = gimp_data_factory_get_container (factory);
|
||||
|
||||
if (collection == NULL)
|
||||
{
|
||||
data = gimp_container_get_child_by_name (container, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchData *search_data = g_new (SearchData, 1);
|
||||
|
||||
search_data->name = name;
|
||||
search_data->collection = collection;
|
||||
search_data->is_internal = is_internal;
|
||||
data = gimp_container_search (container,
|
||||
(GimpContainerSearchFunc) gimp_data_factory_search_in_container,
|
||||
search_data);
|
||||
g_free (search_data);
|
||||
}
|
||||
|
||||
if (! data)
|
||||
data = gimp_container_get_child_by_name (gimp_data_factory_get_container_obsolete (factory),
|
||||
name);
|
||||
|
||||
if (! data && ! strcmp (name, "Standard"))
|
||||
data = (GimpObject *) gimp_data_factory_data_get_standard (factory,
|
||||
gimp_get_user_context (factory->priv->gimp));
|
||||
|
||||
return (GimpData *) data;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_data_factory_has_data_new_func (GimpDataFactory *factory)
|
||||
{
|
||||
@@ -1038,3 +1090,10 @@ gimp_data_factory_get_save_dir (GimpDataFactory *factory,
|
||||
|
||||
return writable_dir;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_data_factory_search_in_container (GimpData *data,
|
||||
SearchData *search_data)
|
||||
{
|
||||
return gimp_data_identify (data, search_data->name, search_data->collection, search_data->is_internal);
|
||||
}
|
||||
|
@@ -87,6 +87,11 @@ GimpAsyncSet * gimp_data_factory_get_async_set (GimpDataFactory *factory);
|
||||
gboolean gimp_data_factory_data_wait (GimpDataFactory *factory);
|
||||
void gimp_data_factory_data_cancel (GimpDataFactory *factory);
|
||||
|
||||
GimpData * gimp_data_factory_get_data (GimpDataFactory *factory,
|
||||
const gchar *name,
|
||||
const gchar *collection,
|
||||
gboolean is_internal);
|
||||
|
||||
gboolean gimp_data_factory_has_data_new_func (GimpDataFactory *factory);
|
||||
GimpData * gimp_data_factory_data_new (GimpDataFactory *factory,
|
||||
GimpContext *context,
|
||||
|
@@ -113,8 +113,7 @@ gimp_drawable_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpItem *item = GIMP_ITEM (viewable);
|
||||
GimpImage *image = gimp_item_get_image (item);
|
||||
@@ -135,8 +134,7 @@ gimp_drawable_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpItem *item = GIMP_ITEM (viewable);
|
||||
GimpImage *image = gimp_item_get_image (item);
|
||||
|
@@ -25,14 +25,12 @@ GimpTempBuf * gimp_drawable_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
GdkPixbuf * gimp_drawable_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
|
||||
/*
|
||||
* normal functions (no virtuals)
|
||||
|
@@ -766,7 +766,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
|
||||
{
|
||||
result = gimp_drawable_transform_paste (drawable, new_buffer, profile,
|
||||
new_offset_x, new_offset_y,
|
||||
new_layer);
|
||||
new_layer, TRUE);
|
||||
g_object_unref (new_buffer);
|
||||
}
|
||||
}
|
||||
@@ -848,7 +848,7 @@ gimp_drawable_transform_flip (GimpDrawable *drawable,
|
||||
{
|
||||
result = gimp_drawable_transform_paste (drawable, new_buffer, profile,
|
||||
new_offset_x, new_offset_y,
|
||||
new_layer);
|
||||
new_layer, TRUE);
|
||||
g_object_unref (new_buffer);
|
||||
}
|
||||
}
|
||||
@@ -933,7 +933,7 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable,
|
||||
{
|
||||
result = gimp_drawable_transform_paste (drawable, new_buffer, profile,
|
||||
new_offset_x, new_offset_y,
|
||||
new_layer);
|
||||
new_layer, TRUE);
|
||||
g_object_unref (new_buffer);
|
||||
}
|
||||
}
|
||||
@@ -1026,11 +1026,11 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
|
||||
GimpColorProfile *buffer_profile,
|
||||
gint offset_x,
|
||||
gint offset_y,
|
||||
gboolean new_layer)
|
||||
gboolean new_layer,
|
||||
gboolean push_undo)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpLayer *layer = NULL;
|
||||
const gchar *undo_desc = NULL;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer = NULL;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
||||
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
|
||||
@@ -1039,14 +1039,19 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
|
||||
|
||||
image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
if (GIMP_IS_LAYER (drawable))
|
||||
undo_desc = C_("undo-type", "Transform Layer");
|
||||
else if (GIMP_IS_CHANNEL (drawable))
|
||||
undo_desc = C_("undo-type", "Transform Channel");
|
||||
else
|
||||
return NULL;
|
||||
if (push_undo)
|
||||
{
|
||||
const gchar *undo_desc = NULL;
|
||||
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, undo_desc);
|
||||
if (GIMP_IS_LAYER (drawable))
|
||||
undo_desc = C_("undo-type", "Transform Layer");
|
||||
else if (GIMP_IS_CHANNEL (drawable))
|
||||
undo_desc = C_("undo-type", "Transform Channel");
|
||||
else
|
||||
return NULL;
|
||||
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, undo_desc);
|
||||
}
|
||||
|
||||
if (new_layer)
|
||||
{
|
||||
@@ -1066,13 +1071,14 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_drawable_set_buffer_full (drawable, TRUE, NULL,
|
||||
gimp_drawable_set_buffer_full (drawable, push_undo, NULL,
|
||||
buffer,
|
||||
GEGL_RECTANGLE (offset_x, offset_y, 0, 0),
|
||||
TRUE);
|
||||
}
|
||||
|
||||
gimp_image_undo_group_end (image);
|
||||
if (push_undo)
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
return drawable;
|
||||
}
|
||||
|
@@ -87,4 +87,5 @@ GimpDrawable * gimp_drawable_transform_paste (GimpDrawable
|
||||
GimpColorProfile *buffer_profile,
|
||||
gint offset_x,
|
||||
gint offset_y,
|
||||
gboolean new_layer);
|
||||
gboolean new_layer,
|
||||
gboolean push_undo);
|
||||
|
@@ -142,7 +142,8 @@ static void gimp_drawable_transform (GimpItem *item,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress);
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo);
|
||||
|
||||
static const guint8 *
|
||||
gimp_drawable_get_icc_profile (GimpColorManaged *managed,
|
||||
@@ -583,7 +584,7 @@ gimp_drawable_duplicate (GimpItem *item,
|
||||
|
||||
new_filter = gimp_drawable_filter_duplicate (new_drawable,
|
||||
filter);
|
||||
if (filter)
|
||||
if (new_filter)
|
||||
{
|
||||
gimp_drawable_filter_apply (new_filter, NULL);
|
||||
gimp_drawable_filter_commit (new_filter, TRUE, NULL, FALSE);
|
||||
@@ -742,7 +743,7 @@ gimp_drawable_flip (GimpItem *item,
|
||||
if (buffer)
|
||||
{
|
||||
gimp_drawable_transform_paste (drawable, buffer, buffer_profile,
|
||||
new_off_x, new_off_y, FALSE);
|
||||
new_off_x, new_off_y, FALSE, TRUE);
|
||||
g_object_unref (buffer);
|
||||
}
|
||||
}
|
||||
@@ -774,7 +775,7 @@ gimp_drawable_rotate (GimpItem *item,
|
||||
if (buffer)
|
||||
{
|
||||
gimp_drawable_transform_paste (drawable, buffer, buffer_profile,
|
||||
new_off_x, new_off_y, FALSE);
|
||||
new_off_x, new_off_y, FALSE, TRUE);
|
||||
g_object_unref (buffer);
|
||||
}
|
||||
}
|
||||
@@ -786,7 +787,8 @@ gimp_drawable_transform (GimpItem *item,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress)
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo)
|
||||
{
|
||||
GimpDrawable *drawable = GIMP_DRAWABLE (item);
|
||||
GeglBuffer *buffer;
|
||||
@@ -809,7 +811,7 @@ gimp_drawable_transform (GimpItem *item,
|
||||
if (buffer)
|
||||
{
|
||||
gimp_drawable_transform_paste (drawable, buffer, buffer_profile,
|
||||
new_off_x, new_off_y, FALSE);
|
||||
new_off_x, new_off_y, FALSE, push_undo);
|
||||
g_object_unref (buffer);
|
||||
}
|
||||
}
|
||||
|
@@ -56,6 +56,8 @@
|
||||
#include "gimplist.h"
|
||||
#include "gimpprogress.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -173,6 +175,7 @@ static void gimp_drawable_filter_lock_alpha_changed (GimpLayer
|
||||
|
||||
static void gimp_drawable_filter_reorder (GimpFilterStack *stack,
|
||||
GimpDrawableFilter *reordered_filter,
|
||||
gint old_index,
|
||||
gint new_index,
|
||||
GimpDrawableFilter *filter);
|
||||
|
||||
@@ -953,9 +956,8 @@ gimp_drawable_filter_update (GimpDrawableFilter *filter,
|
||||
* directly with bad data.
|
||||
*/
|
||||
g_set_error (error, GIMP_ERROR, GIMP_FAILED,
|
||||
/* TODO: localize after string freeze. */
|
||||
"GEGL operation '%s' has been called with a "
|
||||
"non-existent argument name '%s' (#%d).",
|
||||
_("GEGL operation '%s' has been called with a "
|
||||
"non-existent argument name '%s' (#%d)."),
|
||||
opname, pspec->name, i);
|
||||
break;
|
||||
}
|
||||
@@ -1018,10 +1020,9 @@ gimp_drawable_filter_update (GimpDrawableFilter *filter,
|
||||
else if (! G_TYPE_CHECK_VALUE_TYPE (new_value, G_PARAM_SPEC_VALUE_TYPE (pspec)))
|
||||
{
|
||||
g_set_error (error, GIMP_ERROR, GIMP_FAILED,
|
||||
/* TODO: localize after string freeze. */
|
||||
"GEGL operation '%s' has been called with a "
|
||||
"wrong value type for argument '%s' (#%d). "
|
||||
"Expected %s, got %s.",
|
||||
_("GEGL operation '%s' has been called with a "
|
||||
"wrong value type for argument '%s' (#%d). "
|
||||
"Expected %s, got %s."),
|
||||
opname, pspec->name, i,
|
||||
g_type_name (pspec->value_type),
|
||||
g_type_name (G_VALUE_TYPE (new_value)));
|
||||
@@ -1094,9 +1095,8 @@ gimp_drawable_filter_update (GimpDrawableFilter *filter,
|
||||
if (! gegl_node_has_pad (node, auxinputnames[i]))
|
||||
{
|
||||
g_set_error (error, GIMP_ERROR, GIMP_FAILED,
|
||||
/* TODO: localize after string freeze. */
|
||||
"GEGL operation '%s' has been called with an "
|
||||
"invalid aux input name '%s'.",
|
||||
_("GEGL operation '%s' has been called with an "
|
||||
"invalid aux input name '%s'."),
|
||||
opname, auxinputnames[i]);
|
||||
break;
|
||||
}
|
||||
@@ -2015,6 +2015,7 @@ gimp_drawable_filter_lock_alpha_changed (GimpLayer *layer,
|
||||
static void
|
||||
gimp_drawable_filter_reorder (GimpFilterStack *stack,
|
||||
GimpDrawableFilter *reordered_filter,
|
||||
gint old_index,
|
||||
gint new_index,
|
||||
GimpDrawableFilter *filter)
|
||||
{
|
||||
@@ -2032,6 +2033,8 @@ gimp_drawable_filter_reorder (GimpFilterStack *stack,
|
||||
* it's organized.
|
||||
*/
|
||||
GIMP_IS_DRAWABLE_FILTER (GIMP_LIST (stack)->queue->head->data))
|
||||
gimp_drawable_filter_sync_format (GIMP_LIST (stack)->queue->head->data);
|
||||
{
|
||||
gimp_drawable_filter_sync_format (GIMP_LIST (stack)->queue->head->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -108,8 +108,7 @@ gimp_drawable_filter_mask_rename (GimpItem *item,
|
||||
GError **error)
|
||||
{
|
||||
g_set_error (error, GIMP_ERROR, GIMP_FAILED,
|
||||
/* TODO: localized after string freeze. */
|
||||
"Cannot rename effect masks.");
|
||||
_("Cannot rename effect masks."));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -47,6 +47,7 @@ static void gimp_drawable_stack_remove (GimpContainer *container
|
||||
GimpObject *object);
|
||||
static void gimp_drawable_stack_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index);
|
||||
|
||||
static void gimp_drawable_stack_drawable_update (GimpItem *item,
|
||||
@@ -142,11 +143,13 @@ gimp_drawable_stack_remove (GimpContainer *container,
|
||||
static void
|
||||
gimp_drawable_stack_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index)
|
||||
{
|
||||
GimpDrawableStack *stack = GIMP_DRAWABLE_STACK (container);
|
||||
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object, new_index);
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object,
|
||||
old_index, new_index);
|
||||
|
||||
if (gimp_filter_get_active (GIMP_FILTER (object)))
|
||||
gimp_drawable_stack_drawable_active (GIMP_ITEM (object), stack);
|
||||
|
@@ -20,7 +20,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <appstream-glib.h>
|
||||
#include <appstream.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
@@ -45,11 +46,12 @@ enum
|
||||
|
||||
struct _GimpExtensionPrivate
|
||||
{
|
||||
gchar *path;
|
||||
gchar *path;
|
||||
|
||||
AsApp *app;
|
||||
gboolean writable;
|
||||
gboolean running;
|
||||
AsMetadata *metadata;
|
||||
AsComponent *component;
|
||||
gboolean writable;
|
||||
gboolean running;
|
||||
|
||||
/* Extension metadata: directories. */
|
||||
GList *brush_paths;
|
||||
@@ -144,8 +146,7 @@ gimp_extension_finalize (GObject *object)
|
||||
gimp_extension_clean (extension);
|
||||
|
||||
g_free (extension->p->path);
|
||||
if (extension->p->app)
|
||||
g_object_unref (extension->p->app);
|
||||
g_clear_object (&extension->p->metadata);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
@@ -222,31 +223,26 @@ gimp_extension_new (const gchar *dir,
|
||||
const gchar *
|
||||
gimp_extension_get_name (GimpExtension *extension)
|
||||
{
|
||||
g_return_val_if_fail (extension->p->app != NULL, NULL);
|
||||
g_return_val_if_fail (extension->p->component != NULL, NULL);
|
||||
|
||||
return as_app_get_name (extension->p->app, g_getenv ("LANGUAGE")) ?
|
||||
as_app_get_name (extension->p->app, g_getenv ("LANGUAGE")) :
|
||||
as_app_get_name (extension->p->app, NULL);
|
||||
return as_component_get_name (extension->p->component);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_extension_get_comment (GimpExtension *extension)
|
||||
{
|
||||
g_return_val_if_fail (extension->p->app != NULL, NULL);
|
||||
|
||||
return as_app_get_comment (extension->p->app, g_getenv ("LANGUAGE")) ?
|
||||
as_app_get_comment (extension->p->app, g_getenv ("LANGUAGE")) :
|
||||
as_app_get_comment (extension->p->app, NULL);
|
||||
g_return_val_if_fail (extension->p->component != NULL, NULL);
|
||||
|
||||
return as_component_get_summary (extension->p->component);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_extension_get_description (GimpExtension *extension)
|
||||
{
|
||||
g_return_val_if_fail (extension->p->app != NULL, NULL);
|
||||
g_return_val_if_fail (extension->p->component != NULL, NULL);
|
||||
|
||||
return as_app_get_description (extension->p->app, g_getenv ("LANGUAGE")) ?
|
||||
as_app_get_description (extension->p->app, g_getenv ("LANGUAGE")) :
|
||||
as_app_get_description (extension->p->app, NULL);
|
||||
return as_component_get_description (extension->p->component);
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
@@ -255,30 +251,74 @@ gimp_extension_get_screenshot (GimpExtension *extension,
|
||||
gint height,
|
||||
const gchar **caption)
|
||||
{
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
AsScreenshot *screenshot;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
AsScreenshot *screenshot = NULL;
|
||||
const GPtrArray *screenshots;
|
||||
|
||||
g_return_val_if_fail (extension->p->app != NULL, NULL);
|
||||
g_return_val_if_fail (extension->p->component != NULL, NULL);
|
||||
|
||||
#if AS_CHECK_VERSION(1, 0, 0)
|
||||
screenshots = as_component_get_screenshots_all (extension->p->component);
|
||||
#else
|
||||
screenshots = as_component_get_screenshots (extension->p->component);
|
||||
#endif
|
||||
|
||||
if (screenshots == NULL || screenshots->len == 0)
|
||||
{
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/* Look for the screenshot marked as default */
|
||||
for (guint i = 0; i < screenshots->len; i++)
|
||||
{
|
||||
AsScreenshot *ss = g_ptr_array_index (screenshots, i);
|
||||
if (as_screenshot_get_kind (ss) == AS_SCREENSHOT_KIND_DEFAULT)
|
||||
{
|
||||
screenshot = ss;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (screenshot == NULL)
|
||||
{
|
||||
g_printerr (_("Invalid AppStream metadata: failed to find default screenshot for extension \"%s\""),
|
||||
as_component_get_id (extension->p->component));
|
||||
}
|
||||
|
||||
screenshot = as_app_get_screenshot_default (extension->p->app);
|
||||
if (screenshot)
|
||||
{
|
||||
AsImage *image;
|
||||
AsImage *image = NULL;
|
||||
GFile *file = NULL;
|
||||
GFileInputStream *istream = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
image = as_screenshot_get_image_for_locale (screenshot, g_getenv ("LANGUAGE"), width, height);
|
||||
if (! image)
|
||||
image = as_screenshot_get_image_for_locale (screenshot, NULL, width, height);
|
||||
#if AS_CHECK_VERSION(1, 0, 0)
|
||||
image = as_screenshot_get_image (screenshot, width, height, 1);
|
||||
#else
|
||||
image = as_screenshot_get_image (screenshot, width, height);
|
||||
#endif
|
||||
|
||||
file = g_file_new_for_uri (as_image_get_url (image));
|
||||
istream = g_file_read (file, NULL, &error);
|
||||
if (istream != NULL)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (istream), NULL, &error);
|
||||
}
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
g_printerr (_("Invalid AppStream metadata: Error loading image: \"%s\""), error->message);
|
||||
}
|
||||
|
||||
pixbuf = as_image_get_pixbuf (image);
|
||||
if (pixbuf)
|
||||
{
|
||||
g_object_ref (pixbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
GFile *file;
|
||||
GFileInputStream *istream;
|
||||
GError *error = NULL;
|
||||
GFile *file = NULL;
|
||||
GFileInputStream *istream = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
file = g_file_new_for_uri (as_image_get_url (image));
|
||||
istream = g_file_read (file, NULL, &error);
|
||||
@@ -298,9 +338,7 @@ gimp_extension_get_screenshot (GimpExtension *extension,
|
||||
|
||||
if (caption)
|
||||
{
|
||||
*caption = as_screenshot_get_caption (screenshot, g_getenv ("LANGUAGE"));
|
||||
if (*caption == NULL)
|
||||
*caption = as_screenshot_get_caption (screenshot, NULL);
|
||||
*caption = as_screenshot_get_caption (screenshot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,16 +369,29 @@ gboolean
|
||||
gimp_extension_load (GimpExtension *extension,
|
||||
GError **error)
|
||||
{
|
||||
AsApp *app;
|
||||
GPtrArray *extends;
|
||||
GPtrArray *requires;
|
||||
AsRelease *release;
|
||||
gchar *appdata_name;
|
||||
gchar *path;
|
||||
gboolean success = FALSE;
|
||||
gboolean has_require = FALSE;
|
||||
AsMetadata *metadata;
|
||||
AsComponent *component;
|
||||
#if AS_CHECK_VERSION(1, 0, 0)
|
||||
AsComponentBox *components = NULL;
|
||||
#else
|
||||
GPtrArray *components = NULL;
|
||||
#endif
|
||||
GPtrArray *extends;
|
||||
GPtrArray *relations;
|
||||
AsRelease *release = NULL;
|
||||
#if AS_CHECK_VERSION(1, 0, 0)
|
||||
AsReleaseList *rlist = NULL;
|
||||
#else
|
||||
GPtrArray *rlist = NULL;
|
||||
#endif
|
||||
gchar *appdata_name;
|
||||
gchar *path;
|
||||
GFile *file;
|
||||
gboolean success = FALSE;
|
||||
gboolean has_require = FALSE;
|
||||
|
||||
g_clear_object (&extension->p->app);
|
||||
g_clear_object (&extension->p->metadata);
|
||||
extension->p->component = NULL;
|
||||
|
||||
/* Search in subdirectory if a file with the same name as
|
||||
* directory and ending with ".metainfo.xml" exists.
|
||||
@@ -350,12 +401,32 @@ gimp_extension_load (GimpExtension *extension,
|
||||
path = g_build_filename (extension->p->path, appdata_name, NULL);
|
||||
g_free (appdata_name);
|
||||
|
||||
app = as_app_new ();
|
||||
success = as_app_parse_file (app, path,
|
||||
AS_APP_PARSE_FLAG_USE_HEURISTICS,
|
||||
error);
|
||||
file = g_file_new_for_path (path);
|
||||
|
||||
metadata = as_metadata_new ();
|
||||
success = as_metadata_parse_file (metadata, file, AS_FORMAT_KIND_XML, error);
|
||||
|
||||
if (success)
|
||||
{
|
||||
#if AS_CHECK_VERSION(1, 0, 0)
|
||||
components = as_metadata_get_components (metadata);
|
||||
component = as_component_box_index (components, 0);
|
||||
#else
|
||||
components = as_metadata_get_components (metadata);
|
||||
component = g_ptr_array_index (components, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
g_object_unref (file);
|
||||
g_free (path);
|
||||
if (success && as_app_get_kind (app) != AS_APP_KIND_ADDON)
|
||||
|
||||
if (!success)
|
||||
{
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
if (success && as_component_get_kind (component) != AS_COMPONENT_KIND_ADDON)
|
||||
{
|
||||
/* Properly setting the type will allow extensions to be
|
||||
* distributed appropriately through other means.
|
||||
@@ -364,11 +435,11 @@ gimp_extension_load (GimpExtension *extension,
|
||||
*error = g_error_new (GIMP_EXTENSION_ERROR,
|
||||
GIMP_EXTENSION_BAD_APPDATA,
|
||||
_("Extension AppData must be of type \"addon\", found \"%s\" instead."),
|
||||
as_app_kind_to_string (as_app_get_kind (app)));
|
||||
as_component_kind_to_string (as_component_get_kind (component)));
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
extends = as_app_get_extends (app);
|
||||
extends = as_component_get_extends (component);
|
||||
if (success &&
|
||||
! g_ptr_array_find_with_equal_func (extends, "org.gimp.GIMP",
|
||||
g_str_equal, NULL))
|
||||
@@ -384,7 +455,7 @@ gimp_extension_load (GimpExtension *extension,
|
||||
}
|
||||
|
||||
if (success &&
|
||||
g_strcmp0 (as_app_get_id (app),
|
||||
g_strcmp0 (as_component_get_id (component),
|
||||
gimp_object_get_name (extension)) != 0)
|
||||
{
|
||||
/* Extension IDs will be unique and we want therefore the
|
||||
@@ -394,11 +465,24 @@ gimp_extension_load (GimpExtension *extension,
|
||||
*error = g_error_new (GIMP_EXTENSION_ERROR,
|
||||
GIMP_EXTENSION_FAILED,
|
||||
_("Extension AppData id (\"%s\") and directory (\"%s\") must be the same."),
|
||||
as_app_get_id (app), gimp_object_get_name (extension));
|
||||
as_component_get_id (component), gimp_object_get_name (extension));
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
release = as_app_get_release_default (app);
|
||||
#if AS_CHECK_VERSION(1, 0, 0)
|
||||
rlist = as_component_get_releases_plain (component);
|
||||
if (rlist != NULL && !as_release_list_is_empty (rlist))
|
||||
{
|
||||
release = as_release_list_index (rlist, 0);
|
||||
}
|
||||
#else
|
||||
rlist = as_component_get_releases (component);
|
||||
if (rlist != NULL && rlist->len > 0)
|
||||
{
|
||||
release = g_ptr_array_index (rlist, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (success && (! release || ! as_release_get_version (release)))
|
||||
{
|
||||
/* We don't need the detail, just to know that the extension has a
|
||||
@@ -412,24 +496,19 @@ gimp_extension_load (GimpExtension *extension,
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
requires = as_app_get_requires (app);
|
||||
if (success && requires)
|
||||
relations = as_component_get_requires (component);
|
||||
if (success && relations != NULL)
|
||||
{
|
||||
gint i;
|
||||
|
||||
/* An extension could set requirements, in particular a range of
|
||||
* supported version of GIMP, but also other extensions.
|
||||
*/
|
||||
|
||||
for (i = 0; i < requires->len; i++)
|
||||
for (guint i = 0; i < relations->len; i++)
|
||||
{
|
||||
AsRequire *require = g_ptr_array_index (requires, i);
|
||||
AsRelation *relation = g_ptr_array_index(relations, i);
|
||||
|
||||
if (as_require_get_kind (require) == AS_REQUIRE_KIND_ID &&
|
||||
g_strcmp0 (as_require_get_value (require), "org.gimp.GIMP") == 0)
|
||||
if (as_relation_get_item_kind(relation) == AS_RELATION_ITEM_KIND_ID &&
|
||||
g_strcmp0(as_relation_get_value_str(relation), "org.gimp.GIMP") == 0)
|
||||
{
|
||||
has_require = TRUE;
|
||||
if (! as_require_version_compare (require, GIMP_VERSION, error))
|
||||
|
||||
if (! as_relation_version_compare (relation, GIMP_VERSION, error))
|
||||
{
|
||||
success = FALSE;
|
||||
break;
|
||||
@@ -437,14 +516,11 @@ gimp_extension_load (GimpExtension *extension,
|
||||
}
|
||||
else if (error && *error == NULL)
|
||||
{
|
||||
/* Right now we only support requirement relative to GIMP
|
||||
* version.
|
||||
*/
|
||||
*error = g_error_new (GIMP_EXTENSION_ERROR,
|
||||
GIMP_EXTENSION_FAILED,
|
||||
_("Unsupported <requires> \"%s\" (type %s)."),
|
||||
as_require_get_value (require),
|
||||
as_require_kind_to_string (as_require_get_kind (require)));
|
||||
_("Unsupported <relation> \"%s\" (type %s)."),
|
||||
as_relation_get_value_str(relation),
|
||||
as_relation_item_kind_to_string(as_relation_get_item_kind(relation)));
|
||||
success = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -462,9 +538,14 @@ gimp_extension_load (GimpExtension *extension,
|
||||
}
|
||||
|
||||
if (success)
|
||||
extension->p->app = app;
|
||||
{
|
||||
extension->p->metadata = metadata;
|
||||
extension->p->component = component;
|
||||
}
|
||||
else
|
||||
g_object_unref (app);
|
||||
{
|
||||
g_clear_object (&metadata);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -476,11 +557,11 @@ gimp_extension_run (GimpExtension *extension,
|
||||
GHashTable *metadata;
|
||||
gchar *value;
|
||||
|
||||
g_return_val_if_fail (extension->p->app != NULL, FALSE);
|
||||
g_return_val_if_fail (extension->p->component != NULL, FALSE);
|
||||
g_return_val_if_fail (error && *error == NULL, FALSE);
|
||||
|
||||
gimp_extension_clean (extension);
|
||||
metadata = as_app_get_metadata (extension->p->app);
|
||||
metadata = as_component_get_custom (extension->p->component);
|
||||
|
||||
value = g_hash_table_lookup (metadata, "GIMP::brush-path");
|
||||
extension->p->brush_paths = gimp_extension_validate_paths (extension,
|
||||
@@ -738,7 +819,7 @@ gimp_extension_validate_paths (GimpExtension *extension,
|
||||
|
||||
for (i = 0; patharray[i]; i++)
|
||||
{
|
||||
/* Note: appstream-glib is supposed to return everything as UTF-8,
|
||||
/* Note: appstream is supposed to return everything as UTF-8,
|
||||
* so we should not have to bother about this. */
|
||||
gchar *path;
|
||||
GFile *file;
|
||||
|
@@ -60,6 +60,9 @@ static void gimp_filtered_container_real_src_thaw (GimpFilteredContainer *
|
||||
|
||||
static gboolean gimp_filtered_container_object_matches (GimpFilteredContainer *filtered_container,
|
||||
GimpObject *object);
|
||||
static void gimp_filtered_container_src_sort_func (GimpContainer *src,
|
||||
GParamSpec *pspec,
|
||||
GimpFilteredContainer *filtered_container);
|
||||
static void gimp_filtered_container_src_add (GimpContainer *src_container,
|
||||
GimpObject *obj,
|
||||
GimpFilteredContainer *filtered_container);
|
||||
@@ -148,6 +151,9 @@ gimp_filtered_container_dispose (GObject *object)
|
||||
|
||||
if (filtered_container->src_container)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (filtered_container->src_container,
|
||||
gimp_filtered_container_src_sort_func,
|
||||
filtered_container);
|
||||
g_signal_handlers_disconnect_by_func (filtered_container->src_container,
|
||||
gimp_filtered_container_src_add,
|
||||
filtered_container);
|
||||
@@ -188,6 +194,9 @@ gimp_filtered_container_set_property (GObject *object,
|
||||
case PROP_SRC_CONTAINER:
|
||||
filtered_container->src_container = g_value_dup_object (value);
|
||||
|
||||
g_signal_connect (filtered_container->src_container, "notify::sort-func",
|
||||
G_CALLBACK (gimp_filtered_container_src_sort_func),
|
||||
filtered_container);
|
||||
g_signal_connect (filtered_container->src_container, "add",
|
||||
G_CALLBACK (gimp_filtered_container_src_add),
|
||||
filtered_container);
|
||||
@@ -332,6 +341,16 @@ gimp_filtered_container_object_matches (GimpFilteredContainer *filtered_containe
|
||||
filtered_container->filter_data));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_filtered_container_src_sort_func (GimpContainer *src,
|
||||
GParamSpec *pspec,
|
||||
GimpFilteredContainer *filtered_container)
|
||||
{
|
||||
GCompareFunc sort_func = gimp_list_get_sort_func (GIMP_LIST (src));
|
||||
|
||||
gimp_list_set_sort_func (GIMP_LIST (filtered_container), sort_func);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_filtered_container_src_add (GimpContainer *src_container,
|
||||
GimpObject *object,
|
||||
|
@@ -40,6 +40,7 @@ static void gimp_filter_stack_remove (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
static void gimp_filter_stack_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index);
|
||||
|
||||
static void gimp_filter_stack_add_node (GimpFilterStack *stack,
|
||||
@@ -147,6 +148,7 @@ gimp_filter_stack_remove (GimpContainer *container,
|
||||
static void
|
||||
gimp_filter_stack_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index)
|
||||
{
|
||||
GimpFilterStack *stack = GIMP_FILTER_STACK (container);
|
||||
@@ -155,7 +157,8 @@ gimp_filter_stack_reorder (GimpContainer *container,
|
||||
if (stack->graph && gimp_filter_get_active (filter))
|
||||
gimp_filter_stack_remove_node (stack, filter);
|
||||
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object, new_index);
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object,
|
||||
old_index, new_index);
|
||||
|
||||
if (gimp_filter_get_active (filter))
|
||||
{
|
||||
|
@@ -63,8 +63,7 @@ static GimpTempBuf * gimp_gradient_get_new_preview (GimpViewable *viewa
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
|
||||
static const gchar * gimp_gradient_get_extension (GimpData *data);
|
||||
static void gimp_gradient_copy (GimpData *data,
|
||||
@@ -219,8 +218,7 @@ gimp_gradient_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpGradient *gradient = GIMP_GRADIENT (viewable);
|
||||
GimpGradientSegment *seg = NULL;
|
||||
|
@@ -159,7 +159,8 @@ static void gimp_group_layer_transform (GimpLayer *layer,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress);
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo);
|
||||
static void gimp_group_layer_convert_type (GimpLayer *layer,
|
||||
GimpImage *dest_image,
|
||||
const Babl *new_format,
|
||||
@@ -1016,7 +1017,8 @@ gimp_group_layer_transform (GimpLayer *layer,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress)
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo)
|
||||
{
|
||||
GimpGroupLayer *group = GIMP_GROUP_LAYER (layer);
|
||||
GimpGroupLayerPrivate *private = GET_PRIVATE (layer);
|
||||
|
@@ -152,7 +152,7 @@ gimp_id_table_insert (GimpIdTable *id_table, gpointer data)
|
||||
* @data: The data to associate with the id
|
||||
*
|
||||
* Insert data in the id table with a specific ID. If data already
|
||||
* exsts with the given ID, this function fails.
|
||||
* exists with the given ID, this function fails.
|
||||
*
|
||||
* Returns: The used ID if successful, -1 if it was already in use.
|
||||
**/
|
||||
|
@@ -2361,6 +2361,8 @@ select_colors_gray (QuantizeObj *quantobj,
|
||||
/* Compute the representative color for each box, fill colormap */
|
||||
for (i = 0; i < numboxes; i++)
|
||||
compute_color_gray (quantobj, histogram, boxlist + i, i);
|
||||
|
||||
g_free (boxlist);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -122,8 +122,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (viewable);
|
||||
const Babl *format;
|
||||
@@ -153,8 +152,7 @@ gimp_image_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (viewable);
|
||||
GdkPixbuf *pixbuf;
|
||||
|
@@ -41,11 +41,9 @@ GimpTempBuf * gimp_image_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
GdkPixbuf * gimp_image_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
|
@@ -48,6 +48,8 @@
|
||||
#include "gimplayermaskundo.h"
|
||||
#include "gimplayerpropundo.h"
|
||||
#include "gimplayerundo.h"
|
||||
#include "gimplinklayer.h"
|
||||
#include "gimplinklayerundo.h"
|
||||
#include "gimpmaskundo.h"
|
||||
#include "gimpsamplepoint.h"
|
||||
#include "gimpsamplepointundo.h"
|
||||
@@ -57,6 +59,8 @@
|
||||
#include "path/gimppathmodundo.h"
|
||||
#include "path/gimppathpropundo.h"
|
||||
#include "path/gimppathundo.h"
|
||||
#include "path/gimpvectorlayer.h"
|
||||
#include "path/gimpvectorlayerundo.h"
|
||||
|
||||
#include "text/gimptextlayer.h"
|
||||
#include "text/gimptextundo.h"
|
||||
@@ -876,6 +880,64 @@ gimp_image_undo_push_text_layer_convert (GimpImage *image,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**********************/
|
||||
/* Link Layer Undos */
|
||||
/**********************/
|
||||
|
||||
GimpUndo *
|
||||
gimp_image_undo_push_link_layer (GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpLinkLayer *layer)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_LINK_LAYER (layer), NULL);
|
||||
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), NULL);
|
||||
|
||||
return gimp_image_undo_push (image, GIMP_TYPE_LINK_LAYER_UNDO,
|
||||
GIMP_UNDO_LINK_LAYER, undo_desc,
|
||||
GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE,
|
||||
"item", layer,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/************************/
|
||||
/* Vector Layer Undos */
|
||||
/************************/
|
||||
|
||||
GimpUndo *
|
||||
gimp_image_undo_push_vector_layer (GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpVectorLayer *layer,
|
||||
const GParamSpec *pspec)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_VECTOR_LAYER (layer), NULL);
|
||||
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), NULL);
|
||||
|
||||
return gimp_image_undo_push (image, GIMP_TYPE_VECTOR_LAYER_UNDO,
|
||||
GIMP_UNDO_VECTOR_LAYER, undo_desc,
|
||||
GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE,
|
||||
"item", layer,
|
||||
"param", pspec,
|
||||
NULL);
|
||||
}
|
||||
|
||||
GimpUndo *
|
||||
gimp_image_undo_push_vector_layer_modified (GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpVectorLayer *layer)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_VECTOR_LAYER (layer), NULL);
|
||||
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), NULL);
|
||||
|
||||
return gimp_image_undo_push (image, GIMP_TYPE_VECTOR_LAYER_UNDO,
|
||||
GIMP_UNDO_VECTOR_LAYER_MODIFIED, undo_desc,
|
||||
GIMP_DIRTY_ITEM_META,
|
||||
"item", layer,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
/**********************/
|
||||
/* Layer Mask Undos */
|
||||
@@ -898,6 +960,7 @@ gimp_image_undo_push_layer_mask_add (GimpImage *image,
|
||||
GIMP_DIRTY_IMAGE_STRUCTURE,
|
||||
"item", layer,
|
||||
"layer-mask", mask,
|
||||
"edit-mask", FALSE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -920,6 +983,7 @@ gimp_image_undo_push_layer_mask_remove (GimpImage *image,
|
||||
GIMP_DIRTY_IMAGE_STRUCTURE,
|
||||
"item", layer,
|
||||
"layer-mask", mask,
|
||||
"edit-mask", gimp_layer_get_edit_mask (layer),
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -214,6 +214,22 @@ GimpUndo * gimp_image_undo_push_text_layer_convert (GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpTextLayer *layer);
|
||||
|
||||
/* link layer undos */
|
||||
|
||||
GimpUndo * gimp_image_undo_push_link_layer (GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpLinkLayer *layer);
|
||||
|
||||
/* vector layer undos */
|
||||
|
||||
GimpUndo * gimp_image_undo_push_vector_layer (GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpVectorLayer *layer,
|
||||
const GParamSpec *pspec);
|
||||
GimpUndo * gimp_image_undo_push_vector_layer_modified
|
||||
(GimpImage *image,
|
||||
const gchar *undo_desc,
|
||||
GimpVectorLayer *layer);
|
||||
|
||||
/* layer mask undos */
|
||||
|
||||
|
@@ -71,6 +71,7 @@
|
||||
#include "gimplayer-floating-selection.h"
|
||||
#include "gimplayermask.h"
|
||||
#include "gimplayerstack.h"
|
||||
#include "gimplinklayer.h"
|
||||
#include "gimpmarshal.h"
|
||||
#include "gimppalette.h"
|
||||
#include "gimpparasitelist.h"
|
||||
@@ -87,6 +88,7 @@
|
||||
#include "text/gimptextlayer.h"
|
||||
|
||||
#include "path/gimppath.h"
|
||||
#include "path/gimpvectorlayer.h"
|
||||
|
||||
#include "gimp-log.h"
|
||||
#include "gimp-intl.h"
|
||||
@@ -3010,11 +3012,27 @@ gimp_image_get_xcf_version (GimpImage *image,
|
||||
/* The blending space variant corresponding to SPACE_RGB_PERCEPTUAL in <3.0
|
||||
* corresponds to R'G'B'A which is NON_LINEAR in babl. Perceptual in babl is
|
||||
* R~G~B~A, >= 3.0 the code, comments and usage matches the existing enum value
|
||||
* as being NON_LINEAR and new layers created use the new interger value for
|
||||
* as being NON_LINEAR and new layers created use the new integer value for
|
||||
* PERCEPTUAL.
|
||||
*/
|
||||
version = MAX (23, version);
|
||||
}
|
||||
|
||||
/* Need version 24 for vector layers. */
|
||||
if (GIMP_IS_VECTOR_LAYER (layer))
|
||||
{
|
||||
ADD_REASON (g_strdup_printf (_("Vector layers were added in %s"),
|
||||
"GIMP 3.2"));
|
||||
version = MAX (24, version);
|
||||
}
|
||||
|
||||
/* Need version 25 for link layers. */
|
||||
if (GIMP_IS_LINK_LAYER (layer))
|
||||
{
|
||||
ADD_REASON (g_strdup_printf (_("Link layers were added in %s"),
|
||||
"GIMP 3.2"));
|
||||
version = MAX (25, version);
|
||||
}
|
||||
}
|
||||
g_list_free (items);
|
||||
|
||||
@@ -3148,7 +3166,7 @@ gimp_image_get_xcf_version (GimpImage *image,
|
||||
|
||||
/* Note: user unit storage was changed in XCF 21, but we can still
|
||||
* easily save older XCF (we use the unit name for both singular and
|
||||
* plural forms). Therefore we don't bump the XCF version unecessarily
|
||||
* plural forms). Therefore we don't bump the XCF version unnecessarily
|
||||
* and don't add any test.
|
||||
*/
|
||||
|
||||
@@ -3194,6 +3212,11 @@ gimp_image_get_xcf_version (GimpImage *image,
|
||||
if (gimp_version) *gimp_version = 300;
|
||||
if (version_string) *version_string = "GIMP 3.0";
|
||||
break;
|
||||
case 24:
|
||||
case 25:
|
||||
if (gimp_version) *gimp_version = 320;
|
||||
if (version_string) *version_string = "GIMP 3.2";
|
||||
break;
|
||||
}
|
||||
|
||||
if (version_reason && reasons)
|
||||
@@ -5457,6 +5480,17 @@ gimp_image_add_layer (GimpImage *image,
|
||||
gimp_drawable_attach_floating_sel (gimp_layer_get_floating_sel_drawable (layer),
|
||||
layer);
|
||||
|
||||
/* If the layer is a vector layer, also add its path to the image */
|
||||
if (gimp_item_is_vector_layer (GIMP_ITEM (layer)))
|
||||
{
|
||||
GimpPath *path = gimp_vector_layer_get_path (GIMP_VECTOR_LAYER (layer));
|
||||
|
||||
if (path &&
|
||||
(! gimp_item_is_attached (GIMP_ITEM (path))) &&
|
||||
gimp_item_get_image (GIMP_ITEM (path)) == image)
|
||||
gimp_image_add_path (image, path, NULL, -1, FALSE);
|
||||
}
|
||||
|
||||
if (old_has_alpha != gimp_image_has_alpha (image))
|
||||
private->flush_accum.alpha_changed = TRUE;
|
||||
|
||||
|
@@ -71,6 +71,10 @@ struct _GimpImagefilePrivate
|
||||
|
||||
gchar *description;
|
||||
gboolean static_desc;
|
||||
|
||||
gint popup_size;
|
||||
gint popup_width;
|
||||
gint popup_height;
|
||||
};
|
||||
|
||||
#define GET_PRIVATE(imagefile) ((GimpImagefilePrivate *) gimp_imagefile_get_instance_private ((GimpImagefile *) (imagefile)))
|
||||
@@ -81,12 +85,17 @@ static void gimp_imagefile_finalize (GObject *object);
|
||||
|
||||
static void gimp_imagefile_name_changed (GimpObject *object);
|
||||
|
||||
static gboolean gimp_imagefile_get_popup_size (GimpViewable *viewable,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean dot_for_dot,
|
||||
gint *popup_width,
|
||||
gint *popup_height);
|
||||
static GdkPixbuf * gimp_imagefile_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_imagefile_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
|
||||
@@ -147,6 +156,7 @@ gimp_imagefile_class_init (GimpImagefileClass *klass)
|
||||
gimp_object_class->name_changed = gimp_imagefile_name_changed;
|
||||
|
||||
viewable_class->name_changed_signal = "info-changed";
|
||||
viewable_class->get_popup_size = gimp_imagefile_get_popup_size;
|
||||
viewable_class->get_new_pixbuf = gimp_imagefile_get_new_pixbuf;
|
||||
viewable_class->get_description = gimp_imagefile_get_description;
|
||||
|
||||
@@ -222,13 +232,34 @@ gimp_imagefile_name_changed (GimpObject *object)
|
||||
private->file = g_file_new_for_uri (gimp_object_get_name (object));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_imagefile_get_popup_size (GimpViewable *viewable,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean dot_for_dot,
|
||||
gint *popup_width,
|
||||
gint *popup_height)
|
||||
{
|
||||
GimpImagefilePrivate *private = GET_PRIVATE (viewable);
|
||||
|
||||
if (width < private->popup_width ||
|
||||
height < private->popup_height)
|
||||
{
|
||||
*popup_width = private->popup_width;
|
||||
*popup_height = private->popup_height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
gimp_imagefile_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpImagefile *imagefile = GIMP_IMAGEFILE (viewable);
|
||||
|
||||
@@ -517,10 +548,10 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
|
||||
}
|
||||
|
||||
image = file_open_image (private->gimp, context, progress,
|
||||
private->file, size, size,
|
||||
private->file, size, size, TRUE,
|
||||
FALSE, NULL,
|
||||
GIMP_RUN_NONINTERACTIVE,
|
||||
&status, &mime_type, error);
|
||||
NULL, &status, &mime_type, error);
|
||||
|
||||
if (image)
|
||||
gimp_thumbnail_set_info_from_image (private->thumbnail,
|
||||
@@ -931,11 +962,9 @@ gimp_imagefile_load_thumb (GimpImagefile *imagefile,
|
||||
gchar *image_uri;
|
||||
gint image_width;
|
||||
gint image_height;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
GError *error = NULL;
|
||||
gint size = MAX (width, height);
|
||||
gint pixbuf_width;
|
||||
gint pixbuf_height;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
GError *error = NULL;
|
||||
gint size;
|
||||
gint preview_width;
|
||||
gint preview_height;
|
||||
|
||||
@@ -946,6 +975,19 @@ gimp_imagefile_load_thumb (GimpImagefile *imagefile,
|
||||
"image-height", &image_height,
|
||||
NULL);
|
||||
|
||||
/* use the size remembered below if a pixbuf of the remembered
|
||||
* dimensions is requested
|
||||
*/
|
||||
if (width == private->popup_width &&
|
||||
height == private->popup_height)
|
||||
{
|
||||
size = private->popup_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = MAX (width, height);
|
||||
}
|
||||
|
||||
if (gimp_thumbnail_peek_thumb (thumbnail, size) < GIMP_THUMB_STATE_EXISTS)
|
||||
return NULL;
|
||||
|
||||
@@ -975,11 +1017,16 @@ gimp_imagefile_load_thumb (GimpImagefile *imagefile,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixbuf_width = gdk_pixbuf_get_width (pixbuf);
|
||||
pixbuf_height = gdk_pixbuf_get_height (pixbuf);
|
||||
/* remember the actual dimensions of the returned pixbuf, and the
|
||||
* size used to request it, so we can later use that size to get a
|
||||
* popup.
|
||||
*/
|
||||
private->popup_size = size;
|
||||
private->popup_width = gdk_pixbuf_get_width (pixbuf);
|
||||
private->popup_height = gdk_pixbuf_get_height (pixbuf);
|
||||
|
||||
gimp_viewable_calc_preview_size (pixbuf_width,
|
||||
pixbuf_height,
|
||||
gimp_viewable_calc_preview_size (private->popup_width,
|
||||
private->popup_height,
|
||||
width,
|
||||
height,
|
||||
TRUE, 1.0, 1.0,
|
||||
@@ -987,7 +1034,8 @@ gimp_imagefile_load_thumb (GimpImagefile *imagefile,
|
||||
&preview_height,
|
||||
NULL);
|
||||
|
||||
if (preview_width < pixbuf_width || preview_height < pixbuf_height)
|
||||
if (preview_width != private->popup_width ||
|
||||
preview_height != private->popup_height)
|
||||
{
|
||||
GdkPixbuf *scaled = gdk_pixbuf_scale_simple (pixbuf,
|
||||
preview_width,
|
||||
@@ -995,18 +1043,15 @@ gimp_imagefile_load_thumb (GimpImagefile *imagefile,
|
||||
GDK_INTERP_BILINEAR);
|
||||
g_object_unref (pixbuf);
|
||||
pixbuf = scaled;
|
||||
|
||||
pixbuf_width = preview_width;
|
||||
pixbuf_height = preview_height;
|
||||
}
|
||||
|
||||
if (gdk_pixbuf_get_n_channels (pixbuf) != 3)
|
||||
{
|
||||
GdkPixbuf *tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
|
||||
pixbuf_width, pixbuf_height);
|
||||
preview_width, preview_height);
|
||||
|
||||
gdk_pixbuf_composite_color (pixbuf, tmp,
|
||||
0, 0, pixbuf_width, pixbuf_height,
|
||||
0, 0, preview_width, preview_height,
|
||||
0.0, 0.0, 1.0, 1.0,
|
||||
GDK_INTERP_NEAREST, 255,
|
||||
0, 0, GIMP_CHECK_SIZE_SM,
|
||||
@@ -1065,7 +1110,7 @@ gimp_imagefile_save_thumb (GimpImagefile *imagefile,
|
||||
pixbuf = gimp_viewable_get_new_pixbuf (GIMP_VIEWABLE (image),
|
||||
/* random context, unused */
|
||||
gimp_get_user_context (image->gimp),
|
||||
width, height, NULL, NULL);
|
||||
width, height, NULL);
|
||||
|
||||
/* when layer previews are disabled, we won't get a pixbuf */
|
||||
if (! pixbuf)
|
||||
|
@@ -94,14 +94,12 @@ static GimpTempBuf * gimp_image_proxy_get_new_preview (GimpViewabl
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static GdkPixbuf * gimp_image_proxy_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_image_proxy_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
|
||||
@@ -378,8 +376,7 @@ gimp_image_proxy_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpImageProxy *image_proxy = GIMP_IMAGE_PROXY (viewable);
|
||||
GimpImage *image = image_proxy->priv->image;
|
||||
@@ -421,8 +418,7 @@ gimp_image_proxy_get_new_pixbuf (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpImageProxy *image_proxy = GIMP_IMAGE_PROXY (viewable);
|
||||
GimpImage *image = image_proxy->priv->image;
|
||||
|
@@ -1777,7 +1777,7 @@ gimp_item_transform (GimpItem *item,
|
||||
g_object_freeze_notify (G_OBJECT (item));
|
||||
|
||||
item_class->transform (item, context, matrix, direction, interpolation,
|
||||
clip_result, progress);
|
||||
clip_result, progress, TRUE);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (item));
|
||||
|
||||
@@ -2650,7 +2650,8 @@ gimp_item_mask_bounds (GimpItem *item,
|
||||
! gimp_channel_is_empty (selection) &&
|
||||
gimp_item_bounds (GIMP_ITEM (selection), &x, &y, &width, &height))
|
||||
{
|
||||
gint off_x, off_y;
|
||||
gint off_x = 0;
|
||||
gint off_y = 0;
|
||||
gint x2, y2;
|
||||
|
||||
gimp_item_get_offset (item, &off_x, &off_y);
|
||||
@@ -2724,7 +2725,8 @@ gimp_item_mask_intersect (GimpItem *item,
|
||||
gimp_item_bounds (GIMP_ITEM (selection),
|
||||
&tmp_x, &tmp_y, &tmp_width, &tmp_height))
|
||||
{
|
||||
gint off_x, off_y;
|
||||
gint off_x = 0;
|
||||
gint off_y = 0;
|
||||
|
||||
gimp_item_get_offset (item, &off_x, &off_y);
|
||||
|
||||
|
@@ -107,7 +107,8 @@ struct _GimpItemClass
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress);
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo);
|
||||
GimpTransformResize (* get_clip) (GimpItem *item,
|
||||
GimpTransformResize clip_result);
|
||||
gboolean (* fill) (GimpItem *item,
|
||||
|
111
app/core/gimplayer-xcf.c
Normal file
111
app/core/gimplayer-xcf.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimplayer-xcf.c
|
||||
*
|
||||
* Copyright 2003 Sven Neumann <sven@gimp.org>
|
||||
* Copyright 2025 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include "core-types.h"
|
||||
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimplayer-xcf.h"
|
||||
|
||||
/**
|
||||
* gimp_layer_from_layer:
|
||||
* @layer: a #GimpLayer object
|
||||
* @options: a #GimpVectorLayerOptions object
|
||||
*
|
||||
* Converts a standard #GimpLayer into a more specific type of
|
||||
* #GimpLayer. The new layer takes ownership of properties of @layer.
|
||||
* The @layer object is rendered unusable by this function. Don't even
|
||||
* try to use it afterwards!
|
||||
*
|
||||
* This is a gross hack that is needed in order to load text or vector
|
||||
* layers from XCF files in a backwards-compatible way, or as a
|
||||
* secondary step (after more data has been loaded). Please don't use it
|
||||
* for anything else!
|
||||
*
|
||||
* The variable list of arguments will be the properties which will be
|
||||
* used to create the new layer of type @new_layer_type. Note that the
|
||||
* "image" property needs to be set at the minimum.
|
||||
*
|
||||
* Return value: a newly allocated object of a subtype of #GimpLayer.
|
||||
**/
|
||||
GimpLayer *
|
||||
gimp_layer_from_layer (GimpLayer *layer,
|
||||
GType new_layer_type,
|
||||
...)
|
||||
{
|
||||
GimpLayer *new_layer;
|
||||
GimpDrawable *drawable;
|
||||
GimpImage *image;
|
||||
gboolean attached;
|
||||
GimpLayer *parent = NULL;
|
||||
gint position = 0;
|
||||
va_list args;
|
||||
const gchar *first_prop;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
|
||||
g_return_val_if_fail (g_type_is_a (new_layer_type, GIMP_TYPE_LAYER), NULL);
|
||||
|
||||
image = gimp_item_get_image (GIMP_ITEM (layer));
|
||||
|
||||
if ((attached = gimp_item_is_attached (GIMP_ITEM (layer))))
|
||||
{
|
||||
parent = gimp_layer_get_parent (layer);
|
||||
position = gimp_item_get_index (GIMP_ITEM (layer));
|
||||
|
||||
g_object_ref (layer);
|
||||
gimp_image_remove_layer (image, layer, FALSE, NULL);
|
||||
}
|
||||
|
||||
va_start (args, new_layer_type);
|
||||
first_prop = va_arg (args, gchar *);
|
||||
new_layer = GIMP_LAYER (g_object_new_valist (new_layer_type, first_prop, args));
|
||||
va_end (args);
|
||||
|
||||
gimp_item_replace_item (GIMP_ITEM (new_layer), GIMP_ITEM (layer));
|
||||
|
||||
drawable = GIMP_DRAWABLE (new_layer);
|
||||
gimp_drawable_steal_buffer (drawable, GIMP_DRAWABLE (layer));
|
||||
|
||||
gimp_layer_set_opacity (GIMP_LAYER (new_layer),
|
||||
gimp_layer_get_opacity (layer), FALSE);
|
||||
gimp_layer_set_mode (GIMP_LAYER (new_layer),
|
||||
gimp_layer_get_mode (layer), FALSE);
|
||||
gimp_layer_set_blend_space (GIMP_LAYER (new_layer),
|
||||
gimp_layer_get_blend_space (layer), FALSE);
|
||||
gimp_layer_set_composite_space (GIMP_LAYER (new_layer),
|
||||
gimp_layer_get_composite_space (layer), FALSE);
|
||||
gimp_layer_set_composite_mode (GIMP_LAYER (new_layer),
|
||||
gimp_layer_get_composite_mode (layer), FALSE);
|
||||
gimp_layer_set_lock_alpha (GIMP_LAYER (new_layer),
|
||||
gimp_layer_get_lock_alpha (layer), FALSE);
|
||||
|
||||
g_object_unref (layer);
|
||||
|
||||
if (attached)
|
||||
gimp_image_add_layer (image, new_layer, parent, position, FALSE);
|
||||
|
||||
return new_layer;
|
||||
}
|
27
app/core/gimplayer-xcf.h
Normal file
27
app/core/gimplayer-xcf.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimplayer-xcf.h
|
||||
*
|
||||
* Copyright 2003 Sven Neumann <sven@gimp.org>
|
||||
* Copyright 2025 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
GimpLayer * gimp_layer_from_layer (GimpLayer *layer,
|
||||
GType new_layer_type,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
@@ -169,7 +169,8 @@ static void gimp_layer_transform (GimpItem *item,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress);
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo);
|
||||
static void gimp_layer_to_selection (GimpItem *item,
|
||||
GimpChannelOps op,
|
||||
gboolean antialias,
|
||||
@@ -248,7 +249,8 @@ static void gimp_layer_real_transform (GimpLayer *layer,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress);
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo);
|
||||
static void gimp_layer_real_convert_type (GimpLayer *layer,
|
||||
GimpImage *dest_image,
|
||||
const Babl *new_format,
|
||||
@@ -989,10 +991,10 @@ gimp_layer_duplicate (GimpItem *item,
|
||||
|
||||
mask = gimp_item_duplicate (GIMP_ITEM (layer->mask),
|
||||
G_TYPE_FROM_INSTANCE (layer->mask));
|
||||
gimp_layer_add_mask (new_layer, GIMP_LAYER_MASK (mask), FALSE, NULL);
|
||||
gimp_layer_add_mask (new_layer, GIMP_LAYER_MASK (mask),
|
||||
layer->edit_mask, FALSE, NULL);
|
||||
|
||||
new_layer->apply_mask = layer->apply_mask;
|
||||
new_layer->edit_mask = layer->edit_mask;
|
||||
new_layer->show_mask = layer->show_mask;
|
||||
}
|
||||
}
|
||||
@@ -1298,7 +1300,8 @@ gimp_layer_transform (GimpItem *item,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress)
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo)
|
||||
{
|
||||
GimpLayer *layer = GIMP_LAYER (item);
|
||||
GimpObjectQueue *queue = NULL;
|
||||
@@ -1328,7 +1331,7 @@ gimp_layer_transform (GimpItem *item,
|
||||
GIMP_LAYER_GET_CLASS (layer)->transform (layer, context, matrix, direction,
|
||||
interpolation_type,
|
||||
clip_result,
|
||||
progress);
|
||||
progress, push_undo);
|
||||
|
||||
if (layer->mask)
|
||||
{
|
||||
@@ -1743,7 +1746,8 @@ gimp_layer_real_transform (GimpLayer *layer,
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress)
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo)
|
||||
{
|
||||
if (! gimp_matrix3_is_simple (matrix) &&
|
||||
! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
|
||||
@@ -1753,7 +1757,7 @@ gimp_layer_real_transform (GimpLayer *layer,
|
||||
context, matrix, direction,
|
||||
interpolation_type,
|
||||
clip_result,
|
||||
progress);
|
||||
progress, push_undo);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1913,6 +1917,7 @@ gimp_layer_get_mask (GimpLayer *layer)
|
||||
GimpLayerMask *
|
||||
gimp_layer_add_mask (GimpLayer *layer,
|
||||
GimpLayerMask *mask,
|
||||
gboolean edit_mask,
|
||||
gboolean push_undo,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1954,7 +1959,7 @@ gimp_layer_add_mask (GimpLayer *layer,
|
||||
|
||||
layer->mask = g_object_ref_sink (mask);
|
||||
layer->apply_mask = TRUE;
|
||||
layer->edit_mask = TRUE;
|
||||
layer->edit_mask = edit_mask;
|
||||
layer->show_mask = FALSE;
|
||||
|
||||
gimp_layer_mask_set_layer (mask, layer);
|
||||
|
@@ -122,7 +122,8 @@ struct _GimpLayerClass
|
||||
GimpTransformDirection direction,
|
||||
GimpInterpolationType interpolation_type,
|
||||
GimpTransformResize clip_result,
|
||||
GimpProgress *progress);
|
||||
GimpProgress *progress,
|
||||
gboolean push_undo);
|
||||
void (* convert_type) (GimpLayer *layer,
|
||||
GimpImage *dest_image,
|
||||
const Babl *new_format,
|
||||
@@ -158,6 +159,7 @@ GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer,
|
||||
GimpChannel *channel);
|
||||
GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer,
|
||||
GimpLayerMask *mask,
|
||||
gboolean edit_mask,
|
||||
gboolean push_undo,
|
||||
GError **error);
|
||||
void gimp_layer_apply_mask (GimpLayer *layer,
|
||||
|
@@ -33,7 +33,8 @@
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_LAYER_MASK
|
||||
PROP_LAYER_MASK,
|
||||
PROP_EDIT_MASK
|
||||
};
|
||||
|
||||
|
||||
@@ -83,6 +84,11 @@ gimp_layer_mask_undo_class_init (GimpLayerMaskUndoClass *klass)
|
||||
GIMP_TYPE_LAYER_MASK,
|
||||
GIMP_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY));
|
||||
g_object_class_install_property (object_class, PROP_EDIT_MASK,
|
||||
g_param_spec_boolean ("edit-mask", NULL, NULL,
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -114,6 +120,9 @@ gimp_layer_mask_undo_set_property (GObject *object,
|
||||
case PROP_LAYER_MASK:
|
||||
layer_mask_undo->layer_mask = g_value_dup_object (value);
|
||||
break;
|
||||
case PROP_EDIT_MASK:
|
||||
layer_mask_undo->edit_mask = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
@@ -134,6 +143,9 @@ gimp_layer_mask_undo_get_property (GObject *object,
|
||||
case PROP_LAYER_MASK:
|
||||
g_value_set_object (value, layer_mask_undo->layer_mask);
|
||||
break;
|
||||
case PROP_EDIT_MASK:
|
||||
g_value_set_boolean (value, layer_mask_undo->edit_mask);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
@@ -175,13 +187,15 @@ gimp_layer_mask_undo_pop (GimpUndo *undo,
|
||||
{
|
||||
/* remove layer mask */
|
||||
|
||||
layer_mask_undo->edit_mask = gimp_layer_get_edit_mask (layer);
|
||||
gimp_layer_apply_mask (layer, GIMP_MASK_DISCARD, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* restore layer mask */
|
||||
|
||||
gimp_layer_add_mask (layer, layer_mask_undo->layer_mask, FALSE, NULL);
|
||||
gimp_layer_add_mask (layer, layer_mask_undo->layer_mask,
|
||||
layer_mask_undo->edit_mask, FALSE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,6 +36,7 @@ struct _GimpLayerMaskUndo
|
||||
GimpItemUndo parent_instance;
|
||||
|
||||
GimpLayerMask *layer_mask;
|
||||
gboolean edit_mask;
|
||||
};
|
||||
|
||||
struct _GimpLayerMaskUndoClass
|
||||
|
@@ -39,6 +39,7 @@ static void gimp_layer_stack_remove (GimpContainer *container
|
||||
GimpObject *object);
|
||||
static void gimp_layer_stack_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index);
|
||||
|
||||
static void gimp_layer_stack_layer_active (GimpLayer *layer,
|
||||
@@ -130,22 +131,20 @@ gimp_layer_stack_remove (GimpContainer *container,
|
||||
static void
|
||||
gimp_layer_stack_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index)
|
||||
{
|
||||
GimpLayerStack *stack = GIMP_LAYER_STACK (container);
|
||||
gboolean update_backdrop;
|
||||
gint index;
|
||||
|
||||
update_backdrop = gimp_filter_get_active (GIMP_FILTER (object)) &&
|
||||
gimp_layer_get_excludes_backdrop (GIMP_LAYER (object));
|
||||
|
||||
if (update_backdrop)
|
||||
index = gimp_container_get_child_index (container, object);
|
||||
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object, new_index);
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object,
|
||||
old_index, new_index);
|
||||
|
||||
if (update_backdrop)
|
||||
gimp_layer_stack_update_range (stack, index, new_index);
|
||||
gimp_layer_stack_update_range (stack, old_index, new_index);
|
||||
}
|
||||
|
||||
|
||||
|
748
app/core/gimplink.c
Normal file
748
app/core/gimplink.c
Normal file
@@ -0,0 +1,748 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* GimpLink
|
||||
* Copyright (C) 2019 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <cairo.h>
|
||||
#include <gegl.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "core-types.h"
|
||||
|
||||
#include "gimp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplink.h"
|
||||
#include "gimpmarshal.h"
|
||||
#include "gimppickable.h"
|
||||
#include "gimpprojection.h"
|
||||
|
||||
#include "file/file-open.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_GIMP,
|
||||
PROP_FILE,
|
||||
PROP_ABSOLUTE_PATH,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
struct _GimpLinkPrivate
|
||||
{
|
||||
Gimp *gimp;
|
||||
GFile *file;
|
||||
GFileMonitor *monitor;
|
||||
gboolean absolute_path;
|
||||
|
||||
GeglBuffer *buffer;
|
||||
gboolean broken;
|
||||
GError *error;
|
||||
guint idle_changed_source;
|
||||
|
||||
gboolean is_vector;
|
||||
gint width;
|
||||
gint height;
|
||||
gboolean keep_ratio;
|
||||
GimpImageBaseType base_type;
|
||||
GimpPrecision precision;
|
||||
GimpPlugInProcedure *load_proc;
|
||||
const gchar *mime_type;
|
||||
};
|
||||
|
||||
static void gimp_link_finalize (GObject *object);
|
||||
static void gimp_link_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_link_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gimp_link_file_changed (GFileMonitor *monitor,
|
||||
GFile *file,
|
||||
GFile *other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
GimpLink *link);
|
||||
static gboolean gimp_link_emit_changed (gpointer data);
|
||||
|
||||
static void gimp_link_update_buffer (GimpLink *link,
|
||||
GimpProgress *progress,
|
||||
GError **error);
|
||||
static void gimp_link_start_monitoring (GimpLink *link);
|
||||
static gchar * gimp_link_get_relative_path (GimpLink *link,
|
||||
GFile *parent,
|
||||
gint n_back);
|
||||
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GimpLink, gimp_link, GIMP_TYPE_OBJECT)
|
||||
|
||||
#define parent_class gimp_link_parent_class
|
||||
|
||||
static guint link_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static GParamSpec *link_props[N_PROPS] = { NULL, };
|
||||
|
||||
static void
|
||||
gimp_link_class_init (GimpLinkClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
link_signals[CHANGED] =
|
||||
g_signal_new ("changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GimpLinkClass, changed),
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
object_class->finalize = gimp_link_finalize;
|
||||
object_class->get_property = gimp_link_get_property;
|
||||
object_class->set_property = gimp_link_set_property;
|
||||
|
||||
link_props[PROP_GIMP] = g_param_spec_object ("gimp", NULL, NULL,
|
||||
GIMP_TYPE_GIMP,
|
||||
GIMP_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY);
|
||||
link_props[PROP_FILE] = g_param_spec_object ("file", NULL, NULL,
|
||||
G_TYPE_FILE,
|
||||
GIMP_PARAM_READWRITE |
|
||||
G_PARAM_EXPLICIT_NOTIFY);
|
||||
link_props[PROP_ABSOLUTE_PATH] = g_param_spec_boolean ("absolute-path", NULL, NULL,
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, link_props);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_init (GimpLink *link)
|
||||
{
|
||||
link->p = gimp_link_get_instance_private (link);
|
||||
link->p->gimp = NULL;
|
||||
link->p->file = NULL;
|
||||
link->p->monitor = NULL;
|
||||
link->p->buffer = NULL;
|
||||
link->p->broken = TRUE;
|
||||
link->p->error = NULL;
|
||||
link->p->width = 0;
|
||||
link->p->height = 0;
|
||||
link->p->base_type = GIMP_RGB;
|
||||
link->p->precision = GIMP_PRECISION_U8_PERCEPTUAL;
|
||||
link->p->load_proc = NULL;
|
||||
|
||||
link->p->idle_changed_source = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_finalize (GObject *object)
|
||||
{
|
||||
GimpLink *link = GIMP_LINK (object);
|
||||
|
||||
g_clear_object (&link->p->file);
|
||||
g_clear_object (&link->p->monitor);
|
||||
g_clear_object (&link->p->buffer);
|
||||
g_clear_error (&link->p->error);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpLink *link = GIMP_LINK (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_GIMP:
|
||||
g_value_set_object (value, link->p->gimp);
|
||||
break;
|
||||
case PROP_FILE:
|
||||
g_value_set_object (value, link->p->file);
|
||||
break;
|
||||
case PROP_ABSOLUTE_PATH:
|
||||
g_value_set_boolean (value, link->p->absolute_path);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpLink *link = GIMP_LINK (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_GIMP:
|
||||
link->p->gimp = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_FILE:
|
||||
gimp_link_set_file (link, g_value_get_object (value), 0, 0, FALSE, NULL, NULL);
|
||||
break;
|
||||
case PROP_ABSOLUTE_PATH:
|
||||
link->p->absolute_path = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_file_changed (GFileMonitor *monitor,
|
||||
GFile *file,
|
||||
GFile *other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
GimpLink *link)
|
||||
{
|
||||
switch (event_type)
|
||||
{
|
||||
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
|
||||
if (link->p->idle_changed_source == 0)
|
||||
link->p->idle_changed_source = g_idle_add_full (G_PRIORITY_LOW,
|
||||
gimp_link_emit_changed,
|
||||
link, NULL);
|
||||
break;
|
||||
case G_FILE_MONITOR_EVENT_CREATED:
|
||||
g_signal_emit (link, link_signals[CHANGED], 0);
|
||||
break;
|
||||
case G_FILE_MONITOR_EVENT_DELETED:
|
||||
link->p->broken = TRUE;
|
||||
g_clear_error (&link->p->error);
|
||||
g_set_error_literal (&link->p->error,
|
||||
G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("The file got deleted"));
|
||||
break;
|
||||
|
||||
default:
|
||||
/* No need to signal for changes where nothing can be done anyway.
|
||||
* In particular a file deletion, the link is broken, yet we don't
|
||||
* want to re-render.
|
||||
* Don't emit either on G_FILE_MONITOR_EVENT_CHANGED because too
|
||||
* many such events may be emitted for a single file writing.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_link_emit_changed (gpointer data)
|
||||
{
|
||||
GimpLink *link = GIMP_LINK (data);
|
||||
|
||||
gimp_link_update_buffer (link, NULL, NULL);
|
||||
|
||||
g_signal_emit (link, link_signals[CHANGED], 0);
|
||||
link->p->idle_changed_source = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_update_buffer (GimpLink *link,
|
||||
GimpProgress *progress,
|
||||
GError **error)
|
||||
{
|
||||
GeglBuffer *buffer = NULL;
|
||||
GError *real_error = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
g_return_if_fail (error == NULL || *error == NULL);
|
||||
|
||||
link->p->is_vector = FALSE;
|
||||
g_clear_error (&link->p->error);
|
||||
|
||||
if (link->p->file)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpPDBStatusType status;
|
||||
|
||||
link->p->mime_type = NULL;
|
||||
image = file_open_image (link->p->gimp,
|
||||
gimp_get_user_context (link->p->gimp),
|
||||
progress,
|
||||
link->p->file,
|
||||
link->p->width, link->p->height,
|
||||
link->p->keep_ratio,
|
||||
FALSE, NULL,
|
||||
/* XXX We might want interactive opening
|
||||
* for a first opening (when done through
|
||||
* GUI), but not for every re-render.
|
||||
*/
|
||||
GIMP_RUN_NONINTERACTIVE,
|
||||
&link->p->is_vector,
|
||||
&status, &link->p->mime_type,
|
||||
&real_error);
|
||||
|
||||
if (image && status == GIMP_PDB_SUCCESS)
|
||||
{
|
||||
/* If we don't flush the projection first, the buffer may be empty.
|
||||
* I do wonder if the flushing and updating of the link could
|
||||
* not be multi-threaded with gimp_projection_flush() instead,
|
||||
* then notifying the update through signals. For very heavy
|
||||
* images, would it be a better UX? XXX
|
||||
*/
|
||||
gimp_projection_flush_now (gimp_image_get_projection (image), TRUE);
|
||||
buffer = gimp_pickable_get_buffer (GIMP_PICKABLE (image));
|
||||
g_object_ref (buffer);
|
||||
|
||||
link->p->base_type = gimp_image_get_base_type (image);
|
||||
link->p->precision = gimp_image_get_precision (image);
|
||||
link->p->width = gimp_image_get_width (image);
|
||||
link->p->height = gimp_image_get_height (image);
|
||||
link->p->load_proc = gimp_image_get_load_proc (image);
|
||||
}
|
||||
|
||||
/* Only keep the buffer, free the rest. */
|
||||
g_clear_object (&image);
|
||||
}
|
||||
|
||||
link->p->broken = (buffer == NULL);
|
||||
if (link->p->broken)
|
||||
{
|
||||
if (real_error)
|
||||
link->p->error = g_error_copy (real_error);
|
||||
else
|
||||
g_set_error_literal (&link->p->error,
|
||||
G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("No file was set"));
|
||||
}
|
||||
|
||||
if (error)
|
||||
*error = real_error;
|
||||
else
|
||||
g_clear_error (&real_error);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
/* Keep the old buffer if the link is broken (outdated image is
|
||||
* better than none).
|
||||
*/
|
||||
g_clear_object (&link->p->buffer);
|
||||
link->p->buffer = buffer;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_start_monitoring (GimpLink *link)
|
||||
{
|
||||
link->p->monitor = g_file_monitor_file (link->p->file,
|
||||
G_FILE_MONITOR_WATCH_HARD_LINKS,
|
||||
NULL, NULL);
|
||||
g_signal_connect (link->p->monitor, "changed",
|
||||
G_CALLBACK (gimp_link_file_changed),
|
||||
link);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_link_get_relative_path:
|
||||
* @link: the image this link is associated with.
|
||||
* @parent: (transfer full): a #GFile object.
|
||||
* @n_back: set it to 0 when calling it initially.
|
||||
*
|
||||
* This is a variant of g_file_get_relative_path() which will work even
|
||||
* when the @link file is not a child of @parent. In this case, the
|
||||
* relative link will use "../" as many times as necessary until a
|
||||
* common parent folder is found.
|
||||
*
|
||||
* In case no parent is found (it may happen for instance on Windows,
|
||||
* with various file system roots), an absolute path is returned
|
||||
* instead, ensuring that we never return %NULL.
|
||||
*
|
||||
* Note that this function takes ownership of @parent and will take care
|
||||
* of freeing it. This allows for tail recursion.
|
||||
*
|
||||
* Returns: a path from @link relatively to @parent, falling back
|
||||
* to an absolute path if a relative path cannot be constructed.
|
||||
**/
|
||||
static gchar *
|
||||
gimp_link_get_relative_path (GimpLink *link,
|
||||
GFile *parent,
|
||||
gint n_back)
|
||||
{
|
||||
gchar *relative_path;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), NULL);
|
||||
g_return_val_if_fail (parent != NULL && n_back >= 0, NULL);
|
||||
|
||||
relative_path = g_file_get_relative_path (parent, link->p->file);
|
||||
|
||||
if (relative_path == NULL)
|
||||
{
|
||||
GFile *grand_parent = g_file_get_parent (parent);
|
||||
|
||||
g_object_unref (parent);
|
||||
|
||||
if (grand_parent == NULL)
|
||||
/* This may happen e.g. on Windows where there are several roots
|
||||
* so it is not always possible to make a relative path.
|
||||
*/
|
||||
return g_file_get_path (link->p->file);
|
||||
else
|
||||
return gimp_link_get_relative_path (link, grand_parent, n_back + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_object_unref (parent);
|
||||
|
||||
if (n_back > 0)
|
||||
{
|
||||
GStrvBuilder *builder;
|
||||
gchar **array;
|
||||
gchar *dots;
|
||||
gchar *relpath;
|
||||
|
||||
builder = g_strv_builder_new ();
|
||||
for (gint i = 0; i < n_back; i++)
|
||||
g_strv_builder_add (builder, "..");
|
||||
|
||||
array = g_strv_builder_end (builder);
|
||||
dots = g_strjoinv (G_DIR_SEPARATOR_S, array);
|
||||
relpath = g_build_filename (dots, relative_path, NULL);
|
||||
|
||||
g_free (relative_path);
|
||||
g_free (dots);
|
||||
g_strfreev (array);
|
||||
g_strv_builder_unref (builder);
|
||||
|
||||
relative_path = relpath;
|
||||
}
|
||||
|
||||
return relative_path;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
/**
|
||||
* gimp_link_new:
|
||||
* @gimp: #Gimp object.
|
||||
* @file: a #GFile object.
|
||||
*
|
||||
* Creates a new link object. By default, all link objects are created
|
||||
* as being relative to the path of the image they will be associated
|
||||
* with.
|
||||
*
|
||||
* Return value: a new #GimpLink or %NULL in case of a problem
|
||||
**/
|
||||
GimpLink *
|
||||
gimp_link_new (Gimp *gimp,
|
||||
GFile *file,
|
||||
gint vector_width,
|
||||
gint vector_height,
|
||||
gboolean keep_ratio,
|
||||
GimpProgress *progress,
|
||||
GError **error)
|
||||
{
|
||||
GimpLink *link;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (G_IS_FILE (file), NULL);
|
||||
|
||||
link = g_object_new (GIMP_TYPE_LINK,
|
||||
"gimp", gimp,
|
||||
"absolute-path", FALSE,
|
||||
NULL);
|
||||
|
||||
gimp_link_set_file (link, file, vector_width, vector_height, keep_ratio, progress, error);
|
||||
|
||||
return GIMP_LINK (link);
|
||||
}
|
||||
|
||||
GimpLink *
|
||||
gimp_link_duplicate (GimpLink *link)
|
||||
{
|
||||
GimpLink *new_link;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), NULL);
|
||||
|
||||
new_link = g_object_new (GIMP_TYPE_LINK,
|
||||
"gimp", link->p->gimp,
|
||||
"absolute-path", gimp_link_get_absolute_path (link),
|
||||
NULL);
|
||||
|
||||
/* Copy things manually as we do not need to trigger a load. */
|
||||
new_link->p->file = link->p->file ? g_object_ref (link->p->file) : NULL;
|
||||
|
||||
new_link->p->buffer = link->p->buffer ? gegl_buffer_dup (link->p->buffer) : NULL;
|
||||
new_link->p->broken = link->p->broken;
|
||||
new_link->p->error = link->p->error ? g_error_copy (link->p->error) : NULL;
|
||||
|
||||
new_link->p->is_vector = link->p->is_vector;
|
||||
new_link->p->width = link->p->width;
|
||||
new_link->p->height = link->p->height;
|
||||
new_link->p->base_type = link->p->base_type;
|
||||
new_link->p->precision = link->p->precision;
|
||||
new_link->p->load_proc = link->p->load_proc;
|
||||
|
||||
if (new_link->p->file)
|
||||
{
|
||||
gchar *basename;
|
||||
|
||||
basename = g_file_get_basename (new_link->p->file);
|
||||
gimp_object_set_name_safe (GIMP_OBJECT (new_link), basename);
|
||||
g_free (basename);
|
||||
|
||||
if (gimp_link_is_monitored (link))
|
||||
gimp_link_start_monitoring (new_link);
|
||||
}
|
||||
|
||||
return new_link;
|
||||
}
|
||||
|
||||
/*
|
||||
* gimp_link_get_file:
|
||||
* @link: the #GimpLink object.
|
||||
* @xcf_file: optional XCF file from which @path will be relative to.
|
||||
* @path: optional returned path of the returned file.
|
||||
*
|
||||
* If @path is non-%NULL, it will be set to the file system path for the
|
||||
* returned %GFile, either as an absolute or relative path, depending on
|
||||
* how @link was set.
|
||||
* Note that it is possible for @path to be absolute even when it is set
|
||||
* to be a relative path, in cases where no relative path can be
|
||||
* constructed from @xcf_file.
|
||||
*
|
||||
* Returns: the %GFile which %link is syncing too.
|
||||
*/
|
||||
GFile *
|
||||
gimp_link_get_file (GimpLink *link,
|
||||
GFile *xcf_file,
|
||||
gchar **path)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), NULL);
|
||||
g_return_val_if_fail ((path == NULL && xcf_file == NULL) ||
|
||||
(*path == NULL && xcf_file != NULL &&
|
||||
g_file_has_parent (xcf_file, NULL)), NULL);
|
||||
|
||||
if (path != NULL)
|
||||
{
|
||||
if (link->p->absolute_path)
|
||||
*path = g_file_get_path (link->p->file);
|
||||
else
|
||||
*path = gimp_link_get_relative_path (link,
|
||||
g_file_get_parent (xcf_file),
|
||||
0);
|
||||
}
|
||||
|
||||
return link->p->file;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_link_set_file (GimpLink *link,
|
||||
GFile *file,
|
||||
gint vector_width,
|
||||
gint vector_height,
|
||||
gboolean keep_ratio,
|
||||
GimpProgress *progress,
|
||||
GError **error)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
g_return_if_fail (G_IS_FILE (file) || file == NULL);
|
||||
g_return_if_fail (error == NULL || *error == NULL);
|
||||
|
||||
if (file == link->p->file ||
|
||||
(file && link->p->file && g_file_equal (file, link->p->file)))
|
||||
{
|
||||
if (link->p->width != vector_width ||
|
||||
link->p->height != vector_height ||
|
||||
link->p->keep_ratio != keep_ratio)
|
||||
gimp_link_set_size (link, vector_width, vector_height, keep_ratio);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
link->p->width = vector_width;
|
||||
link->p->height = vector_height;
|
||||
link->p->keep_ratio = keep_ratio;
|
||||
|
||||
g_clear_object (&link->p->monitor);
|
||||
|
||||
g_set_object (&link->p->file, file);
|
||||
|
||||
gimp_link_update_buffer (link, progress, error);
|
||||
|
||||
if (link->p->file)
|
||||
{
|
||||
gchar *basename;
|
||||
|
||||
basename = g_file_get_basename (link->p->file);
|
||||
gimp_object_set_name_safe (GIMP_OBJECT (link), basename);
|
||||
g_free (basename);
|
||||
|
||||
gimp_link_start_monitoring (link);
|
||||
}
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (link), link_props[PROP_FILE]);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_link_get_absolute_path (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), FALSE);
|
||||
|
||||
return link->p->absolute_path;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_link_set_absolute_path (GimpLink *link,
|
||||
gboolean absolute_path)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
|
||||
link->p->absolute_path = absolute_path;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gimp_link_get_mime_type (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), NULL);
|
||||
|
||||
return link->p->mime_type;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_link_freeze (GimpLink *link)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
g_return_if_fail (link->p->monitor != NULL);
|
||||
|
||||
g_clear_object (&link->p->monitor);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_link_thaw (GimpLink *link)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
g_return_if_fail (G_IS_FILE (link->p->file) && link->p->monitor == NULL);
|
||||
|
||||
gimp_link_update_buffer (link, NULL, NULL);
|
||||
gimp_link_start_monitoring (link);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_link_is_monitored (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), FALSE);
|
||||
|
||||
return (link->p->monitor != NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_link_is_broken (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), TRUE);
|
||||
|
||||
return link->p->broken;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_link_set_size (GimpLink *link,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean keep_ratio)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
|
||||
link->p->width = width;
|
||||
link->p->height = height;
|
||||
link->p->keep_ratio = keep_ratio;
|
||||
|
||||
if (link->p->monitor && link->p->is_vector)
|
||||
gimp_link_update_buffer (link, NULL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_link_get_size (GimpLink *link,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_LINK (link));
|
||||
|
||||
*width = link->p->width;
|
||||
*height = link->p->height;
|
||||
}
|
||||
|
||||
GimpImageBaseType
|
||||
gimp_link_get_base_type (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link) && ! link->p->broken, GIMP_RGB);
|
||||
|
||||
return link->p->base_type;
|
||||
}
|
||||
|
||||
GimpPrecision
|
||||
gimp_link_get_precision (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link) && ! link->p->broken, GIMP_PRECISION_U8_PERCEPTUAL);
|
||||
|
||||
return link->p->precision;
|
||||
}
|
||||
|
||||
GimpPlugInProcedure *
|
||||
gimp_link_get_load_proc (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link) && ! link->p->broken, NULL);
|
||||
|
||||
return link->p->load_proc;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_link_is_vector (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), FALSE);
|
||||
|
||||
return link->p->is_vector;
|
||||
}
|
||||
|
||||
GeglBuffer *
|
||||
gimp_link_get_buffer (GimpLink *link)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_LINK (link), NULL);
|
||||
|
||||
return link->p->buffer;
|
||||
}
|
98
app/core/gimplink.h
Normal file
98
app/core/gimplink.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* GimpLink
|
||||
* Copyright (C) 2019 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gimpitem.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_LINK (gimp_link_get_type ())
|
||||
#define GIMP_LINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LINK, GimpLink))
|
||||
#define GIMP_LINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LINK, GimpLinkClass))
|
||||
#define GIMP_IS_LINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LINK))
|
||||
#define GIMP_IS_LINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LINK))
|
||||
#define GIMP_LINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LINK, GimpLinkClass))
|
||||
|
||||
|
||||
typedef struct _GimpLinkClass GimpLinkClass;
|
||||
typedef struct _GimpLinkPrivate GimpLinkPrivate;
|
||||
|
||||
struct _GimpLink
|
||||
{
|
||||
GimpObject parent_instance;
|
||||
|
||||
GimpLinkPrivate *p;
|
||||
};
|
||||
|
||||
struct _GimpLinkClass
|
||||
{
|
||||
GimpObjectClass parent_class;
|
||||
|
||||
void (* changed) (GimpLink *link);
|
||||
};
|
||||
|
||||
|
||||
GType gimp_link_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GimpLink * gimp_link_new (Gimp *gimp,
|
||||
GFile *file,
|
||||
gint vector_width,
|
||||
gint vector_height,
|
||||
gboolean keep_ratio,
|
||||
GimpProgress *progress,
|
||||
GError **error);
|
||||
GimpLink * gimp_link_duplicate (GimpLink *link);
|
||||
|
||||
GFile * gimp_link_get_file (GimpLink *link,
|
||||
GFile *parent,
|
||||
gchar **path);
|
||||
void gimp_link_set_file (GimpLink *layer,
|
||||
GFile *file,
|
||||
gint vector_width,
|
||||
gint vector_height,
|
||||
gboolean keep_ratio,
|
||||
GimpProgress *progress,
|
||||
GError **error);
|
||||
gboolean gimp_link_get_absolute_path (GimpLink *link);
|
||||
void gimp_link_set_absolute_path (GimpLink *link,
|
||||
gboolean absolute_path);
|
||||
|
||||
const gchar * gimp_link_get_mime_type (GimpLink *link);
|
||||
|
||||
void gimp_link_freeze (GimpLink *link);
|
||||
void gimp_link_thaw (GimpLink *link);
|
||||
gboolean gimp_link_is_monitored (GimpLink *link);
|
||||
|
||||
gboolean gimp_link_is_broken (GimpLink *link);
|
||||
|
||||
void gimp_link_set_size (GimpLink *link,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean keep_ratio);
|
||||
void gimp_link_get_size (GimpLink *link,
|
||||
gint *width,
|
||||
gint *height);
|
||||
GimpImageBaseType gimp_link_get_base_type (GimpLink *link);
|
||||
GimpPrecision gimp_link_get_precision (GimpLink *link);
|
||||
GimpPlugInProcedure * gimp_link_get_load_proc (GimpLink *link);
|
||||
|
||||
gboolean gimp_link_is_vector (GimpLink *link);
|
||||
|
||||
GeglBuffer * gimp_link_get_buffer (GimpLink *link);
|
1137
app/core/gimplinklayer.c
Normal file
1137
app/core/gimplinklayer.c
Normal file
File diff suppressed because it is too large
Load Diff
87
app/core/gimplinklayer.h
Normal file
87
app/core/gimplinklayer.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* GimpLinkLayer
|
||||
* Copyright (C) 2019 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gimplayer.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_LINK_LAYER (gimp_link_layer_get_type ())
|
||||
#define GIMP_LINK_LAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LINK_LAYER, GimpLinkLayer))
|
||||
#define GIMP_LINK_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LINK_LAYER, GimpLinkLayerClass))
|
||||
#define GIMP_IS_LINK_LAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LINK_LAYER))
|
||||
#define GIMP_IS_LINK_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LINK_LAYER))
|
||||
#define GIMP_LINK_LAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LINK_LAYER, GimpLinkLayerClass))
|
||||
|
||||
|
||||
typedef struct _GimpLinkLayerClass GimpLinkLayerClass;
|
||||
typedef struct _GimpLinkLayerPrivate GimpLinkLayerPrivate;
|
||||
|
||||
struct _GimpLinkLayer
|
||||
{
|
||||
GimpLayer layer;
|
||||
|
||||
GimpLinkLayerPrivate *p;
|
||||
};
|
||||
|
||||
struct _GimpLinkLayerClass
|
||||
{
|
||||
GimpLayerClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_link_layer_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GimpLayer * gimp_link_layer_new (GimpImage *image,
|
||||
GimpLink *link);
|
||||
|
||||
GimpLink * gimp_link_layer_get_link (GimpLinkLayer *layer);
|
||||
gboolean gimp_link_layer_set_link (GimpLinkLayer *layer,
|
||||
GimpLink *link,
|
||||
gboolean push_undo);
|
||||
gboolean gimp_link_layer_set_link_with_matrix (GimpLinkLayer *layer,
|
||||
GimpLink *link,
|
||||
GimpMatrix3 *matrix,
|
||||
GimpInterpolationType interpolation_type,
|
||||
gint offset_x,
|
||||
gint offset_y,
|
||||
gboolean push_undo);
|
||||
|
||||
void gimp_link_layer_discard (GimpLinkLayer *layer);
|
||||
void gimp_link_layer_monitor (GimpLinkLayer *layer);
|
||||
gboolean gimp_link_layer_is_monitored (GimpLinkLayer *layer);
|
||||
|
||||
gboolean gimp_link_layer_get_transform (GimpLinkLayer *layer,
|
||||
GimpMatrix3 *matrix,
|
||||
gint *offset_x,
|
||||
gint *offset_y,
|
||||
GimpInterpolationType *interpolation);
|
||||
gboolean gimp_link_layer_set_transform (GimpLinkLayer *layer,
|
||||
GimpMatrix3 *matrix,
|
||||
GimpInterpolationType interpolation_type,
|
||||
gboolean push_undo);
|
||||
|
||||
gboolean gimp_item_is_link_layer (GimpItem *item);
|
||||
|
||||
/* Only to be used for XCF loading/saving. */
|
||||
|
||||
guint32 gimp_link_layer_get_xcf_flags (GimpLinkLayer *layer);
|
||||
void gimp_link_layer_set_xcf_flags (GimpLinkLayer *layer,
|
||||
guint32 flags);
|
218
app/core/gimplinklayerundo.c
Normal file
218
app/core/gimplinklayerundo.c
Normal file
@@ -0,0 +1,218 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* Copyright (C) 2019 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "core-types.h"
|
||||
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimplink.h"
|
||||
#include "gimplinklayer.h"
|
||||
#include "gimplinklayerundo.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_PREV_LINK
|
||||
};
|
||||
|
||||
|
||||
static void gimp_link_layer_undo_constructed (GObject *object);
|
||||
static void gimp_link_layer_undo_finalize (GObject *object);
|
||||
static void gimp_link_layer_undo_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_link_layer_undo_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static gint64 gimp_link_layer_undo_get_memsize (GimpObject *object,
|
||||
gint64 *gui_size);
|
||||
|
||||
static void gimp_link_layer_undo_pop (GimpUndo *undo,
|
||||
GimpUndoMode undo_mode,
|
||||
GimpUndoAccumulator *accum);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpLinkLayerUndo, gimp_link_layer_undo, GIMP_TYPE_ITEM_UNDO)
|
||||
|
||||
#define parent_class gimp_link_layer_undo_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_class_init (GimpLinkLayerUndoClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
|
||||
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
|
||||
|
||||
object_class->constructed = gimp_link_layer_undo_constructed;
|
||||
object_class->finalize = gimp_link_layer_undo_finalize;
|
||||
object_class->set_property = gimp_link_layer_undo_set_property;
|
||||
object_class->get_property = gimp_link_layer_undo_get_property;
|
||||
|
||||
gimp_object_class->get_memsize = gimp_link_layer_undo_get_memsize;
|
||||
|
||||
undo_class->pop = gimp_link_layer_undo_pop;
|
||||
|
||||
g_object_class_install_property (object_class, PROP_PREV_LINK,
|
||||
g_param_spec_object ("prev-link",
|
||||
NULL, NULL,
|
||||
GIMP_TYPE_LINK,
|
||||
GIMP_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_init (GimpLinkLayerUndo *undo)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_constructed (GObject *object)
|
||||
{
|
||||
GimpLinkLayerUndo *undo = GIMP_LINK_LAYER_UNDO (object);
|
||||
GimpLinkLayer *layer;
|
||||
GimpLink *link;
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->constructed (object);
|
||||
|
||||
gimp_assert (GIMP_IS_LINK_LAYER (GIMP_ITEM_UNDO (object)->item));
|
||||
|
||||
layer = GIMP_LINK_LAYER (GIMP_ITEM_UNDO (undo)->item);
|
||||
|
||||
link = gimp_link_layer_get_link (layer);
|
||||
undo->link = link ? gimp_link_duplicate (link) : NULL;
|
||||
gimp_link_layer_get_transform (layer,
|
||||
&undo->matrix,
|
||||
&undo->offset_x,
|
||||
&undo->offset_y,
|
||||
&undo->interpolation);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_finalize (GObject *object)
|
||||
{
|
||||
GimpLinkLayerUndo *undo = GIMP_LINK_LAYER_UNDO (object);
|
||||
|
||||
g_clear_object (&undo->link);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpLinkLayerUndo *undo = GIMP_LINK_LAYER_UNDO (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_PREV_LINK:
|
||||
g_clear_object (&undo->link);
|
||||
undo->link = g_value_get_object (value) ? gimp_link_duplicate (g_value_get_object (value)) : NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpLinkLayerUndo *undo = GIMP_LINK_LAYER_UNDO (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_PREV_LINK:
|
||||
g_value_set_object (value, undo->link);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gint64
|
||||
gimp_link_layer_undo_get_memsize (GimpObject *object,
|
||||
gint64 *gui_size)
|
||||
{
|
||||
GimpItemUndo *item_undo = GIMP_ITEM_UNDO (object);
|
||||
gint64 memsize = 0;
|
||||
|
||||
if (! gimp_item_is_attached (item_undo->item))
|
||||
memsize += gimp_object_get_memsize (GIMP_OBJECT (item_undo->item),
|
||||
gui_size);
|
||||
|
||||
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
|
||||
gui_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_link_layer_undo_pop (GimpUndo *undo,
|
||||
GimpUndoMode undo_mode,
|
||||
GimpUndoAccumulator *accum)
|
||||
{
|
||||
GimpLinkLayerUndo *layer_undo = GIMP_LINK_LAYER_UNDO (undo);
|
||||
GimpLinkLayer *layer = GIMP_LINK_LAYER (GIMP_ITEM_UNDO (undo)->item);
|
||||
GimpLink *link;
|
||||
GimpMatrix3 matrix;
|
||||
gint offset_x;
|
||||
gint offset_y;
|
||||
GimpInterpolationType interpolation;
|
||||
|
||||
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
|
||||
|
||||
link = gimp_link_layer_get_link (layer);
|
||||
link = link ? g_object_ref (link) : NULL;
|
||||
|
||||
gimp_link_layer_get_transform (layer, &matrix, &offset_x, &offset_y, &interpolation);
|
||||
gimp_link_layer_set_link_with_matrix (layer, layer_undo->link,
|
||||
&layer_undo->matrix,
|
||||
layer_undo->interpolation,
|
||||
layer_undo->offset_x,
|
||||
layer_undo->offset_y,
|
||||
FALSE);
|
||||
|
||||
|
||||
layer_undo->matrix = matrix;
|
||||
layer_undo->interpolation = interpolation;
|
||||
layer_undo->offset_x = offset_x;
|
||||
layer_undo->offset_y = offset_y;
|
||||
|
||||
g_clear_object (&layer_undo->link);
|
||||
layer_undo->link = link;
|
||||
}
|
53
app/core/gimplinklayerundo.h
Normal file
53
app/core/gimplinklayerundo.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* Copyright (C) 2019 Jehan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gimpitemundo.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_LINK_LAYER_UNDO (gimp_link_layer_undo_get_type ())
|
||||
#define GIMP_LINK_LAYER_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LINK_LAYER_UNDO, GimpLinkLayerUndo))
|
||||
#define GIMP_LINK_LAYER_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LINK_LAYER_UNDO, GimpLinkLayerUndoClass))
|
||||
#define GIMP_IS_LINK_LAYER_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LINK_LAYER_UNDO))
|
||||
#define GIMP_IS_LINK_LAYER_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LINK_LAYER_UNDO))
|
||||
#define GIMP_LINK_LAYER_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LINK_LAYER_UNDO, GimpLinkLayerUndoClass))
|
||||
|
||||
|
||||
typedef struct _GimpLinkLayerUndo GimpLinkLayerUndo;
|
||||
typedef struct _GimpLinkLayerUndoClass GimpLinkLayerUndoClass;
|
||||
|
||||
struct _GimpLinkLayerUndo
|
||||
{
|
||||
GimpItemUndo parent_instance;
|
||||
|
||||
GimpLink *link;
|
||||
GimpMatrix3 matrix;
|
||||
gint offset_x;
|
||||
gint offset_y;
|
||||
GimpInterpolationType interpolation;
|
||||
};
|
||||
|
||||
struct _GimpLinkLayerUndoClass
|
||||
{
|
||||
GimpItemUndoClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_link_layer_undo_get_type (void) G_GNUC_CONST;
|
@@ -61,6 +61,7 @@ static void gimp_list_remove (GimpContainer *conta
|
||||
GimpObject *object);
|
||||
static void gimp_list_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index);
|
||||
static void gimp_list_clear (GimpContainer *container);
|
||||
static gboolean gimp_list_have (GimpContainer *container,
|
||||
@@ -297,6 +298,7 @@ gimp_list_remove (GimpContainer *container,
|
||||
static void
|
||||
gimp_list_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index)
|
||||
{
|
||||
GimpList *list = GIMP_LIST (container);
|
||||
@@ -307,6 +309,9 @@ gimp_list_reorder (GimpContainer *container,
|
||||
g_queue_push_tail (list->queue, object);
|
||||
else
|
||||
g_queue_push_nth (list->queue, object, new_index);
|
||||
|
||||
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object,
|
||||
old_index, new_index);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -50,6 +50,7 @@ VOID: INT, INT, BOOLEAN, BOOLEAN
|
||||
VOID: INT, OBJECT
|
||||
VOID: OBJECT, BOOLEAN
|
||||
VOID: OBJECT, INT
|
||||
VOID: OBJECT, INT, INT
|
||||
VOID: OBJECT, OBJECT
|
||||
VOID: OBJECT, POINTER
|
||||
VOID: OBJECT, STRING, STRING
|
||||
|
@@ -207,7 +207,7 @@ gimp_palette_import_create_image_palette (gpointer data,
|
||||
gint n_colors;
|
||||
gchar *lab;
|
||||
GeglColor *color;
|
||||
guint8 rgb[3];
|
||||
guint8 rgb[4];
|
||||
|
||||
n_colors = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (palette),
|
||||
"import-n-colors"));
|
||||
@@ -228,6 +228,12 @@ gimp_palette_import_create_image_palette (gpointer data,
|
||||
rgb[0] = (guchar) color_tab->r + (color_tab->r_adj / color_tab->count);
|
||||
rgb[1] = (guchar) color_tab->g + (color_tab->g_adj / color_tab->count);
|
||||
rgb[2] = (guchar) color_tab->b + (color_tab->b_adj / color_tab->count);
|
||||
/* TODO: We only receive the RGB values, so if the format has alpha, it
|
||||
* becomes transparent when used outside of a palette. For now, we'll set
|
||||
* alpha to 255, but in the future, a less RGB-specific implementation
|
||||
* would be ideal */
|
||||
if (babl_format_has_alpha (format))
|
||||
rgb[3] = 255;
|
||||
|
||||
gegl_color_set_pixel (color, format, rgb);
|
||||
|
||||
|
@@ -872,7 +872,7 @@ gimp_palette_load_acb (GimpContext *context,
|
||||
{
|
||||
g_free (palette_entry);
|
||||
g_free (full_palette_name);
|
||||
g_object_unref (color);
|
||||
g_clear_object (&color);
|
||||
|
||||
g_printerr ("Invalid ACB palette color code");
|
||||
break;
|
||||
@@ -880,63 +880,65 @@ gimp_palette_load_acb (GimpContext *context,
|
||||
|
||||
if (color_space == 0)
|
||||
{
|
||||
gchar rgb[3];
|
||||
guchar rgb[3];
|
||||
|
||||
if (! g_input_stream_read_all (input, rgb, sizeof (rgb),
|
||||
&bytes_read, NULL, error))
|
||||
{
|
||||
g_free (palette_entry);
|
||||
g_free (full_palette_name);
|
||||
g_object_unref (color);
|
||||
g_clear_object (&color);
|
||||
|
||||
g_printerr ("Invalid ACB palette colors");
|
||||
break;
|
||||
}
|
||||
|
||||
gegl_color_set_pixel (color, babl_format ("R'G'B u8"), rgb);
|
||||
gegl_color_set_pixel (color, babl_format ("R'G'B' u8"), rgb);
|
||||
color_ok = TRUE;
|
||||
}
|
||||
else if (color_space == 2)
|
||||
{
|
||||
gchar cmyk[4];
|
||||
guchar cmyk[4];
|
||||
gfloat cmyk_f[4];
|
||||
|
||||
if (! g_input_stream_read_all (input, cmyk, sizeof (cmyk),
|
||||
&bytes_read, NULL, error))
|
||||
{
|
||||
g_free (palette_entry);
|
||||
g_free (full_palette_name);
|
||||
g_object_unref (color);
|
||||
g_clear_object (&color);
|
||||
|
||||
g_printerr ("Invalid ACB palette colors");
|
||||
break;
|
||||
}
|
||||
|
||||
for (gint j = 0; j < 4; j++)
|
||||
cmyk[j] = ((255 - cmyk[j]) / 2.55f) + 0.5f;
|
||||
cmyk_f[j] = (((255 - cmyk[j]) / 2.55f) + 0.5f) / 100.0f;
|
||||
|
||||
gegl_color_set_pixel (color, babl_format ("cmyk u8"), cmyk);
|
||||
gegl_color_set_pixel (color, babl_format ("CMYK float"), cmyk_f);
|
||||
color_ok = TRUE;
|
||||
}
|
||||
else if (color_space == 7)
|
||||
{
|
||||
gchar lab[3];
|
||||
guchar lab[3];
|
||||
gfloat lab_f[3];
|
||||
|
||||
if (! g_input_stream_read_all (input, lab, sizeof (lab),
|
||||
&bytes_read, NULL, error))
|
||||
{
|
||||
g_free (palette_entry);
|
||||
g_free (full_palette_name);
|
||||
g_object_unref (color);
|
||||
g_clear_object (&color);
|
||||
|
||||
g_printerr ("Invalid ACB palette colors");
|
||||
break;
|
||||
}
|
||||
|
||||
lab[0] = (lab[0] / 2.55f) + 0.5f;
|
||||
lab[1] = lab[1] - 128;
|
||||
lab[2] = lab[2] - 128;
|
||||
lab_f[0] = (lab[0] / 2.55f) + 0.5f;
|
||||
lab_f[1] = ((gfloat) lab[1]) - 128;
|
||||
lab_f[2] = ((gfloat) lab[2]) - 128;
|
||||
|
||||
gegl_color_set_pixel (color, babl_format ("CIE Lab u8"), lab);
|
||||
gegl_color_set_pixel (color, babl_format ("CIE Lab float"), lab_f);
|
||||
color_ok = TRUE;
|
||||
}
|
||||
|
||||
@@ -945,7 +947,7 @@ gimp_palette_load_acb (GimpContext *context,
|
||||
|
||||
g_free (palette_entry);
|
||||
g_free (full_palette_name);
|
||||
g_object_unref (color);
|
||||
g_clear_object (&color);
|
||||
|
||||
if (! color_ok)
|
||||
{
|
||||
|
@@ -76,8 +76,7 @@ static GimpTempBuf * gimp_palette_get_new_preview (GimpViewable *vie
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_palette_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
static const gchar * gimp_palette_get_extension (GimpData *data);
|
||||
@@ -243,8 +242,7 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpPalette *palette = GIMP_PALETTE (viewable);
|
||||
GimpTempBuf *temp_buf;
|
||||
@@ -498,11 +496,7 @@ gimp_palette_restrict_format (GimpPalette *palette,
|
||||
|
||||
if (push_undo_if_image && gimp_data_get_image (GIMP_DATA (palette)))
|
||||
gimp_image_undo_push_image_colormap (gimp_data_get_image (GIMP_DATA (palette)),
|
||||
/* TODO: use localized string
|
||||
* after string freeze.
|
||||
*/
|
||||
/*C_("undo-type", "Change Colormap format restriction"));*/
|
||||
"Change Colormap format restriction");
|
||||
C_("undo-type", "Change Colormap format restriction"));
|
||||
palette->format = format;
|
||||
|
||||
if (palette->format == NULL)
|
||||
|
@@ -36,12 +36,14 @@
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimplayermask.h"
|
||||
#include "gimplinklayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "gimpparamspecs.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimpselection.h"
|
||||
|
||||
#include "path/gimppath.h"
|
||||
#include "path/gimpvectorlayer.h"
|
||||
|
||||
#include "text/gimpfont.h"
|
||||
#include "text/gimptextlayer.h"
|
||||
|
@@ -50,8 +50,7 @@ static GimpTempBuf * gimp_pattern_get_new_preview (GimpViewable *viewa
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
static gchar * gimp_pattern_get_description (GimpViewable *viewable,
|
||||
gchar **tooltip);
|
||||
|
||||
@@ -145,8 +144,7 @@ gimp_pattern_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpPattern *pattern = GIMP_PATTERN (viewable);
|
||||
GimpTempBuf *temp_buf;
|
||||
|
@@ -66,6 +66,7 @@ static void gimp_tree_proxy_container_remove (GimpContainer *container,
|
||||
GimpTreeProxy *tree_proxy);
|
||||
static void gimp_tree_proxy_container_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index,
|
||||
GimpTreeProxy *tree_proxy);
|
||||
static void gimp_tree_proxy_container_freeze (GimpContainer *container,
|
||||
@@ -213,6 +214,7 @@ gimp_tree_proxy_container_remove (GimpContainer *container,
|
||||
static void
|
||||
gimp_tree_proxy_container_reorder (GimpContainer *container,
|
||||
GimpObject *object,
|
||||
gint old_index,
|
||||
gint new_index,
|
||||
GimpTreeProxy *tree_proxy)
|
||||
{
|
||||
|
@@ -83,8 +83,7 @@ static GimpTempBuf * gimp_undo_get_new_preview (GimpViewable *viewabl
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color,
|
||||
GeglColor *background);
|
||||
GeglColor *fg_color);
|
||||
|
||||
static void gimp_undo_real_pop (GimpUndo *undo,
|
||||
GimpUndoMode undo_mode,
|
||||
@@ -304,8 +303,7 @@ gimp_undo_get_new_preview (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
gint width,
|
||||
gint height,
|
||||
GeglColor *color G_GNUC_UNUSED,
|
||||
GeglColor *background G_GNUC_UNUSED)
|
||||
GeglColor *fg_color G_GNUC_UNUSED)
|
||||
{
|
||||
GimpUndo *undo = GIMP_UNDO (viewable);
|
||||
|
||||
@@ -495,7 +493,7 @@ gimp_undo_create_preview_private (GimpUndo *undo,
|
||||
}
|
||||
|
||||
undo->preview = gimp_viewable_get_new_preview (preview_viewable, context,
|
||||
width, height, NULL, NULL);
|
||||
width, height, NULL);
|
||||
|
||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (undo));
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user