Compare commits
1972 Commits
parse-dash
...
front-cach
Author | SHA1 | Date | |
---|---|---|---|
|
c5988a22a4 | ||
|
498bf67cec | ||
|
65455cdb91 | ||
|
d4963ba2e5 | ||
|
ec5fed6cc4 | ||
|
b7ae5404a3 | ||
|
fb4f210430 | ||
|
82df109444 | ||
|
bd84142f43 | ||
|
65074bbbac | ||
|
21fb5ec0b2 | ||
|
e57f92b7e9 | ||
|
e94e348ad5 | ||
|
91234e75f8 | ||
|
212e9a6957 | ||
|
b4b7e9b040 | ||
|
c3fcf0f7b0 | ||
|
60fc48e71f | ||
|
01d9886eea | ||
|
a97231c8bf | ||
|
8ac8a027b2 | ||
|
070f3a61ac | ||
|
022347fa85 | ||
|
ebb6076aca | ||
|
7b66bc45aa | ||
|
698aa7c0f3 | ||
|
70699efc71 | ||
|
cebc95f253 | ||
|
f9c6bd125b | ||
|
4733ca193b | ||
|
c7b345f73e | ||
|
1fbc61f2cb | ||
|
565694ede5 | ||
|
0df03b054d | ||
|
73d01d3130 | ||
|
80f3357117 | ||
|
d5b34aecdd | ||
|
d16d2135e6 | ||
|
53b52abd30 | ||
|
e55e9e3b36 | ||
|
9f9cea219f | ||
|
dbee1a8160 | ||
|
133cd87bdf | ||
|
9f8e84cb60 | ||
|
b8057b088e | ||
|
cf8cca8724 | ||
|
d97767014c | ||
|
2f974a1f5a | ||
|
4e2c7d5eb0 | ||
|
a5d1cb93ef | ||
|
401b902cbf | ||
|
9f2778b97c | ||
|
ed4eeb8adb | ||
|
fb36d30685 | ||
|
385b9a7241 | ||
|
c2abf30c46 | ||
|
50a47f55d9 | ||
|
cd7fe772a7 | ||
|
317bba756e | ||
|
2212049e8f | ||
|
0f26a006ee | ||
|
3c451b3ec7 | ||
|
323adf9aa8 | ||
|
70f0cde730 | ||
|
14e78663ee | ||
|
d8279209a2 | ||
|
a0527ff0bd | ||
|
771ea81715 | ||
|
f22a3f9ec6 | ||
|
246876a404 | ||
|
27a086b5f0 | ||
|
8158945de9 | ||
|
1c85141612 | ||
|
690381672b | ||
|
3d7ff44dc5 | ||
|
a518c59098 | ||
|
1dd5e92499 | ||
|
fbd3c5ebd0 | ||
|
48dc7df5b7 | ||
|
0c4c90d606 | ||
|
da954d20f9 | ||
|
ff262c081e | ||
|
c6967234de | ||
|
cdbfb35067 | ||
|
53e17ab14e | ||
|
550e98090a | ||
|
2771befdd9 | ||
|
911730493d | ||
|
d05f47a695 | ||
|
11dc15207e | ||
|
4ea748a676 | ||
|
b78d2a7f75 | ||
|
1fd9e1e916 | ||
|
24ceb47cbc | ||
|
8872e1cbb0 | ||
|
c1e2ffac83 | ||
|
17df646663 | ||
|
6f8fae590f | ||
|
4146db0003 | ||
|
9c228cc634 | ||
|
df2cdb6913 | ||
|
22a5447039 | ||
|
a2475051fa | ||
|
d41fb7c5a6 | ||
|
3b28c46595 | ||
|
f57300b924 | ||
|
c146f225ff | ||
|
9f4f65be4a | ||
|
93715b963e | ||
|
c1407f2ca6 | ||
|
3b299f574d | ||
|
a51c6aed47 | ||
|
b552cf74dd | ||
|
0be0265751 | ||
|
207dd6fe0d | ||
|
a87ff8d556 | ||
|
153cb8316e | ||
|
7ad7c0d8c1 | ||
|
61595af586 | ||
|
d240c35850 | ||
|
d276eb9e9a | ||
|
afe4cbf26d | ||
|
76e5ef6937 | ||
|
0ed43f66a9 | ||
|
4882514234 | ||
|
a15e87d2a6 | ||
|
cc92b9b19f | ||
|
bf0120f73d | ||
|
7f06eed8da | ||
|
dc30044829 | ||
|
781fe2d7fa | ||
|
b8a61f7899 | ||
|
a44ca6756a | ||
|
490a9f193d | ||
|
754d364efd | ||
|
4939f0bb75 | ||
|
7537d80047 | ||
|
c5bdf0a995 | ||
|
04870fc1a1 | ||
|
43e5bc795a | ||
|
f3ec58d290 | ||
|
5b3d14e15b | ||
|
131ab11f5c | ||
|
a2eb467663 | ||
|
06f85ee566 | ||
|
aab40ad6a2 | ||
|
364eec24b1 | ||
|
f1fe21e009 | ||
|
126cbccddf | ||
|
26cf74de5c | ||
|
2ecb8c08dc | ||
|
ce7cc942e4 | ||
|
a0e9d93b4c | ||
|
017aea1952 | ||
|
63d7b22924 | ||
|
3f3629154c | ||
|
c3cfabfa96 | ||
|
cd9525afc9 | ||
|
4d76beb59c | ||
|
59578c6d18 | ||
|
7bf8669d97 | ||
|
e1156ea636 | ||
|
82f601253e | ||
|
96e710a76f | ||
|
a45b66e1ca | ||
|
325b0010e4 | ||
|
bf14a5f70b | ||
|
532e887c88 | ||
|
7830535c04 | ||
|
440c207146 | ||
|
ed12c0cd5a | ||
|
543c7ae52a | ||
|
3ac50b81f2 | ||
|
6bac377fa5 | ||
|
3bb1c2298f | ||
|
637f6cc81b | ||
|
0ba8903fa5 | ||
|
ee14b96c28 | ||
|
cf86a01b65 | ||
|
f57e211ba9 | ||
|
e2c8b7fa6c | ||
|
b486588883 | ||
|
d0bf33339e | ||
|
df09975753 | ||
|
d21467e2e8 | ||
|
c8529df309 | ||
|
5f03053569 | ||
|
1dbd74e181 | ||
|
c8ae2d9002 | ||
|
03cd652063 | ||
|
c0d49f296e | ||
|
1723ab34e1 | ||
|
55dbf0accb | ||
|
b3d044a0b1 | ||
|
2fef71da5c | ||
|
48c1f5fd27 | ||
|
6e4a526ddf | ||
|
d11886e7ac | ||
|
177b19a2da | ||
|
f943469fc9 | ||
|
59d062cb3d | ||
|
8032e30a76 | ||
|
2e81e4d452 | ||
|
d900407a18 | ||
|
64e5c76323 | ||
|
b9651606d3 | ||
|
2a5f6fdde5 | ||
|
6dbbd65ef8 | ||
|
9947760d87 | ||
|
493b83ff24 | ||
|
b65f6eef59 | ||
|
f6ff0ee18c | ||
|
b388c066dc | ||
|
9fe011b98f | ||
|
89ab3a8146 | ||
|
5dcaca9b3c | ||
|
69c8278558 | ||
|
0e9b967bf9 | ||
|
0c32a94d8e | ||
|
6d20f4bc60 | ||
|
8361949ba1 | ||
|
8372bc00bd | ||
|
5cf3c70db0 | ||
|
a031011e5e | ||
|
bd901896ee | ||
|
cb5c994cd9 | ||
|
39a0e27513 | ||
|
832ddb31b7 | ||
|
8bdc7a3289 | ||
|
57521e6242 | ||
|
93d681ae77 | ||
|
a9b27a7de0 | ||
|
41d80ac277 | ||
|
cf9b8231bd | ||
|
3b6035a46d | ||
|
c7a69882d3 | ||
|
e5cd813a24 | ||
|
62d917eb08 | ||
|
d4c4e4bbc5 | ||
|
cfcc9658b2 | ||
|
d8a0cd24d7 | ||
|
496ecd68f2 | ||
|
683878c733 | ||
|
38c0e2bdf6 | ||
|
f0fc2709d6 | ||
|
1b38cbd410 | ||
|
c2ec97e922 | ||
|
90a278ce46 | ||
|
2a5fe8cd0c | ||
|
42d89a0ff1 | ||
|
9f65cdf3aa | ||
|
35bc08da5e | ||
|
723c2493b2 | ||
|
245e51099f | ||
|
a06cd6a821 | ||
|
1c509be875 | ||
|
9894417a09 | ||
|
51f218c877 | ||
|
a8bb0a0ee1 | ||
|
b7414dfbdd | ||
|
057479c284 | ||
|
c5a01cd14b | ||
|
719ff9eca9 | ||
|
d50e235753 | ||
|
ae2020aca2 | ||
|
450524f6cf | ||
|
be09cebb09 | ||
|
6230ff0fc4 | ||
|
1733671295 | ||
|
78a7127b96 | ||
|
94063cbe92 | ||
|
96e579501f | ||
|
98c88780bc | ||
|
7dcb7d7d0f | ||
|
95e36af46b | ||
|
47a13e601f | ||
|
a301f18ebf | ||
|
6cbf4667a4 | ||
|
ef20b706e2 | ||
|
979e4207f3 | ||
|
c29237c75d | ||
|
99aa5f398b | ||
|
1858d955de | ||
|
3e5af3afce | ||
|
b4a1ed2a70 | ||
|
f05a8927f3 | ||
|
a2368803fa | ||
|
ee93f88268 | ||
|
32d35b1d01 | ||
|
528e246f1a | ||
|
03f820d26c | ||
|
bf39fa3b3b | ||
|
d2229e2aed | ||
|
9eac147426 | ||
|
1b1abba313 | ||
|
223d1343de | ||
|
f0f6af1cf8 | ||
|
82eed5d672 | ||
|
38f64c2357 | ||
|
daadaf8448 | ||
|
e86fa6a072 | ||
|
1b3eb3ecd1 | ||
|
94539e6f08 | ||
|
f5af3fe933 | ||
|
bbad290518 | ||
|
334e380d31 | ||
|
d8db673fb7 | ||
|
268ad54c6a | ||
|
64a67ac3a8 | ||
|
74ac95dc32 | ||
|
7f817fce0a | ||
|
5549a7ab5f | ||
|
53821da4d6 | ||
|
f518d780ed | ||
|
9045431bde | ||
|
8271687ef6 | ||
|
8043d4d6e0 | ||
|
e7a59d92ac | ||
|
e3bac4063c | ||
|
48012a1ce4 | ||
|
63f6e75b38 | ||
|
23c1ec07e7 | ||
|
7431a58617 | ||
|
30e9d98f0d | ||
|
43d0b0fb3c | ||
|
d47c8613b0 | ||
|
e01311a565 | ||
|
0876089f8f | ||
|
b7a8c2207e | ||
|
5ab8fde0bc | ||
|
d1d1af1a62 | ||
|
88618952c5 | ||
|
92d1df94fa | ||
|
187db92a88 | ||
|
a9b8551e70 | ||
|
0cac75aff1 | ||
|
6cf3f6ebff | ||
|
3efe1bef93 | ||
|
16c804c5e3 | ||
|
28f4666366 | ||
|
72a5927d38 | ||
|
7473617ffb | ||
|
7d43e4e56a | ||
|
8fd2a267ae | ||
|
3809e6efb9 | ||
|
9224efd95e | ||
|
4cbd384e39 | ||
|
12010a597b | ||
|
720ac700b3 | ||
|
373a6ab9f1 | ||
|
57c1c95e75 | ||
|
ffc117564b | ||
|
ee3367697d | ||
|
c6e19f0384 | ||
|
9df265acdc | ||
|
461d9b4052 | ||
|
0ed45c5f40 | ||
|
73ac2d0a1c | ||
|
57ab670991 | ||
|
e2b5e0d17d | ||
|
77e05a4240 | ||
|
97c5bb284b | ||
|
286b473f55 | ||
|
1152c93778 | ||
|
1a85d569e3 | ||
|
bd114ab1a8 | ||
|
7a1f764910 | ||
|
10f934f782 | ||
|
97c60b84c8 | ||
|
bf89431464 | ||
|
9ddae8aebc | ||
|
e3c70645f9 | ||
|
1e54e838e0 | ||
|
40854f2ae9 | ||
|
5e8e877f95 | ||
|
99844c8ccf | ||
|
8418e4276a | ||
|
7693e7133d | ||
|
e56f9dbeb8 | ||
|
282d66a604 | ||
|
3f513f3cc7 | ||
|
854910cc17 | ||
|
6bc7ec3d4d | ||
|
bda6530fea | ||
|
6227592dfa | ||
|
bc066de998 | ||
|
68980a5e3b | ||
|
f200e8b132 | ||
|
dde2d9b545 | ||
|
ac64948efd | ||
|
dfe2141227 | ||
|
1e1c973d71 | ||
|
b69898228d | ||
|
9c71469c67 | ||
|
a8b1c90303 | ||
|
69ffaab09f | ||
|
9730d44252 | ||
|
f99e725391 | ||
|
8e4a42a214 | ||
|
603de8361c | ||
|
51fd7cf35a | ||
|
ab1fba6fdc | ||
|
cfa53de9af | ||
|
3ebbcc981a | ||
|
96a71d515b | ||
|
b830ca8fab | ||
|
825c97be6c | ||
|
25f99f35f6 | ||
|
b719f3bd60 | ||
|
b16d01e018 | ||
|
c56360f20b | ||
|
726d5b25e8 | ||
|
681aac7317 | ||
|
2cd550cdbc | ||
|
766048b8e4 | ||
|
63615c05bc | ||
|
cdf5d08294 | ||
|
3e4d0b69d4 | ||
|
7742434dde | ||
|
f0e6c03d94 | ||
|
09882701c2 | ||
|
a19bc6620a | ||
|
da5de1ba99 | ||
|
e9d2f832a1 | ||
|
4fac0f713a | ||
|
fff8198393 | ||
|
df2cbb4e9f | ||
|
2990c1d8d8 | ||
|
4b5adcd374 | ||
|
0b861cf159 | ||
|
b7e770c8fc | ||
|
71bbba45cc | ||
|
2da5ca4b42 | ||
|
02d5f6a629 | ||
|
fe224c3ad9 | ||
|
3d898af736 | ||
|
686d0f8d64 | ||
|
bad4327e72 | ||
|
156cd7e967 | ||
|
28b552ad8c | ||
|
c2fda3144d | ||
|
1e19629ce1 | ||
|
c7b4347342 | ||
|
1c3e8d5280 | ||
|
ed8bca1548 | ||
|
e1ca4b4569 | ||
|
34392ca018 | ||
|
0c3c8a6a85 | ||
|
ea5768cb42 | ||
|
6683909dda | ||
|
e4e0c27f58 | ||
|
4e5456c8c3 | ||
|
4563f9353a | ||
|
906b88067a | ||
|
062902c003 | ||
|
6d57bbe7dd | ||
|
0c036c0c21 | ||
|
af014007f4 | ||
|
3f97ba2041 | ||
|
4ce08a7b89 | ||
|
914e9bc316 | ||
|
9a5490c0cc | ||
|
1385ffd2c2 | ||
|
a28915bffb | ||
|
2af5f7ffd1 | ||
|
e1bae384f0 | ||
|
12a97ef422 | ||
|
9a6d6e80b5 | ||
|
7ed6c39862 | ||
|
57a4500bae | ||
|
b01ed4ce39 | ||
|
2b142a59a1 | ||
|
20c81d90c9 | ||
|
3167a5b4d6 | ||
|
f5584b178d | ||
|
332fd1b840 | ||
|
5e85b1aa02 | ||
|
7f7254f10b | ||
|
72c58ccd7d | ||
|
f574cc2936 | ||
|
2b59c4cf16 | ||
|
72b35a32fd | ||
|
97b78cede0 | ||
|
653d1eec55 | ||
|
4cc2a660e3 | ||
|
6ab6109149 | ||
|
e93acc5762 | ||
|
290c02b123 | ||
|
64db415e67 | ||
|
ed7ff78a0d | ||
|
e857f0a3af | ||
|
9e8adb9792 | ||
|
4e84312a5a | ||
|
5d84b757e2 | ||
|
c21ca4811e | ||
|
96152303a6 | ||
|
fe07337e02 | ||
|
312c0f0b3b | ||
|
adc9cc568e | ||
|
3e59b0b582 | ||
|
6a5ee99c23 | ||
|
8fda63c85e | ||
|
eccf0a6905 | ||
|
cfa9dc6162 | ||
|
9f068866e2 | ||
|
0d03e570b0 | ||
|
0dcf31292d | ||
|
4ab18b6657 | ||
|
957d96102a | ||
|
d21a691f44 | ||
|
ae5ea8e495 | ||
|
bbabb1973c | ||
|
d2a85abf79 | ||
|
74620ffc46 | ||
|
ce04dfad41 | ||
|
568eed9477 | ||
|
26561ab2e7 | ||
|
26060b1be2 | ||
|
210c71b856 | ||
|
7206060450 | ||
|
31cd2b19cd | ||
|
857de33937 | ||
|
3d9d4031d6 | ||
|
738b48c660 | ||
|
cce5f691e2 | ||
|
ad4f2de86c | ||
|
9166e90bd4 | ||
|
6ad15fe6d0 | ||
|
66b992c3c0 | ||
|
b19f71dd24 | ||
|
cccec91b66 | ||
|
cd6e8d9e5b | ||
|
00566261b2 | ||
|
888b9ee352 | ||
|
f0eceb4aa3 | ||
|
ff082a7758 | ||
|
f357623170 | ||
|
bd3afd1006 | ||
|
79009d4158 | ||
|
b782f80311 | ||
|
c48a3152f0 | ||
|
d2d2fb4b50 | ||
|
81adf6be22 | ||
|
ff9c9e05c3 | ||
|
e3f39bf0c3 | ||
|
d692243727 | ||
|
6ad9db0bf0 | ||
|
486157f6bf | ||
|
5ca4ab3aaa | ||
|
a37b3fb691 | ||
|
c414889cfa | ||
|
4dfc07ef57 | ||
|
cf4b0a27f8 | ||
|
393ee574b6 | ||
|
e3c85be53f | ||
|
0f5fda2277 | ||
|
0889037959 | ||
|
ee56ad792c | ||
|
5688b7b4bb | ||
|
df1802f756 | ||
|
84de90756d | ||
|
cb5a8a76da | ||
|
26c35c00e1 | ||
|
5d4879aae7 | ||
|
39b08b82ca | ||
|
2b6e7147d6 | ||
|
3a1349e8ef | ||
|
5485d806c5 | ||
|
6e7c499408 | ||
|
c341da32aa | ||
|
d39ec8c09e | ||
|
e3299e38df | ||
|
8fd02f6fa2 | ||
|
9bc0ad9a13 | ||
|
19171c7a89 | ||
|
abf942efe5 | ||
|
dfe7afdb04 | ||
|
1629b072fe | ||
|
0b0a5a52af | ||
|
75d259eedf | ||
|
6fec018cbd | ||
|
6d9c950b82 | ||
|
0933ea63c5 | ||
|
8cb594696e | ||
|
ab7592ee4f | ||
|
9d7389aea7 | ||
|
994644ffe7 | ||
|
76a1f1714d | ||
|
9af08e17e0 | ||
|
276afbca92 | ||
|
0342d23dbe | ||
|
1c10837b21 | ||
|
7cc5d5c7a5 | ||
|
6a59326dbf | ||
|
1968f331d9 | ||
|
bf35836350 | ||
|
036629a491 | ||
|
8cabf59cf3 | ||
|
6a4b238641 | ||
|
d4d0239ae7 | ||
|
a30f32db8d | ||
|
6948a74d72 | ||
|
14ec255812 | ||
|
00ebd51d06 | ||
|
7de528b487 | ||
|
77f40d7508 | ||
|
b969f4649d | ||
|
f4f25e584c | ||
|
b049a3501a | ||
|
0114fad8a5 | ||
|
afafac6878 | ||
|
108eb43b01 | ||
|
6961c1fe4a | ||
|
606d150e0b | ||
|
96f7bb99a7 | ||
|
b937c17985 | ||
|
79cb370f81 | ||
|
154b73723f | ||
|
c0efed4e4a | ||
|
4402676aa2 | ||
|
9bf4a45d47 | ||
|
85ce343816 | ||
|
114d0621aa | ||
|
d595aff52d | ||
|
d72fd951e1 | ||
|
78706e3fbe | ||
|
98b796a371 | ||
|
c99f62aef1 | ||
|
8754247a90 | ||
|
fd12707162 | ||
|
34bca0ff56 | ||
|
c668519d07 | ||
|
454e6eadc6 | ||
|
e248a01fbd | ||
|
e2bd7defa4 | ||
|
855fa6d523 | ||
|
7c620ac2b7 | ||
|
d96f2f54e9 | ||
|
71c2ee3530 | ||
|
5e415ee916 | ||
|
e163021b8f | ||
|
1bf88f1d81 | ||
|
72d2b8e546 | ||
|
37f7f3d60c | ||
|
8d1443994b | ||
|
39db73dff1 | ||
|
68cf5f2cf3 | ||
|
77c4097c86 | ||
|
d7bc4c719b | ||
|
725857e15b | ||
|
50ee872978 | ||
|
b6c82c6b54 | ||
|
1bf94b045c | ||
|
13bfe188b5 | ||
|
f21175b3d0 | ||
|
d78475372f | ||
|
988b9de210 | ||
|
0c19ef6c2c | ||
|
2bfd4a88d6 | ||
|
de3eeb4970 | ||
|
5c2e2977e0 | ||
|
24f3ec0949 | ||
|
bcab0e4254 | ||
|
253955c017 | ||
|
3a8834a437 | ||
|
48ea2ecac3 | ||
|
6d0b31128b | ||
|
0b519bc353 | ||
|
bb756b35a2 | ||
|
7ba7ab1e3d | ||
|
f73a7e29ca | ||
|
2eb6e3d4c5 | ||
|
b28cf76f11 | ||
|
36314f28e2 | ||
|
b7a1b1d7ee | ||
|
57e382b59c | ||
|
a35a885902 | ||
|
5fa3a2a39f | ||
|
7f53b3d3f4 | ||
|
9b25257cbf | ||
|
a90a6c4517 | ||
|
e69f062c99 | ||
|
210c7f25ad | ||
|
9695791f7b | ||
|
ca0da0dd83 | ||
|
5a8a839921 | ||
|
eb84171cda | ||
|
5608a8978e | ||
|
efefdbd5c0 | ||
|
6bea059424 | ||
|
c99c06f0da | ||
|
bda8f5393d | ||
|
160fa969d4 | ||
|
edf33a6617 | ||
|
86587a9328 | ||
|
8691d471d0 | ||
|
463b6dd1fd | ||
|
88e1f77f90 | ||
|
1ee488f445 | ||
|
eae0e15b9d | ||
|
00d551bda8 | ||
|
2dcec44714 | ||
|
f04c819439 | ||
|
c679ba9ebf | ||
|
9aadc2b860 | ||
|
e4370cc95e | ||
|
22ceb018fb | ||
|
833d307695 | ||
|
e8afb5e210 | ||
|
b916c4dac1 | ||
|
699c6d6159 | ||
|
025b846fce | ||
|
fcdbab3f69 | ||
|
d7eac7a6ad | ||
|
52dbb3f372 | ||
|
7dc38ca12f | ||
|
e858924d03 | ||
|
852aab1576 | ||
|
5eb42815ed | ||
|
0b853f62ed | ||
|
fb969f5431 | ||
|
ef6ed31853 | ||
|
c57245b73c | ||
|
f9fd78b67e | ||
|
00a63a9fcf | ||
|
b4ae2377b3 | ||
|
392977d670 | ||
|
5a29e2704c | ||
|
ec6c52680e | ||
|
d850161b2f | ||
|
1a3504469d | ||
|
be0546bb39 | ||
|
d4a569057f | ||
|
c5727df568 | ||
|
7406cea257 | ||
|
de3f55fc5f | ||
|
010ff81b2f | ||
|
c94ec8b658 | ||
|
9c1ae5374d | ||
|
4a018de0a1 | ||
|
23e50bb21d | ||
|
a8e3e747df | ||
|
7fd90853f8 | ||
|
01aa4989f8 | ||
|
d4fee23ff6 | ||
|
b878949f00 | ||
|
3a88522a19 | ||
|
358cd28d09 | ||
|
6eb6b0cb50 | ||
|
c81954120a | ||
|
4bdc44f4af | ||
|
3ab7b2d7ce | ||
|
429056c214 | ||
|
acecf519bc | ||
|
b2fbdcda41 | ||
|
1b08fda93e | ||
|
f6b6176ec0 | ||
|
2803189afd | ||
|
ad08c1444a | ||
|
ef77a6fa73 | ||
|
667f02ecd8 | ||
|
160f632668 | ||
|
653bf46494 | ||
|
46d4c70cd7 | ||
|
4920ac4a57 | ||
|
5bdc9f71fd | ||
|
c92761b184 | ||
|
9185f15cd9 | ||
|
efec30babb | ||
|
190e7da317 | ||
|
28d38cd730 | ||
|
d7a72493ae | ||
|
7299c9baa9 | ||
|
540a83327f | ||
|
04d41eaa66 | ||
|
524d681496 | ||
|
44d977844b | ||
|
6259800f5a | ||
|
d3a5aa5304 | ||
|
d32ab7544d | ||
|
e2e7c931c5 | ||
|
e202348380 | ||
|
ba5403da17 | ||
|
904d44074f | ||
|
c636baf6f5 | ||
|
b7c2528ad1 | ||
|
48740de71a | ||
|
34c16b0df2 | ||
|
d0a675ab01 | ||
|
0e0bf8ed47 | ||
|
00d7d4b17b | ||
|
9eef566b54 | ||
|
272168c94b | ||
|
ca054bfdc9 | ||
|
59dbfb0843 | ||
|
223e27e7dc | ||
|
efe1415429 | ||
|
489723916d | ||
|
e8894ad383 | ||
|
9423d6261a | ||
|
b766f92026 | ||
|
a37aacf4e4 | ||
|
93959ef7df | ||
|
209a1a69cc | ||
|
982f965ea8 | ||
|
f7fc90daa0 | ||
|
a58424588f | ||
|
f8c9b3394b | ||
|
ce4d8cc6d9 | ||
|
c85766ac71 | ||
|
b24ae31716 | ||
|
7cf805c8b3 | ||
|
1f62c693cd | ||
|
6ae9cbfe0f | ||
|
7803aad872 | ||
|
cc2d3fa7d6 | ||
|
a9e4993184 | ||
|
33703bfe01 | ||
|
7ba5cf5309 | ||
|
bb890f6004 | ||
|
1c7a0e7a15 | ||
|
cd7e1c1387 | ||
|
a2e1e727c5 | ||
|
61207f81c3 | ||
|
f624586a75 | ||
|
1a93967e1f | ||
|
310ab7b531 | ||
|
d55801c8ba | ||
|
b1809bfd88 | ||
|
deb8a35ea0 | ||
|
c5ce24c82c | ||
|
54815e4771 | ||
|
5a99790a87 | ||
|
8aa7174bfb | ||
|
9df5e3cbd6 | ||
|
8b5194c016 | ||
|
9a63172cf5 | ||
|
3ade9ae184 | ||
|
76349ff6e5 | ||
|
dd530b45e2 | ||
|
00ce51472c | ||
|
b6bcbeae23 | ||
|
cf86cc1184 | ||
|
b503b60a49 | ||
|
5850055b68 | ||
|
b224e66a9f | ||
|
bbb0150383 | ||
|
8aef682079 | ||
|
fe4b7a5159 | ||
|
7ba4ba05e1 | ||
|
85e1088171 | ||
|
c1ed034367 | ||
|
cc3e25b163 | ||
|
bdb3e345c8 | ||
|
a30e9dcfeb | ||
|
76007c4d09 | ||
|
020ef51cb0 | ||
|
1914adc344 | ||
|
6e236b9459 | ||
|
11715760f9 | ||
|
f19c08ffda | ||
|
d0f76b6ab4 | ||
|
4c7206343a | ||
|
dfae2cb3a5 | ||
|
de74d38039 | ||
|
fb20542fcc | ||
|
a26e289d5c | ||
|
892d3b9530 | ||
|
8477dcfeff | ||
|
25835afd9c | ||
|
06dda4e12b | ||
|
26edfe6d18 | ||
|
4a749aee6e | ||
|
99a8417142 | ||
|
20e2075a10 | ||
|
d8c649b57f | ||
|
bb2b8bf2c3 | ||
|
eb048c91be | ||
|
358779dfb2 | ||
|
8f90ddb906 | ||
|
ed54aa8acf | ||
|
a90ffb117f | ||
|
29681717ed | ||
|
e0cd2b756f | ||
|
2c85060b5f | ||
|
864c5b4608 | ||
|
1ab501649e | ||
|
2d874e601c | ||
|
c9b83dfa1d | ||
|
dd7a38069f | ||
|
51a181af7a | ||
|
8fcd9bc0c4 | ||
|
e2edf693f5 | ||
|
323300e92a | ||
|
e688be1cff | ||
|
611d5cf844 | ||
|
677e78bdce | ||
|
51cb1aeb4e | ||
|
625eb508e8 | ||
|
2718e1715d | ||
|
6ddcad6b33 | ||
|
0c23997f70 | ||
|
4d1ef63009 | ||
|
30e14f73fa | ||
|
39e205aa78 | ||
|
f0ec1660c1 | ||
|
79f98f3a13 | ||
|
5f0557027d | ||
|
a579e3bc6d | ||
|
8f70f4b85e | ||
|
911198cddd | ||
|
ca5247a995 | ||
|
004a881521 | ||
|
65993ed0e0 | ||
|
a4d0a5bda5 | ||
|
33bc276639 | ||
|
06822581f7 | ||
|
976143fbe9 | ||
|
9fd4feef0c | ||
|
5eed13bd07 | ||
|
d02d45dd8d | ||
|
13d0e311b7 | ||
|
52254f755f | ||
|
494154beb6 | ||
|
adde188eca | ||
|
8fb0ab2b43 | ||
|
b8b5835fc6 | ||
|
463307655c | ||
|
d17d8e04a6 | ||
|
d8d1dfd8f3 | ||
|
f581280811 | ||
|
3a9aea44df | ||
|
e05764806a | ||
|
5ca65f04fe | ||
|
32ba1e389c | ||
|
beb9e0c906 | ||
|
98f02f6221 | ||
|
13848969f4 | ||
|
0817dfe67f | ||
|
9e3f537a15 | ||
|
612e0e29f9 | ||
|
e1cbc96b8c | ||
|
410240fe7b | ||
|
73cf3a92f9 | ||
|
dd15122ccb | ||
|
5299f1384f | ||
|
58a0e4ffaa | ||
|
7ab9056c11 | ||
|
2d9fbb16bc | ||
|
cbfd8542c6 | ||
|
7679504134 | ||
|
446d461ad2 | ||
|
5b6fcfe8c9 | ||
|
59ce7ab222 | ||
|
0992837b08 | ||
|
aca02916ad | ||
|
98e883f9b4 | ||
|
2c66aa0c15 | ||
|
8843c0d504 | ||
|
8858f1c9ec | ||
|
a1c5c20e2c | ||
|
1da674423d | ||
|
10250a0a6a | ||
|
c0a2f9fbc3 | ||
|
bd974b08b3 | ||
|
d289c0d4f1 | ||
|
f4722289f7 | ||
|
389af3591c | ||
|
008d9e5327 | ||
|
09723d79c6 | ||
|
4586af5876 | ||
|
193d9cd31a | ||
|
f29303dea7 | ||
|
4e47d0d71e | ||
|
dd8c6e9f51 | ||
|
65676150c4 | ||
|
b0e26873f6 | ||
|
f4a67ebcbb | ||
|
000c876953 | ||
|
b8ffceaebb | ||
|
148b8e5cd8 | ||
|
583ad47b03 | ||
|
b95d8ebdd3 | ||
|
677a601d11 | ||
|
194db51fba | ||
|
d55fa0dfef | ||
|
612b5416af | ||
|
54637ae3b3 | ||
|
014adb841e | ||
|
a5c6a40b3c | ||
|
402a51b876 | ||
|
d1e091279c | ||
|
7325121c63 | ||
|
31abe56b7a | ||
|
ca3fd16039 | ||
|
4417509515 | ||
|
9dc2e554e5 | ||
|
bfb01f5a4b | ||
|
570e80a9ff | ||
|
6d90d25a74 | ||
|
a7f6e65291 | ||
|
59641b3c7b | ||
|
2f842b087c | ||
|
699f6a7993 | ||
|
f04ba3bc60 | ||
|
09aac114d4 | ||
|
9132600e1f | ||
|
5dcd6c7e12 | ||
|
9f8d34ab01 | ||
|
7a4580fa89 | ||
|
45a7617cc8 | ||
|
57d8cc08a3 | ||
|
1ca067a478 | ||
|
7a13e4f9b9 | ||
|
d101e17608 | ||
|
203a4fc45e | ||
|
a9823e05bb | ||
|
6f5833df28 | ||
|
5631ab6711 | ||
|
62fedf4eed | ||
|
c274d073e0 | ||
|
8dda753505 | ||
|
4e66df79c4 | ||
|
71c7e61162 | ||
|
e39ecbf16d | ||
|
0dbd2bd09e | ||
|
1297cc188d | ||
|
e584d17aad | ||
|
4936965fb6 | ||
|
e9cc53796e | ||
|
c93efe85dd | ||
|
44daa847ff | ||
|
d23e13aced | ||
|
40102a2b61 | ||
|
49fbbfb6cc | ||
|
fefd856d67 | ||
|
39dab6d7bd | ||
|
7b5b78b065 | ||
|
005b5042f6 | ||
|
b5149a483f | ||
|
15c43e5284 | ||
|
fc4c0f769c | ||
|
e8ecbb2009 | ||
|
964affb1cc | ||
|
05b51af2d5 | ||
|
28e51c763b | ||
|
ebf8e18319 | ||
|
d8bbe1c296 | ||
|
c1417d3d4a | ||
|
3b4359d76d | ||
|
16806294e3 | ||
|
822425072b | ||
|
7cc1283a26 | ||
|
f4198706d1 | ||
|
37a5ad3a53 | ||
|
8478ba66fe | ||
|
00e4dab1ef | ||
|
1d58de6ffb | ||
|
473881357c | ||
|
f5cec5c0f2 | ||
|
368f2af634 | ||
|
66a9fee071 | ||
|
6e0ac83d99 | ||
|
12ad6b3157 | ||
|
fda9fd5ced | ||
|
029ce83a69 | ||
|
5ced6be416 | ||
|
bbda833b01 | ||
|
c86bc00330 | ||
|
8367411785 | ||
|
17e37dc42a | ||
|
68755c0fd2 | ||
|
9090c28125 | ||
|
3a3244891e | ||
|
b55117334c | ||
|
02e5c7b9ad | ||
|
7268167f4c | ||
|
93c7502cf7 | ||
|
789705cfe4 | ||
|
741471a1f8 | ||
|
f8da751cc2 | ||
|
8174842d9f | ||
|
e872952f36 | ||
|
b010e46d13 | ||
|
eb646a8e8b | ||
|
1e2975147d | ||
|
653c10e8b6 | ||
|
dfbafdf047 | ||
|
d8c821a851 | ||
|
83376648d7 | ||
|
089c34fa03 | ||
|
c846f8d745 | ||
|
79ebd76ac8 | ||
|
6eb9836eb0 | ||
|
4a8f8a6eea | ||
|
3ea723730b | ||
|
90be2baf8b | ||
|
0b64fa88a1 | ||
|
c6cc446e63 | ||
|
0cad37760e | ||
|
e720008dca | ||
|
9c636a6136 | ||
|
1e24aa425e | ||
|
a8c597005a | ||
|
97a781b380 | ||
|
313cadefe6 | ||
|
9f078bd5c9 | ||
|
8ff4e27103 | ||
|
8389ca633d | ||
|
18fbec0fe1 | ||
|
eb0a00067d | ||
|
91216408e5 | ||
|
6da5b8cb25 | ||
|
7bee7bf5fc | ||
|
fac66ade01 | ||
|
96eae5f62e | ||
|
1cc99847f4 | ||
|
d8b14cd3e3 | ||
|
0c80eb5afb | ||
|
fdcb1d92c5 | ||
|
d65dc6c730 | ||
|
c721c4d6ef | ||
|
1a7ba3c512 | ||
|
25ee1a7784 | ||
|
0b2cebe3d8 | ||
|
5dd0d39a6b | ||
|
9f3ff427c1 | ||
|
14e60d21ac | ||
|
65c3796135 | ||
|
25acc26531 | ||
|
859bf8b15d | ||
|
e0bf96f329 | ||
|
11c5ea1fec | ||
|
bc063350ef | ||
|
347b0317e5 | ||
|
72d832a4f3 | ||
|
76df3ade18 | ||
|
d849a53b98 | ||
|
ef6d3af6b9 | ||
|
f513914306 | ||
|
7135f80094 | ||
|
ef82e0ce4e | ||
|
1910834f8f | ||
|
f94a0624fa | ||
|
4c46f5a8f7 | ||
|
17c59d6da6 | ||
|
56c0aa596e | ||
|
a1c73a9b2e | ||
|
cac0cb7f02 | ||
|
7eb999720a | ||
|
05e15241b4 | ||
|
a730867778 | ||
|
8513621709 | ||
|
14d99bacbc | ||
|
cbbd3e8fc3 | ||
|
8fa45d5fef | ||
|
3e1706679c | ||
|
7f359e31c6 | ||
|
e4af2c4d80 | ||
|
2d121c07c9 | ||
|
cc904698a6 | ||
|
a5fdd1228f | ||
|
271d7632cb | ||
|
a8613377a5 | ||
|
d7cf5c2b1b | ||
|
95865cb1bf | ||
|
0b813de72a | ||
|
9c159cf129 | ||
|
957d494090 | ||
|
968b4237a9 | ||
|
f67c57b1f8 | ||
|
84f8c2d91d | ||
|
8f1d8d7cb5 | ||
|
e98d9d62eb | ||
|
5a0b65c611 | ||
|
5777587e7a | ||
|
ecfc661054 | ||
|
e00722dee6 | ||
|
5af21e70ec | ||
|
7e13cfea91 | ||
|
68b4d9c35e | ||
|
1f3b69e7db | ||
|
ca63552cf8 | ||
|
a6d2d983b8 | ||
|
7cd97192e5 | ||
|
8ac8bca52a | ||
|
cf8f6d254e | ||
|
a267dfac5d | ||
|
745b28ef38 | ||
|
5c27899efa | ||
|
fd006592b5 | ||
|
201f27fe19 | ||
|
36c4dc8aea | ||
|
f0bd0c3e50 | ||
|
4d71ff6da1 | ||
|
6d16776e27 | ||
|
7cdff6bbb3 | ||
|
bf43859bdc | ||
|
4b45f8415f | ||
|
86e0d5c13e | ||
|
d21ee115d0 | ||
|
2dd8e3b0eb | ||
|
6d001f79f9 | ||
|
eb6ca8f39a | ||
|
abebd92b19 | ||
|
014ca76334 | ||
|
a520f9fcf7 | ||
|
de724b2a57 | ||
|
061637f4eb | ||
|
dab1897d4e | ||
|
9ebb030c78 | ||
|
93477ec019 | ||
|
f2a71898b1 | ||
|
24048dce43 | ||
|
41af8ee2e2 | ||
|
60c20fa6ed | ||
|
5152c13081 | ||
|
e9089f65e3 | ||
|
9aaec91f95 | ||
|
1c971c595f | ||
|
f8627755b5 | ||
|
55ae8dc39e | ||
|
dd7d145249 | ||
|
0b2c249de3 | ||
|
ea6b95f60d | ||
|
ed44f37de4 | ||
|
3780a5ed6a | ||
|
fec3f0191a | ||
|
359fa99945 | ||
|
5441ed2227 | ||
|
ec1a1d0e34 | ||
|
8f4fb45715 | ||
|
9db2288064 | ||
|
1502c21e97 | ||
|
408dd4b34d | ||
|
609e1f54ef | ||
|
f49d0fbbf6 | ||
|
dde47b7966 | ||
|
f84da62740 | ||
|
cbfbe6dc23 | ||
|
2c63a34791 | ||
|
9ab07553a3 | ||
|
c29fb838e9 | ||
|
aecc76d916 | ||
|
713a5188cf | ||
|
911f3bf555 | ||
|
c752598a3d | ||
|
9dfdb1b65b | ||
|
a05a021fd1 | ||
|
9ffd7840ba | ||
|
dd64084b44 | ||
|
21277a37d6 | ||
|
ddc7e36543 | ||
|
f429dff03e | ||
|
6f07c6a3f1 | ||
|
4cb4aa1029 | ||
|
cecab7801e | ||
|
ea7fd1ff5a | ||
|
ad474a60c0 | ||
|
1e8e7e0c00 | ||
|
1e9e8d24c3 | ||
|
9bd9b6f2ca | ||
|
913a6ddcc9 | ||
|
31da6f60d0 | ||
|
c4c118e425 | ||
|
02599acf4d | ||
|
6a653e4675 | ||
|
29e92d6a0e | ||
|
b4fcc8b5f0 | ||
|
b00333c603 | ||
|
63614727a3 | ||
|
061a56d213 | ||
|
3f63ba36ce | ||
|
d9b96c34be | ||
|
39a8c64624 | ||
|
360b77cc50 | ||
|
1186eff1b7 | ||
|
0b8582ccba | ||
|
dc2914e1f9 | ||
|
a0d8678a9c | ||
|
c8a43da526 | ||
|
90ee05ae64 | ||
|
67a7602080 | ||
|
37db270d19 | ||
|
f3312f677b | ||
|
05547d98d6 | ||
|
11b219bc61 | ||
|
5721c3cb8f | ||
|
f90ca697af | ||
|
7a0e27b6e8 | ||
|
e81aa18c82 | ||
|
827bbc0cc1 | ||
|
7095a67910 | ||
|
dcbca3f0d7 | ||
|
702d7c238a | ||
|
5a3ed65ad8 | ||
|
2e24a9ece4 | ||
|
2a17320314 | ||
|
0dbff14555 | ||
|
c5d89d00f1 | ||
|
6f3be310f4 | ||
|
0ea6b70d55 | ||
|
2ca9982b91 | ||
|
a40282b2fb | ||
|
ad9fb1e101 | ||
|
02a9652af4 | ||
|
6f823d2d0d | ||
|
a5c9cd5657 | ||
|
21ab5b6fa3 | ||
|
2582fd45e4 | ||
|
0a28a5d53a | ||
|
ddd4855bbc | ||
|
204216e3d5 | ||
|
1e6a124665 | ||
|
78c5aff956 | ||
|
8d1844135b | ||
|
b5dd9dae0d | ||
|
ebcb518e4f | ||
|
b7ea22f168 | ||
|
f0b3381660 | ||
|
0796c72049 | ||
|
822e988efe | ||
|
cee043f977 | ||
|
b420540b15 | ||
|
031c0ec3e5 | ||
|
43b6822eb0 | ||
|
ba3a657c48 | ||
|
5f2f116c28 | ||
|
1db75e521d | ||
|
2297a353b8 | ||
|
80903e5f44 | ||
|
7342ce5bca | ||
|
167b38dfa1 | ||
|
ead88c36ec | ||
|
b8a3d7fa00 | ||
|
0fce24674a | ||
|
739084e9bc | ||
|
99ad585252 | ||
|
949b6692ac | ||
|
eb0479d8ed | ||
|
6defdb4e8a | ||
|
9fdad6d4ee | ||
|
b6e285844f | ||
|
c989a06718 | ||
|
1c8bd8658d | ||
|
ab50cba4e9 | ||
|
57918813e2 | ||
|
a4df8d8818 | ||
|
4b00cfc1ce | ||
|
889688c978 | ||
|
0bf1ae033d | ||
|
994afcaeed | ||
|
b69cc832ef | ||
|
ca188b41ae | ||
|
81c8d1dd28 | ||
|
32d00ca9ed | ||
|
01b9997590 | ||
|
677e19042d | ||
|
bd79f61cc5 | ||
|
361cdecfe4 | ||
|
581ad5fc04 | ||
|
ff40dcffec | ||
|
eb2fa4195a | ||
|
e2d2b57f0e | ||
|
6c1a128ea3 | ||
|
cfaa31eeb8 | ||
|
2097b15f9c | ||
|
46a8f57735 | ||
|
2e5639a077 | ||
|
007cfeac94 | ||
|
553499522c | ||
|
2782daadb4 | ||
|
81821978ae | ||
|
787b1a661e | ||
|
04e6fc3f74 | ||
|
54d2f0063a | ||
|
ae7ec40cf2 | ||
|
d586a5c67c | ||
|
c97dc6e903 | ||
|
eec90d1026 | ||
|
f4fb4d04e5 | ||
|
3283157352 | ||
|
d07a6b8566 | ||
|
4e8e59cd58 | ||
|
9f811ccee5 | ||
|
6cd6da050b | ||
|
a906dbea35 | ||
|
5bc82f4141 | ||
|
25e6231a88 | ||
|
650e4b1920 | ||
|
5dc0cbc20f | ||
|
e1faf28310 | ||
|
854c695153 | ||
|
ebd4ceca15 | ||
|
d873643407 | ||
|
8a789d0234 | ||
|
286b4cbc72 | ||
|
b4428029af | ||
|
9aeb5be8ad | ||
|
007dd55a71 | ||
|
7a05e40ce7 | ||
|
8d0654db6b | ||
|
63d5615fe7 | ||
|
37d18816be | ||
|
f1de7a524c | ||
|
644692a2e0 | ||
|
da2e8b78c2 | ||
|
0b5a6ecbff | ||
|
9a6aac0459 | ||
|
8aaecc3416 | ||
|
d3f9b3e28a | ||
|
4229a37e90 | ||
|
12297fd88a | ||
|
7943610066 | ||
|
e19246d2db | ||
|
e70117bd9f | ||
|
20c4e24b74 | ||
|
3c5efbc77e | ||
|
f6c2b6bb88 | ||
|
4ab03e79b7 | ||
|
7a12abdea3 | ||
|
36ca1f10dc | ||
|
07a92c1690 | ||
|
0f7b9e686c | ||
|
71584107b0 | ||
|
88c0ace644 | ||
|
d33ed4f9ab | ||
|
a63af177a4 | ||
|
43c8e136b5 | ||
|
efd597c6ed | ||
|
024a753a6a | ||
|
e1dd3fb801 | ||
|
82011569ce | ||
|
747c9c4f94 | ||
|
7d7a090875 | ||
|
0f125aad90 | ||
|
a7d5796750 | ||
|
79e132ab7b | ||
|
85957b5d3e | ||
|
373972b8ca | ||
|
30e6d70b14 | ||
|
c78b34649b | ||
|
b3fe68ca95 | ||
|
417888f847 | ||
|
de8fdd822c | ||
|
ee8e6ac546 | ||
|
486674927a | ||
|
acf9612ed8 | ||
|
8c664b669c | ||
|
b367bf83b4 | ||
|
b84f60877d | ||
|
8a84024a54 | ||
|
56cb614f79 | ||
|
957d8845fd | ||
|
231c0ad77f | ||
|
da635d6392 | ||
|
b8a103b993 | ||
|
162759f34b | ||
|
79fa785dbc | ||
|
2a03e50030 | ||
|
fb0f5b5c14 | ||
|
cd7726bb31 | ||
|
2b4e577b53 | ||
|
1ed695931f | ||
|
51a44ddd1d | ||
|
29cdac18e8 | ||
|
418f6b35af | ||
|
96a6e05f0b | ||
|
d665d2fb89 | ||
|
8862666b5a | ||
|
3adf02445f | ||
|
bfdd325d36 | ||
|
ac76cadf32 | ||
|
5516ff6a02 | ||
|
f2578fcfb9 | ||
|
4da80520b8 | ||
|
b12a27083d | ||
|
07ec266a00 | ||
|
965b3025d9 | ||
|
88e74ca21e | ||
|
148da12cfc | ||
|
3ded6ada0c | ||
|
0c39890e0f | ||
|
e45cba13ed | ||
|
b4977decc1 | ||
|
2da9d5862f | ||
|
b948e03e8a | ||
|
2c90cadef4 | ||
|
08c064d79a | ||
|
73853f1a6b | ||
|
8634d67cff | ||
|
125ea90894 | ||
|
ffba5a3f42 | ||
|
60df21213b | ||
|
14ba577acb | ||
|
7d5ef1117e | ||
|
af0e2bff94 | ||
|
7d65f81d7f | ||
|
b08ecfcf9e | ||
|
e2cd362f24 | ||
|
1a1b6fe66b | ||
|
122176a3a1 | ||
|
5beccc8208 | ||
|
6715a3267a | ||
|
313078b77c | ||
|
246a7cfeab | ||
|
082fdfdb24 | ||
|
823cb714ec | ||
|
cc93347fe6 | ||
|
d6a07cd617 | ||
|
858bd9f84c | ||
|
be7e5c866f | ||
|
93a90bafc3 | ||
|
090e01b383 | ||
|
03a511aab4 | ||
|
5cf9a09c07 | ||
|
9558c70683 | ||
|
57d98a12fa | ||
|
3dd40049a9 | ||
|
225e626ada | ||
|
081f504ae4 | ||
|
45aa8e4e00 | ||
|
87430be658 | ||
|
012c16ccd6 | ||
|
de0cef5d4d | ||
|
e807a84967 | ||
|
b5e105d4f4 | ||
|
a85ab3585e | ||
|
a1d40c5236 | ||
|
95ea6b2615 | ||
|
82d8bc9403 | ||
|
536d432444 | ||
|
3b8c26a116 | ||
|
6ace4b60d8 | ||
|
7601b89561 | ||
|
0cdd2e7008 | ||
|
595152bdba | ||
|
90f0733673 | ||
|
625e83e1de | ||
|
daac04be82 | ||
|
8ec9bba892 | ||
|
b63e365fd2 | ||
|
859a25b0e7 | ||
|
f5d47a4658 | ||
|
fa6645f157 | ||
|
69b6067c5e | ||
|
e645f59748 | ||
|
2929686c1d | ||
|
c83256e080 | ||
|
4b7e1b1233 | ||
|
95a8821614 | ||
|
73500f9ebb | ||
|
eae38756c2 | ||
|
8bf7187b89 | ||
|
e7fb8842b5 | ||
|
aaac0cb4a1 | ||
|
67a4279d3f | ||
|
dd4b8a4c89 | ||
|
4cc5a54da3 | ||
|
07add0144e | ||
|
d1c7376b05 | ||
|
a71388d2d6 | ||
|
62176a3bd0 | ||
|
8475a29836 | ||
|
44bc5a139c | ||
|
11f48f3c5b | ||
|
fa4ad1590d | ||
|
47ddc742fc | ||
|
31d994837b | ||
|
83d692e2d3 | ||
|
2a96dde115 | ||
|
f55b3c68ad | ||
|
f2835bb48b | ||
|
857c22db32 | ||
|
fff1645060 | ||
|
4f0c3c81fb | ||
|
421365cfc3 | ||
|
59c5b41f3d | ||
|
267367355f | ||
|
0aa3356499 | ||
|
14a3b35333 | ||
|
77def95659 | ||
|
4e91cd1155 | ||
|
2d923d362f | ||
|
b7544636d4 | ||
|
6220baf230 | ||
|
917307a6a4 | ||
|
5f49b7b492 | ||
|
b03abea402 | ||
|
d4fcc883cb | ||
|
ca2a2697d6 | ||
|
68c6f63e90 | ||
|
0e89fed8ed | ||
|
4d726543d0 | ||
|
2bcc998e90 | ||
|
f707185248 | ||
|
ded30049db | ||
|
5c55e9d11e | ||
|
c35bb11c18 | ||
|
cc19781d27 | ||
|
08d08678e8 | ||
|
11b632a691 | ||
|
4881ef251e | ||
|
5b39abd1a4 | ||
|
f0089097dd | ||
|
d603925ab2 | ||
|
6af9dc8612 | ||
|
35b313f9b0 | ||
|
fe84ce8686 | ||
|
02a4e5a457 | ||
|
a548a91e6d | ||
|
fc3c2e0942 | ||
|
60e07335a1 | ||
|
cb6b968fb5 | ||
|
3aa3816125 | ||
|
c37c29422a | ||
|
db71c07f8f | ||
|
bf1b97efd3 | ||
|
4d7277f72c | ||
|
3296f01edf | ||
|
dbcbf0523b | ||
|
888abb6f24 | ||
|
9b916b329a | ||
|
eb3ada6386 | ||
|
eebe370e0a | ||
|
2a725b658b | ||
|
97f605f811 | ||
|
4e7d578881 | ||
|
438d936f57 | ||
|
fc4a464b47 | ||
|
785b9541f6 | ||
|
a4cbabb80f | ||
|
1b5dfcba7e | ||
|
ba41edf531 | ||
|
bf3892caed | ||
|
1e6a95aa1b | ||
|
70a9d08e21 | ||
|
7511d4e281 | ||
|
53ea97decb | ||
|
28190ded71 | ||
|
8083cb0e47 | ||
|
d241ec4f3e | ||
|
544320a961 | ||
|
ee5a95ba24 | ||
|
232260b86b | ||
|
857f50649c | ||
|
a39d9d60a7 | ||
|
5f9bc97291 | ||
|
01b3b096fe | ||
|
fef69881a7 | ||
|
be0eaa64ed | ||
|
62087b1ab5 | ||
|
6af55a31d7 | ||
|
8e57818a52 | ||
|
a447c439f4 | ||
|
2120ef38d9 | ||
|
6077ea4f48 | ||
|
c278c78378 | ||
|
b64dc75e3a | ||
|
447c07bf5e | ||
|
2a5f1dc6c7 | ||
|
105be5a457 | ||
|
0b6b6b0984 | ||
|
a0429c8218 | ||
|
56649007d0 | ||
|
42d0590d80 | ||
|
ce4fbcef8e | ||
|
7c8171f069 | ||
|
33fe93d9f2 | ||
|
a8d092f978 | ||
|
645043d5a2 | ||
|
c6693b7fb7 | ||
|
5c4bb1f93b | ||
|
d05628c66a | ||
|
0e2db8090b | ||
|
b4ab398e0d | ||
|
26018107d6 | ||
|
3e066a0a15 | ||
|
23222a97fc | ||
|
d4a5872fb0 | ||
|
24714cb91c | ||
|
b51d8a22ef | ||
|
aa0afab960 | ||
|
111269019f | ||
|
f0d974c6f5 | ||
|
d30adc48d4 | ||
|
40d3b30770 | ||
|
2e7291d0e7 | ||
|
48d1dfd195 | ||
|
caeccfd2da | ||
|
a9082fa5fa | ||
|
eb10af0dac | ||
|
3387dc8ec3 | ||
|
f663617724 | ||
|
b42760da4d | ||
|
ea72e7e5b3 | ||
|
a51003661e | ||
|
a483fb2d96 | ||
|
f13c8a3cb4 | ||
|
51e617daf3 | ||
|
f9f96637d7 | ||
|
1df5857b07 | ||
|
d637398ab0 | ||
|
20ead71c0b | ||
|
abcfa21c12 | ||
|
424c4b4150 | ||
|
5d18ea621d | ||
|
e00e6f3d5d | ||
|
e98ae233fc | ||
|
2ad11e12d4 | ||
|
3f16f7e0d4 | ||
|
166777dd55 | ||
|
c8f385e3bc | ||
|
89b4f12b38 | ||
|
ae509406f1 | ||
|
1aa7f18b23 | ||
|
cf39c80fe2 | ||
|
24fe66a5f3 | ||
|
51b786b799 | ||
|
9685030632 | ||
|
09be7f65d5 | ||
|
2f4d931d0d | ||
|
61df8d941b | ||
|
327c93066d | ||
|
7f946eff01 | ||
|
03a8b9cf17 | ||
|
ba89a22a4d | ||
|
657c018242 | ||
|
83db8e41a6 | ||
|
57e7112781 | ||
|
96f92ee207 | ||
|
d27e7e0180 | ||
|
5c8bd49383 | ||
|
e82bdd8c0d | ||
|
72f52751c2 | ||
|
98269a29b1 | ||
|
8bb968bc01 | ||
|
c61313cbfe | ||
|
96145ae8ed | ||
|
1f848bf9fd | ||
|
7a8a27bd60 | ||
|
3e9c47e6f7 | ||
|
69cf0a75c5 | ||
|
a8d3aa133c | ||
|
e1d4385026 | ||
|
7cc29ce236 | ||
|
f998505e27 | ||
|
64f50b33e4 | ||
|
bc20af2741 | ||
|
25f61dd5d5 | ||
|
0e5f2cd6f6 | ||
|
5aef534871 | ||
|
f0f7613adb | ||
|
72a1bd64e6 | ||
|
bd1b3447c4 | ||
|
6653f2b4c3 | ||
|
b00b0902ca | ||
|
59941930f7 | ||
|
aa888c0b3f | ||
|
c12a09d24e | ||
|
79721d64ad | ||
|
62e68f72d6 | ||
|
0b1bcf8bee | ||
|
477fb8fdfb | ||
|
1bd820fc60 | ||
|
a4247f1358 | ||
|
00b5df6b06 | ||
|
1e75fc35c8 | ||
|
0751f59ee8 | ||
|
b5b797b0aa | ||
|
ddfe9f15af | ||
|
9929726eb2 | ||
|
1aa6e721ae | ||
|
87d2ce1332 | ||
|
6260a33e8e | ||
|
2024913cc2 | ||
|
0978a794ac | ||
|
da51c90d5c | ||
|
b1b8a98568 | ||
|
4a8122f685 | ||
|
7a58439977 | ||
|
27fbdcbecb | ||
|
5bd13ccf15 | ||
|
d30a9e7fa9 | ||
|
6e75e26a0c | ||
|
6562338502 | ||
|
cd5cdad31d | ||
|
5da01ec4af | ||
|
8da96b9353 | ||
|
e042db9348 | ||
|
601011ccc0 | ||
|
5958abae1d | ||
|
a056063395 | ||
|
537669e2b0 | ||
|
216a368f22 | ||
|
fd4da47125 | ||
|
411e0c5fbd | ||
|
e523d3a50e | ||
|
99d6a15049 | ||
|
7fb6c04e99 | ||
|
08fd9e1f2e | ||
|
dd641867a2 | ||
|
2cbe89de7d | ||
|
4d9e7d30b0 | ||
|
65224f4533 | ||
|
cd84f5a56e | ||
|
4311d17cb1 | ||
|
11a0646281 | ||
|
492507af11 | ||
|
67a3929583 | ||
|
413d3819cf | ||
|
0f289fddf7 | ||
|
92038d6b7f | ||
|
6e27579d1f | ||
|
390a104ddd | ||
|
31727a4ec5 | ||
|
add197bcf7 | ||
|
e73c4fe133 | ||
|
2e6b7b5b78 | ||
|
90e933a6aa | ||
|
e7549f3359 | ||
|
fee497f9e1 | ||
|
ef4930723b | ||
|
a8ff291a12 | ||
|
f366ccc0b2 | ||
|
ca69fd2b7a | ||
|
db2029d931 | ||
|
6f2fd001a0 | ||
|
3327a6ba08 | ||
|
4954e6962f | ||
|
93db1cc89e | ||
|
68b337d457 | ||
|
0d5e54986a | ||
|
822641c161 | ||
|
385ab74922 | ||
|
fcf65c7caa | ||
|
ece4e59e99 | ||
|
6eea08ff99 | ||
|
372dcba9c9 | ||
|
af817a3362 | ||
|
0edd7547c1 | ||
|
ce042f7ba1 | ||
|
bb2cd7225e | ||
|
5e1fd56345 | ||
|
c72588748b | ||
|
48e1d48e7f | ||
|
70a12c4efb | ||
|
6f76c37fed | ||
|
cc5cab65a1 | ||
|
f3823eff87 | ||
|
13d6e691c2 | ||
|
0bf16d738e | ||
|
2aba50efa0 | ||
|
63ad234391 | ||
|
21d2372396 | ||
|
c0b185bee9 | ||
|
da4a4f6a25 | ||
|
d7764cc6b3 | ||
|
a6b2bcbf24 | ||
|
7fa159e94a | ||
|
05c9f3442c | ||
|
cef87b102c | ||
|
70c9521cae | ||
|
1abcf3d48a | ||
|
6363f27f95 | ||
|
f35053b837 | ||
|
d669e3ab6a | ||
|
5707551b79 | ||
|
a7c247bccd | ||
|
d86d4c5597 | ||
|
73f1dfc762 | ||
|
a621bd066b | ||
|
143ca0e17d | ||
|
58c318a4dc | ||
|
210cb3eecd | ||
|
6e6fa3daed | ||
|
2d6ebbb4d5 | ||
|
efa4cae949 | ||
|
5e72914c48 | ||
|
f3aab662c3 | ||
|
c598fa9147 | ||
|
b2296a1918 | ||
|
594595d9cd | ||
|
9ac36aeb42 | ||
|
a61fe61318 | ||
|
99085605a8 | ||
|
9da1055575 | ||
|
b049990356 | ||
|
8207c548cc | ||
|
83960622e3 | ||
|
7cf7870254 | ||
|
7763e883d6 | ||
|
8bacfad171 | ||
|
53e7277584 | ||
|
e43b7902be | ||
|
f1d81bb7df | ||
|
84cf6de36d | ||
|
aaa219497b | ||
|
8515224921 | ||
|
f53da409e5 | ||
|
b45a2025d9 | ||
|
0946b0b333 | ||
|
1d9ad55c54 | ||
|
94a64329c2 | ||
|
ba502a5009 | ||
|
e1d2477485 | ||
|
2fef53b154 | ||
|
742ef96748 | ||
|
8d928ad340 | ||
|
32e123fa67 | ||
|
df0dd296e9 | ||
|
34e13556b4 | ||
|
bdbb1398db | ||
|
9fbd582951 | ||
|
b00ca0d699 | ||
|
8c4245da2f | ||
|
7e7aa17484 | ||
|
4e6a04152b | ||
|
fb56929791 | ||
|
c9022ac2d5 | ||
|
0b6392c0a8 | ||
|
526c0404c2 | ||
|
cdacfc5a21 | ||
|
ab809d1dc3 | ||
|
6dd9048c6d | ||
|
3523d56122 | ||
|
5c601b673e | ||
|
465a34e6b0 | ||
|
aa82a400df | ||
|
4d673e9c9a | ||
|
1f3db35271 | ||
|
18cce46ed2 | ||
|
e78148bae5 | ||
|
41237509ad | ||
|
576e8a2090 | ||
|
d0f77c1db4 | ||
|
e28ff79bec | ||
|
dccf6b55bd | ||
|
d5ea376e7b | ||
|
40707a6af0 | ||
|
9b71c9dfc6 | ||
|
64308317f8 | ||
|
f920723eae | ||
|
c581f4c96f | ||
|
4998c90b10 | ||
|
412b23a146 | ||
|
c179013790 | ||
|
c6eb7fd483 | ||
|
7c58370673 | ||
|
84737a5159 | ||
|
48804c81f3 | ||
|
c79ec355af | ||
|
ce5d74d7df | ||
|
5bcc943ec3 | ||
|
f5d68bb586 | ||
|
6d1537647c | ||
|
ae2c10996a | ||
|
81e9de3778 | ||
|
42a704fefb | ||
|
e57eaf16b4 | ||
|
9aabb0e98d | ||
|
9590a5f45e | ||
|
32a3690a3c | ||
|
43af0ee514 | ||
|
3912d6aba9 | ||
|
871685e271 | ||
|
5e9daa9728 | ||
|
412bc1713a | ||
|
5240d8cdf5 | ||
|
afbcbb8404 | ||
|
90183b3588 | ||
|
5c00dc7ef4 |
@@ -26,12 +26,20 @@ variables:
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled -Dbuild-testsuite=true -Dintrospection=enabled"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v46"
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v49"
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
# run merge request pipelines
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
# do not run branch pipelines if corresponding merge requests exist...
|
||||
# (this avoids duplicate pipelines)
|
||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
||||
when: never
|
||||
# ...but otherwise run branch pipelines
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
# run tag pipelines
|
||||
- if: $CI_COMMIT_TAG
|
||||
|
||||
default:
|
||||
retry:
|
||||
@@ -58,7 +66,8 @@ style-check-diff:
|
||||
junit:
|
||||
- "${CI_PROJECT_DIR}/_build/report-x11.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_gles.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_gl.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_gles2.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-broadway.xml"
|
||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
@@ -95,8 +104,9 @@ fedora-x86_64:
|
||||
${FEATURE_FLAGS}
|
||||
_build
|
||||
- meson compile -C _build
|
||||
- .gitlab-ci/run-tests.sh _build wayland
|
||||
- .gitlab-ci/run-tests.sh _build wayland_gles
|
||||
- .gitlab-ci/run-tests.sh _build x11 gtk
|
||||
# only repeat test runs that are likely affected by test setups
|
||||
- .gitlab-ci/run-tests.sh _build wayland_gl gtk:gdk,gtk:gsk-gl
|
||||
|
||||
release-build:
|
||||
extends: .build-fedora-default
|
||||
@@ -121,7 +131,9 @@ release-build:
|
||||
- meson install -C _build
|
||||
- PKG_CONFIG_PATH=${CI_PROJECT_DIR}/_install/lib64/pkgconfig:${CI_PROJECT_DIR}/_install/share/pkgconfig meson setup _build_hello examples/hello
|
||||
- LD_LIBRARY_PATH=${CI_PROJECT_DIR}/_install/lib64 meson compile -C _build_hello
|
||||
- .gitlab-ci/run-tests.sh _build x11
|
||||
- .gitlab-ci/run-tests.sh _build wayland gtk
|
||||
# only repeat test runs that are likely affected by test setups
|
||||
- .gitlab-ci/run-tests.sh _build wayland_gles2 gtk:gdk,gtk:gsk-gl
|
||||
|
||||
fedora-clang:
|
||||
extends: .build-fedora-default
|
||||
@@ -197,28 +209,44 @@ msys2-mingw64:
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
||||
|
||||
macos:
|
||||
# Sadly, this fails regularly, and its failure is never enlightening
|
||||
allow_failure: true
|
||||
macos-x86_64:
|
||||
rules:
|
||||
# Do not run in forks as the runner is not available there.
|
||||
- if: $CI_PROJECT_NAMESPACE == "GNOME"
|
||||
stage: build
|
||||
tags:
|
||||
- macos
|
||||
- macosintel
|
||||
needs: []
|
||||
variables:
|
||||
MESON_FORCE_BACKTRACKE: 1
|
||||
TMPDIR: /Users/Shared/work/tmp
|
||||
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
|
||||
PIP_CACHE_DIR: /Users/Shared/build/cache
|
||||
PIPENV_CACHE_DIR: $PIP_CACHE_DIR
|
||||
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
|
||||
EXTRA_MESON_FLAGS: "-Dgobject-introspection:werror=false"
|
||||
before_script:
|
||||
# Not using ccache on purpose as it accelerates the build so much that it
|
||||
# can trigger race conditions in the gobject-introspection subproject.
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- pip3 install --user meson~=1.0
|
||||
- pip3 install --user ninja
|
||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||
- export MESON_FORCE_BACKTRACE=1
|
||||
- /opt/macports/bin/python3.10 -m venv .venv
|
||||
- ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin
|
||||
- ln -s /opt/pkg-config/bin/pkg-config .venv/bin
|
||||
- ln -s /opt/bison/bin/bison .venv/bin
|
||||
- source .venv/bin/activate
|
||||
- pip3 install meson==1.2.0
|
||||
- pip3 install ninja==1.11.1
|
||||
- pip3 install /Users/Shared/build/pkgs/PyGObject-3.44.0-cp310-cp310-macosx_10_13_x86_64.whl
|
||||
/Users/Shared/build/pkgs/pycairo-1.23.0-cp310-cp310-macosx_10_13_x86_64.whl
|
||||
script:
|
||||
- meson setup ${COMMON_MESON_FLAGS}
|
||||
- meson setup
|
||||
${COMMON_MESON_FLAGS}
|
||||
${EXTRA_MESON_FLAGS}
|
||||
-Dx11-backend=false
|
||||
-Dbroadway-backend=true
|
||||
-Dmacos-backend=true
|
||||
-Dmedia-gstreamer=disabled
|
||||
-Dintrospection=disabled
|
||||
-Dintrospection=enabled
|
||||
-Dcpp_std=c++11
|
||||
-Dpixman:tests=disabled
|
||||
-Dlibjpeg-turbo:simd=disabled
|
||||
@@ -399,11 +427,12 @@ asan-build:
|
||||
-Df16c=disabled
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build wayland
|
||||
- .gitlab-ci/run-tests.sh _build wayland_gles
|
||||
- .gitlab-ci/run-tests.sh _build x11
|
||||
- .gitlab-ci/run-tests.sh _build wayland gtk
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit:
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland.xml"
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
|
||||
@@ -418,10 +447,11 @@ reference:
|
||||
--buildtype=release
|
||||
--force-fallback-for=gdk-pixbuf,pango
|
||||
-Dintrospection=enabled
|
||||
-Ddocumentation=true
|
||||
-Dgtk_doc=true
|
||||
-Dgdk-pixbuf:gtk_doc=true
|
||||
-Dpango:gtk_doc=true
|
||||
-Ddemos=false
|
||||
-Dbuild-demos=false
|
||||
-Dbuild-examples=false
|
||||
-Dbuild-tests=false
|
||||
-Dbuild-testsuite=false
|
||||
|
BIN
.gitlab-ci/.fedora.Dockerfile.swp
Normal file
@@ -1,4 +1,4 @@
|
||||
FROM fedora:38
|
||||
FROM fedora:39
|
||||
|
||||
RUN dnf -y install \
|
||||
adwaita-icon-theme \
|
||||
@@ -32,6 +32,7 @@ RUN dnf -y install \
|
||||
glib2-static \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
glslc \
|
||||
gnupg2 \
|
||||
gobject-introspection-devel \
|
||||
graphene-devel \
|
||||
|
@@ -19,6 +19,7 @@ flatpak build ${builddir} meson \
|
||||
--buildtype=debugoptimized \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dvulkan=disabled \
|
||||
-Dbuild-tests=false \
|
||||
-Dbuild-testsuite=false \
|
||||
-Dbuild-examples=false \
|
||||
@@ -27,7 +28,7 @@ flatpak build ${builddir} meson \
|
||||
-Ddemo-profile=devel \
|
||||
_flatpak_build
|
||||
|
||||
flatpak build ${builddir} ninja -C _flatpak_build install
|
||||
flatpak build --env=CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA ${builddir} ninja -C _flatpak_build install
|
||||
|
||||
flatpak-builder \
|
||||
--user --disable-rofiles-fuse \
|
||||
|
@@ -324,7 +324,7 @@ for line in args.infile:
|
||||
units.append(unit)
|
||||
|
||||
report = {}
|
||||
report['date'] = datetime.datetime.utcnow()
|
||||
report['date'] = datetime.datetime.now(datetime.UTC)
|
||||
report['locale_date'] = report['date'].strftime("%c")
|
||||
report['project_name'] = args.project_name
|
||||
report['backend'] = args.backend
|
||||
|
@@ -44,7 +44,7 @@ outfile = args.output
|
||||
testsuites = ET.Element('testsuites')
|
||||
testsuites.set('id', '{}/{}'.format(args.job_id, args.branch))
|
||||
testsuites.set('package', args.project_name)
|
||||
testsuites.set('timestamp', datetime.datetime.utcnow().isoformat(timespec='minutes'))
|
||||
testsuites.set('timestamp', datetime.datetime.now(datetime.UTC).isoformat(timespec='minutes'))
|
||||
|
||||
suites = {}
|
||||
for line in args.infile:
|
||||
|
32
.gitlab-ci/run-single-test.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/sh
|
||||
#
|
||||
builddir=$1
|
||||
suite=$2
|
||||
unit=$3
|
||||
|
||||
echo "** builddir: ${builddir}"
|
||||
echo "** suite: ${suite}"
|
||||
echo "** unit: ${unit}"
|
||||
|
||||
export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
|
||||
|
||||
weston --backend=headless-backend.so --socket=wayland-5 --idle-time=0 &
|
||||
compositor=$!
|
||||
|
||||
export WAYLAND_DISPLAY=wayland-5
|
||||
|
||||
meson test -C ${builddir} \
|
||||
--print-errorlogs \
|
||||
--setup=wayland \
|
||||
--suite=${suite} \
|
||||
--no-suite=failing \
|
||||
--no-suite=flaky \
|
||||
--no-suite=wayland_failing \
|
||||
--no-suite=gsk-compare-broadway \
|
||||
--verbose \
|
||||
"${unit}"
|
||||
|
||||
exit_code=$?
|
||||
kill ${compositor}
|
||||
|
||||
exit ${exit_code}
|
@@ -1,28 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +x
|
||||
set -x
|
||||
set +e
|
||||
|
||||
srcdir=$( pwd )
|
||||
builddir=$1
|
||||
backend=$2
|
||||
setup=$2
|
||||
suite=$3
|
||||
multiplier=${MESON_TEST_TIMEOUT_MULTIPLIER:-1}
|
||||
|
||||
# Ignore memory leaks lower in dependencies
|
||||
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0:detect_leaks=0:allocator_may_return_null=1
|
||||
export G_SLICE=always-malloc
|
||||
|
||||
case "${backend}" in
|
||||
x11)
|
||||
case "${setup}" in
|
||||
x11*)
|
||||
xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \
|
||||
meson test -C ${builddir} \
|
||||
--quiet \
|
||||
--timeout-multiplier "${multiplier}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--setup=${setup} \
|
||||
--suite=${suite//,/ --suite=} \
|
||||
--no-suite=failing \
|
||||
--no-suite=${setup}_failing \
|
||||
--no-suite=flaky \
|
||||
--no-suite=headless \
|
||||
--no-suite=gsk-compare-broadway
|
||||
|
||||
# Store the exit code for the CI run, but always
|
||||
@@ -41,18 +44,19 @@ case "${backend}" in
|
||||
--quiet \
|
||||
--timeout-multiplier "${multiplier}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--setup=${setup} \
|
||||
--suite=${suite//,/ --suite=} \
|
||||
--no-suite=failing \
|
||||
--no-suite=${setup}_failing \
|
||||
--no-suite=flaky \
|
||||
--no-suite=${backend}_failing \
|
||||
--no-suite=headless \
|
||||
--no-suite=gsk-compare-broadway
|
||||
exit_code=$?
|
||||
|
||||
kill ${compositor}
|
||||
;;
|
||||
|
||||
broadway)
|
||||
broadway*)
|
||||
export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
|
||||
|
||||
${builddir}/gdk/broadway/gtk4-broadwayd :5 &
|
||||
@@ -63,17 +67,19 @@ case "${backend}" in
|
||||
--quiet \
|
||||
--timeout-multiplier "${multiplier}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--setup=${setup} \
|
||||
--suite=${suite//,/ --suite=} \
|
||||
--no-suite=failing \
|
||||
--no-suite=${setup}_failing \
|
||||
--no-suite=flaky \
|
||||
--no-suite=headless \
|
||||
--no-suite=gsk-compare-opengl
|
||||
|
||||
kill ${server}
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Failed to add ${backend} to .gitlab-ci/run-tests.sh"
|
||||
echo "Failed to add ${setup} to .gitlab-ci/run-tests.sh"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
@@ -83,17 +89,17 @@ cd ${builddir}
|
||||
|
||||
$srcdir/.gitlab-ci/meson-junit-report.py \
|
||||
--project-name=gtk \
|
||||
--backend="${backend}" \
|
||||
--backend="${setup}" \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--output="report-${backend}.xml" \
|
||||
"meson-logs/testlog-${backend}.json"
|
||||
--output="report-${setup}.xml" \
|
||||
"meson-logs/testlog-${setup}.json"
|
||||
|
||||
$srcdir/.gitlab-ci/meson-html-report.py \
|
||||
--project-name=gtk \
|
||||
--backend="${backend}" \
|
||||
--backend="${setup}" \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--reftest-output-dir="testsuite/reftests/output/${backend}" \
|
||||
--output="report-${backend}.html" \
|
||||
"meson-logs/testlog-${backend}.json"
|
||||
--reftest-output-dir="testsuite/reftests/output/${setup}" \
|
||||
--output="report-${setup}.html" \
|
||||
"meson-logs/testlog-${setup}.json"
|
||||
|
||||
exit $exit_code
|
||||
|
@@ -6,7 +6,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
|
||||
|
||||
:: FIXME: make warnings fatal
|
||||
pip3 install --upgrade --user meson~=0.64 || goto :error
|
||||
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
|
||||
meson setup -Dbackend_max_links=1 -Ddebug=false -Dmedia-gstreamer=disabled -Dvulkan=disabled _build || goto :error
|
||||
ninja -C _build || goto :error
|
||||
|
||||
goto :EOF
|
||||
|
@@ -32,7 +32,9 @@ pacman --noconfirm -S --needed \
|
||||
mingw-w64-$MSYS2_ARCH-fribidi \
|
||||
mingw-w64-$MSYS2_ARCH-gst-plugins-bad-libs \
|
||||
mingw-w64-$MSYS2_ARCH-shared-mime-info \
|
||||
mingw-w64-$MSYS2_ARCH-python-gobject
|
||||
mingw-w64-$MSYS2_ARCH-python-gobject \
|
||||
mingw-w64-$MSYS2_ARCH-shaderc \
|
||||
mingw-w64-$MSYS2_ARCH-vulkan
|
||||
|
||||
mkdir -p _ccache
|
||||
export CCACHE_BASEDIR="$(pwd)"
|
||||
@@ -46,7 +48,6 @@ meson \
|
||||
-Dx11-backend=false \
|
||||
-Dwayland-backend=false \
|
||||
-Dwin32-backend=true \
|
||||
-Dvulkan=disabled \
|
||||
-Dintrospection=enabled \
|
||||
-Dgtk:werror=true \
|
||||
_build
|
||||
|
45
AUTHORS
@@ -7,7 +7,7 @@ Peter Mattis <petm@xcf.berkeley.edu>
|
||||
Spencer Kimball <spencer@xcf.berkeley.edu>
|
||||
Josh MacDonald <jmacd@xcf.berkeley.edu>
|
||||
|
||||
The Team that build GTK 2 (in alphabetical order)
|
||||
The team that build GTK 2 (in alphabetical order)
|
||||
-------------------------------------------------
|
||||
Shawn T. Amundson <amundson@gtk.org>
|
||||
Jerome Bolliet <bolliet@gtk.org>
|
||||
@@ -28,9 +28,8 @@ Jay Painter <jpaint@gtk.org>
|
||||
Manish Singh <manish@gtk.org>
|
||||
Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
The current team (GTK 3 and 4)
|
||||
------------------------------
|
||||
|
||||
The team that built GTK 3
|
||||
-------------------------
|
||||
Jonas Ådahl <jadahl@gmail.com>
|
||||
Tim Bäder <mail@baedert.org>
|
||||
Emmanuele Bassi <ebassi@gnome.org>
|
||||
@@ -40,6 +39,16 @@ Carlos Garnacho <mrgarnacho@gmail.com>
|
||||
Alexander Larsson <alexl@redhat.com>
|
||||
Benjamin Otte <otte@gnome.org>
|
||||
|
||||
The current team (GTK 4)
|
||||
------------------------
|
||||
Jonas Ådahl <jadahl@gmail.com>
|
||||
Emmanuele Bassi <ebassi@gnome.org>
|
||||
Christian Hergert <chergert@gnome.org>
|
||||
Chun-wei Fan <fanchunwei@src.gnome.org>
|
||||
Matthias Clasen <mclasen@redhat.com>
|
||||
Carlos Garnacho <mrgarnacho@gmail.com>
|
||||
Benjamin Otte <otte@gnome.org>
|
||||
|
||||
|
||||
There are many others who have contributed patches; we thank them,
|
||||
GTK is much better because of them.
|
||||
@@ -49,35 +58,15 @@ Over time, GTK has incorporated some pieces of software which
|
||||
started as independent projects. We list the original authors here:
|
||||
|
||||
|
||||
MS-Windows theme engine
|
||||
-----------------------
|
||||
Raymond Penners
|
||||
Dom Lachowicz
|
||||
|
||||
|
||||
Pixbuf theme engine
|
||||
-------------------
|
||||
Owen Taylor
|
||||
|
||||
|
||||
IME input method
|
||||
----------------
|
||||
Takuro Ashie
|
||||
Kazuki IWAMOTO
|
||||
|
||||
|
||||
Mac OS X backend
|
||||
----------------
|
||||
MacOS backend
|
||||
-------------
|
||||
Anders Carlsson
|
||||
|
||||
|
||||
DirectFB backend
|
||||
----------------
|
||||
Denis Oliver Kropp
|
||||
Sven Neumann
|
||||
Mike Emmel
|
||||
|
||||
|
||||
gtkparasite
|
||||
-----------
|
||||
GtkInspector (originally gtkparasite)
|
||||
-------------------------------------
|
||||
Christian Hammond
|
||||
|
@@ -35,8 +35,7 @@ The issue tracker is meant to be used for actionable issues only.
|
||||
|
||||
You should not open a new issue for security related questions.
|
||||
|
||||
When in doubt, send an email to the [security](mailto:security@gnome.org)
|
||||
mailing list.
|
||||
When in doubt, follow [security](https://security.gnome.org/).
|
||||
|
||||
### Bug reports
|
||||
|
||||
@@ -214,7 +213,7 @@ Closes #1234
|
||||
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
|
||||
|
||||
- If your commit is addressing an issue, use the
|
||||
[GitLab syntax](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html)
|
||||
[GitLab syntax](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
to automatically close the issue when merging the commit with the upstream
|
||||
repository:
|
||||
|
||||
@@ -244,13 +243,11 @@ people committing to GTK to follow a few rules:
|
||||
code, you should always ask. If your change is minor and you've been
|
||||
working on GTK for a while it probably isn't necessary to ask. But when
|
||||
in doubt, ask. Even if your change is correct, somebody may know a
|
||||
better way to do things. If you are making changes to GTK, you should
|
||||
be subscribed to the [gtk-devel](https://mail.gnome.org/mailman/listinfo/gtk-devel-list)
|
||||
mailing list; this is a good place to ask about intended changes.
|
||||
The `#gtk` IRC channel on irc.gnome.org is also a good place to find GTK
|
||||
developers to discuss changes, but if you live outside of the EU/US time
|
||||
zones, an email to the gtk-devel mailing list is the most certain and
|
||||
preferred method.
|
||||
better way to do things.
|
||||
The `gtk` [room on matrix](https://matrix.to/#/#gtk:gnome.org) is also a
|
||||
good place to find GTK developers to discuss changes, but if you live
|
||||
outside of the EU/US time zones, the [gtk tag on the GNOME Discourse instance](https://discourse.gnome.org/tag/gtk)
|
||||
is the most certain and preferred method.
|
||||
|
||||
0. Ask _first_.
|
||||
|
||||
|
483
NEWS
@@ -1,4 +1,473 @@
|
||||
Overview of Changes in 4.11.4, xx-xx-xxxx
|
||||
Overview of Changes in 4.13.6, xx-xx-xxxx
|
||||
=========================================
|
||||
|
||||
Overview of Changes in 4.13.5, 07-01-2024
|
||||
=========================================
|
||||
|
||||
This release adds two new GSK renderers called vulkan and ngl,
|
||||
that are built from the same sources. The new renderers can
|
||||
handle many corner cases correctly that the current gl renderer
|
||||
does not handle, and they offer advantages such as antialiasing
|
||||
and supersampled gradients.
|
||||
|
||||
The new renderers are still considered experimental, and GTK
|
||||
will only use them if they are explicitly selected using the
|
||||
GSK_RENDERER environment variable.
|
||||
|
||||
As part of this work, the GSK include files have been rearranged.
|
||||
It is no longer necessary to include renderer-specific headers for
|
||||
ngl and vulkan (and doing so will trigger deprecation warnings),
|
||||
and their constructors are always available.
|
||||
|
||||
The previously available experimental GdkVulkanContext APIs and
|
||||
the old Vulkan renderer have been removed.
|
||||
|
||||
Vulkan is now enabled by default, and Linux distributions should
|
||||
build GTK with Vulkan support. This requires the glslc shader
|
||||
compiler as a new dependency.
|
||||
|
||||
Vulkan is now also used for dmabuf support.
|
||||
|
||||
* GtkDropdown:
|
||||
- Fix display of initial selection
|
||||
|
||||
* GtkShortcutsWindow:
|
||||
- Make the window adapt to smaller screen widths
|
||||
|
||||
* GtkTextView:
|
||||
- Fix a possible NULL dereference in history
|
||||
|
||||
* GDK:
|
||||
- Make the png loader safer against overflows
|
||||
|
||||
* GL:
|
||||
- Fix some errors in handling of texture formats and mipmaps
|
||||
|
||||
|
||||
Overview of Changes in 4.13.4, 30-12-2023
|
||||
=========================================
|
||||
|
||||
* GtkFileDialog:
|
||||
- Return an error if no file is selected
|
||||
|
||||
* GtkFileLauncher:
|
||||
- Add a writable property
|
||||
|
||||
* GtkFileChooserNative:
|
||||
- Make closing portal file dialogs work
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Update Emoji data to CLDR v43
|
||||
|
||||
* GtkStringList:
|
||||
- Add item-type and n-itmes properties
|
||||
|
||||
* Input:
|
||||
- Respect GTK grabs on DND events
|
||||
- Fix crossing event generation for enter/leave
|
||||
|
||||
* Wayland:
|
||||
- Avoid recreating wl_buffers needlessly
|
||||
- Be more careful when loading cursors
|
||||
|
||||
* Dmabuf:
|
||||
- Add support for all Dmabuf formats
|
||||
- Tweak the offload code a bit, allow offloading translucent
|
||||
textures, as long as they are raised. Decline to offload
|
||||
with fractional scales.
|
||||
|
||||
* Accessibility:
|
||||
- Add a few more accessible roles
|
||||
|
||||
* GL:
|
||||
- Use GLES by default
|
||||
- Tweak GDK_DEBUG values. The new values are
|
||||
gl-disable-gl, gl-disable-gles and gl-prefer-gl.
|
||||
The gl-legacy and nograbs values have been dropped.
|
||||
|
||||
* Css:
|
||||
- Reduce memory consumption during theme loading
|
||||
- Fix opacity handling
|
||||
|
||||
* Theme:
|
||||
- Refresh some of the included symbolic icons
|
||||
|
||||
* MacOs:
|
||||
- Silence secure-restore message
|
||||
|
||||
* Build:
|
||||
- Require Vulkan 1.3
|
||||
|
||||
* Translation updates:
|
||||
Chinese (China)
|
||||
Czech
|
||||
Hebrew
|
||||
Icelandic
|
||||
Polish
|
||||
Russian
|
||||
|
||||
|
||||
Overview of Changes in 4.13.3, 15-11-2023
|
||||
=========================================
|
||||
|
||||
* GtkGraphicsOffload: A new widget to support passthrough
|
||||
of dmabuf textures with subsurfaces on Wayland
|
||||
|
||||
* GtkListView:
|
||||
- reduce tree indentation
|
||||
|
||||
* GtkInspector:
|
||||
- Show more GL information
|
||||
- Add a subsurface overlay
|
||||
- Improve the fps overlay
|
||||
|
||||
* GDK
|
||||
- Allow implicit modifiers for dmabufs
|
||||
- Support more dmabuf formats: NV16, NV61, NV24, NV42
|
||||
and 3-plane YUV formats
|
||||
|
||||
* GSK
|
||||
- Fix padding of icons in the GL atlas
|
||||
- Fix handling of texture-scale nodes in cairo
|
||||
- Treat texture-scale nodes more faithfully in GL
|
||||
|
||||
* Accessibility:
|
||||
- Tweak the accessible name computation for corner cases
|
||||
|
||||
* The GTK/GDK/GSK_DEBUG environment variables now
|
||||
work in productions as well as in debug builds
|
||||
|
||||
* Translation updates
|
||||
Catalan
|
||||
French
|
||||
Russian
|
||||
|
||||
|
||||
Overview of Changes in 4.13.2, 22-10-2023
|
||||
=========================================
|
||||
|
||||
* GtkPrintdialog:
|
||||
- New async-style api to replace GtkPrintOperation
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Add more languages: Bengali, Hindi, Japanese, Finnish,
|
||||
Thai and Norwegian bokmål
|
||||
|
||||
* Accessibility:
|
||||
- Fix some utf8 handling issues
|
||||
|
||||
* GDK:
|
||||
- Add support for dmabuf textures, with GdkDmabufTextureBuilder
|
||||
- Add a few more supported memory formats for textures
|
||||
|
||||
* GSK:
|
||||
- Add a fast-path for masking color
|
||||
- Add support for importing dmabuf textures
|
||||
- Handle GLES better by using some extensions
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
Russian
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.13.1, 28-09-2023
|
||||
=========================================
|
||||
|
||||
* GtkTooltip:
|
||||
- Don't cross native boundaries when looking for tooltips
|
||||
|
||||
* GtkCenterLayout, GtkEntry, GtkSearchEntry:
|
||||
- Fix some issues with baseline handling
|
||||
|
||||
* GtkColorButton, GtkFontButton:
|
||||
- Propagate focus-on-click
|
||||
|
||||
* GtkFileChooser:
|
||||
- Make "Visit file" scroll to the file
|
||||
|
||||
* GtkSwitch:
|
||||
- Respect text direction
|
||||
|
||||
* GtkWindow:
|
||||
- Don't assume titlebars are GtkHeaderBars
|
||||
|
||||
* Printing:
|
||||
- Fix some problems with the portal implementation
|
||||
- Add a new simple print API: GtkPrintDialog
|
||||
|
||||
* Paths:
|
||||
- GskPathMeasure performance has been improved
|
||||
- Add custom contours for circles, rounded rectangles and rectangles
|
||||
- Simplify GskPathPoint handling
|
||||
- gsk_path_point_get_closest_point now returns the distance as well
|
||||
- Make GskPathBuilder simplify curves
|
||||
|
||||
* Input:
|
||||
- Handle (some) single-key compose sequences
|
||||
- Fix active state tracking with sensitivity changes and grabs
|
||||
|
||||
* GSK:
|
||||
- Make the repeated gradients match between GL and cairo
|
||||
- Make rounded rect shrinking match between Vulkan, GL and cairo
|
||||
- Fix parsing of text nodes with color glyphs
|
||||
- Restrict an optimization to the cases where it is crrect
|
||||
- Fix rendering of shadows with opacity
|
||||
- The Vulkan renderer now requires Vulkan 1.2
|
||||
- GL: Transition gradients unpremultiplied
|
||||
- GL: Fix clipping of shadows
|
||||
- GL: Some optimizations
|
||||
- Broadway: Fix memory leaks in the renderer
|
||||
|
||||
* Wayland:
|
||||
- Make activation more reliable
|
||||
|
||||
* macOS:
|
||||
- Clamp damage regions to the surface size
|
||||
|
||||
* Tools:
|
||||
- gtk4-path-tool gained restrict and reverse commands
|
||||
- gtk4-path-tool show and render can show control points
|
||||
|
||||
* Demos:
|
||||
- Add a demo for hit testing with paths
|
||||
|
||||
* Build:
|
||||
- Fix build problems with C++ compilers
|
||||
|
||||
* Deprecations:
|
||||
- gtk_window_present_with_time
|
||||
|
||||
* Translation updates
|
||||
Brazilian Portuguese
|
||||
British English
|
||||
Catalan
|
||||
Chinese (China)
|
||||
Czech
|
||||
Danish
|
||||
Dutch
|
||||
Esperanto
|
||||
Galician
|
||||
Georgian
|
||||
Italian
|
||||
Korean
|
||||
Latvian
|
||||
Lithuanian
|
||||
Persian
|
||||
Polish
|
||||
Punjabi
|
||||
Slovenian
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.13.0, 25-08-2023
|
||||
=========================================
|
||||
|
||||
* GskPath, GskPathBuilder, GskPathMeasure:
|
||||
Data types and APIs for path rendering. These APIs are still
|
||||
considered experimental, and may change until 4.14. Please try
|
||||
them out and give us feedback. Documentation can be found
|
||||
here: https://docs.gtk.org/gsk4/paths.html
|
||||
|
||||
* GtkGridView:
|
||||
- Fix a crash when scrolling
|
||||
|
||||
* GtkColumnView:
|
||||
- Fix a refcounting issue in the new scroll_to api
|
||||
|
||||
* GtkTreeView
|
||||
- Fix style classes for sort arrows
|
||||
|
||||
* GtkEntry:
|
||||
- Improve tracking of user changes (for undo)
|
||||
|
||||
* GtkNotebook:
|
||||
- Fix a critical when switching pages
|
||||
|
||||
* GtkColor/FontDialogButton:
|
||||
- Make these widgets activatable
|
||||
|
||||
* GtkMenuButton:
|
||||
- Fix problems with focus handling
|
||||
- Fix problems with DND
|
||||
- Make flags a settable property
|
||||
|
||||
* GtkShortcutsWindow:
|
||||
- Add API to build shortcuts windows programmatically
|
||||
|
||||
* Printing
|
||||
- Fix the cpdb backend build
|
||||
|
||||
* MacOS:
|
||||
- Make file filters work again
|
||||
|
||||
* GSK:
|
||||
- Fix issues with color matrix nodes
|
||||
|
||||
* Wayland:
|
||||
- Fix a crash with compositors other than gnome-shell
|
||||
|
||||
* Deprecations:
|
||||
- Remaining GtkTreeModel-related types
|
||||
|
||||
* Demos:
|
||||
- Add a few path demos to gtk4-demo
|
||||
|
||||
* Tools:
|
||||
- gtk4-path-tool provides a commandline interface for paths
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Catalan
|
||||
Finnish
|
||||
Galician
|
||||
Georgian
|
||||
German
|
||||
Greek
|
||||
Indonesian
|
||||
Kazakh
|
||||
Persian
|
||||
Polish
|
||||
Romanian
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.12.0, 05-08-2023
|
||||
=========================================
|
||||
|
||||
* List widgets:
|
||||
- Add scroll_to APIs
|
||||
|
||||
* GtkFileLauncher:
|
||||
- Add an always-ask property
|
||||
|
||||
* GtkTextView:
|
||||
- Make backspace behavior match GtkEntry
|
||||
|
||||
* gsk:
|
||||
- Fix handling of luminance in mask nodes
|
||||
|
||||
* Text rendering:
|
||||
- Automate the setting of gtk-hint-font-metrics from the
|
||||
scale factor. This improves font rendering in flatpaks
|
||||
|
||||
* Wayland:
|
||||
- Fix behavior of stylus buttons
|
||||
- Support suspended window state
|
||||
|
||||
* Vulkan:
|
||||
- Many improvements
|
||||
|
||||
* Tools:
|
||||
- Add gtk4-rendernode-tool
|
||||
|
||||
* Debugging:
|
||||
- Drop the GTK_DEBUG_TOUCHSCREEN flag
|
||||
|
||||
* Build:
|
||||
- Some build options have been renamed:
|
||||
gtk_doc -> documentation
|
||||
update_screenshots -> screenshots
|
||||
The old names still work
|
||||
|
||||
* Translation updates:
|
||||
Georgian
|
||||
Greek
|
||||
Hebrew
|
||||
Persian
|
||||
Vietnamese
|
||||
|
||||
* Contributors:
|
||||
Aleksandr Melman
|
||||
Alexander Mikhaylenko
|
||||
Alexander Shopov
|
||||
Alexandre Franke
|
||||
Alice Mikhaylenko
|
||||
António Fernandes
|
||||
Arjan Molenaar
|
||||
Asier Sarasua Garmendia
|
||||
Balázs Meskó
|
||||
Balázs Úr
|
||||
Barnabás Pőcze
|
||||
Bart Jacobs
|
||||
Benjamin Otte
|
||||
Bilal Elmoussaoui
|
||||
Boyuan Yang
|
||||
Bruce Cowan
|
||||
Calvin Walton
|
||||
Cam Cook
|
||||
Chris Mayo
|
||||
Christian Hergert
|
||||
Christopher Davis
|
||||
Chun-wei Fan
|
||||
Corey Berla
|
||||
Danial Behzadi
|
||||
Daniel Boles
|
||||
Daniel Rusek
|
||||
Efstathios Iosifidis
|
||||
Ekaterine Papava
|
||||
Emin Tufan Çetin
|
||||
Emmanuele Bassi
|
||||
Erik Schilling
|
||||
Fabio Tomat
|
||||
FeRD (Frank Dana)
|
||||
Fina Wilke
|
||||
FineFindus
|
||||
Fran Dieguez
|
||||
G.Willems
|
||||
Georges Basile Stavracas Neto
|
||||
Guillaume Bernard
|
||||
Hugo Carvalho
|
||||
Ivan Molodetskikh
|
||||
Jason Francis
|
||||
Jonas Ådahl
|
||||
Jordan Petridis
|
||||
Jordi Mas
|
||||
José Expósito
|
||||
José Roberto de Souza
|
||||
Khalid Abu Shawarib
|
||||
Kévin Commaille
|
||||
Leônidas Araújo
|
||||
Luca Bacci
|
||||
Ludovico de Nittis
|
||||
Lukáš Tyrychtr
|
||||
Marc-André Lureau
|
||||
Marco Trevisan (Treviño)
|
||||
Matt Turner
|
||||
Matthias Clasen
|
||||
Maximiliano Sandoval R
|
||||
Michael Catanzaro
|
||||
Michel Dänzer
|
||||
Mohammed Sadiq
|
||||
Nathan Follens
|
||||
Nelson Benítez León
|
||||
Ngọc Quân Trần
|
||||
Niels De Graef
|
||||
Olivier Crête
|
||||
Patrick Griffis
|
||||
Piotr Drąg
|
||||
Sabri Ünal
|
||||
Sebastian Keller
|
||||
Sophie Herold
|
||||
Sébastien Le Roux
|
||||
Takao Fujiwara
|
||||
Thomas Lange
|
||||
Yiğit Burak
|
||||
Yosef Or Boczko
|
||||
Yuri Chornoivan
|
||||
Zander Brown
|
||||
al_SeveR
|
||||
dgsasha
|
||||
sumibi-yakitori
|
||||
tszymanski
|
||||
velsinki
|
||||
Алексей Шилин
|
||||
Арсений Засыпкин
|
||||
|
||||
Overview of Changes in 4.11.4, 03-07-2023
|
||||
=========================================
|
||||
|
||||
* GtkFileChooser:
|
||||
@@ -26,6 +495,9 @@ Overview of Changes in 4.11.4, xx-xx-xxxx
|
||||
* GtkDropDown:
|
||||
- Update on expression changes
|
||||
|
||||
* GtkMapListModel:
|
||||
- Implement GtkSectionModel
|
||||
|
||||
* Accessibility:
|
||||
- Improvements all over the place: GtkButton, GtkPasswordEntry,
|
||||
GtkFontChooserDialog, GtkColorChooserDialog, GtkShortcutsWindow,
|
||||
@@ -50,7 +522,7 @@ Overview of Changes in 4.11.4, xx-xx-xxxx
|
||||
- Center newly created transient windows
|
||||
|
||||
* Vulkan:
|
||||
- Add antialising for gradients
|
||||
- Add antialiasing for gradients
|
||||
- Do less work on clipped away nodes
|
||||
- Redo image uploading
|
||||
- Support different image depths and formats
|
||||
@@ -72,6 +544,7 @@ Overview of Changes in 4.11.4, xx-xx-xxxx
|
||||
* Build:
|
||||
- Require GLib 2.76
|
||||
- Make asan builds work again
|
||||
- Fix the build if ld is not ld.bdf
|
||||
|
||||
* Translation updates:
|
||||
Brazilian Portuguese
|
||||
@@ -1033,7 +1506,7 @@ Overview of Changes in 4.7.0, 07-05-2022
|
||||
- Event handling fixes
|
||||
- Fix keyboard input on popovers
|
||||
- Support OpenGL-based video playback
|
||||
- Suport fullscreen
|
||||
- Support fullscreen
|
||||
- Improve native filechoooser size allocation
|
||||
- Use CALayer and IOSurface for rendering
|
||||
- Use a per-monitor CVDisplayLink
|
||||
@@ -1430,7 +1903,7 @@ Overview of Changes in 4.4.0
|
||||
- Activate when moving focus
|
||||
|
||||
* GtkLabel:
|
||||
- Propertly ignore double underscores for mnemonics
|
||||
- Properly ignore double underscores for mnemonics
|
||||
|
||||
* GtkPopoverMenu:
|
||||
- Fix focus cycling
|
||||
@@ -1977,7 +2450,7 @@ Overview of Changes in 4.1.0
|
||||
- Set sort arrows in CSS
|
||||
- Set menu button arrows in CSS
|
||||
- Make scrollbars larger
|
||||
- Supprt circular menubuttons
|
||||
- Support circular menubuttons
|
||||
|
||||
* CSS:
|
||||
- Implement transform-origin
|
||||
|
23
README.md
@@ -67,6 +67,13 @@ building for:
|
||||
- [Graphene](https://github.com/ebassi/graphene)
|
||||
- [Xkb-common](https://github.com/xkbcommon/libxkbcommon)
|
||||
|
||||
If you are building the Wayland backend, you will also need:
|
||||
|
||||
- Wayland-client
|
||||
- Wayland-protocols
|
||||
- Wayland-cursor
|
||||
- Wayland-EGL
|
||||
|
||||
If you are building the X11 backend, you will also need:
|
||||
|
||||
- Xlib, and the following X extensions:
|
||||
@@ -79,32 +86,24 @@ If you are building the X11 backend, you will also need:
|
||||
- xdamage
|
||||
- xcomposite
|
||||
|
||||
If you are building the Wayland backend, you will also need:
|
||||
|
||||
- Wayland-client
|
||||
- Wayland-protocols
|
||||
- Wayland-cursor
|
||||
- Wayland-EGL
|
||||
|
||||
Once you have all the necessary dependencies, you can build GTK by using
|
||||
Meson:
|
||||
|
||||
```sh
|
||||
$ meson _build .
|
||||
$ cd _build
|
||||
$ ninja
|
||||
$ meson setup _build
|
||||
$ meson compile -C_build
|
||||
```
|
||||
|
||||
You can run the test suite using:
|
||||
|
||||
```sh
|
||||
$ meson test
|
||||
$ meson test -C_build
|
||||
```
|
||||
|
||||
And, finally, you can install GTK using:
|
||||
|
||||
```
|
||||
$ sudo ninja install
|
||||
$ sudo meson install -C_build
|
||||
```
|
||||
|
||||
Complete information about installing GTK and related libraries
|
||||
|
41
build-aux/msvc/msvc_recommended_pragmas.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef _MSC_VER
|
||||
#pragma error "This header is for Microsoft VC or clang-cl only."
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Make MSVC more pedantic, this is a recommended pragma list
|
||||
* from _Win32_Programming_ by Rector and Newcomer.
|
||||
*/
|
||||
#ifndef __clang__
|
||||
#pragma warning(error:4002) /* too many actual parameters for macro */
|
||||
#pragma warning(error:4003) /* not enough actual parameters for macro */
|
||||
#pragma warning(1:4010) /* single-line comment contains line-continuation character */
|
||||
#pragma warning(error:4013) /* 'function' undefined; assuming extern returning int */
|
||||
#pragma warning(1:4016) /* no function return type; using int as default */
|
||||
#pragma warning(error:4020) /* too many actual parameters */
|
||||
#pragma warning(error:4021) /* too few actual parameters */
|
||||
#pragma warning(error:4027) /* function declared without formal parameter list */
|
||||
#pragma warning(error:4029) /* declared formal parameter list different from definition */
|
||||
#pragma warning(error:4033) /* 'function' must return a value */
|
||||
#pragma warning(error:4035) /* 'function' : no return value */
|
||||
#pragma warning(error:4045) /* array bounds overflow */
|
||||
#pragma warning(error:4047) /* different levels of indirection */
|
||||
#pragma warning(error:4049) /* terminating line number emission */
|
||||
#pragma warning(error:4053) /* An expression of type void was used as an operand */
|
||||
#pragma warning(error:4071) /* no function prototype given */
|
||||
#pragma warning(disable:4101) /* unreferenced local variable */
|
||||
#pragma warning(error:4150)
|
||||
|
||||
/* G_NORETURN */
|
||||
#pragma warning(error:4646) /* function declared with __declspec(noreturn) has non-void return type */
|
||||
#pragma warning(error:4715) /* 'function': not all control paths return a value */
|
||||
#pragma warning(error:4098) /* 'void' function returning a value */
|
||||
|
||||
#pragma warning(disable:4244) /* No possible loss of data warnings */
|
||||
#pragma warning(disable:4305) /* No truncation from int to char warnings */
|
||||
|
||||
#pragma warning(error:4819) /* The file contains a character that cannot be represented in the current code page */
|
||||
#endif /* __clang__ */
|
||||
|
||||
/* work around Microsoft's premature attempt to deprecate the C-Library */
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_NONSTDC_NO_WARNINGS
|
@@ -483,6 +483,8 @@ constraint_editor_window_class_init (ConstraintEditorWindowClass *class)
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
g_type_ensure (CONSTRAINT_VIEW_TYPE);
|
||||
|
||||
object_class->dispose = constraint_editor_window_dispose;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class,
|
||||
|
@@ -20,8 +20,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "constraint-editor.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
#include "constraint-view.h"
|
||||
|
||||
struct _ConstraintEditor
|
||||
{
|
||||
@@ -66,7 +65,7 @@ static const char *
|
||||
get_target_name (GtkConstraintTarget *target)
|
||||
{
|
||||
if (target == NULL)
|
||||
return "super";
|
||||
return "Super";
|
||||
else if (GTK_IS_WIDGET (target))
|
||||
return gtk_widget_get_name (GTK_WIDGET (target));
|
||||
else if (GTK_IS_CONSTRAINT_GUIDE (target))
|
||||
@@ -80,62 +79,29 @@ constraint_target_combo (GListModel *model,
|
||||
GtkWidget *combo,
|
||||
gboolean is_source)
|
||||
{
|
||||
GtkStringList *targets;
|
||||
int i;
|
||||
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "super", "Super");
|
||||
targets = gtk_string_list_new (NULL);
|
||||
|
||||
gtk_string_list_append (targets, "Super");
|
||||
|
||||
if (model)
|
||||
{
|
||||
for (i = 0; i < g_list_model_get_n_items (model); i++)
|
||||
{
|
||||
GObject *item = g_list_model_get_object (model, i);
|
||||
const char *name;
|
||||
|
||||
if (GTK_IS_CONSTRAINT (item))
|
||||
continue;
|
||||
|
||||
name = get_target_name (GTK_CONSTRAINT_TARGET (item));
|
||||
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), name, name);
|
||||
gtk_string_list_append (targets, get_target_name (GTK_CONSTRAINT_TARGET (item)));
|
||||
g_object_unref (item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
constraint_attribute_combo (GtkWidget *combo,
|
||||
gboolean is_source)
|
||||
{
|
||||
if (is_source)
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "none", "None");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "left", "Left");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "right", "Right");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "top", "Top");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "bottom", "Bottom");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "start", "Start");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "end", "End");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "width", "Width");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "height", "Height");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "center-x", "Center X");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "center-y", "Center Y");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "baseline", "Baseline");
|
||||
}
|
||||
|
||||
static void
|
||||
constraint_relation_combo (GtkWidget *combo)
|
||||
{
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "le", "≤");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "eq", "=");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "ge", "≥");
|
||||
}
|
||||
|
||||
static void
|
||||
constraint_strength_combo (GtkWidget *combo)
|
||||
{
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "weak", "Weak");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "medium", "Medium");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "strong", "Strong");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "required", "Required");
|
||||
gtk_drop_down_set_model (GTK_DROP_DOWN (combo), G_LIST_MODEL (targets));
|
||||
g_object_unref (targets);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
@@ -147,7 +113,7 @@ get_target (GListModel *model,
|
||||
if (id == NULL)
|
||||
return NULL;
|
||||
|
||||
if (strcmp ("super", id) == 0)
|
||||
if (strcmp ("Super", id) == 0)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < g_list_model_get_n_items (model); i++)
|
||||
@@ -171,16 +137,65 @@ get_target (GListModel *model,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GtkConstraintAttribute
|
||||
get_target_attr (const char *id)
|
||||
static void
|
||||
select_target (GtkDropDown *combo,
|
||||
const char *target_name)
|
||||
{
|
||||
GtkConstraintAttribute attr;
|
||||
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_ATTRIBUTE);
|
||||
GEnumValue *value = g_enum_get_value_by_nick (class, id);
|
||||
attr = value->value;
|
||||
g_type_class_unref (class);
|
||||
GListModel *model = gtk_drop_down_get_model (combo);
|
||||
|
||||
return attr;
|
||||
for (unsigned int i = 0; i < g_list_model_get_n_items (model); i++)
|
||||
{
|
||||
GtkStringObject *s = g_list_model_get_item (model, i);
|
||||
|
||||
g_object_unref (s);
|
||||
if (strcmp (target_name, gtk_string_object_get_string (s)) == 0)
|
||||
{
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GtkConstraintAttribute
|
||||
get_attr (unsigned int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0: return GTK_CONSTRAINT_ATTRIBUTE_NONE;
|
||||
case 1: return GTK_CONSTRAINT_ATTRIBUTE_LEFT;
|
||||
case 2: return GTK_CONSTRAINT_ATTRIBUTE_RIGHT;
|
||||
case 3: return GTK_CONSTRAINT_ATTRIBUTE_TOP;
|
||||
case 4: return GTK_CONSTRAINT_ATTRIBUTE_BOTTOM;
|
||||
case 5: return GTK_CONSTRAINT_ATTRIBUTE_START;
|
||||
case 6: return GTK_CONSTRAINT_ATTRIBUTE_END;
|
||||
case 7: return GTK_CONSTRAINT_ATTRIBUTE_WIDTH;
|
||||
case 8: return GTK_CONSTRAINT_ATTRIBUTE_HEIGHT;
|
||||
case 9: return GTK_CONSTRAINT_ATTRIBUTE_CENTER_X;
|
||||
case 10: return GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y;
|
||||
case 11: return GTK_CONSTRAINT_ATTRIBUTE_BASELINE;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
get_attr_id (GtkConstraintAttribute attr)
|
||||
{
|
||||
switch (attr)
|
||||
{
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_NONE: return 0;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_LEFT: return 1;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_RIGHT: return 2;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_TOP: return 3;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_BOTTOM: return 4;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_START: return 5;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_END: return 6;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_WIDTH: return 7;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_HEIGHT: return 8;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_CENTER_X: return 9;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y: return 10;
|
||||
case GTK_CONSTRAINT_ATTRIBUTE_BASELINE: return 11;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -195,15 +210,27 @@ get_attr_nick (GtkConstraintAttribute attr)
|
||||
}
|
||||
|
||||
static GtkConstraintRelation
|
||||
get_relation (const char *id)
|
||||
get_relation (unsigned int id)
|
||||
{
|
||||
GtkConstraintRelation relation;
|
||||
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_RELATION);
|
||||
GEnumValue *value = g_enum_get_value_by_nick (class, id);
|
||||
relation = value->value;
|
||||
g_type_class_unref (class);
|
||||
switch (id)
|
||||
{
|
||||
case 0: return GTK_CONSTRAINT_RELATION_LE;
|
||||
case 1: return GTK_CONSTRAINT_RELATION_EQ;
|
||||
case 2: return GTK_CONSTRAINT_RELATION_GE;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
return relation;
|
||||
static unsigned int
|
||||
get_relation_id (GtkConstraintRelation relation)
|
||||
{
|
||||
switch (relation)
|
||||
{
|
||||
case GTK_CONSTRAINT_RELATION_LE: return 0;
|
||||
case GTK_CONSTRAINT_RELATION_EQ: return 1;
|
||||
case GTK_CONSTRAINT_RELATION_GE: return 2;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -234,15 +261,29 @@ get_relation_display_name (GtkConstraintRelation relation)
|
||||
}
|
||||
|
||||
static GtkConstraintStrength
|
||||
get_strength (const char *id)
|
||||
{
|
||||
GtkConstraintStrength strength;
|
||||
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
|
||||
GEnumValue *value = g_enum_get_value_by_nick (class, id);
|
||||
strength = value->value;
|
||||
g_type_class_unref (class);
|
||||
get_strength (unsigned int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0: return GTK_CONSTRAINT_STRENGTH_WEAK;
|
||||
case 1: return GTK_CONSTRAINT_STRENGTH_MEDIUM;
|
||||
case 2: return GTK_CONSTRAINT_STRENGTH_STRONG;
|
||||
case 3: return GTK_CONSTRAINT_STRENGTH_REQUIRED;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
return strength;
|
||||
static unsigned int
|
||||
get_strength_id (GtkConstraintStrength strength)
|
||||
{
|
||||
switch (strength)
|
||||
{
|
||||
case GTK_CONSTRAINT_STRENGTH_WEAK: return 0;
|
||||
case GTK_CONSTRAINT_STRENGTH_MEDIUM: return 1;
|
||||
case GTK_CONSTRAINT_STRENGTH_STRONG: return 2;
|
||||
case GTK_CONSTRAINT_STRENGTH_REQUIRED: return 3;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -294,7 +335,7 @@ static void
|
||||
create_constraint (GtkButton *button,
|
||||
ConstraintEditor *editor)
|
||||
{
|
||||
const char *id;
|
||||
gpointer obj;
|
||||
gpointer target;
|
||||
GtkConstraintAttribute target_attr;
|
||||
gpointer source;
|
||||
@@ -305,25 +346,27 @@ create_constraint (GtkButton *button,
|
||||
int strength;
|
||||
GtkConstraint *constraint;
|
||||
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target));
|
||||
target = get_target (editor->model, id);
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target_attr));
|
||||
target_attr = get_target_attr (id);
|
||||
obj = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (editor->target));
|
||||
if (obj)
|
||||
target = get_target (editor->model, gtk_string_object_get_string (GTK_STRING_OBJECT (obj)));
|
||||
else
|
||||
target = NULL;
|
||||
target_attr = get_attr (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->target_attr)));
|
||||
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source));
|
||||
source = get_target (editor->model, id);
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
|
||||
source_attr = get_target_attr (id);
|
||||
obj = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (editor->source));
|
||||
if (obj)
|
||||
source = get_target (editor->model, gtk_string_object_get_string (GTK_STRING_OBJECT (obj)));
|
||||
else
|
||||
source = NULL;
|
||||
source_attr = get_attr (gtk_drop_down_get_selected (GTK_DROP_DOWN(editor->source_attr)));
|
||||
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->relation));
|
||||
relation = get_relation (id);
|
||||
relation = get_relation (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->relation)));
|
||||
|
||||
multiplier = g_ascii_strtod (gtk_editable_get_text (GTK_EDITABLE (editor->multiplier)), NULL);
|
||||
|
||||
constant = g_ascii_strtod (gtk_editable_get_text (GTK_EDITABLE (editor->constant)), NULL);
|
||||
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->strength));
|
||||
strength = get_strength (id);
|
||||
strength = get_strength (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->strength)));
|
||||
|
||||
constraint = gtk_constraint_new (target, target_attr,
|
||||
relation,
|
||||
@@ -338,12 +381,9 @@ create_constraint (GtkButton *button,
|
||||
static void
|
||||
source_attr_changed (ConstraintEditor *editor)
|
||||
{
|
||||
const char *id;
|
||||
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
|
||||
if (strcmp (id, "none") == 0)
|
||||
if (get_attr (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->source_attr))) == GTK_CONSTRAINT_ATTRIBUTE_NONE)
|
||||
{
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (editor->source), -1);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->source), GTK_INVALID_LIST_POSITION);
|
||||
gtk_editable_set_text (GTK_EDITABLE (editor->multiplier), "");
|
||||
gtk_widget_set_sensitive (editor->source, FALSE);
|
||||
gtk_widget_set_sensitive (editor->multiplier, FALSE);
|
||||
@@ -409,7 +449,7 @@ update_preview (ConstraintEditor *editor)
|
||||
GString *str;
|
||||
const char *name;
|
||||
const char *attr;
|
||||
char *relation;
|
||||
const char *relation;
|
||||
const char *multiplier;
|
||||
const char *constant;
|
||||
double c, m;
|
||||
@@ -419,23 +459,22 @@ update_preview (ConstraintEditor *editor)
|
||||
|
||||
str = g_string_new ("");
|
||||
|
||||
name = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target));
|
||||
attr = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target_attr));
|
||||
relation = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->relation));
|
||||
name = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_drop_down_get_selected_item (GTK_DROP_DOWN (editor->target))));
|
||||
attr = get_attr_nick (get_attr (gtk_drop_down_get_selected ((GTK_DROP_DOWN (editor->target_attr)))));
|
||||
relation = get_relation_nick (get_relation (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->relation))));
|
||||
|
||||
if (name == NULL)
|
||||
name = "[ ]";
|
||||
|
||||
g_string_append_printf (str, "%s.%s %s ", name, attr, relation);
|
||||
g_free (relation);
|
||||
|
||||
constant = gtk_editable_get_text (GTK_EDITABLE (editor->constant));
|
||||
c = g_ascii_strtod (constant, NULL);
|
||||
|
||||
attr = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
|
||||
attr = get_attr_nick (get_attr (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->source_attr))));
|
||||
if (strcmp (attr, "none") != 0)
|
||||
{
|
||||
name = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source));
|
||||
name = gtk_string_object_get_string (GTK_STRING_OBJECT (gtk_drop_down_get_selected_item (GTK_DROP_DOWN (editor->source))));
|
||||
multiplier = gtk_editable_get_text (GTK_EDITABLE (editor->multiplier));
|
||||
m = g_ascii_strtod (multiplier, NULL);
|
||||
|
||||
@@ -463,12 +502,18 @@ update_preview (ConstraintEditor *editor)
|
||||
static void
|
||||
update_button (ConstraintEditor *editor)
|
||||
{
|
||||
const char *target = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->target));
|
||||
const char *source = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source));
|
||||
const char *source_attr = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->source_attr));
|
||||
gpointer obj;
|
||||
const char *target;
|
||||
const char *source;
|
||||
GtkConstraintAttribute source_attr = get_attr (gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->source_attr)));
|
||||
|
||||
if (target &&
|
||||
(source || (source_attr && get_target_attr (source_attr) == GTK_CONSTRAINT_ATTRIBUTE_NONE)))
|
||||
obj = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (editor->target));
|
||||
target = obj ? gtk_string_object_get_string (GTK_STRING_OBJECT (obj)) : NULL;
|
||||
|
||||
obj = gtk_drop_down_get_selected_item (GTK_DROP_DOWN (editor->source));
|
||||
source = obj ? gtk_string_object_get_string (GTK_STRING_OBJECT (obj)) : NULL;
|
||||
|
||||
if (target && (source || (source_attr == GTK_CONSTRAINT_ATTRIBUTE_NONE)))
|
||||
gtk_widget_set_sensitive (editor->button, TRUE);
|
||||
else
|
||||
gtk_widget_set_sensitive (editor->button, FALSE);
|
||||
@@ -486,12 +531,7 @@ constraint_editor_constructed (GObject *object)
|
||||
ConstraintEditor *editor = CONSTRAINT_EDITOR (object);
|
||||
|
||||
constraint_target_combo (editor->model, editor->target, FALSE);
|
||||
constraint_attribute_combo (editor->target_attr, FALSE);
|
||||
constraint_relation_combo (editor->relation);
|
||||
constraint_target_combo (editor->model, editor->source, TRUE);
|
||||
constraint_attribute_combo (editor->source_attr, TRUE);
|
||||
|
||||
constraint_strength_combo (editor->strength);
|
||||
|
||||
if (editor->constraint)
|
||||
{
|
||||
@@ -499,30 +539,24 @@ constraint_editor_constructed (GObject *object)
|
||||
GtkConstraintAttribute attr;
|
||||
GtkConstraintRelation relation;
|
||||
GtkConstraintStrength strength;
|
||||
const char *nick;
|
||||
char *val;
|
||||
double multiplier;
|
||||
double constant;
|
||||
|
||||
target = gtk_constraint_get_target (editor->constraint);
|
||||
nick = get_target_name (target);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->target), nick);
|
||||
select_target (GTK_DROP_DOWN (editor->target), get_target_name (target));
|
||||
|
||||
attr = gtk_constraint_get_target_attribute (editor->constraint);
|
||||
nick = get_attr_nick (attr);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->target_attr), nick);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->target_attr), get_attr_id (attr));
|
||||
|
||||
target = gtk_constraint_get_source (editor->constraint);
|
||||
nick = get_target_name (target);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->source), nick);
|
||||
select_target (GTK_DROP_DOWN (editor->source), get_target_name (target));
|
||||
|
||||
attr = gtk_constraint_get_source_attribute (editor->constraint);
|
||||
nick = get_attr_nick (attr);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->source_attr), nick);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->source_attr), get_attr_id (attr));
|
||||
|
||||
relation = gtk_constraint_get_relation (editor->constraint);
|
||||
nick = get_relation_nick (relation);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->relation), nick);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->relation), get_relation_id (relation));
|
||||
|
||||
multiplier = gtk_constraint_get_multiplier (editor->constraint);
|
||||
val = g_strdup_printf ("%g", multiplier);
|
||||
@@ -535,17 +569,16 @@ constraint_editor_constructed (GObject *object)
|
||||
g_free (val);
|
||||
|
||||
strength = gtk_constraint_get_strength (editor->constraint);
|
||||
nick = get_strength_nick (strength);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), nick);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->strength), get_strength_id (strength));
|
||||
|
||||
gtk_button_set_label (GTK_BUTTON (editor->button), "Apply");
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->target_attr), "left");
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->source_attr), "left");
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->relation), "eq");
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), "required");
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->target_attr), get_attr_id (GTK_CONSTRAINT_ATTRIBUTE_LEFT));
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->source_attr), get_attr_id (GTK_CONSTRAINT_ATTRIBUTE_LEFT));
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->relation), get_relation_id (GTK_CONSTRAINT_RELATION_EQ));
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->strength), get_strength_id (GTK_CONSTRAINT_STRENGTH_REQUIRED));
|
||||
|
||||
gtk_editable_set_text (GTK_EDITABLE (editor->multiplier), "1.0");
|
||||
gtk_editable_set_text (GTK_EDITABLE (editor->constant), "0.0");
|
||||
|
@@ -1,5 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkStringList" id="targets">
|
||||
<items>
|
||||
<item>None</item>
|
||||
<item>Left</item>
|
||||
<item>Right</item>
|
||||
<item>Top</item>
|
||||
<item>Bottom</item>
|
||||
<item>Start</item>
|
||||
<item>End</item>
|
||||
<item>Width</item>
|
||||
<item>Height</item>
|
||||
<item>Center X</item>
|
||||
<item>Center Y</item>
|
||||
<item>Baseline</item>
|
||||
</items>
|
||||
</object>
|
||||
<template class="ConstraintEditor" parent="GtkWidget">
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid">
|
||||
@@ -19,9 +35,9 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="target">
|
||||
<signal name="changed" handler="update_preview" swapped="yes"/>
|
||||
<signal name="changed" handler="update_button" swapped="yes"/>
|
||||
<object class="GtkDropDown" id="target">
|
||||
<signal name="notify::selected" handler="update_preview" swapped="yes"/>
|
||||
<signal name="notify::selected" handler="update_button" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">1</property>
|
||||
@@ -29,8 +45,9 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="target_attr">
|
||||
<signal name="changed" handler="update_preview" swapped="yes"/>
|
||||
<object class="GtkDropDown" id="target_attr">
|
||||
<property name="model">targets</property>
|
||||
<signal name="notify::selected" handler="update_preview" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">1</property>
|
||||
@@ -47,8 +64,17 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="relation">
|
||||
<signal name="changed" handler="update_preview" swapped="yes"/>
|
||||
<object class="GtkDropDown" id="relation">
|
||||
<signal name="notify::selected" handler="update_preview" swapped="yes"/>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item>≤</item>
|
||||
<item>=</item>
|
||||
<item>≥</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">2</property>
|
||||
@@ -65,9 +91,9 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="source">
|
||||
<signal name="changed" handler="update_preview" swapped="yes"/>
|
||||
<signal name="changed" handler="update_button" swapped="yes"/>
|
||||
<object class="GtkDropDown" id="source">
|
||||
<signal name="notify::selected" handler="update_preview" swapped="yes"/>
|
||||
<signal name="notify::selected" handler="update_button" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">3</property>
|
||||
@@ -75,10 +101,11 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="source_attr">
|
||||
<signal name="changed" handler="update_preview" swapped="yes"/>
|
||||
<signal name="changed" handler="source_attr_changed" swapped="yes"/>
|
||||
<signal name="changed" handler="update_button" swapped="yes"/>
|
||||
<object class="GtkDropDown" id="source_attr">
|
||||
<property name="model">targets</property>
|
||||
<signal name="notify::selected" handler="update_preview" swapped="yes"/>
|
||||
<signal name="notify::selected" handler="source_attr_changed" swapped="yes"/>
|
||||
<signal name="notify::selected" handler="update_button" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">3</property>
|
||||
@@ -131,7 +158,17 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="strength">
|
||||
<object class="GtkDropDown" id="strength">
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item>Weak</item>
|
||||
<item>Medium</item>
|
||||
<item>Strong</item>
|
||||
<item>Required</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">6</property>
|
||||
|
@@ -21,8 +21,6 @@
|
||||
|
||||
#include "guide-editor.h"
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
struct _GuideEditor
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
@@ -59,25 +57,30 @@ static guint signals[LAST_SIGNAL];
|
||||
|
||||
G_DEFINE_TYPE(GuideEditor, guide_editor, GTK_TYPE_WIDGET);
|
||||
|
||||
static void
|
||||
guide_strength_combo (GtkWidget *combo)
|
||||
static GtkConstraintStrength
|
||||
get_strength (unsigned int id)
|
||||
{
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "weak", "Weak");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "medium", "Medium");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "strong", "Strong");
|
||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "required", "Required");
|
||||
switch (id)
|
||||
{
|
||||
case 0: return GTK_CONSTRAINT_STRENGTH_WEAK;
|
||||
case 1: return GTK_CONSTRAINT_STRENGTH_MEDIUM;
|
||||
case 2: return GTK_CONSTRAINT_STRENGTH_STRONG;
|
||||
case 3: return GTK_CONSTRAINT_STRENGTH_REQUIRED;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static GtkConstraintStrength
|
||||
get_strength (const char *id)
|
||||
static unsigned int
|
||||
get_strength_id (GtkConstraintStrength strength)
|
||||
{
|
||||
GtkConstraintStrength strength;
|
||||
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
|
||||
GEnumValue *value = g_enum_get_value_by_nick (class, id);
|
||||
strength = value->value;
|
||||
g_type_class_unref (class);
|
||||
|
||||
return strength;
|
||||
switch (strength)
|
||||
{
|
||||
case GTK_CONSTRAINT_STRENGTH_WEAK: return 0;
|
||||
case GTK_CONSTRAINT_STRENGTH_MEDIUM: return 1;
|
||||
case GTK_CONSTRAINT_STRENGTH_STRONG: return 2;
|
||||
case GTK_CONSTRAINT_STRENGTH_REQUIRED: return 3;
|
||||
default: g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -118,11 +121,11 @@ static void
|
||||
create_guide (GtkButton *button,
|
||||
GuideEditor *editor)
|
||||
{
|
||||
const char *id;
|
||||
int strength;
|
||||
const char *name;
|
||||
int w, h;
|
||||
GtkConstraintGuide *guide;
|
||||
unsigned int id;
|
||||
|
||||
if (editor->guide)
|
||||
guide = g_object_ref (editor->guide);
|
||||
@@ -144,7 +147,7 @@ create_guide (GtkButton *button,
|
||||
h = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (editor->max_height));
|
||||
gtk_constraint_guide_set_max_size (guide, w, h);
|
||||
|
||||
id = gtk_combo_box_get_active_id (GTK_COMBO_BOX (editor->strength));
|
||||
id = gtk_drop_down_get_selected (GTK_DROP_DOWN (editor->strength));
|
||||
strength = get_strength (id);
|
||||
gtk_constraint_guide_set_strength (guide, strength);
|
||||
|
||||
@@ -191,14 +194,9 @@ guide_editor_constructed (GObject *object)
|
||||
{
|
||||
GuideEditor *editor = GUIDE_EDITOR (object);
|
||||
|
||||
guide_strength_combo (editor->strength);
|
||||
|
||||
g_signal_connect (editor->min_width, "input", G_CALLBACK (min_input), NULL);
|
||||
|
||||
g_signal_connect (editor->min_height, "input", G_CALLBACK (min_input), NULL);
|
||||
|
||||
g_signal_connect (editor->max_width, "input", G_CALLBACK (max_input), NULL);
|
||||
|
||||
g_signal_connect (editor->max_height, "input", G_CALLBACK (max_input), NULL);
|
||||
|
||||
if (editor->guide)
|
||||
@@ -224,8 +222,7 @@ guide_editor_constructed (GObject *object)
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_height), h);
|
||||
|
||||
strength = gtk_constraint_guide_get_strength (editor->guide);
|
||||
nick = get_strength_nick (strength);
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), nick);
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->strength), get_strength_id (strength));
|
||||
|
||||
gtk_button_set_label (GTK_BUTTON (editor->button), "Apply");
|
||||
}
|
||||
@@ -245,7 +242,7 @@ guide_editor_constructed (GObject *object)
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_width), G_MAXINT);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->max_height), G_MAXINT);
|
||||
|
||||
gtk_combo_box_set_active_id (GTK_COMBO_BOX (editor->strength), "medium");
|
||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (editor->strength), get_strength_id (GTK_CONSTRAINT_STRENGTH_MEDIUM));
|
||||
|
||||
gtk_button_set_label (GTK_BUTTON (editor->button), "Create");
|
||||
}
|
||||
|
@@ -167,7 +167,17 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="strength">
|
||||
<object class="GtkDropDown" id="strength">
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item>Weak</item>
|
||||
<item>Medium</item>
|
||||
<item>Strong</item>
|
||||
<item>Required</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">4</property>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -2,8 +2,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef GtkApplication DemoApplication;
|
||||
typedef GtkApplicationClass DemoApplicationClass;
|
||||
|
||||
@@ -37,7 +35,7 @@ show_action_dialog (GSimpleAction *action)
|
||||
{
|
||||
GtkAlertDialog *dialog;
|
||||
|
||||
dialog = gtk_alert_dialog_new ("You activated action: \"%s\n",
|
||||
dialog = gtk_alert_dialog_new ("You activated action: \"%s\"",
|
||||
g_action_get_name (G_ACTION (action)));
|
||||
gtk_alert_dialog_show (dialog, NULL);
|
||||
g_object_unref (dialog);
|
||||
@@ -216,6 +214,41 @@ activate_quit (GSimpleAction *action,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
delete_messages (gpointer data)
|
||||
{
|
||||
g_list_free_full ((GList *)data, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
pop_message (GtkWidget *status)
|
||||
{
|
||||
GList *messages = (GList *) g_object_steal_data (G_OBJECT (status), "messages");
|
||||
|
||||
if (messages)
|
||||
{
|
||||
char *message = messages->data;
|
||||
messages = g_list_remove (messages, message);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (status), "messages",
|
||||
messages, delete_messages);
|
||||
|
||||
gtk_label_set_label (GTK_LABEL (status), message);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
push_message (GtkWidget *status,
|
||||
const char *message)
|
||||
{
|
||||
GList *messages = (GList *) g_object_steal_data (G_OBJECT (status), "messages");
|
||||
|
||||
gtk_label_set_label (GTK_LABEL (status), message);
|
||||
messages = g_list_prepend (messages, g_strdup (message));
|
||||
g_object_set_data_full (G_OBJECT (status), "messages",
|
||||
messages, delete_messages);
|
||||
}
|
||||
|
||||
static void
|
||||
update_statusbar (GtkTextBuffer *buffer,
|
||||
DemoApplicationWindow *window)
|
||||
@@ -226,7 +259,7 @@ update_statusbar (GtkTextBuffer *buffer,
|
||||
GtkTextIter iter;
|
||||
|
||||
/* clear any previous message, underflow is allowed */
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (window->status), 0);
|
||||
pop_message (window->status);
|
||||
|
||||
count = gtk_text_buffer_get_char_count (buffer);
|
||||
|
||||
@@ -240,7 +273,7 @@ update_statusbar (GtkTextBuffer *buffer,
|
||||
msg = g_strdup_printf ("Cursor at row %d column %d - %d chars in document",
|
||||
row, col, count);
|
||||
|
||||
gtk_statusbar_push (GTK_STATUSBAR (window->status), 0, msg);
|
||||
push_message (window->status, msg);
|
||||
|
||||
g_free (msg);
|
||||
}
|
||||
|
@@ -76,8 +76,13 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="status">
|
||||
<object class="GtkLabel" id="status">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="margin-start">2</property>
|
||||
<property name="margin-end">2</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">3</property>
|
||||
|
@@ -18,8 +18,7 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __BLUR_OVERLAY_H__
|
||||
#define __BLUR_OVERLAY_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -60,5 +59,3 @@ void blur_overlay_set_child (BlurOverlay *overlay,
|
||||
GtkWidget *widget);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BLUR_OVERLAY_H__ */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/* Builder
|
||||
* #Keywords: GMenu, GtkPopoverMenuBar, GtkBuilder, GtkStatusBar, GtkShortcutController, toolbar
|
||||
* #Keywords: GMenu, GtkPopoverMenuBar, GtkBuilder, GtkShortcutController, toolbar
|
||||
*
|
||||
* Demonstrates a traditional interface, loaded from a XML description,
|
||||
* and shows how to connect actions to the menu items and toolbar buttons.
|
||||
@@ -37,30 +37,34 @@ remove_timeout (gpointer data)
|
||||
g_source_remove (id);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static gboolean
|
||||
pop_status (gpointer data)
|
||||
static int
|
||||
pop_message (gpointer data)
|
||||
{
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (data), 0);
|
||||
g_object_set_data (G_OBJECT (data), "timeout", NULL);
|
||||
GtkWidget *status = data;
|
||||
|
||||
gtk_label_set_label (GTK_LABEL (status), "");
|
||||
g_object_set_data (G_OBJECT (status), "timeout", GUINT_TO_POINTER (0));
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
status_message (GtkStatusbar *status,
|
||||
const char *text)
|
||||
status_message (GtkWidget *status,
|
||||
const char *text)
|
||||
{
|
||||
guint id;
|
||||
|
||||
gtk_statusbar_push (GTK_STATUSBAR (status), 0, text);
|
||||
id = g_timeout_add (5000, pop_status, status);
|
||||
id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (status), "timeout"));
|
||||
if (id)
|
||||
g_source_remove (id);
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (status), text);
|
||||
|
||||
id = g_timeout_add (5000, pop_message, status);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (status), "timeout", GUINT_TO_POINTER (id), remove_timeout);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
help_activate (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
@@ -69,7 +73,7 @@ help_activate (GSimpleAction *action,
|
||||
GtkWidget *status;
|
||||
|
||||
status = GTK_WIDGET (g_object_get_data (G_OBJECT (user_data), "status"));
|
||||
status_message (GTK_STATUSBAR (status), "Help not available");
|
||||
status_message (status, "Help not available");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -82,7 +86,7 @@ not_implemented (GSimpleAction *action,
|
||||
|
||||
text = g_strdup_printf ("Action “%s” not implemented", g_action_get_name (G_ACTION (action)));
|
||||
status = GTK_WIDGET (g_object_get_data (G_OBJECT (user_data), "status"));
|
||||
status_message (GTK_STATUSBAR (status), text);
|
||||
status_message (status, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 985 B After Width: | Height: | Size: 1019 B |
@@ -6,8 +6,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
@@ -49,20 +47,23 @@ css_text_changed (GtkTextBuffer *buffer,
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_css_provider_load_from_data (provider, text, -1);
|
||||
gtk_css_provider_load_from_string (provider, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_provider (gpointer data)
|
||||
{
|
||||
GtkStyleProvider *provider = data;
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
}
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
for (child = gtk_widget_get_first_child (widget);
|
||||
child != NULL;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
apply_css (child, provider);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (), provider, G_MAXUINT);
|
||||
g_object_set_data_full (G_OBJECT (widget), "provider", provider, clear_provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
@@ -81,6 +82,7 @@ do_css_basics (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Basics");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
gtk_widget_add_css_class (window, "demo");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
text = gtk_text_buffer_new (NULL);
|
||||
|
@@ -4,23 +4,24 @@
|
||||
* anymore. :)
|
||||
*/
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
@import url("resource://css_basics/reset.css");
|
||||
/* This resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use
|
||||
*/
|
||||
@import url("resource://css_shadows/reset.css");
|
||||
|
||||
/* Set a very futuristic style by default */
|
||||
* {
|
||||
.demo * {
|
||||
color: green;
|
||||
font-family: Monospace;
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
window {
|
||||
window.demo {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
/* Make sure selections are visible */
|
||||
selection {
|
||||
.demo selection {
|
||||
background-color: darkGreen;
|
||||
color: black;
|
||||
}
|
||||
|
@@ -6,8 +6,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
@@ -50,33 +48,23 @@ css_text_changed (GtkTextBuffer *buffer,
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_css_provider_load_from_data (provider, text, -1);
|
||||
gtk_css_provider_load_from_string (provider, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static void
|
||||
drawing_area_draw (GtkDrawingArea *da,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
gpointer data)
|
||||
clear_provider (gpointer data)
|
||||
{
|
||||
GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (da));
|
||||
GtkStyleProvider *provider = data;
|
||||
|
||||
gtk_render_background (context, cr, 0, 0, width, height);
|
||||
gtk_render_frame (context, cr, 0, 0, width, height);
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
}
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
for (child = gtk_widget_get_first_child (widget);
|
||||
child != NULL;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
apply_css (child, provider);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (), provider, G_MAXUINT);
|
||||
g_object_set_data_full (G_OBJECT (widget), "provider", provider, clear_provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
@@ -95,16 +83,17 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Multiple Backgrounds");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
gtk_widget_add_css_class (window, "demo");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
overlay = gtk_overlay_new ();
|
||||
gtk_window_set_child (GTK_WINDOW (window), overlay);
|
||||
|
||||
child = gtk_drawing_area_new ();
|
||||
/* Don't set a draw_func, since we are only interested in CSS drawing,
|
||||
* which happens automatically.
|
||||
*/
|
||||
gtk_widget_set_name (child, "canvas");
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (child),
|
||||
drawing_area_draw,
|
||||
NULL, NULL);
|
||||
gtk_overlay_set_child (GTK_OVERLAY (overlay), child);
|
||||
|
||||
child = gtk_button_new ();
|
||||
|
@@ -7,8 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
@@ -51,20 +49,23 @@ css_text_changed (GtkTextBuffer *buffer,
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_css_provider_load_from_data (provider, text, -1);
|
||||
gtk_css_provider_load_from_string (provider, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_provider (gpointer data)
|
||||
{
|
||||
GtkStyleProvider *provider = data;
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
}
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
for (child = gtk_widget_get_first_child (widget);
|
||||
child != NULL;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
apply_css (child, provider);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (), provider, G_MAXUINT);
|
||||
g_object_set_data_full (G_OBJECT (widget), "provider", provider, clear_provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
@@ -83,6 +84,7 @@ do_css_pixbufs (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Animated Backgrounds");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
gtk_widget_add_css_class (window, "demo");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
|
@@ -50,7 +50,7 @@
|
||||
100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto; }
|
||||
}
|
||||
|
||||
window {
|
||||
window.demo {
|
||||
background-image: url("resource://css_pixbufs/images/apple-red.png"),
|
||||
url("resource://css_pixbufs/images/gnome-applets.png"),
|
||||
url("resource://css_pixbufs/images/gnome-calendar.png"),
|
||||
@@ -66,11 +66,11 @@ window {
|
||||
}
|
||||
|
||||
/* Make the text editor has a nice style */
|
||||
.view, scrollbar, separator {
|
||||
window.demo .view, scrollbar, separator {
|
||||
color: black;
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.view:selected {
|
||||
window.demo .view:selected {
|
||||
background-color: rgba(127,127,255,0.5);
|
||||
}
|
||||
|
@@ -5,8 +5,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static void
|
||||
show_parsing_error (GtkCssProvider *provider,
|
||||
GtkCssSection *section,
|
||||
@@ -48,20 +46,23 @@ css_text_changed (GtkTextBuffer *buffer,
|
||||
gtk_text_buffer_remove_all_tags (buffer, &start, &end);
|
||||
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_css_provider_load_from_data (provider, text, -1);
|
||||
gtk_css_provider_load_from_string (provider, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_provider (gpointer data)
|
||||
{
|
||||
GtkStyleProvider *provider = data;
|
||||
|
||||
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||
}
|
||||
|
||||
static void
|
||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
||||
for (child = gtk_widget_get_first_child (widget);
|
||||
child != NULL;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
apply_css (child, provider);
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (), provider, G_MAXUINT);
|
||||
g_object_set_data_full (G_OBJECT (widget), "provider", provider, clear_provider);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -101,6 +102,7 @@ do_css_shadows (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Shadows");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
gtk_widget_add_css_class (window, "demo");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
@@ -142,7 +144,7 @@ do_css_shadows (GtkWidget *do_widget)
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
|
@@ -5,12 +5,13 @@
|
||||
*/
|
||||
|
||||
/* This CSS resets all properties to their defaults values
|
||||
* and overrides all user settings and the theme in use */
|
||||
* and overrides all user settings and the theme in use
|
||||
*/
|
||||
@import url("resource://css_shadows/reset.css");
|
||||
@import url("resource://css_shadows/cssview.css");
|
||||
|
||||
/* Get a nice background for the window */
|
||||
.background {
|
||||
window.demo.background {
|
||||
background-color: #4870bc;
|
||||
background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%),
|
||||
linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%),
|
||||
@@ -19,7 +20,7 @@
|
||||
background-size: 29px, 59px, 73px, 109px;
|
||||
}
|
||||
|
||||
button {
|
||||
window.demo button {
|
||||
color: black;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
@@ -27,18 +28,15 @@ button {
|
||||
border: 1px transparent solid;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
window.demo button:hover {
|
||||
text-shadow: 3px 3px 5px alpha(black, 0.75);
|
||||
-gtk-icon-shadow: 3px 3px 5px alpha(black, 0.75);
|
||||
box-shadow: 3px 3px 5px alpha(black, 0.5) inset;
|
||||
border: solid 1px alpha(black, 0.75);
|
||||
}
|
||||
|
||||
button:active {
|
||||
window.demo button:active {
|
||||
padding: 11px 9px 9px 11px;
|
||||
text-shadow: 1px 1px 2.5px alpha(black, 0.6);
|
||||
-gtk-icon-shadow: 1px 1px 2.5px alpha(black, 0.6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -1,21 +1,21 @@
|
||||
/* Make the text editor has a nice style */
|
||||
.view {
|
||||
window.demo .view {
|
||||
color: #2e3436;
|
||||
font-family: Monospace;
|
||||
background-color: alpha(white, 0.30);
|
||||
}
|
||||
|
||||
.view:selected {
|
||||
window.demo .view:selected {
|
||||
color: white;
|
||||
background-color: #4a90d9;
|
||||
}
|
||||
|
||||
scrollbar trough,
|
||||
window.demo scrollbar trough,
|
||||
.scrollbars-junction {
|
||||
background-color: alpha(white, 0.80);
|
||||
}
|
||||
|
||||
scrollbar slider {
|
||||
window.demo scrollbar slider {
|
||||
border-width: 3px;
|
||||
border-style: solid;
|
||||
border-radius: 10px;
|
||||
@@ -24,11 +24,11 @@ scrollbar slider {
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
scrollbar slider:hover {
|
||||
window.demo scrollbar slider:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
paned separator {
|
||||
window.demo paned separator {
|
||||
background-color: alpha(white, 0.80);
|
||||
background-image: linear-gradient(transparent, transparent 1px, #999 1px, #999 4px, transparent 4px);
|
||||
background-size: 40px auto;
|
||||
@@ -36,6 +36,6 @@ paned separator {
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
paned separator:hover {
|
||||
window.demo paned separator:hover {
|
||||
background-image: linear-gradient(transparent, transparent 1px, #555 1px, #555 4px, transparent 4px);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -127,6 +127,7 @@
|
||||
<file>fishbowl.ui</file>
|
||||
<file>gtkfishbowl.c</file>
|
||||
<file>gtkfishbowl.h</file>
|
||||
<file>tiger.node</file>
|
||||
</gresource>
|
||||
<gresource prefix="/frames">
|
||||
<file>frames.ui</file>
|
||||
@@ -335,6 +336,11 @@
|
||||
<file>paintable_symbolic.c</file>
|
||||
<file>panes.c</file>
|
||||
<file>password_entry.c</file>
|
||||
<file>path_fill.c</file>
|
||||
<file>path_maze.c</file>
|
||||
<file>path_spinner.c</file>
|
||||
<file>path_walk.c</file>
|
||||
<file>path_text.c</file>
|
||||
<file>peg_solitaire.c</file>
|
||||
<file>pickers.c</file>
|
||||
<file>printing.c</file>
|
||||
@@ -420,6 +426,13 @@
|
||||
<gresource prefix="/fontrendering">
|
||||
<file>fontrendering.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/path_walk">
|
||||
<file>path_walk.ui</file>
|
||||
<file compressed="true">path_world.txt</file>
|
||||
</gresource>
|
||||
<gresource prefix="/path_text">
|
||||
<file>path_text.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/Demo4">
|
||||
<file>icons/16x16/actions/application-exit.png</file>
|
||||
<file>icons/16x16/actions/document-new.png</file>
|
||||
|
@@ -208,7 +208,13 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="statusbar1"/>
|
||||
<object class="GtkLabel" id="statusbar1">
|
||||
<property name="xalign">0</property>
|
||||
<property name="margin-start">2</property>
|
||||
<property name="margin-end">2</property>
|
||||
<property name="margin-top">2</property>
|
||||
<property name="margin-bottom">2</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
@@ -75,7 +75,9 @@ query_tooltip (GtkWidget *widget,
|
||||
gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
|
||||
|
||||
precision = 1;
|
||||
s = NULL;
|
||||
do {
|
||||
g_free (s);
|
||||
s = g_strdup_printf ("%.*f", precision, self->scale);
|
||||
l = strlen (s) - 1;
|
||||
while (s[l] == '0')
|
||||
|
@@ -18,8 +18,7 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __DEMO_TAGGED_ENTRY_H__
|
||||
#define __DEMO_TAGGED_ENTRY_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -57,5 +56,3 @@ void demo_tagged_entry_tag_set_has_close_button (DemoTaggedEntryTag *
|
||||
gboolean has_close_button);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __DEMO_TAGGED_ENTRY_H__ */
|
||||
|
@@ -34,7 +34,7 @@ transition (GtkWidget *widget,
|
||||
{
|
||||
DemoWidget *self = DEMO_WIDGET (widget);
|
||||
DemoLayout *demo_layout = DEMO_LAYOUT (gtk_widget_get_layout_manager (widget));
|
||||
gint64 now = g_get_monotonic_time ();
|
||||
gint64 now = gdk_frame_clock_get_frame_time (frame_clock);
|
||||
|
||||
gtk_widget_queue_allocate (widget);
|
||||
|
||||
@@ -66,11 +66,13 @@ clicked (GtkGestureClick *gesture,
|
||||
gpointer data)
|
||||
{
|
||||
DemoWidget *self = data;
|
||||
GdkFrameClock *frame_clock;
|
||||
|
||||
if (self->tick_id != 0)
|
||||
return;
|
||||
|
||||
self->start_time = g_get_monotonic_time ();
|
||||
frame_clock = gtk_widget_get_frame_clock (GTK_WIDGET (self));
|
||||
self->start_time = gdk_frame_clock_get_frame_time (frame_clock);
|
||||
self->tick_id = gtk_widget_add_tick_callback (GTK_WIDGET (self), transition, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@@ -760,9 +760,7 @@ do_dnd (GtkWidget *do_widget)
|
||||
GtkCssProvider *provider;
|
||||
GString *css;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
button = gtk_color_button_new ();
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
button = gtk_color_dialog_button_new (gtk_color_dialog_new ());
|
||||
g_object_unref (g_object_ref_sink (button));
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -10,8 +10,6 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static void
|
||||
@@ -45,21 +43,22 @@ do_expander (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
toplevel = GTK_WIDGET (gtk_widget_get_root (do_widget));
|
||||
window = gtk_message_dialog_new_with_markup (GTK_WINDOW (toplevel),
|
||||
0,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"<big><b>%s</b></big>",
|
||||
"Something went wrong");
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (window),
|
||||
"Here are some more details "
|
||||
"but not the full story.");
|
||||
|
||||
area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (window));
|
||||
|
||||
label = gtk_widget_get_last_child (area);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Expander");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (toplevel));
|
||||
area = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
|
||||
gtk_widget_set_margin_start (area, 10);
|
||||
gtk_widget_set_margin_end (area, 10);
|
||||
gtk_widget_set_margin_top (area, 10);
|
||||
gtk_widget_set_margin_bottom (area, 10);
|
||||
gtk_window_set_child (GTK_WINDOW (window), area);
|
||||
label = gtk_label_new ("<big><b>Something went wrong</b></big>");
|
||||
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
|
||||
gtk_box_append (GTK_BOX (area), label);
|
||||
label = gtk_label_new ("Here are some more details but not the full story");
|
||||
gtk_label_set_wrap (GTK_LABEL (label), FALSE);
|
||||
gtk_widget_set_vexpand (label, FALSE);
|
||||
gtk_box_append (GTK_BOX (area), label);
|
||||
|
||||
expander = gtk_expander_new ("Details:");
|
||||
gtk_widget_set_vexpand (expander, TRUE);
|
||||
@@ -122,7 +121,7 @@ do_expander (GtkWidget *do_widget)
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
|
@@ -11,6 +11,9 @@
|
||||
#include "gtkgears.h"
|
||||
#include "gskshaderpaintable.h"
|
||||
|
||||
#include "nodewidget.h"
|
||||
#include "graphwidget.h"
|
||||
|
||||
const char *const css =
|
||||
".blurred-button {"
|
||||
" box-shadow: 0px 0px 5px 10px rgba(0, 0, 0, 0.5);"
|
||||
@@ -68,13 +71,11 @@ create_blurred_button (void)
|
||||
return w;
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
static GtkWidget *
|
||||
create_font_button (void)
|
||||
{
|
||||
return gtk_font_button_new ();
|
||||
return gtk_font_dialog_button_new (gtk_font_dialog_new ());
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
static GtkWidget *
|
||||
create_level_bar (void)
|
||||
@@ -203,6 +204,18 @@ create_menu_button (void)
|
||||
return w;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_tiger (void)
|
||||
{
|
||||
return node_widget_new ("/fishbowl/tiger.node");
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_graph (void)
|
||||
{
|
||||
return graph_widget_new ();
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
GtkWidget * (*create_func) (void);
|
||||
@@ -220,6 +233,8 @@ static const struct {
|
||||
{ "Switch", create_switch },
|
||||
{ "Menubutton", create_menu_button },
|
||||
{ "Shader", create_cogs },
|
||||
{ "Tiger", create_tiger },
|
||||
{ "Graph", create_graph },
|
||||
};
|
||||
|
||||
static int selected_widget_type = -1;
|
||||
@@ -310,11 +325,20 @@ do_fishbowl (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkBuilderScope *scope;
|
||||
GtkWidget *bowl;
|
||||
|
||||
g_type_ensure (GTK_TYPE_FISHBOWL);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/fishbowl/fishbowl.ui");
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback (GTK_BUILDER_CSCOPE (scope), fishbowl_prev_button_clicked_cb);
|
||||
gtk_builder_cscope_add_callback (GTK_BUILDER_CSCOPE (scope), fishbowl_next_button_clicked_cb);
|
||||
gtk_builder_cscope_add_callback (GTK_BUILDER_CSCOPE (scope), fishbowl_changes_toggled_cb);
|
||||
gtk_builder_cscope_add_callback (GTK_BUILDER_CSCOPE (scope), format_header_cb);
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
gtk_builder_add_from_resource (builder, "/fishbowl/fishbowl.ui", NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
@@ -326,6 +350,7 @@ do_fishbowl (GtkWidget *do_widget)
|
||||
|
||||
gtk_widget_realize (window);
|
||||
g_object_unref (builder);
|
||||
g_object_unref (scope);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -1586,7 +1586,7 @@ update_font_variations (void)
|
||||
}
|
||||
|
||||
gtk_grid_attach (GTK_GRID (demo->variations_grid), combo, 1, -1, 3, 1);
|
||||
g_signal_connect (combo, "notify::selecte", G_CALLBACK (instance_changed), NULL);
|
||||
g_signal_connect (combo, "notify::selected", G_CALLBACK (instance_changed), NULL);
|
||||
demo->instance_combo = combo;
|
||||
}
|
||||
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_FONT_PLANE_H__
|
||||
#define __GTK_FONT_PLANE_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -60,5 +59,3 @@ GtkWidget * gtk_font_plane_new (GtkAdjustment *width_adj,
|
||||
GtkAdjustment *weight_adj);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_FONT_PLANE_H__ */
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
153
demos/gtk-demo/graphwidget.c
Normal file
@@ -0,0 +1,153 @@
|
||||
#include "graphwidget.h"
|
||||
|
||||
struct _GraphWidget
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GskPath *path;
|
||||
GskStroke *stroke;
|
||||
GdkRGBA color;
|
||||
|
||||
guint tick_cb;
|
||||
guint64 start_time;
|
||||
|
||||
double period;
|
||||
double amplitude;
|
||||
};
|
||||
|
||||
struct _GraphWidgetClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GraphWidget, graph_widget, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
update_path (GraphWidget *self,
|
||||
float amplitude)
|
||||
{
|
||||
graphene_point_t p[20];
|
||||
GskPathBuilder *builder;
|
||||
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
p[i].x = 10 * i;
|
||||
p[i].y = 50;
|
||||
|
||||
if (i % 4 == 1 || i % 4 == 2)
|
||||
{
|
||||
if (i % 8 < 4)
|
||||
p[i].y += amplitude;
|
||||
else
|
||||
p[i].y -= amplitude;
|
||||
}
|
||||
}
|
||||
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_move_to (builder, p[0].x, p[0].y);
|
||||
|
||||
for (int i = 0; i < 20; i += 4)
|
||||
gsk_path_builder_cubic_to (builder,
|
||||
p[i+1].x, p[i+1].y,
|
||||
p[i+2].x, p[i+2].y,
|
||||
p[i+3].x, p[i+3].y);
|
||||
|
||||
self->path = gsk_path_builder_free_to_path (builder);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tick_cb (GtkWidget *widget,
|
||||
GdkFrameClock *frame_clock,
|
||||
gpointer user_data)
|
||||
{
|
||||
GraphWidget *self = GRAPH_WIDGET (widget);
|
||||
guint64 now;
|
||||
double angle;
|
||||
|
||||
now = gdk_frame_clock_get_frame_time (frame_clock);
|
||||
|
||||
if (self->start_time == 0)
|
||||
self->start_time = now;
|
||||
|
||||
angle = 360 * (now - self->start_time) / (double)(self->period * G_TIME_SPAN_MINUTE);
|
||||
update_path (self, sin (angle) * self->amplitude);
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
graph_widget_init (GraphWidget *self)
|
||||
{
|
||||
self->color.red = g_random_double_range (0, 1);
|
||||
self->color.green = g_random_double_range (0, 1);
|
||||
self->color.blue = g_random_double_range (0, 1);
|
||||
self->color.alpha = 1;
|
||||
|
||||
self->period = g_random_double_range (0.5, 1);
|
||||
self->amplitude = g_random_double_range (10, 25);
|
||||
|
||||
self->stroke = gsk_stroke_new (2);
|
||||
|
||||
update_path (self, 0);
|
||||
|
||||
self->start_time = 0;
|
||||
self->tick_cb = gtk_widget_add_tick_callback (GTK_WIDGET (self), tick_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
graph_widget_dispose (GObject *object)
|
||||
{
|
||||
GraphWidget *self = GRAPH_WIDGET (object);
|
||||
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
gsk_stroke_free (self->stroke);
|
||||
|
||||
G_OBJECT_CLASS (graph_widget_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
graph_widget_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
GraphWidget *self = GRAPH_WIDGET (widget);
|
||||
|
||||
gtk_snapshot_append_stroke (snapshot, self->path, self->stroke, &self->color);
|
||||
}
|
||||
|
||||
static void
|
||||
graph_widget_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
*minimum = *natural = 200;
|
||||
else
|
||||
*minimum = *natural = 100;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
graph_widget_class_init (GraphWidgetClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->dispose = graph_widget_dispose;
|
||||
|
||||
widget_class->snapshot = graph_widget_snapshot;
|
||||
widget_class->measure = graph_widget_measure;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
graph_widget_new (void)
|
||||
{
|
||||
return g_object_new (GRAPH_TYPE_WIDGET, NULL);
|
||||
}
|
8
demos/gtk-demo/graphwidget.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define GRAPH_TYPE_WIDGET (graph_widget_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GraphWidget, graph_widget, GRAPH, WIDGET, GtkWidget)
|
||||
|
||||
GtkWidget * graph_widget_new (void);
|
@@ -17,8 +17,7 @@
|
||||
* Authors: Matthias Clasen <mclasen@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __GSK_SHADER_PAINTABLE_H__
|
||||
#define __GSK_SHADER_PAINTABLE_H__
|
||||
#pragma once
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gsk/gsk.h>
|
||||
@@ -42,5 +41,3 @@ void gsk_shader_paintable_update_time (GskShaderPaintable *self
|
||||
int time_idx,
|
||||
gint64 frame_time);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSK_SHADER_PAINTABLE_H__ */
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_FISHBOWL_H__
|
||||
#define __GTK_FISHBOWL_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -65,5 +64,3 @@ void gtk_fishbowl_set_creation_func (GtkFishbowl *fishbowl,
|
||||
GtkFishCreationFunc creation_func);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_FISHBOWL_H__ */
|
||||
|
@@ -840,24 +840,24 @@ gtk_gears_unrealize (GtkWidget *widget)
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private ((GtkGears *) widget);
|
||||
|
||||
gtk_gl_area_make_current (glarea);
|
||||
if (gtk_gl_area_get_error (glarea) != NULL)
|
||||
return;
|
||||
if (gtk_gl_area_get_error (glarea) == NULL)
|
||||
{
|
||||
/* Release the resources associated with OpenGL */
|
||||
if (priv->gear_vbo[0] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[0]));
|
||||
|
||||
/* Release the resources associated with OpenGL */
|
||||
if (priv->gear_vbo[0] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[0]));
|
||||
if (priv->gear_vbo[1] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[1]));
|
||||
|
||||
if (priv->gear_vbo[1] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[1]));
|
||||
if (priv->gear_vbo[2] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[2]));
|
||||
|
||||
if (priv->gear_vbo[2] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[2]));
|
||||
if (priv->vao != 0)
|
||||
glDeleteVertexArrays (1, &priv->vao);
|
||||
|
||||
if (priv->vao != 0)
|
||||
glDeleteVertexArrays (1, &priv->vao);
|
||||
|
||||
if (priv->program != 0)
|
||||
glDeleteProgram (priv->program);
|
||||
if (priv->program != 0)
|
||||
glDeleteProgram (priv->program);
|
||||
}
|
||||
|
||||
priv->ModelViewProjectionMatrix_location = 0;
|
||||
priv->NormalMatrix_location = 0;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef __GTK_GEARS_H__
|
||||
#define __GTK_GEARS_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -44,5 +43,3 @@ void gtk_gears_set_fps_label (GtkGears *gears,
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_GEARS_H__ */
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef __GTK_SHADER_BIN_H__
|
||||
#define __GTK_SHADER_BIN_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -19,5 +18,3 @@ void gtk_shader_bin_set_child (GtkShaderBin *self,
|
||||
GtkWidget *gtk_shader_bin_get_child (GtkShaderBin *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_SHADER_BIN_H__ */
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef __GTK_SHADER_STACK_H__
|
||||
#define __GTK_SHADER_STACK_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -19,5 +18,3 @@ void gtk_shader_stack_set_active (GtkShaderStack *self,
|
||||
int index);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_SHADER_STACK_H__ */
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef __GTK_SHADERTOY_H__
|
||||
#define __GTK_SHADERTOY_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -30,5 +29,3 @@ void gtk_shadertoy_set_image_shader (GtkShadertoy *shadertoy,
|
||||
const char *shader);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_SHADERTOY_H__ */
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -354,10 +354,18 @@ do_iconscroll (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkBuilderScope *scope;
|
||||
GtkWidget *label;
|
||||
guint id;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/iconscroll/iconscroll.ui");
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback (GTK_BUILDER_CSCOPE (scope), iconscroll_prev_clicked_cb);
|
||||
gtk_builder_cscope_add_callback (GTK_BUILDER_CSCOPE (scope), iconscroll_next_clicked_cb);
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
|
||||
gtk_builder_add_from_resource (builder, "/iconscroll/iconscroll.ui", NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
@@ -375,6 +383,7 @@ do_iconscroll (GtkWidget *do_widget)
|
||||
GUINT_TO_POINTER (id), remove_timeout);
|
||||
|
||||
g_object_unref (builder);
|
||||
g_object_unref (scope);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef LANGUAGE_NAMES_H
|
||||
#define LANGUAGE_NAMES_H
|
||||
#pragma once
|
||||
|
||||
#include <pango/pango.h>
|
||||
|
||||
@@ -9,5 +8,3 @@ const char * get_language_name (PangoLanguage *language);
|
||||
const char * get_language_name_for_tag (guint32 tag);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include "demos.h"
|
||||
#include "fontify.h"
|
||||
|
||||
#include "demo_conf.h"
|
||||
#include "profile_conf.h"
|
||||
|
||||
static GtkWidget *info_view;
|
||||
static GtkWidget *source_view;
|
||||
|
@@ -72,6 +72,11 @@ demos = files([
|
||||
'paintable_symbolic.c',
|
||||
'panes.c',
|
||||
'password_entry.c',
|
||||
'path_fill.c',
|
||||
'path_maze.c',
|
||||
'path_spinner.c',
|
||||
'path_walk.c',
|
||||
'path_text.c',
|
||||
'peg_solitaire.c',
|
||||
'pickers.c',
|
||||
'printing.c',
|
||||
@@ -136,6 +141,8 @@ extra_demo_sources = files([
|
||||
'unicode-names.c',
|
||||
'suggestionentry.c',
|
||||
'language-names.c',
|
||||
'nodewidget.c',
|
||||
'graphwidget.c',
|
||||
])
|
||||
|
||||
if os_unix
|
||||
@@ -150,8 +157,6 @@ if librsvg_dep.found()
|
||||
gtkdemo_deps += [ librsvg_dep ]
|
||||
endif
|
||||
|
||||
gtkdemo_args = [ '-DGDK_DISABLE_DEPRECATED', '-DGTK_DISABLE_DEPRECATED', ]
|
||||
|
||||
demos_h = custom_target('gtk4 demo header',
|
||||
output: 'demos.h',
|
||||
input: demos,
|
||||
@@ -206,6 +211,7 @@ if can_use_objcopy_for_resources
|
||||
output : 'gtkdemo_resources2.o',
|
||||
command : [objcopy,
|
||||
'--strip-all',
|
||||
'--set-section-alignment', '.data=8',
|
||||
'--add-symbol','_g_binary_gtkdemo_resource_data=.data:0',
|
||||
'@INPUT@',
|
||||
'@OUTPUT@'])
|
||||
@@ -230,11 +236,11 @@ foreach flag: common_cflags
|
||||
endif
|
||||
endforeach
|
||||
|
||||
gtkdemo_deps += [ demo_conf_h ]
|
||||
gtkdemo_deps += [ profile_conf_h ]
|
||||
|
||||
executable('gtk4-demo',
|
||||
sources: [demos, demos_h, extra_demo_sources, gtkdemo_resources],
|
||||
c_args: gtkdemo_args + demo_cflags,
|
||||
c_args: demo_cflags,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
win_subsystem: 'windows',
|
||||
@@ -244,7 +250,7 @@ executable('gtk4-demo',
|
||||
|
||||
executable('gtk4-demo-application',
|
||||
sources: ['application.c', gtkdemo_resources],
|
||||
c_args: gtkdemo_args + common_cflags,
|
||||
c_args: common_cflags,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
win_subsystem: 'windows',
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.7 KiB |
76
demos/gtk-demo/nodewidget.c
Normal file
@@ -0,0 +1,76 @@
|
||||
#include "nodewidget.h"
|
||||
|
||||
struct _NodeWidget
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GskRenderNode *node;
|
||||
};
|
||||
|
||||
struct _NodeWidgetClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NodeWidget, node_widget, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
node_widget_init (NodeWidget *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
node_widget_dispose (GObject *object)
|
||||
{
|
||||
NodeWidget *self = NODE_WIDGET (object);
|
||||
|
||||
gsk_render_node_unref (self->node);
|
||||
|
||||
G_OBJECT_CLASS (node_widget_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
node_widget_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
NodeWidget *self = NODE_WIDGET (widget);
|
||||
|
||||
gtk_snapshot_append_node (snapshot, self->node);
|
||||
}
|
||||
|
||||
static void
|
||||
node_widget_class_init (NodeWidgetClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->dispose = node_widget_dispose;
|
||||
|
||||
widget_class->snapshot = node_widget_snapshot;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
node_widget_new (const char *resource)
|
||||
{
|
||||
NodeWidget *self;
|
||||
GBytes *bytes;
|
||||
GskRenderNode *node;
|
||||
graphene_rect_t bounds;
|
||||
float scale;
|
||||
GskTransform *transform;
|
||||
|
||||
self = g_object_new (NODE_TYPE_WIDGET, NULL);
|
||||
|
||||
bytes = g_resources_lookup_data (resource, 0, NULL);
|
||||
node = gsk_render_node_deserialize (bytes, NULL, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
gsk_render_node_get_bounds (node, &bounds);
|
||||
scale = MIN (100.0/bounds.size.width, 100.0/bounds.size.height);
|
||||
transform = gsk_transform_scale (NULL, scale, scale);
|
||||
self->node = gsk_transform_node_new (node, transform);
|
||||
gsk_transform_unref (transform);
|
||||
gsk_render_node_unref (node);
|
||||
|
||||
return GTK_WIDGET (self);
|
||||
}
|
8
demos/gtk-demo/nodewidget.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define NODE_TYPE_WIDGET (node_widget_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (NodeWidget, node_widget, NODE, WIDGET, GtkWidget)
|
||||
|
||||
GtkWidget * node_widget_new (const char *file);
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -7,8 +7,6 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
enum {
|
||||
COLOR_SET,
|
||||
N_SIGNALS
|
||||
@@ -124,19 +122,16 @@ drawing_area_unmap (GtkWidget *widget)
|
||||
|
||||
static void
|
||||
drawing_area_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
DrawingArea *area = (DrawingArea *) widget;
|
||||
GtkAllocation allocation;
|
||||
int width, height;
|
||||
cairo_t *cr;
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
cr = gtk_snapshot_append_cairo (snapshot,
|
||||
&GRAPHENE_RECT_INIT (
|
||||
0, 0,
|
||||
allocation.width,
|
||||
allocation.height
|
||||
));
|
||||
width = gtk_widget_get_width (widget);
|
||||
height = gtk_widget_get_height (widget);
|
||||
|
||||
cr = gtk_snapshot_append_cairo (snapshot, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_paint (cr);
|
||||
@@ -145,7 +140,7 @@ drawing_area_snapshot (GtkWidget *widget,
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_set_source_rgb (cr, 0.6, 0.6, 0.6);
|
||||
cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
@@ -53,7 +53,9 @@ gtk_nuclear_snapshot (GtkSnapshot *snapshot,
|
||||
double rotation)
|
||||
{
|
||||
#define RADIUS 0.3
|
||||
cairo_t *cr;
|
||||
GskPathBuilder *builder;
|
||||
GskPath *path;
|
||||
GskStroke *stroke;
|
||||
double size;
|
||||
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
@@ -61,24 +63,29 @@ gtk_nuclear_snapshot (GtkSnapshot *snapshot,
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
|
||||
size = MIN (width, height);
|
||||
cr = gtk_snapshot_append_cairo (snapshot,
|
||||
&GRAPHENE_RECT_INIT ((width - size) / 2.0,
|
||||
(height - size) / 2.0,
|
||||
size, size));
|
||||
gdk_cairo_set_source_rgba (cr, foreground);
|
||||
cairo_translate (cr, width / 2.0, height / 2.0);
|
||||
cairo_scale (cr, size, size);
|
||||
cairo_rotate (cr, rotation);
|
||||
|
||||
cairo_arc (cr, 0, 0, 0.1, - G_PI, G_PI);
|
||||
cairo_fill (cr);
|
||||
gtk_snapshot_save (snapshot);
|
||||
|
||||
cairo_set_line_width (cr, RADIUS);
|
||||
cairo_set_dash (cr, (double[1]) { RADIUS * G_PI / 3 }, 1, 0.0);
|
||||
cairo_arc (cr, 0, 0, RADIUS, - G_PI, G_PI);
|
||||
cairo_stroke (cr);
|
||||
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (width / 2.0, height / 2.0));
|
||||
gtk_snapshot_scale (snapshot, size, size);
|
||||
gtk_snapshot_rotate (snapshot, rotation);
|
||||
|
||||
cairo_destroy (cr);
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_add_circle (builder, graphene_point_zero (), 0.1);
|
||||
path = gsk_path_builder_free_to_path (builder);
|
||||
gtk_snapshot_append_fill (snapshot, path, GSK_FILL_RULE_WINDING, foreground);
|
||||
gsk_path_unref (path);
|
||||
|
||||
stroke = gsk_stroke_new (RADIUS);
|
||||
gsk_stroke_set_dash (stroke, (float[1]) { RADIUS * G_PI / 3 }, 1);
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_add_circle (builder, graphene_point_zero(), RADIUS);
|
||||
path = gsk_path_builder_free_to_path (builder);
|
||||
gtk_snapshot_append_stroke (snapshot, path, stroke, foreground);
|
||||
gsk_path_unref (path);
|
||||
gsk_stroke_free (stroke);
|
||||
|
||||
gtk_snapshot_restore (snapshot);
|
||||
}
|
||||
|
||||
/* Here, we implement the functionality required by the GdkPaintable interface */
|
||||
|
@@ -1,5 +1,4 @@
|
||||
#ifndef __PAINTABLE_H__
|
||||
#define __PAINTABLE_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -13,5 +12,3 @@ void gtk_nuclear_snapshot (GtkSnapshot *snapshot,
|
||||
GdkPaintable * gtk_nuclear_icon_new (double rotation);
|
||||
GdkPaintable * gtk_nuclear_animation_new (gboolean draw_background);
|
||||
GtkMediaStream *gtk_nuclear_media_stream_new (void);
|
||||
|
||||
#endif /* __PAINTABLE_H__ */
|
||||
|
@@ -70,7 +70,7 @@ gtk_nuclear_animation_snapshot (GdkPaintable *paintable,
|
||||
? &(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 } /* yellow */
|
||||
: &(GdkRGBA) { 0, 0, 0, 0 }, /* transparent */
|
||||
width, height,
|
||||
2 * G_PI * nuclear->progress / MAX_PROGRESS);
|
||||
360 * nuclear->progress / MAX_PROGRESS);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
@@ -85,7 +85,7 @@ gtk_nuclear_animation_get_current_image (GdkPaintable *paintable)
|
||||
* Luckily we added the rotation property to the nuclear icon
|
||||
* object previously, so we can just return an instance of that one.
|
||||
*/
|
||||
return gtk_nuclear_icon_new (2 * G_PI * nuclear->progress / MAX_PROGRESS);
|
||||
return gtk_nuclear_icon_new (360 * nuclear->progress / MAX_PROGRESS);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
|
@@ -76,7 +76,7 @@ gtk_nuclear_media_stream_snapshot (GdkPaintable *paintable,
|
||||
&(GdkRGBA) { 0, 0, 0, 1 }, /* black */
|
||||
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 }, /* yellow */
|
||||
width, height,
|
||||
2 * G_PI * nuclear->progress / DURATION);
|
||||
360 * nuclear->progress / DURATION);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
@@ -85,7 +85,7 @@ gtk_nuclear_media_stream_get_current_image (GdkPaintable *paintable)
|
||||
GtkNuclearMediaStream *nuclear = GTK_NUCLEAR_MEDIA_STREAM (paintable);
|
||||
|
||||
/* Same thing as with the animation */
|
||||
return gtk_nuclear_icon_new (2 * G_PI * nuclear->progress / DURATION);
|
||||
return gtk_nuclear_icon_new (360 * nuclear->progress / DURATION);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
|
295
demos/gtk-demo/path_fill.c
Normal file
@@ -0,0 +1,295 @@
|
||||
/* Path/Fill and Stroke
|
||||
*
|
||||
* This demo shows how to use GskPath to draw shapes that are (a bit)
|
||||
* more complex than a rounded rectangle.
|
||||
*
|
||||
* It also demonstrates printing to a stream with GtkPrintDialog.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <cairo-pdf.h>
|
||||
|
||||
#include "paintable.h"
|
||||
|
||||
#define GTK_TYPE_LOGO_PAINTABLE (gtk_logo_paintable_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkLogoPaintable, gtk_logo_paintable, GTK, LOGO_PAINTABLE, GObject)
|
||||
|
||||
struct _GtkLogoPaintable
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
GskPath *path[3];
|
||||
GdkRGBA color[3];
|
||||
|
||||
GskPath *stroke_path;
|
||||
GskStroke *stroke1;
|
||||
GskStroke *stroke2;
|
||||
GdkRGBA stroke_color;
|
||||
};
|
||||
|
||||
struct _GtkLogoPaintableClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static int
|
||||
gtk_logo_paintable_get_intrinsic_width (GdkPaintable *paintable)
|
||||
{
|
||||
GtkLogoPaintable *self = GTK_LOGO_PAINTABLE (paintable);
|
||||
|
||||
return self->width;
|
||||
}
|
||||
|
||||
static int
|
||||
gtk_logo_paintable_get_intrinsic_height (GdkPaintable *paintable)
|
||||
{
|
||||
GtkLogoPaintable *self = GTK_LOGO_PAINTABLE (paintable);
|
||||
|
||||
return self->height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_logo_paintable_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
double width,
|
||||
double height)
|
||||
{
|
||||
GtkLogoPaintable *self = GTK_LOGO_PAINTABLE (paintable);
|
||||
|
||||
for (unsigned int i = 0; i < 3; i++)
|
||||
{
|
||||
gtk_snapshot_push_fill (snapshot, self->path[i], GSK_FILL_RULE_WINDING);
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
&self->color[i],
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
}
|
||||
for (unsigned int i = 0; i < 3; i++)
|
||||
{
|
||||
gtk_snapshot_push_stroke (snapshot, self->stroke_path, self->stroke1);
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
&self->stroke_color,
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
}
|
||||
|
||||
gtk_snapshot_push_stroke (snapshot, self->stroke_path, self->stroke2);
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
&self->stroke_color,
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
gtk_logo_paintable_get_flags (GdkPaintable *paintable)
|
||||
{
|
||||
return GDK_PAINTABLE_STATIC_CONTENTS | GDK_PAINTABLE_STATIC_SIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_logo_paintable_paintable_init (GdkPaintableInterface *iface)
|
||||
{
|
||||
iface->get_intrinsic_width = gtk_logo_paintable_get_intrinsic_width;
|
||||
iface->get_intrinsic_height = gtk_logo_paintable_get_intrinsic_height;
|
||||
iface->snapshot = gtk_logo_paintable_snapshot;
|
||||
iface->get_flags = gtk_logo_paintable_get_flags;
|
||||
}
|
||||
|
||||
/* When defining the GType, we need to implement the GdkPaintable interface */
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkLogoPaintable, gtk_logo_paintable, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_logo_paintable_paintable_init))
|
||||
|
||||
static void
|
||||
gtk_logo_paintable_dispose (GObject *object)
|
||||
{
|
||||
GtkLogoPaintable *self = GTK_LOGO_PAINTABLE (object);
|
||||
|
||||
for (unsigned int i = 0; i < 3; i++)
|
||||
gsk_path_unref (self->path[i]);
|
||||
|
||||
gsk_path_unref (self->stroke_path);
|
||||
|
||||
gsk_stroke_free (self->stroke1);
|
||||
gsk_stroke_free (self->stroke2);
|
||||
|
||||
G_OBJECT_CLASS (gtk_logo_paintable_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_logo_paintable_class_init (GtkLogoPaintableClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_logo_paintable_dispose;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_logo_paintable_init (GtkLogoPaintable *self)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_logo_paintable_new (void)
|
||||
{
|
||||
GtkLogoPaintable *self;
|
||||
graphene_rect_t bounds, bounds2;
|
||||
|
||||
self = g_object_new (GTK_TYPE_LOGO_PAINTABLE, NULL);
|
||||
|
||||
/* Paths and colors extracted from gtk-logo.svg */
|
||||
self->path[0] = gsk_path_parse ("m3.12,66.17 -2.06,-51.46 32.93,24.7 v55.58 l-30.87,-28.82 z");
|
||||
self->path[1] = gsk_path_parse ("m34,95 49.4,-20.58 4.12,-51.46 -53.52,16.47 v55.58 z");
|
||||
self->path[2] = gsk_path_parse ("m1.06,14.71 32.93,24.7 53.52,-16.47 -36.75,-21.88 -49.7,13.65 z");
|
||||
|
||||
gdk_rgba_parse (&self->color[0], "#e40000");
|
||||
gdk_rgba_parse (&self->color[1], "#7fe719");
|
||||
gdk_rgba_parse (&self->color[2], "#729fcf");
|
||||
|
||||
self->stroke_path = gsk_path_parse ("m50.6,51.3 -47.3,14 z l33,23 z v-50");
|
||||
self->stroke1 = gsk_stroke_new (2.12);
|
||||
self->stroke2 = gsk_stroke_new (1.25);
|
||||
gdk_rgba_parse (&self->stroke_color, "#ffffff");
|
||||
|
||||
gsk_path_get_stroke_bounds (self->path[0], self->stroke1, &bounds);
|
||||
gsk_path_get_stroke_bounds (self->path[1], self->stroke1, &bounds2);
|
||||
graphene_rect_union (&bounds, &bounds2, &bounds);
|
||||
gsk_path_get_stroke_bounds (self->path[2], self->stroke1, &bounds2);
|
||||
graphene_rect_union (&bounds, &bounds2, &bounds);
|
||||
gsk_path_get_stroke_bounds (self->stroke_path, self->stroke2, &bounds2);
|
||||
graphene_rect_union (&bounds, &bounds2, &bounds);
|
||||
|
||||
self->width = bounds.origin.x + bounds.size.width;
|
||||
self->height = bounds.origin.y + bounds.size.height;
|
||||
|
||||
return GDK_PAINTABLE (self);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
write_cairo (void *closure,
|
||||
const unsigned char *data,
|
||||
unsigned int length)
|
||||
{
|
||||
GOutputStream *stream = closure;
|
||||
gsize written;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_output_stream_write_all (stream, data, length, &written, NULL, &error))
|
||||
{
|
||||
g_print ("Error writing pdf stream: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
return CAIRO_STATUS_WRITE_ERROR;
|
||||
}
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
print_ready (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GtkPrintDialog *dialog = GTK_PRINT_DIALOG (source);
|
||||
GError *error = NULL;
|
||||
GOutputStream *stream;
|
||||
GtkSnapshot *snapshot;
|
||||
GdkPaintable *paintable;
|
||||
GskRenderNode *node;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
||||
stream = gtk_print_dialog_print_finish (dialog, result, &error);
|
||||
if (stream == NULL)
|
||||
{
|
||||
g_print ("Failed to get output stream: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
paintable = gtk_picture_get_paintable (GTK_PICTURE (data));
|
||||
gdk_paintable_snapshot (paintable, snapshot, 100, 100);
|
||||
node = gtk_snapshot_free_to_node (snapshot);
|
||||
|
||||
surface = cairo_pdf_surface_create_for_stream (write_cairo, stream, 100, 100);
|
||||
cr = cairo_create (surface);
|
||||
|
||||
gsk_render_node_draw (node, cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
cairo_surface_destroy (surface);
|
||||
gsk_render_node_unref (node);
|
||||
|
||||
if (!g_output_stream_close (stream, NULL, &error))
|
||||
{
|
||||
g_print ("Error from close: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_object_unref (stream);
|
||||
}
|
||||
|
||||
static void
|
||||
print (GtkButton *button,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *picture = data;
|
||||
GtkPrintDialog *dialog;
|
||||
|
||||
dialog = gtk_print_dialog_new ();
|
||||
|
||||
gtk_print_dialog_print (dialog,
|
||||
GTK_WINDOW (gtk_widget_get_root (picture)),
|
||||
NULL,
|
||||
NULL,
|
||||
print_ready,
|
||||
picture);
|
||||
|
||||
g_object_unref (dialog);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_path_fill (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *header, *button, *label;
|
||||
GtkWidget *picture;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 100, 100);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Fill and Stroke");
|
||||
header = gtk_header_bar_new ();
|
||||
button = gtk_button_new_from_icon_name ("printer-symbolic");
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), button);
|
||||
label = gtk_label_new ("Fill and Stroke");
|
||||
gtk_widget_add_css_class (label, "title");
|
||||
gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header), label);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
paintable = gtk_logo_paintable_new ();
|
||||
picture = gtk_picture_new_for_paintable (paintable);
|
||||
gtk_picture_set_content_fit (GTK_PICTURE (picture), GTK_CONTENT_FIT_CONTAIN);
|
||||
gtk_picture_set_can_shrink (GTK_PICTURE (picture), FALSE);
|
||||
g_object_unref (paintable);
|
||||
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print), picture);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), picture);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
return window;
|
||||
}
|
369
demos/gtk-demo/path_maze.c
Normal file
@@ -0,0 +1,369 @@
|
||||
/* Path/Maze
|
||||
*
|
||||
* This demo shows how to use a GskPath to create a maze and use
|
||||
* gsk_path_get_closest_point() to check the mouse stays
|
||||
* on the path.
|
||||
*
|
||||
* It also shows off the performance of GskPath (or not) as this
|
||||
* is a rather complex path.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paintable.h"
|
||||
|
||||
#define MAZE_GRID_SIZE 20
|
||||
#define MAZE_STROKE_SIZE_ACTIVE (MAZE_GRID_SIZE - 4)
|
||||
#define MAZE_STROKE_SIZE_INACTIVE (MAZE_GRID_SIZE - 12)
|
||||
#define MAZE_WIDTH 31
|
||||
#define MAZE_HEIGHT 21
|
||||
|
||||
#define GTK_TYPE_MAZE (gtk_maze_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkMaze, gtk_maze, GTK, MAZE, GtkWidget)
|
||||
|
||||
struct _GtkMaze
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
GskPath *path;
|
||||
GskPathMeasure *measure;
|
||||
GdkPaintable *background;
|
||||
|
||||
gboolean active;
|
||||
};
|
||||
|
||||
struct _GtkMazeClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GtkMaze, gtk_maze, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
gtk_maze_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
GtkMaze *self = GTK_MAZE (widget);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
*minimum = *natural = self->width;
|
||||
else
|
||||
*minimum = *natural = self->height;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_maze_snapshot (GtkWidget *widget,
|
||||
GdkSnapshot *snapshot)
|
||||
{
|
||||
GtkMaze *self = GTK_MAZE (widget);
|
||||
double width = gtk_widget_get_width (widget);
|
||||
double height = gtk_widget_get_height (widget);
|
||||
GskStroke *stroke;
|
||||
|
||||
stroke = gsk_stroke_new (MAZE_STROKE_SIZE_INACTIVE);
|
||||
if (self->active)
|
||||
gsk_stroke_set_line_width (stroke, MAZE_STROKE_SIZE_ACTIVE);
|
||||
gsk_stroke_set_line_join (stroke, GSK_LINE_JOIN_ROUND);
|
||||
gsk_stroke_set_line_cap (stroke, GSK_LINE_CAP_ROUND);
|
||||
gtk_snapshot_push_stroke (snapshot, self->path, stroke);
|
||||
gsk_stroke_free (stroke);
|
||||
|
||||
if (self->background)
|
||||
{
|
||||
gdk_paintable_snapshot (self->background, snapshot, width, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_snapshot_append_linear_gradient (snapshot,
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
||||
&GRAPHENE_POINT_INIT (0, 0),
|
||||
&GRAPHENE_POINT_INIT (width, height),
|
||||
(GskColorStop[8]) {
|
||||
{ 0.0, { 1.0, 0.0, 0.0, 1.0 } },
|
||||
{ 0.2, { 1.0, 0.0, 0.0, 1.0 } },
|
||||
{ 0.3, { 1.0, 1.0, 0.0, 1.0 } },
|
||||
{ 0.4, { 0.0, 1.0, 0.0, 1.0 } },
|
||||
{ 0.6, { 0.0, 1.0, 1.0, 1.0 } },
|
||||
{ 0.7, { 0.0, 0.0, 1.0, 1.0 } },
|
||||
{ 0.8, { 1.0, 0.0, 1.0, 1.0 } },
|
||||
{ 1.0, { 1.0, 0.0, 1.0, 1.0 } }
|
||||
},
|
||||
8);
|
||||
}
|
||||
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_maze_dispose (GObject *object)
|
||||
{
|
||||
GtkMaze *self = GTK_MAZE (object);
|
||||
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
g_clear_pointer (&self->measure, gsk_path_measure_unref);
|
||||
if (self->background)
|
||||
{
|
||||
g_signal_handlers_disconnect_matched (self->background, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, self);
|
||||
g_clear_object (&self->background);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (gtk_maze_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_maze_class_init (GtkMazeClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_maze_dispose;
|
||||
|
||||
widget_class->measure = gtk_maze_measure;
|
||||
widget_class->snapshot = gtk_maze_snapshot;
|
||||
}
|
||||
|
||||
static void
|
||||
celebrate (gboolean win)
|
||||
{
|
||||
char *path;
|
||||
GtkMediaStream *stream;
|
||||
|
||||
if (win)
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "complete.oga", NULL);
|
||||
else
|
||||
path = g_build_filename (GTK_DATADIR, "sounds", "freedesktop", "stereo", "suspend-error.oga", NULL);
|
||||
stream = gtk_media_file_new_for_filename (path);
|
||||
gtk_media_stream_set_volume (stream, 1.0);
|
||||
gtk_media_stream_play (stream);
|
||||
|
||||
g_signal_connect (stream, "notify::ended", G_CALLBACK (g_object_unref), NULL);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_motion (GtkEventControllerMotion *controller,
|
||||
double x,
|
||||
double y,
|
||||
GtkMaze *self)
|
||||
{
|
||||
GskPathPoint point;
|
||||
float distance;
|
||||
|
||||
if (!self->active)
|
||||
return;
|
||||
|
||||
if (gsk_path_get_closest_point (self->path,
|
||||
&GRAPHENE_POINT_INIT (x, y),
|
||||
INFINITY,
|
||||
&point,
|
||||
&distance))
|
||||
{
|
||||
if (distance < MAZE_STROKE_SIZE_ACTIVE / 2.f)
|
||||
return;
|
||||
}
|
||||
|
||||
celebrate (FALSE);
|
||||
|
||||
self->active = FALSE;
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_leave (GtkEventControllerMotion *controller,
|
||||
GtkMaze *self)
|
||||
{
|
||||
if (!self->active)
|
||||
{
|
||||
self->active = TRUE;
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_maze_init (GtkMaze *self)
|
||||
{
|
||||
GtkEventController *controller;
|
||||
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_event_controller_motion_new ());
|
||||
g_signal_connect (controller, "motion", G_CALLBACK (pointer_motion), self);
|
||||
g_signal_connect (controller, "leave", G_CALLBACK (pointer_leave), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||
|
||||
self->active = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_maze_set_path (GtkMaze *self,
|
||||
GskPath *path)
|
||||
{
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
g_clear_pointer (&self->measure, gsk_path_measure_unref);
|
||||
self->path = gsk_path_ref (path);
|
||||
self->measure = gsk_path_measure_new (path);
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_maze_new (GskPath *path,
|
||||
GdkPaintable *background,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GtkMaze *self;
|
||||
|
||||
self = g_object_new (GTK_TYPE_MAZE, NULL);
|
||||
|
||||
gtk_maze_set_path (self, path);
|
||||
gsk_path_unref (path);
|
||||
self->background = background;
|
||||
if (self->background)
|
||||
{
|
||||
g_signal_connect_swapped (self->background, "invalidate-contents", G_CALLBACK (gtk_widget_queue_draw), self);
|
||||
g_signal_connect_swapped (self->background, "invalidate-size", G_CALLBACK (gtk_widget_queue_resize), self);
|
||||
}
|
||||
self->width = width;
|
||||
self->height = height;
|
||||
|
||||
return GTK_WIDGET (self);
|
||||
}
|
||||
|
||||
static void
|
||||
add_point_to_maze (GtkBitset *maze,
|
||||
GskPathBuilder *builder,
|
||||
guint x,
|
||||
guint y)
|
||||
{
|
||||
gboolean set[4] = { FALSE, FALSE, FALSE, FALSE };
|
||||
guint dir;
|
||||
|
||||
gtk_bitset_add (maze, y * MAZE_WIDTH + x);
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
set[0] = set[0] || x == 0 || gtk_bitset_contains (maze, y * MAZE_WIDTH + x - 1);
|
||||
set[1] = set[1] || y == 0 || gtk_bitset_contains (maze, (y - 1) * MAZE_WIDTH + x);
|
||||
set[2] = set[2] || x + 1 == MAZE_WIDTH || gtk_bitset_contains (maze, y * MAZE_WIDTH + x + 1);
|
||||
set[3] = set[3] || y + 1 == MAZE_HEIGHT || gtk_bitset_contains (maze, (y + 1) * MAZE_WIDTH + x);
|
||||
|
||||
if (set[0] && set[1] && set[2] && set[3])
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
dir = g_random_int_range (0, 4);
|
||||
}
|
||||
while (set[dir]);
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case 0:
|
||||
gsk_path_builder_move_to (builder, (x + 0.5) * MAZE_GRID_SIZE, (y + 0.5) * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_line_to (builder, (x - 0.5) * MAZE_GRID_SIZE, (y + 0.5) * MAZE_GRID_SIZE);
|
||||
add_point_to_maze (maze, builder, x - 1, y);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
gsk_path_builder_move_to (builder, (x + 0.5) * MAZE_GRID_SIZE, (y + 0.5) * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_line_to (builder, (x + 0.5) * MAZE_GRID_SIZE, (y - 0.5) * MAZE_GRID_SIZE);
|
||||
add_point_to_maze (maze, builder, x, y - 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
gsk_path_builder_move_to (builder, (x + 0.5) * MAZE_GRID_SIZE, (y + 0.5) * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_line_to (builder, (x + 1.5) * MAZE_GRID_SIZE, (y + 0.5) * MAZE_GRID_SIZE);
|
||||
add_point_to_maze (maze, builder, x + 1, y);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
gsk_path_builder_move_to (builder, (x + 0.5) * MAZE_GRID_SIZE, (y + 0.5) * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_line_to (builder, (x + 0.5) * MAZE_GRID_SIZE, (y + 1.5) * MAZE_GRID_SIZE);
|
||||
add_point_to_maze (maze, builder, x, y + 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GskPath *
|
||||
create_path_for_maze (GtkWidget *widget)
|
||||
{
|
||||
GskPathBuilder *builder;
|
||||
GtkBitset *maze;
|
||||
|
||||
builder = gsk_path_builder_new ();
|
||||
maze = gtk_bitset_new_empty ();
|
||||
/* make sure the outer lines are unreachable:
|
||||
* Set the full range, then remove the center again. */
|
||||
gtk_bitset_add_range (maze, 0, MAZE_WIDTH * MAZE_HEIGHT);
|
||||
gtk_bitset_remove_rectangle (maze, MAZE_WIDTH + 1, MAZE_WIDTH - 2, MAZE_HEIGHT - 2, MAZE_WIDTH);
|
||||
|
||||
/* Fill the maze */
|
||||
add_point_to_maze (maze, builder, MAZE_WIDTH / 2, MAZE_HEIGHT / 2);
|
||||
|
||||
/* Add start and stop lines */
|
||||
gsk_path_builder_move_to (builder, 1.5 * MAZE_GRID_SIZE, -0.5 * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_line_to (builder, 1.5 * MAZE_GRID_SIZE, 1.5 * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_move_to (builder, (MAZE_WIDTH - 1.5) * MAZE_GRID_SIZE, (MAZE_HEIGHT - 1.5) * MAZE_GRID_SIZE);
|
||||
gsk_path_builder_line_to (builder, (MAZE_WIDTH - 1.5) * MAZE_GRID_SIZE, (MAZE_HEIGHT + 0.5) * MAZE_GRID_SIZE);
|
||||
|
||||
|
||||
gtk_bitset_unref (maze);
|
||||
|
||||
return gsk_path_builder_free_to_path (builder);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_path_maze (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *maze;
|
||||
GtkMediaStream *stream;
|
||||
GskPath *path;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Follow the maze with the mouse");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
#if 0
|
||||
stream = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
|
||||
#else
|
||||
stream = gtk_nuclear_media_stream_new ();
|
||||
#endif
|
||||
gtk_media_stream_play (stream);
|
||||
gtk_media_stream_set_loop (stream, TRUE);
|
||||
|
||||
path = create_path_for_maze (window);
|
||||
|
||||
maze = gtk_maze_new (path,
|
||||
GDK_PAINTABLE (stream),
|
||||
MAZE_WIDTH * MAZE_GRID_SIZE,
|
||||
MAZE_HEIGHT * MAZE_GRID_SIZE);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), maze);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
return window;
|
||||
}
|
323
demos/gtk-demo/path_spinner.c
Normal file
@@ -0,0 +1,323 @@
|
||||
/* Path/Spinner
|
||||
*
|
||||
* This demo shows how to use GskPath to draw a simple animation
|
||||
* that could be used as a spinner.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "paintable.h"
|
||||
|
||||
#undef SHOW_CONTROLS
|
||||
|
||||
#define GTK_TYPE_SPINNER_PAINTABLE (gtk_spinner_paintable_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkSpinnerPaintable, gtk_spinner_paintable, GTK, SPINNER_PAINTABLE, GObject)
|
||||
|
||||
struct _GtkSpinnerPaintable
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
gint64 start_time;
|
||||
|
||||
int width;
|
||||
double angle;
|
||||
double completion;
|
||||
|
||||
GskPath *circle;
|
||||
GskPath *path;
|
||||
GskStroke *stroke;
|
||||
GdkRGBA color;
|
||||
GdkRGBA circle_color;
|
||||
#ifdef SHOW_CONTROLS
|
||||
GskPath *controls;
|
||||
GdkRGBA control_color;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _GtkSpinnerPaintableClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
static int
|
||||
gtk_spinner_paintable_get_intrinsic_width (GdkPaintable *paintable)
|
||||
{
|
||||
GtkSpinnerPaintable *self = GTK_SPINNER_PAINTABLE (paintable);
|
||||
|
||||
return self->width;
|
||||
}
|
||||
|
||||
static int
|
||||
gtk_spinner_paintable_get_intrinsic_height (GdkPaintable *paintable)
|
||||
{
|
||||
GtkSpinnerPaintable *self = GTK_SPINNER_PAINTABLE (paintable);
|
||||
|
||||
return self->width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
double width,
|
||||
double height)
|
||||
{
|
||||
GtkSpinnerPaintable *self = GTK_SPINNER_PAINTABLE (paintable);
|
||||
|
||||
gtk_snapshot_append_stroke (snapshot, self->circle, self->stroke, &self->circle_color);
|
||||
gtk_snapshot_append_stroke (snapshot, self->path, self->stroke, &self->color);
|
||||
#ifdef SHOW_CONTROLS
|
||||
GskStroke *stroke = gsk_stroke_new (1);
|
||||
gtk_snapshot_append_stroke (snapshot, self->controls, stroke, &self->control_color);
|
||||
gsk_stroke_free (stroke);
|
||||
#endif
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
gtk_spinner_paintable_get_flags (GdkPaintable *paintable)
|
||||
{
|
||||
return GDK_PAINTABLE_STATIC_SIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_paintable_init (GdkPaintableInterface *iface)
|
||||
{
|
||||
iface->get_intrinsic_width = gtk_spinner_paintable_get_intrinsic_width;
|
||||
iface->get_intrinsic_height = gtk_spinner_paintable_get_intrinsic_height;
|
||||
iface->snapshot = gtk_spinner_paintable_snapshot;
|
||||
iface->get_flags = gtk_spinner_paintable_get_flags;
|
||||
}
|
||||
|
||||
/* When defining the GType, we need to implement the GdkPaintable interface */
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkSpinnerPaintable, gtk_spinner_paintable, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_spinner_paintable_paintable_init))
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_dispose (GObject *object)
|
||||
{
|
||||
GtkSpinnerPaintable *self = GTK_SPINNER_PAINTABLE (object);
|
||||
|
||||
gsk_path_unref (self->circle);
|
||||
gsk_path_unref (self->path);
|
||||
#ifdef SHOW_CONTROLS
|
||||
gsk_path_unref (self->controls);
|
||||
#endif
|
||||
|
||||
gsk_stroke_free (self->stroke);
|
||||
|
||||
G_OBJECT_CLASS (gtk_spinner_paintable_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_class_init (GtkSpinnerPaintableClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_spinner_paintable_dispose;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_init (GtkSpinnerPaintable *self)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
gtk_spinner_paintable_new (void)
|
||||
{
|
||||
GtkSpinnerPaintable *self;
|
||||
GskPathBuilder *builder;
|
||||
|
||||
self = g_object_new (GTK_TYPE_SPINNER_PAINTABLE, NULL);
|
||||
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_add_circle (builder, &GRAPHENE_POINT_INIT (50, 50), 40);
|
||||
self->circle = gsk_path_builder_free_to_path (builder);
|
||||
|
||||
self->width = 100;
|
||||
self->angle = 0;
|
||||
self->completion = 1;
|
||||
gdk_rgba_parse (&self->color, "green");
|
||||
gdk_rgba_parse (&self->circle_color, "lightgray");
|
||||
#ifdef SHOW_CONTROLS
|
||||
gdk_rgba_parse (&self->control_color, "black");
|
||||
#endif
|
||||
self->stroke = gsk_stroke_new (5);
|
||||
|
||||
return GDK_PAINTABLE (self);
|
||||
}
|
||||
|
||||
#ifdef SHOW_CONTROLS
|
||||
static gboolean
|
||||
add_controls (GskPathOperation op,
|
||||
const graphene_point_t *pts,
|
||||
gsize n_pts,
|
||||
float weight,
|
||||
gpointer data)
|
||||
{
|
||||
GskPathBuilder *builder = data;
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case GSK_PATH_MOVE:
|
||||
gsk_path_builder_move_to (builder, pts[0].x, pts[0].y);
|
||||
break;
|
||||
|
||||
case GSK_PATH_CLOSE:
|
||||
case GSK_PATH_LINE:
|
||||
gsk_path_builder_line_to (builder, pts[1].x, pts[1].y);
|
||||
break;
|
||||
|
||||
case GSK_PATH_QUAD:
|
||||
case GSK_PATH_CONIC:
|
||||
gsk_path_builder_line_to (builder, pts[1].x, pts[1].y);
|
||||
gsk_path_builder_line_to (builder, pts[2].x, pts[2].y);
|
||||
break;
|
||||
|
||||
case GSK_PATH_CUBIC:
|
||||
gsk_path_builder_line_to (builder, pts[1].x, pts[1].y);
|
||||
gsk_path_builder_line_to (builder, pts[2].x, pts[2].y);
|
||||
gsk_path_builder_line_to (builder, pts[3].x, pts[3].y);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
update_path (GtkSpinnerPaintable *self)
|
||||
{
|
||||
GskPathBuilder *builder;
|
||||
GskPathPoint start, end;
|
||||
graphene_point_t p0, p1;
|
||||
float start_angle, end_angle;
|
||||
|
||||
start_angle = self->angle;
|
||||
end_angle = fmod (self->angle + 360 * self->completion / 100, 360);
|
||||
|
||||
p0 = GRAPHENE_POINT_INIT (50 + 40 * cos (M_PI * start_angle / 180),
|
||||
50 + 40 * sin (M_PI * start_angle / 180));
|
||||
p1 = GRAPHENE_POINT_INIT (50 + 40 * cos (M_PI * end_angle / 180),
|
||||
50 + 40 * sin (M_PI * end_angle / 180));
|
||||
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
|
||||
gsk_path_get_closest_point (self->circle, &p0, INFINITY, &start, NULL);
|
||||
gsk_path_get_closest_point (self->circle, &p1, INFINITY, &end, NULL);
|
||||
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_add_segment (builder, self->circle, &start, &end);
|
||||
self->path = gsk_path_builder_free_to_path (builder);
|
||||
|
||||
#ifdef SHOW_CONTROLS
|
||||
g_clear_pointer (&self->controls, gsk_path_unref);
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_foreach (self->path, -1, add_controls, builder);
|
||||
self->controls = gsk_path_builder_free_to_path (builder);
|
||||
#endif
|
||||
|
||||
gdk_paintable_invalidate_contents (GDK_PAINTABLE (self));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_set_completion (GtkSpinnerPaintable *self,
|
||||
float completion)
|
||||
{
|
||||
self->completion = CLAMP (completion, 0, 100);
|
||||
update_path (self);
|
||||
}
|
||||
|
||||
static float
|
||||
gtk_spinner_paintable_get_completion (GtkSpinnerPaintable *self)
|
||||
{
|
||||
return self->completion;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spinner_paintable_set_frame_time (GtkSpinnerPaintable *self,
|
||||
gint64 time)
|
||||
{
|
||||
double delta;
|
||||
|
||||
if (self->start_time == 0)
|
||||
self->start_time = time;
|
||||
|
||||
delta = (time - self->start_time) / (double) G_TIME_SPAN_SECOND;
|
||||
self->angle = fmod (60 * delta, 360);
|
||||
update_path (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tick_cb (GtkWidget *widget,
|
||||
GdkFrameClock *clock,
|
||||
gpointer data)
|
||||
{
|
||||
GtkSpinnerPaintable *self = data;
|
||||
|
||||
gtk_spinner_paintable_set_frame_time (self, gdk_frame_clock_get_frame_time (clock));
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
progress_timeout (gpointer data)
|
||||
{
|
||||
GtkSpinnerPaintable *self = data;
|
||||
static float progress_delta = 0.5;
|
||||
float progress;
|
||||
|
||||
progress = gtk_spinner_paintable_get_completion (self);
|
||||
if (progress >= 100 || progress <= 0)
|
||||
progress_delta = -progress_delta;
|
||||
|
||||
gtk_spinner_paintable_set_completion (self, progress + progress_delta);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
unset_timeout (gpointer data)
|
||||
{
|
||||
g_source_remove (GPOINTER_TO_UINT (data));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_path_spinner (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *picture;
|
||||
GdkPaintable *paintable;
|
||||
guint timeout_id;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Spinner");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
paintable = gtk_spinner_paintable_new ();
|
||||
picture = gtk_picture_new_for_paintable (paintable);
|
||||
gtk_picture_set_content_fit (GTK_PICTURE (picture), GTK_CONTENT_FIT_CONTAIN);
|
||||
gtk_picture_set_can_shrink (GTK_PICTURE (picture), FALSE);
|
||||
g_object_unref (paintable);
|
||||
|
||||
gtk_widget_add_tick_callback (picture, tick_cb, paintable, NULL);
|
||||
timeout_id = g_timeout_add (100, progress_timeout, paintable);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (picture), "timeout", GUINT_TO_POINTER (timeout_id), unset_timeout);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), picture);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
return window;
|
||||
}
|
584
demos/gtk-demo/path_text.c
Normal file
@@ -0,0 +1,584 @@
|
||||
/* Path/Text
|
||||
*
|
||||
* This demo shows how to use GskPath to transform a path along another path.
|
||||
*
|
||||
* It also demonstrates that paths can be filled with more interesting
|
||||
* content than just plain colors.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define GTK_TYPE_PATH_WIDGET (gtk_path_widget_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkPathWidget, gtk_path_widget, GTK, PATH_WIDGET, GtkWidget)
|
||||
|
||||
#define POINT_SIZE 8
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_TEXT,
|
||||
PROP_EDITABLE,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
struct _GtkPathWidget
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
char *text;
|
||||
gboolean editable;
|
||||
|
||||
graphene_point_t points[4];
|
||||
|
||||
guint active_point;
|
||||
|
||||
GskPath *line_path;
|
||||
GskPath *text_path;
|
||||
|
||||
GdkPaintable *background;
|
||||
};
|
||||
|
||||
struct _GtkPathWidgetClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
G_DEFINE_TYPE (GtkPathWidget, gtk_path_widget, GTK_TYPE_WIDGET)
|
||||
|
||||
static GskPath *
|
||||
create_path_from_text (GtkWidget *widget,
|
||||
const char *text,
|
||||
graphene_point_t *out_offset)
|
||||
{
|
||||
PangoLayout *layout;
|
||||
PangoFontDescription *desc;
|
||||
GskPathBuilder *builder;
|
||||
GskPath *result;
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
desc = pango_font_description_from_string ("sans bold 36");
|
||||
pango_layout_set_font_description (layout, desc);
|
||||
pango_font_description_free (desc);
|
||||
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_add_layout (builder, layout);
|
||||
result = gsk_path_builder_free_to_path (builder);
|
||||
|
||||
if (out_offset)
|
||||
graphene_point_init (out_offset, 0, - pango_layout_get_baseline (layout) / (double) PANGO_SCALE);
|
||||
g_object_unref (layout);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GskPathMeasure *measure;
|
||||
GskPathBuilder *builder;
|
||||
graphene_point_t offset;
|
||||
double scale;
|
||||
} GtkPathTransform;
|
||||
|
||||
static void
|
||||
gtk_path_transform_point (GskPathMeasure *measure,
|
||||
const graphene_point_t *pt,
|
||||
const graphene_point_t *offset,
|
||||
float scale,
|
||||
graphene_point_t *res)
|
||||
{
|
||||
graphene_vec2_t tangent;
|
||||
GskPathPoint point;
|
||||
|
||||
if (gsk_path_measure_get_point (measure, (pt->x + offset->x) * scale, &point))
|
||||
{
|
||||
GskPath *path = gsk_path_measure_get_path (measure);
|
||||
|
||||
gsk_path_point_get_position (&point, path, res);
|
||||
gsk_path_point_get_tangent (&point, path, GSK_PATH_TO_END, &tangent);
|
||||
|
||||
res->x -= (pt->y + offset->y) * scale * graphene_vec2_get_y (&tangent);
|
||||
res->y += (pt->y + offset->y) * scale * graphene_vec2_get_x (&tangent);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_path_transform_op (GskPathOperation op,
|
||||
const graphene_point_t *pts,
|
||||
gsize n_pts,
|
||||
float weight,
|
||||
gpointer data)
|
||||
{
|
||||
GtkPathTransform *transform = data;
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case GSK_PATH_MOVE:
|
||||
{
|
||||
graphene_point_t res;
|
||||
gtk_path_transform_point (transform->measure, &pts[0], &transform->offset, transform->scale, &res);
|
||||
gsk_path_builder_move_to (transform->builder, res.x, res.y);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_PATH_LINE:
|
||||
{
|
||||
graphene_point_t res;
|
||||
gtk_path_transform_point (transform->measure, &pts[1], &transform->offset, transform->scale, &res);
|
||||
gsk_path_builder_line_to (transform->builder, res.x, res.y);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_PATH_QUAD:
|
||||
{
|
||||
graphene_point_t res[2];
|
||||
gtk_path_transform_point (transform->measure, &pts[1], &transform->offset, transform->scale, &res[0]);
|
||||
gtk_path_transform_point (transform->measure, &pts[2], &transform->offset, transform->scale, &res[1]);
|
||||
gsk_path_builder_quad_to (transform->builder, res[0].x, res[0].y, res[1].x, res[1].y);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_PATH_CUBIC:
|
||||
{
|
||||
graphene_point_t res[3];
|
||||
gtk_path_transform_point (transform->measure, &pts[1], &transform->offset, transform->scale, &res[0]);
|
||||
gtk_path_transform_point (transform->measure, &pts[2], &transform->offset, transform->scale, &res[1]);
|
||||
gtk_path_transform_point (transform->measure, &pts[3], &transform->offset, transform->scale, &res[2]);
|
||||
gsk_path_builder_cubic_to (transform->builder, res[0].x, res[0].y, res[1].x, res[1].y, res[2].x, res[2].y);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_PATH_CONIC:
|
||||
{
|
||||
graphene_point_t res[2];
|
||||
gtk_path_transform_point (transform->measure, &pts[1], &transform->offset, transform->scale, &res[0]);
|
||||
gtk_path_transform_point (transform->measure, &pts[3], &transform->offset, transform->scale, &res[1]);
|
||||
gsk_path_builder_conic_to (transform->builder, res[0].x, res[0].y, res[1].x, res[1].y, weight);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_PATH_CLOSE:
|
||||
gsk_path_builder_close (transform->builder);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GskPath *
|
||||
gtk_path_transform (GskPath *line_path,
|
||||
GskPath *path,
|
||||
const graphene_point_t *offset)
|
||||
{
|
||||
GskPathMeasure *measure = gsk_path_measure_new (line_path);
|
||||
GtkPathTransform transform = { measure, gsk_path_builder_new (), *offset };
|
||||
graphene_rect_t bounds;
|
||||
|
||||
gsk_path_get_bounds (path, &bounds);
|
||||
if (bounds.origin.x + bounds.size.width > 0)
|
||||
transform.scale = gsk_path_measure_get_length (measure) / (bounds.origin.x + bounds.size.width);
|
||||
else
|
||||
transform.scale = 1.0f;
|
||||
|
||||
gsk_path_foreach (path, -1, gtk_path_transform_op, &transform);
|
||||
|
||||
gsk_path_measure_unref (measure);
|
||||
|
||||
return gsk_path_builder_free_to_path (transform.builder);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_clear_text_path (GtkPathWidget *self)
|
||||
{
|
||||
g_clear_pointer (&self->text_path, gsk_path_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_clear_paths (GtkPathWidget *self)
|
||||
{
|
||||
gtk_path_widget_clear_text_path (self);
|
||||
|
||||
g_clear_pointer (&self->line_path, gsk_path_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_create_text_path (GtkPathWidget *self)
|
||||
{
|
||||
GskPath *path;
|
||||
graphene_point_t offset;
|
||||
|
||||
gtk_path_widget_clear_text_path (self);
|
||||
|
||||
path = create_path_from_text (GTK_WIDGET (self), self->text, &offset);
|
||||
self->text_path = gtk_path_transform (self->line_path, path, &offset);
|
||||
|
||||
gsk_path_unref (path);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_create_paths (GtkPathWidget *self)
|
||||
{
|
||||
double width = gtk_widget_get_width (GTK_WIDGET (self));
|
||||
double height = gtk_widget_get_height (GTK_WIDGET (self));
|
||||
GskPathBuilder *builder;
|
||||
|
||||
gtk_path_widget_clear_paths (self);
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
builder = gsk_path_builder_new ();
|
||||
gsk_path_builder_move_to (builder,
|
||||
self->points[0].x * width, self->points[0].y * height);
|
||||
gsk_path_builder_cubic_to (builder,
|
||||
self->points[1].x * width, self->points[1].y * height,
|
||||
self->points[2].x * width, self->points[2].y * height,
|
||||
self->points[3].x * width, self->points[3].y * height);
|
||||
self->line_path = gsk_path_builder_free_to_path (builder);
|
||||
|
||||
gtk_path_widget_create_text_path (self);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
GtkPathWidget *self = GTK_PATH_WIDGET (widget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_path_widget_parent_class)->size_allocate (widget, width, height, baseline);
|
||||
|
||||
gtk_path_widget_create_paths (self);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkPathWidget *self = GTK_PATH_WIDGET (widget);
|
||||
double width = gtk_widget_get_width (widget);
|
||||
double height = gtk_widget_get_height (widget);
|
||||
GskPath *path;
|
||||
GskStroke *stroke;
|
||||
gsize i;
|
||||
|
||||
/* frosted glass the background */
|
||||
gtk_snapshot_push_blur (snapshot, 100);
|
||||
gdk_paintable_snapshot (self->background, snapshot, width, height);
|
||||
gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 1, 1, 1, 0.6 }, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
/* draw the text */
|
||||
if (self->text_path)
|
||||
{
|
||||
gtk_snapshot_push_fill (snapshot, self->text_path, GSK_FILL_RULE_WINDING);
|
||||
gdk_paintable_snapshot (self->background, snapshot, width, height);
|
||||
|
||||
/* ... with an emboss effect */
|
||||
stroke = gsk_stroke_new (2.0);
|
||||
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT(1, 1));
|
||||
gtk_snapshot_push_stroke (snapshot, self->text_path, stroke);
|
||||
gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 0, 0, 0, 0.2 }, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gsk_stroke_free (stroke);
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
gtk_snapshot_pop (snapshot);
|
||||
}
|
||||
|
||||
if (self->editable && self->line_path)
|
||||
{
|
||||
GskPathBuilder *builder;
|
||||
|
||||
/* draw the control line */
|
||||
stroke = gsk_stroke_new (1.0);
|
||||
gtk_snapshot_push_stroke (snapshot, self->line_path, stroke);
|
||||
gsk_stroke_free (stroke);
|
||||
gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 0, 0, 0, 1 }, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
/* draw the points */
|
||||
builder = gsk_path_builder_new ();
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gsk_path_builder_add_circle (builder, &GRAPHENE_POINT_INIT (self->points[i].x * width, self->points[i].y * height), POINT_SIZE);
|
||||
}
|
||||
path = gsk_path_builder_free_to_path (builder);
|
||||
|
||||
gtk_snapshot_push_fill (snapshot, path, GSK_FILL_RULE_WINDING);
|
||||
gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 1, 1, 1, 1 }, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
stroke = gsk_stroke_new (1.0);
|
||||
gtk_snapshot_push_stroke (snapshot, path, stroke);
|
||||
gsk_stroke_free (stroke);
|
||||
gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 0, 0, 0, 1 }, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
gsk_path_unref (path);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_set_text (GtkPathWidget *self,
|
||||
const char *text)
|
||||
{
|
||||
if (g_strcmp0 (self->text, text) == 0)
|
||||
return;
|
||||
|
||||
g_free (self->text);
|
||||
self->text = g_strdup (text);
|
||||
|
||||
gtk_path_widget_create_paths (self);
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TEXT]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_set_editable (GtkPathWidget *self,
|
||||
gboolean editable)
|
||||
{
|
||||
if (self->editable == editable)
|
||||
return;
|
||||
|
||||
self->editable = editable;
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_EDITABLE]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
|
||||
{
|
||||
GtkPathWidget *self = GTK_PATH_WIDGET (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TEXT:
|
||||
gtk_path_widget_set_text (self, g_value_get_string (value));
|
||||
break;
|
||||
|
||||
case PROP_EDITABLE:
|
||||
gtk_path_widget_set_editable (self, g_value_get_boolean (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkPathWidget *self = GTK_PATH_WIDGET (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TEXT:
|
||||
g_value_set_string (value, self->text);
|
||||
break;
|
||||
|
||||
case PROP_EDITABLE:
|
||||
g_value_set_boolean (value, self->editable);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_dispose (GObject *object)
|
||||
{
|
||||
GtkPathWidget *self = GTK_PATH_WIDGET (object);
|
||||
|
||||
gtk_path_widget_clear_paths (self);
|
||||
|
||||
G_OBJECT_CLASS (gtk_path_widget_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_class_init (GtkPathWidgetClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_path_widget_dispose;
|
||||
object_class->set_property = gtk_path_widget_set_property;
|
||||
object_class->get_property = gtk_path_widget_get_property;
|
||||
|
||||
widget_class->size_allocate = gtk_path_widget_allocate;
|
||||
widget_class->snapshot = gtk_path_widget_snapshot;
|
||||
|
||||
properties[PROP_TEXT] =
|
||||
g_param_spec_string ("text",
|
||||
"text",
|
||||
"Text transformed along a path",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
properties[PROP_EDITABLE] =
|
||||
g_param_spec_boolean ("editable",
|
||||
"editable",
|
||||
"If the path can be edited by the user",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
}
|
||||
|
||||
static void
|
||||
drag_begin (GtkGestureDrag *gesture,
|
||||
double x,
|
||||
double y,
|
||||
GtkPathWidget *self)
|
||||
{
|
||||
graphene_point_t mouse = GRAPHENE_POINT_INIT (x, y);
|
||||
double width = gtk_widget_get_width (GTK_WIDGET (self));
|
||||
double height = gtk_widget_get_height (GTK_WIDGET (self));
|
||||
gsize i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (graphene_point_distance (&GRAPHENE_POINT_INIT (self->points[i].x * width, self->points[i].y * height), &mouse, NULL, NULL) <= POINT_SIZE)
|
||||
{
|
||||
self->active_point = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == 4)
|
||||
{
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
static void
|
||||
drag_update (GtkGestureDrag *drag,
|
||||
double offset_x,
|
||||
double offset_y,
|
||||
GtkPathWidget *self)
|
||||
{
|
||||
double width = gtk_widget_get_width (GTK_WIDGET (self));
|
||||
double height = gtk_widget_get_height (GTK_WIDGET (self));
|
||||
double start_x, start_y;
|
||||
|
||||
gtk_gesture_drag_get_start_point (drag, &start_x, &start_y);
|
||||
|
||||
self->points[self->active_point] = GRAPHENE_POINT_INIT ((start_x + offset_x) / width,
|
||||
(start_y + offset_y) / height);
|
||||
self->points[self->active_point].x = CLAMP (self->points[self->active_point].x, 0, 1);
|
||||
self->points[self->active_point].y = CLAMP (self->points[self->active_point].y, 0, 1);
|
||||
|
||||
gtk_path_widget_create_paths (self);
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_motion (GtkEventControllerMotion *controller,
|
||||
double x,
|
||||
double y,
|
||||
GtkPathWidget *self)
|
||||
{
|
||||
GskPathPoint point;
|
||||
|
||||
if (gsk_path_get_closest_point (self->line_path,
|
||||
&GRAPHENE_POINT_INIT (x, y),
|
||||
INFINITY,
|
||||
&point,
|
||||
NULL))
|
||||
{
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_leave (GtkEventControllerMotion *controller,
|
||||
GtkPathWidget *self)
|
||||
{
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_widget_init (GtkPathWidget *self)
|
||||
{
|
||||
GtkEventController *controller;
|
||||
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_gesture_drag_new ());
|
||||
g_signal_connect (controller, "drag-begin", G_CALLBACK (drag_begin), self);
|
||||
g_signal_connect (controller, "drag-update", G_CALLBACK (drag_update), self);
|
||||
g_signal_connect (controller, "drag-end", G_CALLBACK (drag_update), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||
|
||||
controller = GTK_EVENT_CONTROLLER (gtk_event_controller_motion_new ());
|
||||
g_signal_connect (controller, "enter", G_CALLBACK (pointer_motion), self);
|
||||
g_signal_connect (controller, "motion", G_CALLBACK (pointer_motion), self);
|
||||
g_signal_connect (controller, "leave", G_CALLBACK (pointer_leave), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||
|
||||
self->points[0] = GRAPHENE_POINT_INIT (0.1, 0.9);
|
||||
self->points[1] = GRAPHENE_POINT_INIT (0.3, 0.1);
|
||||
self->points[2] = GRAPHENE_POINT_INIT (0.7, 0.1);
|
||||
self->points[3] = GRAPHENE_POINT_INIT (0.9, 0.9);
|
||||
|
||||
self->background = GDK_PAINTABLE (gdk_texture_new_from_resource ("/sliding_puzzle/portland-rose.jpg"));
|
||||
|
||||
gtk_path_widget_set_text (self, "It's almost working");
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_path_widget_new (void)
|
||||
{
|
||||
GtkPathWidget *self;
|
||||
|
||||
self = g_object_new (GTK_TYPE_PATH_WIDGET, NULL);
|
||||
|
||||
return GTK_WIDGET (self);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_path_text (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
|
||||
g_type_ensure (GTK_TYPE_PATH_WIDGET);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/path_text/path_text.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *) &window);
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
return window;
|
||||
}
|
38
demos/gtk-demo/path_text.ui
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="title" translatable="yes">Text along a Path</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="edit-toggle">
|
||||
<property name="icon-name">document-edit-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="edit-toggle" bind-property="active" bind-flags="sync-create"></property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="text">
|
||||
<property name="text">Through the looking glass</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkPathWidget" id="view">
|
||||
<property name="editable" bind-source="edit-toggle" bind-property="active" bind-flags="sync-create"></property>
|
||||
<property name="text" bind-source="text" bind-property="text" bind-flags="sync-create"></property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
373
demos/gtk-demo/path_walk.c
Normal file
@@ -0,0 +1,373 @@
|
||||
/* Path/Walk
|
||||
*
|
||||
* This demo draws a world map and shows how to animate objects along a GskPath.
|
||||
*
|
||||
* The world map that is used here is a path with 211 lines and 1569 cubic
|
||||
* Bėzier segments in 121 contours.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define GTK_TYPE_PATH_WALK (gtk_path_walk_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkPathWalk, gtk_path_walk, GTK, PATH_WALK, GtkWidget)
|
||||
|
||||
#define POINT_SIZE 8
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_N_POINTS,
|
||||
PROP_PATH,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
struct _GtkPathWalk
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GskPath *path;
|
||||
GskPathMeasure *measure;
|
||||
graphene_rect_t bounds;
|
||||
GskPath *arrow_path;
|
||||
guint n_points;
|
||||
};
|
||||
|
||||
struct _GtkPathWalkClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
G_DEFINE_TYPE (GtkPathWalk, gtk_path_walk, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
rgba_init_from_hsla (GdkRGBA *rgba,
|
||||
float hue,
|
||||
float saturation,
|
||||
float lightness,
|
||||
float alpha)
|
||||
{
|
||||
float m1, m2;
|
||||
|
||||
if (lightness <= 0.5)
|
||||
m2 = lightness * (1 + saturation);
|
||||
else
|
||||
m2 = lightness + saturation - lightness * saturation;
|
||||
m1 = 2 * lightness - m2;
|
||||
|
||||
rgba->alpha = alpha;
|
||||
|
||||
if (saturation == 0)
|
||||
{
|
||||
rgba->red = lightness;
|
||||
rgba->green = lightness;
|
||||
rgba->blue = lightness;
|
||||
}
|
||||
else
|
||||
{
|
||||
hue = hue + 120;
|
||||
while (hue > 360)
|
||||
hue -= 360;
|
||||
while (hue < 0)
|
||||
hue += 360;
|
||||
|
||||
if (hue < 60)
|
||||
rgba->red = m1 + (m2 - m1) * hue / 60;
|
||||
else if (hue < 180)
|
||||
rgba->red = m2;
|
||||
else if (hue < 240)
|
||||
rgba->red = m1 + (m2 - m1) * (240 - hue) / 60;
|
||||
else
|
||||
rgba->red = m1;
|
||||
|
||||
hue -= 120;
|
||||
if (hue < 0)
|
||||
hue += 360;
|
||||
|
||||
if (hue < 60)
|
||||
rgba->green = m1 + (m2 - m1) * hue / 60;
|
||||
else if (hue < 180)
|
||||
rgba->green = m2;
|
||||
else if (hue < 240)
|
||||
rgba->green = m1 + (m2 - m1) * (240 - hue) / 60;
|
||||
else
|
||||
rgba->green = m1;
|
||||
|
||||
hue -= 120;
|
||||
if (hue < 0)
|
||||
hue += 360;
|
||||
|
||||
if (hue < 60)
|
||||
rgba->blue = m1 + (m2 - m1) * hue / 60;
|
||||
else if (hue < 180)
|
||||
rgba->blue = m2;
|
||||
else if (hue < 240)
|
||||
rgba->blue = m1 + (m2 - m1) * (240 - hue) / 60;
|
||||
else
|
||||
rgba->blue = m1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkPathWalk *self = GTK_PATH_WALK (widget);
|
||||
double width = gtk_widget_get_width (widget);
|
||||
double height = gtk_widget_get_height (widget);
|
||||
float length, progress;
|
||||
GskStroke *stroke;
|
||||
guint i;
|
||||
|
||||
if (self->path == NULL)
|
||||
return;
|
||||
|
||||
gtk_snapshot_save (snapshot);
|
||||
|
||||
stroke = gsk_stroke_new (2.0);
|
||||
gtk_snapshot_push_stroke (snapshot, self->path, stroke);
|
||||
gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 0, 0, 0, 1 }, &GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
gtk_snapshot_pop (snapshot);
|
||||
gsk_stroke_free (stroke);
|
||||
|
||||
length = gsk_path_measure_get_length (self->measure);
|
||||
progress = 25.f * gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (widget)) / G_USEC_PER_SEC;
|
||||
|
||||
stroke = gsk_stroke_new (1.0);
|
||||
for (i = 0; i < self->n_points; i++)
|
||||
{
|
||||
GskPathPoint point;
|
||||
graphene_point_t position;
|
||||
float angle;
|
||||
GdkRGBA color;
|
||||
float distance;
|
||||
|
||||
distance = i * length / self->n_points;
|
||||
distance = fmod (distance + progress, length);
|
||||
|
||||
gsk_path_measure_get_point (self->measure, distance, &point);
|
||||
gsk_path_point_get_position (&point, self->path, &position);
|
||||
angle = gsk_path_point_get_rotation (&point, self->path, GSK_PATH_FROM_START);
|
||||
rgba_init_from_hsla (&color, 360.f * i / self->n_points, 1, 0.5, 1);
|
||||
|
||||
gtk_snapshot_save (snapshot);
|
||||
gtk_snapshot_translate (snapshot, &position);
|
||||
gtk_snapshot_rotate (snapshot, angle);
|
||||
gtk_snapshot_append_fill (snapshot, self->arrow_path, GSK_FILL_RULE_EVEN_ODD, &color);
|
||||
gtk_snapshot_append_stroke (snapshot, self->arrow_path, stroke, &(GdkRGBA) { 0, 0, 0, 1 });
|
||||
gtk_snapshot_restore (snapshot);
|
||||
}
|
||||
|
||||
gsk_stroke_free (stroke);
|
||||
gtk_snapshot_restore (snapshot);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
GtkPathWalk *self = GTK_PATH_WALK (widget);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
*minimum = *natural = (int) ceilf (self->bounds.size.width);
|
||||
else
|
||||
*minimum = *natural = (int) ceilf (self->bounds.size.height);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_set_n_points (GtkPathWalk *self,
|
||||
gsize n_points)
|
||||
{
|
||||
if (self->n_points == n_points)
|
||||
return;
|
||||
|
||||
self->n_points = n_points;
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_N_POINTS]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_set_path (GtkPathWalk *self,
|
||||
GskPath *path)
|
||||
{
|
||||
if (self->path == path)
|
||||
return;
|
||||
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
graphene_rect_init (&self->bounds, 0, 0, 0, 0);
|
||||
if (path)
|
||||
{
|
||||
GskStroke *stroke;
|
||||
|
||||
self->path = gsk_path_ref (path);
|
||||
stroke = gsk_stroke_new (2.0);
|
||||
gsk_path_get_stroke_bounds (path, stroke, &self->bounds);
|
||||
gsk_stroke_free (stroke);
|
||||
self->measure = gsk_path_measure_new (self->path);
|
||||
}
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PATH]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
|
||||
{
|
||||
GtkPathWalk *self = GTK_PATH_WALK (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_N_POINTS:
|
||||
gtk_path_walk_set_n_points (self, g_value_get_uint (value));
|
||||
break;
|
||||
|
||||
case PROP_PATH:
|
||||
gtk_path_walk_set_path (self, g_value_get_boxed (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkPathWalk *self = GTK_PATH_WALK (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_N_POINTS:
|
||||
g_value_set_uint (value, self->n_points);
|
||||
break;
|
||||
|
||||
case PROP_PATH:
|
||||
g_value_set_boxed (value, self->path);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_dispose (GObject *object)
|
||||
{
|
||||
GtkPathWalk *self = GTK_PATH_WALK (object);
|
||||
|
||||
g_clear_pointer (&self->path, gsk_path_unref);
|
||||
g_clear_pointer (&self->measure, gsk_path_measure_unref);
|
||||
g_clear_pointer (&self->arrow_path, gsk_path_unref);
|
||||
|
||||
G_OBJECT_CLASS (gtk_path_walk_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_class_init (GtkPathWalkClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_path_walk_dispose;
|
||||
object_class->set_property = gtk_path_walk_set_property;
|
||||
object_class->get_property = gtk_path_walk_get_property;
|
||||
|
||||
widget_class->snapshot = gtk_path_walk_snapshot;
|
||||
widget_class->measure = gtk_path_walk_measure;
|
||||
|
||||
properties[PROP_N_POINTS] =
|
||||
g_param_spec_uint ("n-points",
|
||||
NULL, NULL,
|
||||
1, G_MAXUINT,
|
||||
500,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
properties[PROP_PATH] =
|
||||
g_param_spec_boxed ("path",
|
||||
NULL, NULL,
|
||||
GSK_TYPE_PATH,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tick_tick_tick (GtkWidget *self,
|
||||
GdkFrameClock *frame_clock,
|
||||
gpointer unused)
|
||||
{
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_walk_init (GtkPathWalk *self)
|
||||
{
|
||||
/* Data taken from
|
||||
* https://commons.wikimedia.org/wiki/Maps_of_the_world#/media/File:Simplified_blank_world_map_without_Antartica_(no_borders).svg
|
||||
*/
|
||||
GBytes *data = g_resources_lookup_data ("/path_walk/path_world.txt", 0, NULL);
|
||||
GskPath *path = gsk_path_parse (g_bytes_get_data (data, NULL));
|
||||
g_bytes_unref (data);
|
||||
gtk_path_walk_set_path (self, path);
|
||||
gsk_path_unref (path);
|
||||
self->arrow_path = gsk_path_parse ("M 5 0 L 0 -5. 0 -2, -5 -2, -5 2, 0 2, 0 5 Z");
|
||||
self->n_points = 500;
|
||||
gtk_widget_add_tick_callback (GTK_WIDGET (self), tick_tick_tick, NULL, NULL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_path_walk_new (void)
|
||||
{
|
||||
GtkPathWalk *self;
|
||||
|
||||
self = g_object_new (GTK_TYPE_PATH_WALK, NULL);
|
||||
|
||||
return GTK_WIDGET (self);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_path_walk (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
|
||||
g_type_ensure (GTK_TYPE_PATH_WALK);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/path_walk/path_walk.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *) &window);
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
return window;
|
||||
}
|
35
demos/gtk-demo/path_walk.ui
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="title" translatable="yes">World Map</property>
|
||||
<property name="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<child type="end">
|
||||
<object class="GtkSpinButton">
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="adjustment">
|
||||
<property name="lower">0</property>
|
||||
<property name="upper">5000</property>
|
||||
<property name="value">500</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkPathWalk" id="view">
|
||||
<property name="n-points" bind-source="adjustment" bind-property="value"/>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
1
demos/gtk-demo/path_world.txt
Normal file
@@ -1,8 +1,9 @@
|
||||
/* Pickers and Launchers
|
||||
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog, GtkFileLauncher, GtkUriLauncher
|
||||
* #Keywords: GtkColorDialog, GtkFontDialog, GtkFileDialog, GtkPrintDialog, GtkFileLauncher, GtkUriLauncher
|
||||
*
|
||||
* The dialogs are mainly intended for use in preference dialogs.
|
||||
* They allow to select colors, fonts and applications.
|
||||
* They allow to select colors, fonts and files. There is also a
|
||||
* print dialog.
|
||||
*
|
||||
* The launchers let you open files or URIs in applications that
|
||||
* can handle them.
|
||||
@@ -11,11 +12,13 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *app_picker;
|
||||
static GtkWidget *print_button;
|
||||
|
||||
static void
|
||||
set_file (GFile *file,
|
||||
gpointer data)
|
||||
{
|
||||
GFileInfo *info;
|
||||
char *name;
|
||||
|
||||
if (!file)
|
||||
@@ -31,6 +34,13 @@ set_file (GFile *file,
|
||||
|
||||
gtk_widget_set_sensitive (app_picker, TRUE);
|
||||
g_object_set_data_full (G_OBJECT (app_picker), "file", g_object_ref (file), g_object_unref);
|
||||
|
||||
info = g_file_query_info (file, "standard::content-type", 0, NULL, NULL);
|
||||
if (strcmp (g_file_info_get_content_type (info), "application/pdf") == 0)
|
||||
{
|
||||
gtk_widget_set_sensitive (print_button, TRUE);
|
||||
g_object_set_data_full (G_OBJECT (print_button), "file", g_object_ref (file), g_object_unref);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -47,6 +57,10 @@ file_opened (GObject *source,
|
||||
{
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
gtk_widget_set_sensitive (app_picker, FALSE);
|
||||
g_object_set_data (G_OBJECT (app_picker), "file", NULL);
|
||||
gtk_widget_set_sensitive (print_button, FALSE);
|
||||
g_object_set_data (G_OBJECT (print_button), "file", NULL);
|
||||
}
|
||||
|
||||
set_file (file, data);
|
||||
@@ -114,6 +128,53 @@ open_app (GtkButton *picker)
|
||||
g_object_unref (launcher);
|
||||
}
|
||||
|
||||
static void
|
||||
print_file_done (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GtkPrintDialog *dialog = GTK_PRINT_DIALOG (source);
|
||||
GError *error = NULL;
|
||||
GCancellable *cancellable;
|
||||
unsigned int id;
|
||||
|
||||
cancellable = g_task_get_cancellable (G_TASK (result));
|
||||
id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (cancellable), "timeout"));
|
||||
if (id)
|
||||
g_source_remove (id);
|
||||
|
||||
if (!gtk_print_dialog_print_file_finish (dialog, result, &error))
|
||||
{
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_file (GtkButton *picker)
|
||||
{
|
||||
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (picker)));
|
||||
GtkPrintDialog *dialog;
|
||||
GCancellable *cancellable;
|
||||
GFile *file;
|
||||
unsigned int id;
|
||||
|
||||
file = G_FILE (g_object_get_data (G_OBJECT (picker), "file"));
|
||||
dialog = gtk_print_dialog_new ();
|
||||
|
||||
cancellable = g_cancellable_new ();
|
||||
|
||||
id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,
|
||||
20,
|
||||
abort_mission, g_object_ref (cancellable), g_object_unref);
|
||||
g_object_set_data (G_OBJECT (cancellable), "timeout", GUINT_TO_POINTER (id));
|
||||
|
||||
gtk_print_dialog_print_file (dialog, parent, NULL, file, cancellable, print_file_done, NULL);
|
||||
|
||||
g_object_unref (cancellable);
|
||||
g_object_unref (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
open_uri_done (GObject *source,
|
||||
GAsyncResult *result,
|
||||
@@ -234,8 +295,14 @@ do_pickers (GtkWidget *do_widget)
|
||||
gtk_widget_set_sensitive (app_picker, FALSE);
|
||||
g_signal_connect (app_picker, "clicked", G_CALLBACK (open_app), NULL);
|
||||
gtk_box_append (GTK_BOX (picker), app_picker);
|
||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
|
||||
|
||||
print_button = gtk_button_new_from_icon_name ("printer-symbolic");
|
||||
gtk_widget_set_tooltip_text (print_button, "Print file");
|
||||
gtk_widget_set_sensitive (print_button, FALSE);
|
||||
g_signal_connect (print_button, "clicked", G_CALLBACK (print_file), NULL);
|
||||
gtk_box_append (GTK_BOX (picker), print_button);
|
||||
|
||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
|
||||
|
||||
label = gtk_label_new ("URI:");
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1,5 +1,4 @@
|
||||
#ifndef __PUZZLE_PIECE_H__
|
||||
#define __PUZZLE_PIECE_H__
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -19,5 +18,3 @@ GdkPaintable * gtk_puzzle_piece_new (GdkPaintable *puzzle,
|
||||
GdkPaintable * gtk_puzzle_piece_get_puzzle (GtkPuzzlePiece *self);
|
||||
guint gtk_puzzle_piece_get_x (GtkPuzzlePiece *self);
|
||||
guint gtk_puzzle_piece_get_y (GtkPuzzlePiece *self);
|
||||
|
||||
#endif /* __PUZZLE_PIECE_H__ */
|
||||
|
@@ -6,6 +6,6 @@
|
||||
* Also, when adding new style properties, please add them here.
|
||||
*/
|
||||
|
||||
* {
|
||||
window.demo * {
|
||||
all: unset;
|
||||
}
|
||||
|