Compare commits
1799 Commits
matthiasc/
...
theme-redu
Author | SHA1 | Date | |
---|---|---|---|
|
b1038c5d19 | ||
|
b16b44f1ae | ||
|
37c151ce0f | ||
|
eb7ad4bbad | ||
|
cdec487998 | ||
|
80d3c68615 | ||
|
ed4b3f8033 | ||
|
451e7a5ad2 | ||
|
89360b26af | ||
|
d3d4fe14c2 | ||
|
040175cd92 | ||
|
64b0c63190 | ||
|
8ff540eb4c | ||
|
9194b7388f | ||
|
6831d3e28e | ||
|
800f1c03d5 | ||
|
7a0355fcb1 | ||
|
15d58a868a | ||
|
61f21fc9e9 | ||
|
9e068d3a46 | ||
|
2aa136a19c | ||
|
1dfd514f7f | ||
|
08fbd012ec | ||
|
638508fa20 | ||
|
ce6c7bae51 | ||
|
19f7b7ed40 | ||
|
e3dba28666 | ||
|
88aa548965 | ||
|
17a9b13af2 | ||
|
1efa781a19 | ||
|
0a19d7ef08 | ||
|
926fb208ba | ||
|
e76dee07c5 | ||
|
11a43cf554 | ||
|
a7218da202 | ||
|
ed362fcc5b | ||
|
17ec74da35 | ||
|
754d6d1a04 | ||
|
ff53d5ba11 | ||
|
7233a70d47 | ||
|
12990b3520 | ||
|
95d807ab61 | ||
|
8a1a96a47e | ||
|
c31916081f | ||
|
0a1e19f4e3 | ||
|
7d3f3b7ab8 | ||
|
432b741ab7 | ||
|
703f18ce66 | ||
|
4da82bde7b | ||
|
feee281cf8 | ||
|
443fd4d63d | ||
|
4b346538e2 | ||
|
0ee58e9ef4 | ||
|
bd56bc9055 | ||
|
3e7e862415 | ||
|
4eeb413047 | ||
|
661f3466c2 | ||
|
e735554ced | ||
|
520ea7c39d | ||
|
ffa345e4ab | ||
|
e072d9b28b | ||
|
9f5b04e65c | ||
|
d08310096c | ||
|
20d0d6fae2 | ||
|
6b9ac1043b | ||
|
c5b4066714 | ||
|
b09b2dd2cd | ||
|
72a0828101 | ||
|
7379c34a39 | ||
|
6cd1b9955b | ||
|
a6a31827bc | ||
|
84939a612c | ||
|
394ea32e93 | ||
|
2bd36d490b | ||
|
ad1bc75dd2 | ||
|
7505c1fd7c | ||
|
8780906b93 | ||
|
0ed2e970be | ||
|
58253d567f | ||
|
c09c61769c | ||
|
9b5dc35650 | ||
|
3c9ada14fe | ||
|
6b4d6c3771 | ||
|
b15f16e8db | ||
|
e3b9dfef1c | ||
|
822c2aba36 | ||
|
a11f9fea76 | ||
|
f16c829190 | ||
|
16c820c2f0 | ||
|
72ae6daa1e | ||
|
35ba24d2e8 | ||
|
508cb6160c | ||
|
b9a76ddd75 | ||
|
038190c5a8 | ||
|
2ae08e632c | ||
|
99eed078bd | ||
|
6720552afd | ||
|
6f01508aa8 | ||
|
632524f679 | ||
|
22e1827f84 | ||
|
3c39613d9c | ||
|
46ff9f891a | ||
|
97ff1b83dc | ||
|
9416856420 | ||
|
c1459cc45b | ||
|
4fe8c037c7 | ||
|
b1afe5ff23 | ||
|
bbd4fb8798 | ||
|
b3b29e37fd | ||
|
f996ba6585 | ||
|
7ca36cd2d4 | ||
|
2a18f2150d | ||
|
a65fd81106 | ||
|
ff8217db40 | ||
|
a3861bf9a0 | ||
|
b86c1446a4 | ||
|
9ce58bdb0c | ||
|
9f252f0ceb | ||
|
7008a531bb | ||
|
458b8a6554 | ||
|
307cc69adb | ||
|
ab6b5ae568 | ||
|
0e601c0a70 | ||
|
5425edff82 | ||
|
213c471bb7 | ||
|
9ae0fe7f3a | ||
|
abe6876f7c | ||
|
53d74fd2dc | ||
|
3f0a830f3c | ||
|
e0323fcdc2 | ||
|
cd5cded430 | ||
|
54e4e6cd23 | ||
|
59852d3425 | ||
|
d701a89281 | ||
|
5e095cd208 | ||
|
d2bdf3d5a1 | ||
|
e692385baa | ||
|
1e8df851e9 | ||
|
904db0a8f7 | ||
|
6b7cc8baa6 | ||
|
71fe843d99 | ||
|
552a681816 | ||
|
2f0016eb08 | ||
|
f87291cac2 | ||
|
37c3ba2645 | ||
|
ba05787a06 | ||
|
12b97ffd24 | ||
|
1ae60cb713 | ||
|
3371e3aa49 | ||
|
baeae71d12 | ||
|
f8be3229b1 | ||
|
b9cfcf07e0 | ||
|
eb649d8204 | ||
|
4a00f3bc9a | ||
|
0b17658a82 | ||
|
2486f46c0b | ||
|
c03b7e4d45 | ||
|
e7a8a4eb06 | ||
|
70fbf8dbb6 | ||
|
93a1b3027d | ||
|
1de7719e34 | ||
|
f7f103a322 | ||
|
14be8f6b73 | ||
|
99a344f791 | ||
|
3419d9c04f | ||
|
c297d45b8a | ||
|
dce8d251c6 | ||
|
89ad7893ad | ||
|
da6faf321c | ||
|
c8b791a763 | ||
|
0eb728aa51 | ||
|
3300686bef | ||
|
0a96a483c6 | ||
|
5071367794 | ||
|
5ce05a8fd0 | ||
|
be2a0971c2 | ||
|
25e9a54902 | ||
|
df1c6b6b68 | ||
|
00c791fcf9 | ||
|
a5e73820da | ||
|
7fa103717d | ||
|
f8646b9733 | ||
|
d110fddbce | ||
|
b02db72e17 | ||
|
e8f30c836d | ||
|
6eaadba008 | ||
|
4495bacfd1 | ||
|
234a21905c | ||
|
13213c710f | ||
|
e165267924 | ||
|
00b25d5594 | ||
|
31fb5c287a | ||
|
416ec580dc | ||
|
ee14be8ac1 | ||
|
f27470aaf4 | ||
|
90eda2b17c | ||
|
68d43c8e5c | ||
|
c9aef3fc4d | ||
|
e8330c5eec | ||
|
531766fe64 | ||
|
25a53276e0 | ||
|
1149502767 | ||
|
33928a52c3 | ||
|
b636df7784 | ||
|
005739371c | ||
|
ec854fc503 | ||
|
e75e975a38 | ||
|
2bf81b51d9 | ||
|
22211f29fb | ||
|
8991275fbd | ||
|
f2d6a7b36a | ||
|
e43eb951d6 | ||
|
5205fa0ff7 | ||
|
842af79e97 | ||
|
6b292af6ac | ||
|
1424dd9786 | ||
|
339d3e41b0 | ||
|
9a2f7338df | ||
|
bdb127e54c | ||
|
e5d23aaaaf | ||
|
d662512c44 | ||
|
324af2f701 | ||
|
de481a7b5e | ||
|
c8018e267a | ||
|
4e264a74be | ||
|
4f49d83e43 | ||
|
eaef24c527 | ||
|
777435c470 | ||
|
fb325afc79 | ||
|
046190cb8a | ||
|
53592497a4 | ||
|
cffa45d5ff | ||
|
14166b09b5 | ||
|
8a0035333a | ||
|
1f8e633fff | ||
|
6e6b4a851f | ||
|
7444b15d47 | ||
|
dd625abfc1 | ||
|
b6f6df9662 | ||
|
aaa4e40a1f | ||
|
8ec254e2bb | ||
|
2a9911724f | ||
|
a9b4ac3d59 | ||
|
9df7f0197d | ||
|
f169d23cdb | ||
|
fcd36e59b1 | ||
|
8196478b19 | ||
|
e31bbb41d2 | ||
|
9c948909ac | ||
|
544b8d5a7f | ||
|
6ae5d9ac22 | ||
|
63c6af8d13 | ||
|
199a539ae7 | ||
|
dc3d778e01 | ||
|
2154b8e745 | ||
|
9f93464ea4 | ||
|
5987bc5d71 | ||
|
298218b1d2 | ||
|
fa7f6ad910 | ||
|
b92b7f45b5 | ||
|
2bacc0d4ef | ||
|
e4fb4b635c | ||
|
5432f73095 | ||
|
2f64651a3f | ||
|
0852d66f6e | ||
|
f3e826f4d6 | ||
|
15eb3bbbf1 | ||
|
96f822434f | ||
|
ace183f38f | ||
|
5bf030413b | ||
|
2a3dab5b94 | ||
|
96f0c26306 | ||
|
8cf41c1b66 | ||
|
027ca22def | ||
|
bd55c5842e | ||
|
c3ff175e3f | ||
|
b22c7b8b77 | ||
|
83027c68f1 | ||
|
44931a66df | ||
|
36d986f33c | ||
|
5ac73be976 | ||
|
a07a69e24e | ||
|
3e1f59af61 | ||
|
da47ccaf3c | ||
|
e9082fd9f3 | ||
|
61e88c7421 | ||
|
de31bb59a1 | ||
|
07bb29153b | ||
|
b35e5eeaf6 | ||
|
c0a450e41b | ||
|
785b33f169 | ||
|
af749dc1dc | ||
|
47982ae272 | ||
|
0020b735d9 | ||
|
e05c1b0244 | ||
|
d0b4f9eb29 | ||
|
03375b723a | ||
|
e2beb6ec50 | ||
|
ef32cff771 | ||
|
366b007024 | ||
|
40337aa1b3 | ||
|
0bb38b903e | ||
|
8acd9ffc76 | ||
|
23b29341ba | ||
|
6e52820fd2 | ||
|
173b1333ca | ||
|
784d6f8d0c | ||
|
3437f85aaf | ||
|
7916b95bc5 | ||
|
7b135c96e4 | ||
|
e662438675 | ||
|
aa2ca80817 | ||
|
9ccd514682 | ||
|
2c7afc0556 | ||
|
182cb81bdb | ||
|
ceef86895f | ||
|
001d076e61 | ||
|
408dd37944 | ||
|
9287e0e7fb | ||
|
28eb1fce04 | ||
|
49427119ab | ||
|
05891b1238 | ||
|
b14d99ad7a | ||
|
329638280c | ||
|
06365cdc38 | ||
|
1f808c479a | ||
|
7e8d61b92c | ||
|
d01e664c79 | ||
|
858997d172 | ||
|
f3d061e879 | ||
|
e2c327e025 | ||
|
48910a6d8e | ||
|
fbed55dff9 | ||
|
059917b83c | ||
|
163aa82d45 | ||
|
ba25e08e7b | ||
|
bc2c341d60 | ||
|
7e0266004e | ||
|
93d54ba10b | ||
|
5d07a66d1d | ||
|
8997dc6f31 | ||
|
9f72f4225d | ||
|
f1003d6ae8 | ||
|
b1327167e2 | ||
|
6719d3044d | ||
|
c75fdda8dd | ||
|
170e8bd605 | ||
|
96ccb25f97 | ||
|
c3c06e60dc | ||
|
ecb8dda309 | ||
|
f7975828bc | ||
|
5fdb897f06 | ||
|
8ab2e31b58 | ||
|
0d710b0353 | ||
|
06fe4f0205 | ||
|
910dd7a20a | ||
|
8d8990ccd7 | ||
|
bf3ccaa1bf | ||
|
eaa20f5cdf | ||
|
d07e22dc03 | ||
|
1ec2d1d9f1 | ||
|
f59cd392ba | ||
|
6bacb0b0ae | ||
|
530b571d89 | ||
|
ce22ef18f9 | ||
|
591f6bd7a9 | ||
|
642503afb4 | ||
|
fc0b0b14a8 | ||
|
2de4fc3ec0 | ||
|
b2ac42e576 | ||
|
b19d4b9006 | ||
|
2c28a0713d | ||
|
b423f974db | ||
|
4a430820bd | ||
|
5153cdc01d | ||
|
1db5382c6d | ||
|
6e8c78714d | ||
|
457b6657bb | ||
|
1ddd8586dd | ||
|
5ea45bf57d | ||
|
4e978d6b7a | ||
|
b4722b43a1 | ||
|
fd95cc56b1 | ||
|
d66121c61e | ||
|
35332eb3b0 | ||
|
586e7749d5 | ||
|
904835d4b1 | ||
|
cb821d5df3 | ||
|
ff056af249 | ||
|
9cce474106 | ||
|
9d84996fea | ||
|
c2d77a1f37 | ||
|
54a0037c45 | ||
|
80b988ef6c | ||
|
844801580f | ||
|
28b05eea67 | ||
|
ca1d4322a2 | ||
|
c94ec4a204 | ||
|
778d884f70 | ||
|
e8be45fabc | ||
|
c90b0581dd | ||
|
43c0ea676d | ||
|
bb4fbe3d8f | ||
|
7c4d8d49b6 | ||
|
cac39526a9 | ||
|
4c45410d43 | ||
|
8e9218df03 | ||
|
541c478eeb | ||
|
78e3e42042 | ||
|
33045c3e0b | ||
|
7974751e24 | ||
|
daa7d9072d | ||
|
90a34312d4 | ||
|
580863b112 | ||
|
fb6a8f5fc1 | ||
|
c2e2e2993b | ||
|
5763514ab8 | ||
|
4c5d8547be | ||
|
34987c0b5c | ||
|
3cd4eb0310 | ||
|
a1e9ae5259 | ||
|
e738a4d129 | ||
|
1ec950d14a | ||
|
92e20deca1 | ||
|
cd0332aad5 | ||
|
cdd33bbee6 | ||
|
bca1f6b64f | ||
|
9b99b89807 | ||
|
62f96bfda6 | ||
|
2c62cde780 | ||
|
aab10ea43b | ||
|
9428807c57 | ||
|
21e6e4c026 | ||
|
bde4cbe377 | ||
|
0b7e74318b | ||
|
e398f63bf6 | ||
|
2244eeb727 | ||
|
c3af47f5d9 | ||
|
730154df7d | ||
|
2309e1dd38 | ||
|
90c7f4608a | ||
|
66102dacf1 | ||
|
d84b60e5f9 | ||
|
9a03c8b4d8 | ||
|
f02521c502 | ||
|
c1247a7993 | ||
|
b2a747b4d4 | ||
|
c1ee2fd54a | ||
|
4c7b00fd20 | ||
|
3fba7f9dce | ||
|
7ca4a94768 | ||
|
1df0a5eab5 | ||
|
6a005c815e | ||
|
cb09211ace | ||
|
e430e0e2ff | ||
|
6ad1078595 | ||
|
cd7e9dcc27 | ||
|
8752f613d7 | ||
|
f54d3a3aca | ||
|
db525ef213 | ||
|
3f00e42ec9 | ||
|
d5fa5b9594 | ||
|
2e5fc35e51 | ||
|
6ff94f3637 | ||
|
80888d7111 | ||
|
48b46c8d08 | ||
|
df457cadfc | ||
|
58e8f2332d | ||
|
376dc4d169 | ||
|
dfd81f9c64 | ||
|
6d418134ee | ||
|
02646d74f4 | ||
|
d62be573ad | ||
|
17eef48835 | ||
|
7ffea02eb4 | ||
|
0b75edc0e1 | ||
|
d4bba7de88 | ||
|
a8902da4bc | ||
|
8ff18b3d39 | ||
|
81fa63260e | ||
|
6d452f1eb8 | ||
|
d51b8ff058 | ||
|
b11263ae91 | ||
|
0eb1228902 | ||
|
d8603864a9 | ||
|
f9ee703af4 | ||
|
a232107122 | ||
|
27834b04ae | ||
|
cbe207a8de | ||
|
1cab5e03ca | ||
|
f8c523fa72 | ||
|
e17db0abde | ||
|
cc9c45a47a | ||
|
a9c3a33620 | ||
|
f61d520ab1 | ||
|
7672e6c833 | ||
|
faf61cd112 | ||
|
1308ecb0ae | ||
|
4f6096947e | ||
|
dc18572a59 | ||
|
8493ebfe98 | ||
|
5870d9d72a | ||
|
b5b836668a | ||
|
c155ac98c8 | ||
|
600952e295 | ||
|
3b2adf5d1f | ||
|
56d99ab5cd | ||
|
29c9776daa | ||
|
eb8e0910c3 | ||
|
cfc44e09a0 | ||
|
92b50c5e2a | ||
|
dabd09bc42 | ||
|
d7e5f5b368 | ||
|
95209290c4 | ||
|
90197240d3 | ||
|
6555a2f661 | ||
|
a197b202b8 | ||
|
84e58aa393 | ||
|
e99d1605dc | ||
|
bf988f8d07 | ||
|
245851a6bb | ||
|
bb3dc16680 | ||
|
fceac594ae | ||
|
abeabc39e8 | ||
|
fd58b116cf | ||
|
a67893fe5a | ||
|
9259efb5d7 | ||
|
72f06abd13 | ||
|
923a245a80 | ||
|
38f1dbaba3 | ||
|
795ef5b4e3 | ||
|
fd9c911c3a | ||
|
a8c6ae6085 | ||
|
28e7a0a565 | ||
|
7088bd18e6 | ||
|
ccac404f28 | ||
|
6822dce8fb | ||
|
5b2cdad19e | ||
|
c7caa53917 | ||
|
fa4be719d8 | ||
|
32f088e335 | ||
|
cb81e3ee47 | ||
|
9eda683060 | ||
|
cbb0ca4902 | ||
|
9403f44aef | ||
|
dc4b7131f1 | ||
|
bf6087f2da | ||
|
23f03ca1f2 | ||
|
54a4a18bcf | ||
|
9a0b70fc84 | ||
|
6431bdcf91 | ||
|
0f73e83f44 | ||
|
0264a64f29 | ||
|
c893f79023 | ||
|
68e1c8d3e9 | ||
|
cf7dc5b2bb | ||
|
068ec58287 | ||
|
2747dd5c9f | ||
|
f6fc3073fb | ||
|
31db615885 | ||
|
3ac4c76b18 | ||
|
89b537bd8a | ||
|
7d5cfcf61d | ||
|
2e70b4c323 | ||
|
fcab0943bf | ||
|
c8fd6407a8 | ||
|
53f29ba427 | ||
|
eb3f4b302f | ||
|
59df45f3f7 | ||
|
98011e6273 | ||
|
f40965cc40 | ||
|
ab9b094f80 | ||
|
4bc60c6110 | ||
|
48ace13635 | ||
|
908d996b4f | ||
|
4e263b4042 | ||
|
f5134a833c | ||
|
f7021e80a7 | ||
|
3e7d49a8d3 | ||
|
5a6533d8fb | ||
|
5a6a9dc149 | ||
|
ad69899a9d | ||
|
3cf56817e7 | ||
|
ff6df33b6a | ||
|
e944514664 | ||
|
93bb3f7144 | ||
|
17d9ba362c | ||
|
b685d2c00a | ||
|
1a55f59f23 | ||
|
29ced09dc4 | ||
|
458fcba457 | ||
|
5218dd6a34 | ||
|
df792a088d | ||
|
94ef20ea36 | ||
|
87df17e4ce | ||
|
673a0463e0 | ||
|
0c81698911 | ||
|
a10a295515 | ||
|
3b595f5720 | ||
|
d14807b93d | ||
|
538a1a0461 | ||
|
067bd7019c | ||
|
4a4bfa0766 | ||
|
e6d0560a82 | ||
|
4d0bab0c24 | ||
|
b28da74e90 | ||
|
ba3882de83 | ||
|
20cfa2e280 | ||
|
a977094e18 | ||
|
09400b6bfe | ||
|
bbe98d9f7c | ||
|
ab681b0e05 | ||
|
ef40f22632 | ||
|
bea2dcef8f | ||
|
cc13b47542 | ||
|
8c23ccd86e | ||
|
662a8a2885 | ||
|
d4127fe0d4 | ||
|
22801f0d4d | ||
|
e050288d07 | ||
|
93af53a2fc | ||
|
e2a0ed4fcb | ||
|
fb99f834e6 | ||
|
a062b96051 | ||
|
5033fc62f2 | ||
|
bdde072c06 | ||
|
f7a4d968e9 | ||
|
252030ba59 | ||
|
f24cf29326 | ||
|
9b1d593967 | ||
|
4e3ac8f52b | ||
|
7f10641fd9 | ||
|
3ef6be0d25 | ||
|
56595e7529 | ||
|
4b798e238f | ||
|
718faf68ac | ||
|
83dc9dabed | ||
|
051f7e4118 | ||
|
cbeb096bb3 | ||
|
bf7c51cc11 | ||
|
3803209330 | ||
|
fb7d1095d1 | ||
|
45ec453b76 | ||
|
e4d628b410 | ||
|
e11d799460 | ||
|
6e38af4429 | ||
|
a70635f760 | ||
|
2c91f15f6d | ||
|
bad5ee7ed9 | ||
|
277aaab041 | ||
|
5ade831cd1 | ||
|
3b8a4340da | ||
|
ae11b29ee7 | ||
|
ac31979805 | ||
|
0b4d0f4d31 | ||
|
00bc9e6b85 | ||
|
d75fd59ddf | ||
|
84a52e3bbd | ||
|
9687d69b5a | ||
|
b18f9da807 | ||
|
6c13bbb441 | ||
|
4f128a4a21 | ||
|
e62154c91f | ||
|
78f9940ddc | ||
|
0f6c5da28d | ||
|
c7f10e570e | ||
|
e19b49f5aa | ||
|
ff13ee4b66 | ||
|
fed7d3833f | ||
|
5c6be5c0cd | ||
|
06660874ee | ||
|
4675d74e42 | ||
|
3b3a5c2d53 | ||
|
385c5e0569 | ||
|
6ec96d2e98 | ||
|
6c8d47f585 | ||
|
1bc1b82256 | ||
|
89c0df6cb7 | ||
|
c91dd2cb45 | ||
|
3408ff1dd7 | ||
|
7a46157edf | ||
|
01568dc915 | ||
|
6eb848f0e0 | ||
|
e4578b15c3 | ||
|
8fab4ceebb | ||
|
826f237782 | ||
|
435992600f | ||
|
5d4b46b2d8 | ||
|
292cea7310 | ||
|
4d7f0f330b | ||
|
5bf51adcce | ||
|
5343ec3345 | ||
|
c6cc02637e | ||
|
1576cced0f | ||
|
c9ec1c6af1 | ||
|
32b9dd64db | ||
|
6f156dad7f | ||
|
103ef3c195 | ||
|
60ea97187a | ||
|
fb7ef8f62c | ||
|
d4f49a8cb9 | ||
|
951f821d6a | ||
|
dfda88038e | ||
|
50c2b80c74 | ||
|
0d3df4fb1d | ||
|
4be675b0c9 | ||
|
0c25b4cfa8 | ||
|
c2e5aed874 | ||
|
60a9e9d342 | ||
|
8010bc4596 | ||
|
33db28c288 | ||
|
7db490ef2a | ||
|
8b1301cecd | ||
|
bc6953a081 | ||
|
4b71ed3f5e | ||
|
8fd51d761b | ||
|
66a0a8d53e | ||
|
265d9c8703 | ||
|
eaf9f7e225 | ||
|
331069f378 | ||
|
9aa270f928 | ||
|
97d189d726 | ||
|
9e2829756f | ||
|
b74a26b275 | ||
|
03d6d272f7 | ||
|
1a763c440f | ||
|
43598fc5f2 | ||
|
a4b718da4e | ||
|
086a577fd1 | ||
|
c5076675aa | ||
|
9d98707f66 | ||
|
179b39eb86 | ||
|
19e2ab76ce | ||
|
2fe23409fb | ||
|
1963ff2951 | ||
|
2b2d6bf747 | ||
|
7fd60ab570 | ||
|
25b90907ad | ||
|
f005dfa5fb | ||
|
31d2b686d6 | ||
|
3e06a9b1d2 | ||
|
641c8f3252 | ||
|
f020d77a23 | ||
|
81be6ff46b | ||
|
b7f51a362e | ||
|
b05408f854 | ||
|
fe19ad7919 | ||
|
651b746747 | ||
|
3654c05cb3 | ||
|
b6c8cf72cd | ||
|
8b57092958 | ||
|
4dc27ee4a6 | ||
|
90ff8ca797 | ||
|
7e15a13f48 | ||
|
b2c5d77883 | ||
|
90dfca290c | ||
|
a2dbc729f6 | ||
|
763321e274 | ||
|
df223ae27b | ||
|
0616fe033d | ||
|
5a516f2a22 | ||
|
70e45aa229 | ||
|
c00ec402c1 | ||
|
84095febed | ||
|
4c06c3bb19 | ||
|
34ff8f3afb | ||
|
bf08bf667c | ||
|
cd773e7cb3 | ||
|
b3cabe638f | ||
|
fafddde4bc | ||
|
412a593618 | ||
|
d6be419050 | ||
|
ceefe34027 | ||
|
b25be8a42f | ||
|
3a4e647b2d | ||
|
c67d426dc4 | ||
|
a79b6fbf35 | ||
|
496bd5783c | ||
|
8ea80801b4 | ||
|
f7aec64e6f | ||
|
8e0ad72875 | ||
|
703d69692f | ||
|
f90c0ccaf0 | ||
|
f78f8655a6 | ||
|
6edff8cd67 | ||
|
9266881691 | ||
|
dfbde3da4f | ||
|
c0c387020b | ||
|
3830e764d7 | ||
|
73d8f6a090 | ||
|
822d67295a | ||
|
e7ef4a57ca | ||
|
11c91065cf | ||
|
eefedccaee | ||
|
2ae3b46ee9 | ||
|
ef9d7612f6 | ||
|
66669e0573 | ||
|
aec3705717 | ||
|
ec0fb44958 | ||
|
6c44f7bf07 | ||
|
b2ae6ce8ff | ||
|
72fdf54e07 | ||
|
78ed520a5b | ||
|
29606af03e | ||
|
513eb11c7c | ||
|
2a6c08571f | ||
|
3276021a5b | ||
|
b1fb049277 | ||
|
5acbfce264 | ||
|
dc4f7515bd | ||
|
4e8dfdff2e | ||
|
b670bf54f7 | ||
|
530dd5a940 | ||
|
aee8a02fc8 | ||
|
0791363943 | ||
|
fe35831112 | ||
|
c2f25c0c2f | ||
|
78d71eb439 | ||
|
c488e86caa | ||
|
ad322c154c | ||
|
6f36d9865e | ||
|
d70c9453ba | ||
|
ff0909f366 | ||
|
7de62118a0 | ||
|
8742d42f32 | ||
|
4af0531e8c | ||
|
4232cbe33f | ||
|
2da445f918 | ||
|
5858b56acc | ||
|
7553649c47 | ||
|
7789d0e23f | ||
|
dc36c21835 | ||
|
049f841900 | ||
|
948ab2767b | ||
|
3c28f6d891 | ||
|
6f6ed1e4af | ||
|
e444d7315c | ||
|
5d1e006a95 | ||
|
6fcd5d5ab5 | ||
|
e759358402 | ||
|
01bd7910ce | ||
|
79c60bb7fd | ||
|
b3c332ad9c | ||
|
83982a28e7 | ||
|
d1cd6aacba | ||
|
0e8850bf84 | ||
|
d7fb33caf7 | ||
|
970d9dc06e | ||
|
a1c75795bc | ||
|
63126a1b3e | ||
|
cda9007f0f | ||
|
394955cceb | ||
|
b1a257c0c3 | ||
|
a106b54355 | ||
|
510e17d123 | ||
|
317dcddddb | ||
|
df282a13bb | ||
|
e37729756d | ||
|
3b8d9dbd28 | ||
|
03e7c7fab1 | ||
|
b231a40106 | ||
|
be30f78e62 | ||
|
89e5b8cd3a | ||
|
e356d59a92 | ||
|
4be4799316 | ||
|
7dce9e426e | ||
|
4e88d5a7cf | ||
|
fdd4630952 | ||
|
a4ed6fde9d | ||
|
dc86c744bf | ||
|
9fedcec82e | ||
|
f6b11a5158 | ||
|
38dcc8f63b | ||
|
18b011a717 | ||
|
8fc360dac5 | ||
|
4313c47113 | ||
|
b376d9617e | ||
|
efbae75f3d | ||
|
3f7a7d4ca1 | ||
|
2c04e9441a | ||
|
a3b9dba13c | ||
|
5e099e2606 | ||
|
041043eec1 | ||
|
ec9038a8f2 | ||
|
c7414db684 | ||
|
6d2c6b1257 | ||
|
9f829ebd4a | ||
|
8e14b21e52 | ||
|
46ba019522 | ||
|
3ef1dca51c | ||
|
2e55c9cf8c | ||
|
7427f4f311 | ||
|
c0a63e6dd2 | ||
|
47230f191f | ||
|
0e72adf6dd | ||
|
f5fda3ae58 | ||
|
f4a00e7909 | ||
|
e7db386018 | ||
|
2a697827e1 | ||
|
b2c3e39c89 | ||
|
03882e1f96 | ||
|
9efc4e6777 | ||
|
7cd728a0ea | ||
|
c3fb6ca747 | ||
|
3f7b401de0 | ||
|
a411959c91 | ||
|
f4ac74795c | ||
|
b64a0273c5 | ||
|
b799bc5ce1 | ||
|
fdb39b095b | ||
|
d9fa839097 | ||
|
35f8f05a63 | ||
|
810d567cc9 | ||
|
c9d3f87e43 | ||
|
3d11973df8 | ||
|
57c8a643ff | ||
|
0ffb35c9e7 | ||
|
d60097f8fe | ||
|
8f87555176 | ||
|
8cb45cdeae | ||
|
823714cf66 | ||
|
cf2bcef814 | ||
|
29d033a8b3 | ||
|
cf873f3426 | ||
|
527a8048b6 | ||
|
0c1f93cd7c | ||
|
d86832ad5a | ||
|
8df045537e | ||
|
73d40c2e6e | ||
|
90376d6d6e | ||
|
6a359c54fb | ||
|
17b7aabfc1 | ||
|
dcbecdac31 | ||
|
fa75d7f480 | ||
|
5430c80361 | ||
|
37a2cae10e | ||
|
815e18e069 | ||
|
c79acb418f | ||
|
303e20226c | ||
|
3c2312a2dd | ||
|
7eb7ee33ff | ||
|
d4dcb43aa9 | ||
|
a1bbd25e12 | ||
|
c8f4f903c6 | ||
|
b5bacb3be6 | ||
|
a9c05193a7 | ||
|
2d4e1e248d | ||
|
77ce55b9ac | ||
|
06ff60aa35 | ||
|
341b2a3d39 | ||
|
7bc50b7466 | ||
|
d9608a0357 | ||
|
92d86c4a9f | ||
|
382340c158 | ||
|
a87966b2bf | ||
|
8a6d5a77bb | ||
|
97b5775c1f | ||
|
64ff12dbd7 | ||
|
02e295ec5d | ||
|
6ff057f36a | ||
|
54bf739e8f | ||
|
d5327a61e6 | ||
|
0bca4a276a | ||
|
6056ca9265 | ||
|
73c212d89b | ||
|
6b970c6813 | ||
|
e552adf05a | ||
|
a1fc94f1f7 | ||
|
b81cd8c929 | ||
|
838fc4fdf4 | ||
|
596be280c9 | ||
|
b1d4d24c7b | ||
|
1baae1f288 | ||
|
dae06d82ae | ||
|
549a3a81ae | ||
|
ff4a33b69b | ||
|
68b4c061cf | ||
|
dbd1180ce4 | ||
|
df3b88483d | ||
|
60d2813247 | ||
|
995277f57d | ||
|
e1ca83ddbd | ||
|
f4202c5075 | ||
|
103b6a9205 | ||
|
ceabe70a42 | ||
|
73faa9c84a | ||
|
1b278b0636 | ||
|
648a67085f | ||
|
9d80db29de | ||
|
e73a40733f | ||
|
00f6d1c24b | ||
|
52c948e4e0 | ||
|
8628c573b5 | ||
|
a43d13aa74 | ||
|
259f465e01 | ||
|
6fb50ccd0d | ||
|
7a39f2d49d | ||
|
96b7c5f575 | ||
|
90fb0caf28 | ||
|
3c95798cd3 | ||
|
ec76f65d09 | ||
|
6be9e44786 | ||
|
9ce6e98487 | ||
|
4ca0a93324 | ||
|
3735c9d155 | ||
|
7f46b25c04 | ||
|
78d63a412c | ||
|
5af865f8cb | ||
|
247a68d602 | ||
|
e123853b8b | ||
|
9d2d4a69a5 | ||
|
9036d49bea | ||
|
cc7c1fe108 | ||
|
f536cf0a43 | ||
|
60307da5b1 | ||
|
6e935d469a | ||
|
4280ca2263 | ||
|
28dced597f | ||
|
6c61c7bf0b | ||
|
6442ec2f8d | ||
|
a62d78bf70 | ||
|
a4f7e2ca09 | ||
|
a19066b17c | ||
|
992173c382 | ||
|
b0f6996892 | ||
|
8d5cece080 | ||
|
ec383a2388 | ||
|
7c1cfc5533 | ||
|
14122d1acb | ||
|
f93d0f8fb5 | ||
|
833b564946 | ||
|
7edfcc37a3 | ||
|
f0b0076a1c | ||
|
71323a8b48 | ||
|
b8db9e124b | ||
|
ddd126740e | ||
|
9bf03cfeec | ||
|
011f58fa64 | ||
|
1af94d0bce | ||
|
ff6772fd98 | ||
|
be25905a8d | ||
|
e5ef26efa8 | ||
|
ebd23737c0 | ||
|
6e699e3f04 | ||
|
4a3742979d | ||
|
b09e7df81b | ||
|
516eab5c43 | ||
|
063ad28b1a | ||
|
d505573ee6 | ||
|
5f070ff233 | ||
|
b002572824 | ||
|
767849d6d2 | ||
|
76e115b910 | ||
|
8a098b1343 | ||
|
9d915ff431 | ||
|
6f0a0ce7f1 | ||
|
18d7187e4b | ||
|
d9e3eaaec8 | ||
|
0c4c88b449 | ||
|
2cb0007b89 | ||
|
eb70173646 | ||
|
2e941acb29 | ||
|
42d71f1016 | ||
|
99fc31865a | ||
|
f9b7825a47 | ||
|
e3aee62b18 | ||
|
ce3ed45e81 | ||
|
a12e563cd2 | ||
|
a5e2275a72 | ||
|
d680e2e344 | ||
|
2a8fd25a4b | ||
|
34e5f36fdf | ||
|
9223d1ee04 | ||
|
fc43ec0bbc | ||
|
be4b34aa8f | ||
|
6f73a750a7 | ||
|
4128ee88b0 | ||
|
418bdc87ef | ||
|
612ba7ec15 | ||
|
f656cbdc5b | ||
|
3eea9f3e79 | ||
|
9fa7a47081 | ||
|
13ed531301 | ||
|
7a28118f3a | ||
|
b4bce2ff8a | ||
|
2f13ac2e4d | ||
|
1d6100e7b0 | ||
|
112bc964cb | ||
|
5577cfa40c | ||
|
c73ac2ed70 | ||
|
7597f6b594 | ||
|
b50093d044 | ||
|
608e624ecf | ||
|
808961564c | ||
|
41ef6e9fa5 | ||
|
4180ad57bc | ||
|
d7d7957b04 | ||
|
376f5eacbd | ||
|
77e1fd01c3 | ||
|
43aa6d9c49 | ||
|
5ebe5be225 | ||
|
1c7191f45c | ||
|
497a43a4ba | ||
|
b2226ea1e3 | ||
|
8823882f97 | ||
|
9e415ad017 | ||
|
e062137b2c | ||
|
77aed615e8 | ||
|
4947b94a41 | ||
|
0c96b2d8f7 | ||
|
cadeca74e2 | ||
|
5a2f829a40 | ||
|
89c3a7ab24 | ||
|
7bb6abb1d4 | ||
|
de91e10a1b | ||
|
4098653974 | ||
|
71b3f47909 | ||
|
1ef30c110f | ||
|
6fd913b361 | ||
|
84edce3732 | ||
|
2cce508b33 | ||
|
56d44b4cec | ||
|
563dd65530 | ||
|
0fc2505ed6 | ||
|
b1eaa502df | ||
|
f1cf0eb3fc | ||
|
31bf9da63a | ||
|
1026bfb1ac | ||
|
92288205d4 | ||
|
e5223b1cee | ||
|
2416b4e2a0 | ||
|
2bac066a63 | ||
|
cd601ffb9e | ||
|
e54e48f6d1 | ||
|
b38869b3aa | ||
|
d063b6b6cc | ||
|
e3158a1bfb | ||
|
23c67f8c67 | ||
|
9402e335d0 | ||
|
64b9c6aaaa | ||
|
61c32f3651 | ||
|
1b2289ad9b | ||
|
dd251d85c4 | ||
|
cd2b58574d | ||
|
3830e13b98 | ||
|
c343031a0e | ||
|
835556c270 | ||
|
59cc216985 | ||
|
fe21223d48 | ||
|
f11b1d258b | ||
|
e45711e727 | ||
|
79b4510c6d | ||
|
15501afdbb | ||
|
94fe0944cc | ||
|
9c4f19e8ed | ||
|
9a1497f582 | ||
|
7db8be93f4 | ||
|
047c18844c | ||
|
30740f0e2c | ||
|
c9d9ccdb8c | ||
|
4cf63f3eb3 | ||
|
c4a2cf03b2 | ||
|
495de0b78b | ||
|
dac61b3cce | ||
|
080e5de786 | ||
|
374c9dd880 | ||
|
a5f58e8d28 | ||
|
324aa39cb8 | ||
|
d6c5ecbea3 | ||
|
ef004c64c6 | ||
|
f15e90b194 | ||
|
91b94f51f2 | ||
|
a8e9d6c1f5 | ||
|
7e80c39aee | ||
|
7f2564aabe | ||
|
07ffa9ad6b | ||
|
67035d2e35 | ||
|
9330158f11 | ||
|
8318d3bed3 | ||
|
8b9ad1e963 | ||
|
018870643a | ||
|
aa53fef39c | ||
|
faddbb18d3 | ||
|
f14978c68f | ||
|
c0de02520c | ||
|
b58f9e2aa2 | ||
|
b8a752c751 | ||
|
194039c749 | ||
|
64d0f848bc | ||
|
d8a61b3185 | ||
|
d3936f8d93 | ||
|
63bb1c2aaa | ||
|
e18a159f16 | ||
|
a1bc3ae2c8 | ||
|
2ad6c045b4 | ||
|
ec6d5839bd | ||
|
2bf9a5bd29 | ||
|
b5d4815eb7 | ||
|
188f00e05a | ||
|
9660ae5556 | ||
|
da828a9d0c | ||
|
3a054d5a90 | ||
|
ca71119a40 | ||
|
37f4c644d3 | ||
|
46d40cd4bd | ||
|
11dbc384ab | ||
|
ebd3ee9880 | ||
|
339a04da7c | ||
|
40693412d3 | ||
|
2bb0eddfb5 | ||
|
49fcbc27ca | ||
|
7fafa5133b | ||
|
0d086872ae | ||
|
f284e1d483 | ||
|
4e78dd2ae0 | ||
|
6eaeadb3b9 | ||
|
f43717a42e | ||
|
5097c1defc | ||
|
d58a381c93 | ||
|
66307f00f1 | ||
|
db1ca92790 | ||
|
732716ba95 | ||
|
03ee4229f2 | ||
|
e64cce2ca3 | ||
|
8378eb22a3 | ||
|
0d4d4e9a8c | ||
|
7ca149ff90 | ||
|
7ae5fd357c | ||
|
b8cf7ea1c6 | ||
|
308d2caf31 | ||
|
1145da3ea5 | ||
|
27d7aa1407 | ||
|
9703fcc605 | ||
|
e25bfa6a61 | ||
|
9a7607b419 | ||
|
a838a54dca | ||
|
f5e3584b5b | ||
|
80ba7fd682 | ||
|
91d91a29e8 | ||
|
3a7e3cf90d | ||
|
e1f8c1430f | ||
|
da83457a60 | ||
|
dbad440468 | ||
|
8d2ed36a1b | ||
|
762c4602fb | ||
|
5a726bc665 | ||
|
410dbdf671 | ||
|
43b8aff62c | ||
|
47c8026e38 | ||
|
b844f34cda | ||
|
46bbb397e1 | ||
|
894ac6c126 | ||
|
a824da66d9 | ||
|
08501c9510 | ||
|
a4ecfd8f33 | ||
|
28482e52be | ||
|
bf839dbb88 | ||
|
2529464e21 | ||
|
7e43034068 | ||
|
52979a0e93 | ||
|
78a5bf8e21 | ||
|
8612a8a39f | ||
|
a7de8e6b2f | ||
|
3cc57c2e3a | ||
|
a1d47ec59f | ||
|
43a9f9bd02 | ||
|
e5d83eea30 | ||
|
5f7054862b | ||
|
8ef7013165 | ||
|
723b894c19 | ||
|
c1f71ee3e8 | ||
|
222e6e5d6e | ||
|
de49e47690 | ||
|
a278edab22 | ||
|
c2bd4bc3cb | ||
|
fb856d96cd | ||
|
264967b764 | ||
|
ad23ce23ad | ||
|
41bdf16b23 | ||
|
2c843362a0 | ||
|
922f9df86f | ||
|
980934f82d | ||
|
c45ed9d76e | ||
|
b6cb1a6eb3 | ||
|
22a6aaf4c5 | ||
|
d303b5b0eb | ||
|
97ec29d3f5 | ||
|
eb2e0137fa | ||
|
0969d06925 | ||
|
c4111dad31 | ||
|
33c6032a10 | ||
|
9a631f2942 | ||
|
9332abfd5b | ||
|
883980c48c | ||
|
2e0af29839 | ||
|
cdee2ac173 | ||
|
a66ed7c461 | ||
|
09abb43628 | ||
|
de1543d4fa | ||
|
5ed3f8d98b | ||
|
affc7b58fa | ||
|
2b1e273c53 | ||
|
1a4d1f8994 | ||
|
adc7bf9f25 | ||
|
f4a8edf441 | ||
|
3dc6a07f5d | ||
|
2a0dfa9670 | ||
|
40852ea952 | ||
|
32a2a629dd | ||
|
35ac7de140 | ||
|
0d354d1dc4 | ||
|
cdd7e4c5ec | ||
|
47f2a6cafd | ||
|
313c399122 | ||
|
052d0f6e60 | ||
|
8f6cab6560 | ||
|
6203cecf97 | ||
|
6f9f18009c | ||
|
67610b1242 | ||
|
f0993fc881 | ||
|
75b130ed6b | ||
|
77d7c713d4 | ||
|
b0369fc300 | ||
|
16e38701b6 | ||
|
9d8ceb0cb2 | ||
|
c313a71c3a | ||
|
fb84fe7065 | ||
|
9be8f8cf43 | ||
|
14ecc9ec7e | ||
|
073e8dd987 | ||
|
6c6b3d0d11 | ||
|
2ab9be54fb | ||
|
11ab39617e | ||
|
7404c393f3 | ||
|
1b95cd27bc | ||
|
88e2a060f8 | ||
|
4247bf0fb6 | ||
|
f2da5e5617 | ||
|
f51ceb142b | ||
|
e1d85aeeb0 | ||
|
cc8506ca15 | ||
|
52c46e5c24 | ||
|
b12a6be9d9 | ||
|
d702c159d5 | ||
|
6e3dd6dd62 | ||
|
d9c59a7c8c | ||
|
324202a56c | ||
|
e3a67385f4 | ||
|
b4b00e2887 | ||
|
e134eef505 | ||
|
2890cd849f | ||
|
01d5ad2056 | ||
|
cc643df88b | ||
|
13eedf1a9f | ||
|
685fd3c33d | ||
|
8a1c51db1c | ||
|
6de85c0a68 | ||
|
c2dcd1bf94 | ||
|
6e0cf02494 | ||
|
36808e0c81 | ||
|
9062607d5f | ||
|
042a5736fa | ||
|
720e48ec51 | ||
|
9d0393d8e6 | ||
|
7b0b3d9547 | ||
|
bb71cdd722 | ||
|
2b425fa88a | ||
|
b99a4da939 | ||
|
c69595a3a9 | ||
|
76aba1f046 | ||
|
59028d7d0f | ||
|
0df542e494 | ||
|
47c44644b1 | ||
|
1806af1e83 | ||
|
b5dc03d940 | ||
|
c4dfacc404 | ||
|
c00896a090 | ||
|
5ace9ef4e8 | ||
|
a7d295254f | ||
|
62352dd1fc | ||
|
74b5bb12fb | ||
|
02ac7ff0aa | ||
|
c06a08d63a | ||
|
9e38a70c6b | ||
|
56f9cdd99d | ||
|
153e8a0c92 | ||
|
6ec546be02 | ||
|
dc6fe091b9 | ||
|
1f0438e7fe | ||
|
8fdb710c0f | ||
|
af98c46d04 | ||
|
7ac2982617 | ||
|
8561860aa1 | ||
|
37a9d0620d | ||
|
5e746d35b2 | ||
|
d711ca3a67 | ||
|
564a43cd3a | ||
|
17a5e9b2aa | ||
|
c0dcaccf4b | ||
|
11cd955591 | ||
|
0677bfeb7f | ||
|
b38eb6eab4 | ||
|
7d23b6dad5 | ||
|
e5e7dbf2a5 | ||
|
23211bcae8 | ||
|
59b935af38 | ||
|
d0f5ce41aa | ||
|
1698369d52 | ||
|
96a4bb446c | ||
|
ad0e901061 | ||
|
ba781eca74 | ||
|
8f1253ad26 | ||
|
e123fff545 | ||
|
904eecd1ed | ||
|
344ad65031 | ||
|
14b3b684ef | ||
|
9309153abc | ||
|
643417dc32 | ||
|
4a978dc8c4 | ||
|
bc4637fff6 | ||
|
eec219e6c7 | ||
|
a8db322be6 | ||
|
4dd780a96b | ||
|
4c22939dea | ||
|
a6c5466900 | ||
|
c789711652 | ||
|
7eb889c7aa | ||
|
49a6ad3dd1 | ||
|
ebc720bfdb | ||
|
24917ac353 | ||
|
9eeeb631ca | ||
|
07988fc17f | ||
|
4f79676b0b | ||
|
900ff743f1 | ||
|
810f55c006 | ||
|
fce37b137d | ||
|
998384aa08 | ||
|
327441fa3e | ||
|
b927609e21 | ||
|
688f8bf085 | ||
|
057f41532b | ||
|
ebc24d75af | ||
|
c1970009ff | ||
|
8f0fc24516 | ||
|
ba825dce29 | ||
|
c4b16f7424 | ||
|
cffff36436 | ||
|
7de5b391ab | ||
|
0e15032635 | ||
|
be2ba89900 | ||
|
a824be2bb9 | ||
|
348dcaa4a3 | ||
|
f240bcbbc4 | ||
|
621a427627 | ||
|
645f49cf2b | ||
|
01ba11fc71 | ||
|
f6b0e0e1c2 | ||
|
2f17ab3ce7 | ||
|
55b60f6da9 | ||
|
1f74695758 | ||
|
1ab70e2dfa | ||
|
3cbb3dc0f4 | ||
|
e3afb2fec8 | ||
|
d3857f8bd3 | ||
|
655711fef2 | ||
|
69fa15981c | ||
|
2a46d5960d | ||
|
b9b5cae6d2 | ||
|
3249756648 | ||
|
8ef9009bde | ||
|
093eac9441 | ||
|
93c6f2256f | ||
|
1151da5cf3 | ||
|
a6f9052cf1 | ||
|
a437162f6d | ||
|
9ecd448682 | ||
|
74cb1ca2f5 | ||
|
e94e703685 | ||
|
4cceba06bc | ||
|
ab84b17c1a | ||
|
7fd06cacbd | ||
|
b471158e38 | ||
|
8388791f87 | ||
|
cbb05a3eab | ||
|
4cfac3b91c | ||
|
17ddae5bf9 | ||
|
75ef8d8a50 | ||
|
47b8facca4 | ||
|
bf8fb2c1a5 | ||
|
b7ee2cbc28 | ||
|
b1d64a6b3a | ||
|
60095ade9b | ||
|
3a727eed7a | ||
|
64c6229f54 | ||
|
60be37d63a | ||
|
e044656d99 | ||
|
c0fef36692 | ||
|
a67bd7a04e | ||
|
e152d25ac0 | ||
|
b561eb8299 | ||
|
6150344195 | ||
|
24fede0225 | ||
|
e27413a9ed | ||
|
03317ec2ec | ||
|
1a671cfd63 | ||
|
24e28309fb | ||
|
44e153d8a8 | ||
|
d72301b3c1 | ||
|
e00030dff2 | ||
|
9cccb944ef | ||
|
1363cacb3a | ||
|
68dbb3f31a | ||
|
8a60f5dc78 | ||
|
3d9e622fda | ||
|
645af0917c | ||
|
c247e7680b | ||
|
1da23b0c21 | ||
|
de299bb6bf | ||
|
65cc8305c9 | ||
|
bdbafe63f9 | ||
|
2be29f982d | ||
|
79699cc20d | ||
|
c7ab02d38c | ||
|
e67f0bfcfd | ||
|
56dc99a9fb | ||
|
cf69b7d4c2 | ||
|
e45b668e04 | ||
|
769dae2c71 | ||
|
048effdc5a | ||
|
b916723baf | ||
|
2dba92fd0c | ||
|
a11b1bd08e | ||
|
bc682bef74 | ||
|
580384e962 | ||
|
18965eec83 | ||
|
145ccfe1c4 | ||
|
d01070d472 | ||
|
b3f5243aeb | ||
|
20aec5a744 | ||
|
4a2d539251 | ||
|
a772bf7517 | ||
|
57ecb2829a | ||
|
d45d604df1 | ||
|
6317fd3529 | ||
|
8282698201 | ||
|
fcc3c12919 | ||
|
7c73f2fb02 | ||
|
6ff9f2198d | ||
|
1c253f5dfa | ||
|
a0533923fb | ||
|
5c594fc46a | ||
|
b6e2699409 | ||
|
8788c76bd9 | ||
|
6865744034 | ||
|
de02769a2f | ||
|
d69f7fd63e | ||
|
adccd1391e | ||
|
b529f77827 | ||
|
021aaef824 | ||
|
c691399a80 | ||
|
2f369b6d7a | ||
|
8703c7b7ac | ||
|
e41e8072b1 | ||
|
d1bd1270c9 | ||
|
34cc68003c | ||
|
ac7dd02f8f | ||
|
9746b728ca | ||
|
0ad791277a | ||
|
54f6515005 | ||
|
25c25ba5c1 | ||
|
fac435ba98 | ||
|
b996b85504 | ||
|
1cb575a138 | ||
|
9a446f2041 | ||
|
9e6ae7acd8 | ||
|
955305a034 | ||
|
b1d5de78e1 | ||
|
47c21a255f | ||
|
005ea7a09d | ||
|
ed6c0dc15c | ||
|
1e6171a4a7 | ||
|
85ad943832 | ||
|
b7b251019e | ||
|
ed742f1d6c | ||
|
fcb08a28bf | ||
|
b75d408d6d | ||
|
98b42f6740 | ||
|
416182a20d | ||
|
31713ab5ef | ||
|
b9c880f58d | ||
|
db9730b734 | ||
|
546a748cd8 | ||
|
8722837e67 | ||
|
3177ac4270 | ||
|
3f7e409428 | ||
|
903af75fa1 | ||
|
6640881711 | ||
|
3bb8b56ab3 | ||
|
a1635719fc | ||
|
3cb150abbe | ||
|
cc22987b1b | ||
|
410541f82b | ||
|
c91be540c3 | ||
|
138de60ab2 | ||
|
571021cbc1 | ||
|
f7a5dd7b8b | ||
|
544cd1acfc | ||
|
4b96ba592f | ||
|
7e8d8218b9 | ||
|
3bba52ed67 | ||
|
48b9791989 | ||
|
4c3363b8c2 | ||
|
10023b5d6d | ||
|
bbbe39fb44 | ||
|
b713b9f68d | ||
|
bfebc2b01a | ||
|
a1856c30d9 | ||
|
008eb04125 | ||
|
85e59220a5 | ||
|
b8ffe5b245 | ||
|
4685fe1716 | ||
|
046de4ccbf | ||
|
a3be0ec5f0 | ||
|
ef7172dc1e | ||
|
308d434b57 | ||
|
e4170661b9 | ||
|
0a8d7603ea | ||
|
f8d3845b1a | ||
|
4ab12ab755 | ||
|
69ed4c90e5 | ||
|
f2915180a6 | ||
|
e7f2833703 | ||
|
66af531ff3 | ||
|
621120d1d3 | ||
|
f84fdfc0c1 | ||
|
27223f7956 | ||
|
5faf977f66 | ||
|
7fbb37a09f | ||
|
7027fc9ab6 | ||
|
7479564972 | ||
|
09612a1b3c | ||
|
79c8a16b8d | ||
|
6104c12392 | ||
|
0c5ba00d59 | ||
|
9f55377b69 | ||
|
f140b151e1 | ||
|
c91c4b60e7 | ||
|
a46f9af1c0 | ||
|
4071e1e734 | ||
|
99c89d61e1 | ||
|
09ef67afbc | ||
|
d478ae1ef5 | ||
|
b67d582230 | ||
|
498ab6ac6c | ||
|
c69327caa8 | ||
|
d1cd578d59 | ||
|
5f8c2b52c6 | ||
|
27799ba4f5 | ||
|
2ec51b7010 | ||
|
f7cd2a782b | ||
|
ff0642bba6 | ||
|
b227a2f190 | ||
|
2b202129bb | ||
|
d1c6d78ebb | ||
|
6a8001fe7d | ||
|
ff3e022182 | ||
|
d2f26b2f27 | ||
|
55db9d07c5 | ||
|
1be932279c | ||
|
56ec748824 | ||
|
1e6a82513b | ||
|
b087f9ca51 | ||
|
e2f778602b | ||
|
6a15e9169d | ||
|
929d325560 | ||
|
cb60c1b83d | ||
|
ab69d43089 | ||
|
6af4b6a644 | ||
|
0d666f0cec | ||
|
317b395f0f | ||
|
71b3b54215 | ||
|
97b24b0732 | ||
|
6ffb54f47f | ||
|
afa6cc2369 | ||
|
dbe021239f | ||
|
884e06ad37 | ||
|
53c542765f | ||
|
c42977af04 | ||
|
aefd8443de | ||
|
b96ab7453b | ||
|
3ac7e30455 | ||
|
aef67bd53a | ||
|
bba5de7c6d | ||
|
556a8a8351 | ||
|
5e95e15a03 | ||
|
248883089c | ||
|
aabb250741 | ||
|
83cccfc984 | ||
|
b97054fc38 | ||
|
b859407620 | ||
|
75c73ac3cd | ||
|
10e4c04e61 | ||
|
b378f566d7 | ||
|
5776d0dd99 | ||
|
59994bdd22 | ||
|
db8276f470 | ||
|
c3421cea25 | ||
|
6830845fda | ||
|
db5d9ccdfb | ||
|
51e155bffa | ||
|
98e6e0cf77 | ||
|
058f82d03d | ||
|
a7b34df6af | ||
|
b3f454ed98 | ||
|
fd021e794c | ||
|
5e3cbff8d2 | ||
|
f0fe2e0743 | ||
|
c6158f1684 | ||
|
65050a1c81 | ||
|
12ec090a7b | ||
|
17ca95a161 | ||
|
5be14577d6 | ||
|
1a9ab1a32f | ||
|
c7dca199ae | ||
|
50a3d9be6a | ||
|
5e4b102273 | ||
|
632fab0ca7 | ||
|
43339f1c1c | ||
|
afbff574f5 | ||
|
aff25212df | ||
|
18cb15a05a | ||
|
6c8b65baf9 | ||
|
495eaf31d4 | ||
|
ccdc3ee406 | ||
|
93cf76b068 | ||
|
170130f1d9 | ||
|
6aac56e144 | ||
|
2d5a8974b3 | ||
|
146b921246 | ||
|
8b93ea9238 | ||
|
aa7c5e96a6 | ||
|
1953bc92bc | ||
|
98eeee5bce | ||
|
49b47c9133 | ||
|
af6128b3ab | ||
|
496f3c17bd | ||
|
c2d69643a8 | ||
|
9c6669be48 | ||
|
d0aa79b5a1 | ||
|
4b63523b1f | ||
|
997186f640 | ||
|
3940482820 | ||
|
616a83fb53 | ||
|
baeadea342 | ||
|
04beedfef0 | ||
|
da73394abd | ||
|
d0f69794a5 | ||
|
185ef214fa | ||
|
b530c83d98 | ||
|
b83caec6b9 | ||
|
3cdde3fc4b | ||
|
5040d81e03 | ||
|
05b9a99661 | ||
|
a16e1cbf18 | ||
|
c7ea83cd82 | ||
|
352c9ba42a | ||
|
30b37dd7c5 | ||
|
2e256986c3 | ||
|
77e0d360ed | ||
|
942a93250a | ||
|
7ccd6597c3 | ||
|
355a417dba | ||
|
36e3f4d902 | ||
|
69fe705d0d | ||
|
f62535affc | ||
|
1a56a10fc1 | ||
|
4287f0def4 | ||
|
7bebc3e2b2 | ||
|
b4e2df8fca | ||
|
0df0de0b5d | ||
|
53c22bf833 | ||
|
d8144ec497 | ||
|
3d9e3390f1 | ||
|
03595f9567 | ||
|
64e026d0a9 | ||
|
0623b00512 | ||
|
ac902e697e | ||
|
f1ff69963e | ||
|
731ae8f39e | ||
|
7da6fdc30e | ||
|
a297129685 | ||
|
f15a34c7e4 | ||
|
b36258f204 | ||
|
e75bc172ef | ||
|
4b2e4f6628 | ||
|
26febcc3a8 | ||
|
5dd7f20dab | ||
|
fc15a409cc | ||
|
4b96e7fc78 |
11
.clang-format
Normal file
11
.clang-format
Normal file
@@ -0,0 +1,11 @@
|
||||
# See https://wiki.apertis.org/Guidelines/Coding_conventions#Code_formatting
|
||||
BasedOnStyle: GNU
|
||||
AlwaysBreakAfterDefinitionReturnType: All
|
||||
BreakBeforeBinaryOperators: None
|
||||
BinPackParameters: false
|
||||
SpaceAfterCStyleCast: true
|
||||
# Our column limit is actually 80, but setting that results in clang-format
|
||||
# making a lot of dubious hanging-indent choices; disable it and assume the
|
||||
# developer will line wrap appropriately. clang-format will still check
|
||||
# existing hanging indents.
|
||||
ColumnLimit: 0
|
130
.gitlab-ci.yml
130
.gitlab-ci.yml
@@ -1,7 +1,9 @@
|
||||
stages:
|
||||
- build
|
||||
- analysis
|
||||
- docs
|
||||
- flatpak
|
||||
# - deploy
|
||||
- deploy
|
||||
|
||||
.cache-paths: &cache-paths
|
||||
paths:
|
||||
@@ -12,11 +14,40 @@ stages:
|
||||
- subprojects/libepoxy/
|
||||
- subprojects/pango/
|
||||
|
||||
fedora-x86_64: &fedora-x86_64-defaults
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v9
|
||||
stage: build
|
||||
# Common variables
|
||||
variables:
|
||||
COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 2
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
- branches
|
||||
except:
|
||||
- tags
|
||||
|
||||
style-check-diff:
|
||||
extends: .only-default
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: .pre
|
||||
allow_failure: true
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/test-docker.sh
|
||||
- .gitlab-ci/run-style-check-diff.sh
|
||||
|
||||
fedora-x86_64:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: build
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS}
|
||||
-Dx11-backend=true
|
||||
-Dwayland-backend=true
|
||||
-Dbroadway-backend=true
|
||||
-Dvulkan=yes
|
||||
-Dprofiler=true
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
@@ -34,10 +65,36 @@ fedora-x86_64: &fedora-x86_64-defaults
|
||||
key: "$CI_JOB_NAME"
|
||||
<<: *cache-paths
|
||||
|
||||
fedora-x86_64-staticlibs:
|
||||
release-build:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: build
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
|
||||
<<: *fedora-x86_64-defaults
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS}
|
||||
-Dx11-backend=true
|
||||
-Dwayland-backend=true
|
||||
-Dbroadway-backend=true
|
||||
-Dvulkan=yes
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit:
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report.html"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap"
|
||||
cache:
|
||||
key: "$CI_JOB_NAME"
|
||||
<<: *cache-paths
|
||||
|
||||
.mingw-defaults: &mingw-defaults
|
||||
stage: build
|
||||
@@ -59,6 +116,9 @@ msys2-mingw32:
|
||||
.flatpak-defaults: &flatpak-defaults
|
||||
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
|
||||
stage: flatpak
|
||||
allow_failure: true
|
||||
tags:
|
||||
- flatpak
|
||||
artifacts:
|
||||
paths:
|
||||
- "${APPID}-dev.flatpak"
|
||||
@@ -107,19 +167,41 @@ flatpak-master:icon-browser:
|
||||
APPID: org.gtk.IconBrowser4
|
||||
<<: *flatpak-master
|
||||
|
||||
#pages:
|
||||
# image: registry.gitlab.gnome.org/gnome/gtk/master:v6
|
||||
# stage: deploy
|
||||
# script:
|
||||
# - meson -Dgtk_doc=true _build .
|
||||
# - ninja -C _build
|
||||
# - ninja -C _build gdk4-doc gsk4-doc gtk4-doc
|
||||
# - mkdir -p public/
|
||||
# - mv _build/docs/reference/gtk/html/ public/gtk/
|
||||
# - mv _build/docs/reference/gdk/html/ public/gdk/
|
||||
# - mv _build/docs/reference/gsk/html/ public/gsk/
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - public
|
||||
# only:
|
||||
# - master
|
||||
static-scan:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: analysis
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} _scan_build
|
||||
- ninja -C _scan_build scan-build
|
||||
artifacts:
|
||||
paths:
|
||||
- _scan_build/meson-logs
|
||||
allow_failure: true
|
||||
|
||||
reference:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: docs
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dgtk_doc=true _build
|
||||
- ninja -C _build gdk4-doc gsk4-doc gtk4-doc
|
||||
- mkdir -p _reference/
|
||||
- mv _build/docs/reference/gdk/html/ _reference/gdk/
|
||||
- mv _build/docs/reference/gsk/html/ _reference/gsk/
|
||||
- mv _build/docs/reference/gtk/html/ _reference/gtk/
|
||||
artifacts:
|
||||
paths:
|
||||
- _reference
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
- mv _reference/ public/
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
|
38
.gitlab-ci/README.md
Normal file
38
.gitlab-ci/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## GTK CI infrastructure
|
||||
|
||||
GTK uses different CI images depending on platform and jobs.
|
||||
|
||||
The CI images are Docker containers, generated either using `docker` or
|
||||
`podman`, and pushed to the GitLab [container registry][registry].
|
||||
|
||||
Each Docker image has a tag composed of two parts:
|
||||
|
||||
- `${image}`: the base image for a given platform, like "fedora" or
|
||||
"debian-stable"
|
||||
- `${number}`: an incremental version number, or `latest`
|
||||
|
||||
See the [container registry][registry] for the available images for each
|
||||
branch, as well as their available versions.
|
||||
|
||||
### Checklist for Updating a CI image
|
||||
|
||||
- [ ] Update the `${image}.Dockerfile` file with the dependencies
|
||||
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
|
||||
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
|
||||
once the Docker image is built; you may need to log in by using
|
||||
`docker login` or `podman login`
|
||||
- [ ] Update the `image` keys in the `.gitlab-ci.yml` file with the new
|
||||
image tag
|
||||
- [ ] Open a merge request with your changes and let it run
|
||||
|
||||
### Checklist for Adding a new CI image
|
||||
|
||||
- [ ] Write a new `${image}.Dockerfile` with the instructions to set up
|
||||
a build environment
|
||||
- [ ] Add the `pip3 install meson` incantation
|
||||
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
|
||||
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
|
||||
- [ ] Add the new job to `.gitlab-ci.yml` referencing the image
|
||||
- [ ] Open a merge request with your changes and let it run
|
||||
|
||||
[registry]: https://gitlab.gnome.org/GNOME/gtk/container_registry
|
133
.gitlab-ci/clang-format-diff.py
Executable file
133
.gitlab-ci/clang-format-diff.py
Executable file
@@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# === clang-format-diff.py - ClangFormat Diff Reformatter ---*- python -*-=== #
|
||||
#
|
||||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
# See https://llvm.org/LICENSE.txt for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
# ===---------------------------------------------------------------------=== #
|
||||
|
||||
"""
|
||||
This script reads input from a unified diff and reformats all the changed
|
||||
lines. This is useful to reformat all the lines touched by a specific patch.
|
||||
Example usage for git/svn users:
|
||||
|
||||
git diff -U0 --no-color HEAD^ | clang-format-diff.py -p1 -i
|
||||
svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import argparse
|
||||
import difflib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
if sys.version_info.major >= 3:
|
||||
from io import StringIO
|
||||
else:
|
||||
from io import BytesIO as StringIO
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument('-i', action='store_true', default=False,
|
||||
help='apply edits to files instead of displaying a '
|
||||
'diff')
|
||||
parser.add_argument('-p', metavar='NUM', default=0,
|
||||
help='strip the smallest prefix containing P slashes')
|
||||
parser.add_argument('-regex', metavar='PATTERN', default=None,
|
||||
help='custom pattern selecting file paths to reformat '
|
||||
'(case sensitive, overrides -iregex)')
|
||||
parser.add_argument('-iregex', metavar='PATTERN',
|
||||
default=r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|m|mm|inc'
|
||||
r'|js|ts|proto|protodevel|java|cs)',
|
||||
help='custom pattern selecting file paths to reformat '
|
||||
'(case insensitive, overridden by -regex)')
|
||||
parser.add_argument('-sort-includes', action='store_true', default=False,
|
||||
help='let clang-format sort include blocks')
|
||||
parser.add_argument('-v', '--verbose', action='store_true',
|
||||
help='be more verbose, ineffective without -i')
|
||||
parser.add_argument('-style',
|
||||
help='formatting style to apply (LLVM, Google, '
|
||||
'Chromium, Mozilla, WebKit)')
|
||||
parser.add_argument('-binary', default='clang-format',
|
||||
help='location of binary to use for clang-format')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Extract changed lines for each file.
|
||||
filename = None
|
||||
lines_by_file = {}
|
||||
for line in sys.stdin:
|
||||
match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
|
||||
if match:
|
||||
filename = match.group(2)
|
||||
if filename is None:
|
||||
continue
|
||||
|
||||
if args.regex is not None:
|
||||
if not re.match('^%s$' % args.regex, filename):
|
||||
continue
|
||||
else:
|
||||
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
|
||||
continue
|
||||
|
||||
match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line)
|
||||
if match:
|
||||
start_line = int(match.group(1))
|
||||
line_count = 1
|
||||
if match.group(3):
|
||||
line_count = int(match.group(3))
|
||||
if line_count == 0:
|
||||
continue
|
||||
end_line = start_line + line_count - 1
|
||||
lines_by_file.setdefault(filename, []).extend(
|
||||
['-lines', str(start_line) + ':' + str(end_line)])
|
||||
|
||||
# Reformat files containing changes in place.
|
||||
# We need to count amount of bytes generated in the output of
|
||||
# clang-format-diff. If clang-format-diff doesn't generate any bytes it
|
||||
# means there is nothing to format.
|
||||
format_line_counter = 0
|
||||
for filename, lines in lines_by_file.items():
|
||||
if args.i and args.verbose:
|
||||
print('Formatting {}'.format(filename))
|
||||
command = [args.binary, filename]
|
||||
if args.i:
|
||||
command.append('-i')
|
||||
if args.sort_includes:
|
||||
command.append('-sort-includes')
|
||||
command.extend(lines)
|
||||
if args.style:
|
||||
command.extend(['-style', args.style])
|
||||
p = subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=None,
|
||||
stdin=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
stdout, _ = p.communicate()
|
||||
if p.returncode != 0:
|
||||
sys.exit(p.returncode)
|
||||
|
||||
if not args.i:
|
||||
with open(filename) as f:
|
||||
code = f.readlines()
|
||||
formatted_code = StringIO(stdout).readlines()
|
||||
diff = difflib.unified_diff(code, formatted_code,
|
||||
filename, filename,
|
||||
'(before formatting)',
|
||||
'(after formatting)')
|
||||
diff_string = ''.join(diff)
|
||||
if diff_string:
|
||||
format_line_counter += sys.stdout.write(diff_string)
|
||||
|
||||
if format_line_counter > 0:
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@@ -8,9 +8,12 @@ RUN dnf -y install \
|
||||
cairo-devel \
|
||||
cairo-gobject-devel \
|
||||
ccache \
|
||||
clang \
|
||||
clang-analyzer \
|
||||
colord-devel \
|
||||
cups-devel \
|
||||
dbus-daemon \
|
||||
dbus-x11 \
|
||||
dejavu-sans-mono-fonts \
|
||||
desktop-file-utils \
|
||||
diffutils \
|
||||
@@ -23,6 +26,7 @@ RUN dnf -y install \
|
||||
gettext \
|
||||
git \
|
||||
glib2-devel \
|
||||
glib2-static \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gobject-introspection-devel \
|
||||
@@ -61,9 +65,11 @@ RUN dnf -y install \
|
||||
ninja-build \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
pcre-static \
|
||||
python3 \
|
||||
python3-jinja2 \
|
||||
python3-pip \
|
||||
python3-pygments \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
@@ -76,7 +82,7 @@ RUN dnf -y install \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
|
||||
RUN pip3 install meson==0.50.1
|
||||
RUN pip3 install meson==0.53.1
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
@@ -4,20 +4,19 @@ set -e
|
||||
|
||||
appid=$1
|
||||
|
||||
builddir=app
|
||||
builddir=flatpak_app
|
||||
repodir=repo
|
||||
|
||||
flatpak-builder \
|
||||
--user --disable-rofiles-fuse \
|
||||
--stop-at=gtk \
|
||||
${builddir} \
|
||||
build-aux/flatpak/${appid}.json
|
||||
|
||||
flatpak-builder \
|
||||
--run ${builddir} build-aux/flatpak/${appid}.json \
|
||||
meson \
|
||||
--prefix /app \
|
||||
--libdir /app/lib \
|
||||
--buildtype debug \
|
||||
flatpak build ${builddir} meson \
|
||||
--prefix=/app \
|
||||
--libdir=/app/lib \
|
||||
--buildtype=release \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dprint-backends=file \
|
||||
@@ -25,13 +24,12 @@ flatpak-builder \
|
||||
-Dbuild-examples=false \
|
||||
-Dintrospection=false \
|
||||
-Ddemos=true \
|
||||
_build .
|
||||
|
||||
flatpak-builder \
|
||||
--run ${builddir} build-aux/flatpak/${appid}.json \
|
||||
ninja -C _build install
|
||||
_flatpak_build
|
||||
|
||||
flatpak build ${builddir} ninja -C _flatpak_build install
|
||||
|
||||
flatpak-builder \
|
||||
--user --disable-rofiles-fuse \
|
||||
--finish-only \
|
||||
--repo=${repodir} \
|
||||
${builddir} \
|
||||
@@ -40,5 +38,5 @@ flatpak-builder \
|
||||
flatpak build-bundle \
|
||||
${repodir} \
|
||||
${appid}-dev.flatpak \
|
||||
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
|
||||
--runtime-repo=https://nightly.gnome.org/gnome-nightly.flatpakrepo \
|
||||
${appid}
|
||||
|
@@ -138,22 +138,25 @@ ul.images li {
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>{{ report.project_name }} :: Test Reports</h1>
|
||||
<div class="report-meta">
|
||||
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
|
||||
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
|
||||
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
|
||||
</div>
|
||||
<h1>{{ report.project_name }}/{{ report.branch_name }} :: Test Reports</h1>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<section>
|
||||
<div class="report-meta">
|
||||
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
|
||||
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
|
||||
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="summary">
|
||||
<h3><a name="summary">Summary</a></h3>
|
||||
<ul>
|
||||
<li><strong>Total units:</strong> {{ report.total_units }}</li>
|
||||
<li><strong>Passed:</strong> <a href="#passed">{{ report.total_successes }}</a></li>
|
||||
<li><strong>Failed:</strong> <a href="#failures">{{ report.total_failures }}</a></li>
|
||||
<li><strong>Failed:</strong> {{ report.total_failures }}</li>
|
||||
<li><strong>Passed:</strong> {{ report.total_successes }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -164,30 +167,47 @@ ul.images li {
|
||||
<h3><a name="results">Suite: {{ suite_result.suite_name }}</a></h3>
|
||||
<ul>
|
||||
<li><strong>Units:</strong> {{ suite_result.n_units }}</li>
|
||||
<li><strong>Passed:</strong> {{ suite_result.n_successes }}</li>
|
||||
<li><strong>Failed:</strong> {{ suite_result.n_failures }}</li>
|
||||
<li><strong>Failed:</strong> <a href="#{{ suite_result.suite_name }}-failed">{{ suite_result.n_failures }}</a></li>
|
||||
<li><strong>Passed:</strong> <a href="#{{ suite_result.suite_name }}-passed">{{ suite_result.n_successes }}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="failures">
|
||||
<h4><a name="{{ suite_result.suite_name }}-failed">Failures</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result in [ 'ERROR', 'FAIL', 'UNEXPECTEDPASS' ] %}
|
||||
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
|
||||
{% if failure.stdout %}
|
||||
Output: <pre>{{ failure.stdout }}</pre>
|
||||
{% endif %}
|
||||
{% if failure.image_data is defined %}
|
||||
<ul class="images">
|
||||
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
|
||||
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
|
||||
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="{{ suite_result.suite_name }}-timed-out">Timed out</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result == 'TIMEOUT' %}
|
||||
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
|
||||
{% if failure.stdout %}
|
||||
Output: <pre>{{ failure.stdout }}</pre>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="successes">
|
||||
<h4><a name="passed">Passed</a></h4>
|
||||
<ul class="passed">
|
||||
{% for success in suite_result.successes if success.result == 'OK' %}
|
||||
<li>{{ success.name }} - result: <span class="result pass">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="skipped">Skipped</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'SKIP' %}
|
||||
<li>{{ success.name }} - result: <span class="result skip">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="expected-fail">Expected failures</a></h4>
|
||||
<h4><a name="{{ suite_result.suite_name }}-expected-fail">Expected failures</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'EXPECTEDFAIL' %}
|
||||
<li><a name="{{ success.name }}">{{ success.name }}</a> - result: <span class="result xfail">{{ success.result }}</span><br/>
|
||||
@@ -206,37 +226,20 @@ ul.images li {
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="failures">
|
||||
<h4><a name="failed">Failed</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result == 'FAIL' %}
|
||||
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
|
||||
{% if failure.stdout %}
|
||||
Output: <pre>{{ failure.stdout }}</pre>
|
||||
{% endif %}
|
||||
{% if failure.image_data is defined %}
|
||||
<ul class="images">
|
||||
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
|
||||
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
|
||||
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
<h4><a name="{{ suite_result.suite_name }}-skipped">Skipped</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'SKIP' %}
|
||||
<li>{{ success.name }} - result: <span class="result skip">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="timed-out">Timed out</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result == 'TIMEOUT' %}
|
||||
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
|
||||
{% if failure.stdout %}
|
||||
Output: <pre>{{ failure.stdout }}</pre>
|
||||
{% endif %}
|
||||
</li>
|
||||
<h4><a name="{{ suite_result.suite_name }}-passed">Passed</a></h4>
|
||||
<ul class="passed">
|
||||
{% for success in suite_result.successes if success.result == 'OK' %}
|
||||
<li>{{ success.name }} - result: <span class="result pass">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
@@ -328,7 +331,7 @@ for name, units in suites.items():
|
||||
print('Processing {} suite {}:'.format(project_name, suite_name))
|
||||
|
||||
def if_failed(unit):
|
||||
if unit['result'] in ['FAIL', 'TIMEOUT']:
|
||||
if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT', 'ERROR',]:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@@ -51,6 +51,7 @@ for line in args.infile:
|
||||
|
||||
duration = data['duration']
|
||||
return_code = data['returncode']
|
||||
result = data['result']
|
||||
log = data['stdout']
|
||||
|
||||
unit = {
|
||||
@@ -58,6 +59,7 @@ for line in args.infile:
|
||||
'name': unit_name,
|
||||
'duration': duration,
|
||||
'returncode': return_code,
|
||||
'result': result,
|
||||
'stdout': log,
|
||||
}
|
||||
|
||||
@@ -68,12 +70,12 @@ for name, units in suites.items():
|
||||
print('Processing suite {} (units: {})'.format(name, len(units)))
|
||||
|
||||
def if_failed(unit):
|
||||
if unit['returncode'] != 0:
|
||||
if unit['result'] in ['ERROR', 'FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
|
||||
return True
|
||||
return False
|
||||
|
||||
def if_succeded(unit):
|
||||
if unit['returncode'] == 0:
|
||||
if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@@ -1,11 +1,135 @@
|
||||
#!/bin/bash
|
||||
|
||||
read_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read "$1" <<< "${BASH_REMATCH[1]}"
|
||||
else
|
||||
read "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
set -e
|
||||
|
||||
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v7"
|
||||
build=0
|
||||
run=0
|
||||
push=0
|
||||
list=0
|
||||
print_help=0
|
||||
no_login=0
|
||||
|
||||
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
|
||||
--file "Dockerfile" .
|
||||
sudo docker run --rm --security-opt label=disable \
|
||||
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
|
||||
--tty --interactive "${TAG}" bash
|
||||
while (($# > 0)); do
|
||||
case "${1%%=*}" in
|
||||
build) build=1;;
|
||||
run) run=1;;
|
||||
push) push=1;;
|
||||
list) list=1;;
|
||||
help) print_help=1;;
|
||||
--base|-b) read_arg base "$@" || shift;;
|
||||
--base-version) read_arg base_version "$@" || shift;;
|
||||
--no-login) no_login=1;;
|
||||
*) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $print_help == 1 ]; then
|
||||
echo "$0 - Build and run Docker images"
|
||||
echo ""
|
||||
echo "Usage: $0 <command> [options] [basename]"
|
||||
echo ""
|
||||
echo "Available commands"
|
||||
echo ""
|
||||
echo " build --base=<BASENAME> - Build Docker image <BASENAME>.Dockerfile"
|
||||
echo " run --base=<BASENAME> - Run Docker image <BASENAME>"
|
||||
echo " push --base=<BASENAME> - Push Docker image <BASENAME> to the registry"
|
||||
echo " list - List available images"
|
||||
echo " help - This help message"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ $list == 1 ]; then
|
||||
echo "Available Docker images:"
|
||||
for f in *.Dockerfile; do
|
||||
filename=$( basename -- "$f" )
|
||||
basename="${filename%.*}"
|
||||
|
||||
echo -e " \e[1;39m$basename\e[0m"
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# All commands after this require --base to be set
|
||||
if [ -z $base ]; then
|
||||
echo "Usage: $0 <command>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$base.Dockerfile" ]; then
|
||||
echo -e "\e[1;31mERROR\e[0m: Dockerfile for '$base' not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z $base_version ]; then
|
||||
base_version="latest"
|
||||
else
|
||||
base_version="v$base_version"
|
||||
fi
|
||||
|
||||
if [ ! -x "$(command -v docker)" ] || [ docker --help |& grep -q podman ]; then
|
||||
# Docker is actually implemented by podman, and its OCI output
|
||||
# is incompatible with some of the dockerd instances on GitLab
|
||||
# CI runners.
|
||||
echo "Using: Podman"
|
||||
format="--format docker"
|
||||
CMD="podman"
|
||||
else
|
||||
echo "Using: Docker"
|
||||
format=""
|
||||
CMD="sudo socker"
|
||||
fi
|
||||
|
||||
REGISTRY="registry.gitlab.gnome.org"
|
||||
TAG="${REGISTRY}/gnome/gtk/${base}:${base_version}"
|
||||
|
||||
if [ $build == 1 ]; then
|
||||
echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}"
|
||||
${CMD} build \
|
||||
${format} \
|
||||
--build-arg HOST_USER_ID="$UID" \
|
||||
--tag "${TAG}" \
|
||||
--file "${base}.Dockerfile" .
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $push == 1 ]; then
|
||||
echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}"
|
||||
|
||||
if [ $no_login == 0 ]; then
|
||||
${CMD} login ${REGISTRY}
|
||||
fi
|
||||
|
||||
${CMD} push ${TAG}
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $run == 1 ]; then
|
||||
echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}"
|
||||
${CMD} run \
|
||||
--rm \
|
||||
--volume "$(pwd)/..:/home/user/app" \
|
||||
--workdir "/home/user/app" \
|
||||
--tty \
|
||||
--interactive "${TAG}" \
|
||||
bash
|
||||
exit $?
|
||||
fi
|
||||
|
37
.gitlab-ci/run-style-check-diff.sh
Executable file
37
.gitlab-ci/run-style-check-diff.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# We need to add a new remote for the upstream master, since this script could
|
||||
# be running in a personal fork of the repository which has out of date branches.
|
||||
git remote add upstream https://gitlab.gnome.org/GNOME/gtk.git
|
||||
git fetch upstream
|
||||
|
||||
# Work out the newest common ancestor between the detached HEAD that this CI job
|
||||
# has checked out, and the upstream target branch (which will typically be
|
||||
# `upstream/master` or `upstream/gtk-3-24`).
|
||||
#
|
||||
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` is only defined if we’re running in
|
||||
# a merge request pipeline; fall back to `${CI_DEFAULT_BRANCH}` otherwise.
|
||||
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list --first-parent HEAD) | head -1)
|
||||
git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format" -p1
|
||||
exit_status=$?
|
||||
|
||||
# The style check is not infallible. The clang-format configuration cannot
|
||||
# perfectly describe GTK’s coding style: in particular, it cannot align
|
||||
# function arguments. The documented coding style for GTK takes priority over
|
||||
# clang-format suggestions. Hopefully we can eventually improve clang-format to
|
||||
# be configurable enough for our coding style. That’s why this CI check is OK
|
||||
# to fail: the idea is that people can look through the output and ignore it if
|
||||
# it’s wrong. (That situation can also happen if someone touches pre-existing
|
||||
# badly formatted code and it doesn’t make sense to tidy up the wider coding
|
||||
# style with the changes they’re making.)
|
||||
echo ""
|
||||
echo "Note that clang-format output is advisory and cannot always match the"
|
||||
echo "GTK coding style, documented at:"
|
||||
echo " https://gitlab.gnome.org/GNOME/gtk/blob/master/docs/CODING-STYLE"
|
||||
echo "Warnings from this tool can be ignored in favour of the documented "
|
||||
echo "coding style, or in favour of matching the style of existing"
|
||||
echo "surrounding code."
|
||||
|
||||
exit ${exit_status}
|
34
.gitlab-ci/run-tests.sh
Executable file
34
.gitlab-ci/run-tests.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +x
|
||||
set +e
|
||||
|
||||
srcdir=$( pwd )
|
||||
builddir=$1
|
||||
|
||||
export GDK_BACKEND=x11
|
||||
xvfb-run -a -s "-screen 0 1024x768x24" \
|
||||
meson test -C ${builddir} \
|
||||
--print-errorlogs \
|
||||
--suite=gtk \
|
||||
--no-suite=gtk:a11y
|
||||
|
||||
# Store the exit code for the CI run, but always
|
||||
# generate the reports
|
||||
exit_code=$?
|
||||
|
||||
cd ${builddir}
|
||||
|
||||
$srcdir/.gitlab-ci/meson-junit-report.py \
|
||||
--project-name=gtk \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--output=report.xml \
|
||||
meson-logs/testlog.json
|
||||
$srcdir/.gitlab-ci/meson-html-report.py \
|
||||
--project-name=gtk \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--reftest-output-dir="testsuite/reftests/output" \
|
||||
--output=report.html \
|
||||
meson-logs/testlog.json
|
||||
|
||||
exit $exit_code
|
169
NEWS
169
NEWS
@@ -1,3 +1,170 @@
|
||||
Overview of Changes in GTK 3.98.2
|
||||
=================================
|
||||
|
||||
* Introduce GtkShortcutController, and replace key bindings,
|
||||
mnemonics and accelerators by GtkShortcut
|
||||
|
||||
* Derive the HighContrast theme from Adwaita
|
||||
|
||||
* GtkMenuButton: Add a use-underline property
|
||||
|
||||
* GtkTreeView: Fix cell editing
|
||||
|
||||
* Add gdk_toplevel_inhibit_system_shortcuts
|
||||
|
||||
* gtk-demo: Fix issues in multiple demos
|
||||
|
||||
* Translation updates:
|
||||
Polish
|
||||
|
||||
|
||||
Overview of Changes in GTK 3.98.1
|
||||
=================================
|
||||
|
||||
* GtkFileChooser:
|
||||
- Remove filename/uri api
|
||||
- Drop extra-widget
|
||||
- Remove overwrite confirmation
|
||||
- Remove show-hidden property
|
||||
- Remove local-only property
|
||||
- Remove GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
|
||||
- The portal file chooser supports selecting folders
|
||||
|
||||
* GtkSpinner:
|
||||
- Rename active property to spinning
|
||||
|
||||
* GtkRevealer:
|
||||
- Fix size allocation at small scales
|
||||
|
||||
* GtkPopover:
|
||||
- Drop :relative-to, it is always the :parent now
|
||||
|
||||
* GtkWindow:
|
||||
- Drop window-type, it is always a regular toplevel
|
||||
|
||||
* GtkWidget:
|
||||
- Drop expand property
|
||||
- Drop margin property
|
||||
- Drop gtk_grab_add, gtk_device_grab_add
|
||||
|
||||
* GtkTextView:
|
||||
- Support overlines in GtkTextTag
|
||||
- Support visible spaces in GtkTextTag
|
||||
- Support hyphenation control in GtkTextTag
|
||||
|
||||
* Split GtkEventControllerFocus from GtkEventControllerKey
|
||||
|
||||
* DND:
|
||||
- Fix local DND to avoid serialization
|
||||
- Add new content provider constructors
|
||||
- Split GtkDropTargetAsync and GtkDropTarget
|
||||
- Group DND events into event sequences
|
||||
- Propagate DND events like motion events
|
||||
- Introduce GtkDropControllerMotion
|
||||
- Remove GtkSelectionData
|
||||
|
||||
* Performance:
|
||||
- Clean up profiler marks
|
||||
- Share GL programs between renderers
|
||||
|
||||
* GDK:
|
||||
- Drop gdk_surface_new_temp
|
||||
- Make GdkEvent an immutable boxed type, not an object
|
||||
- Remove GdkAtom and property- and selection-related apis
|
||||
- Introduce GdkPopup and GdkToplevel interfaces
|
||||
- Implement them in backend-specific surface subtypes
|
||||
- Rename gdk_surface_input_shape_combine_region to
|
||||
gdk_surface_set_input_region
|
||||
- Drop X11-only concepts such as sticky or keep-below
|
||||
|
||||
* OS X: Fix OpenGL extension detection
|
||||
|
||||
* Broadway: implement scaling
|
||||
|
||||
* Translation updates:
|
||||
Dutch
|
||||
Japanese
|
||||
Persian
|
||||
|
||||
|
||||
Overview of Changes in GTK 3.98.0
|
||||
=================================
|
||||
|
||||
While this release gets significantly closer to what we aim for in GTK 4,
|
||||
there are still a few big items outstanding that we are currently working
|
||||
on:
|
||||
|
||||
- Event controllers for keyboard shortcuts
|
||||
- Movable popovers
|
||||
- Row-recycling list and grid views
|
||||
- Revamped accessibility infrastructure
|
||||
- Animation API
|
||||
|
||||
We will do further 3.98.x snapshots as these land.
|
||||
|
||||
*****************
|
||||
|
||||
* The DND refactoring has been completed. The GTK API for DND has been turned
|
||||
into event controllers: GtkDragSource and GtkDropTarget. Support for file
|
||||
transfers via file transfer portal has been added for both DND and the clipboard.
|
||||
|
||||
* Child surfaces have been removed. GDK only supports toplevel and popup surfaces
|
||||
now. The client-side window implementation has been removed too. On the GTK side,
|
||||
the GtkNative interface has been introduced for widgets that have their own
|
||||
surface. This cleanup is not 100% complete yet.
|
||||
|
||||
* Global positions and related apis such as gdk_surface_move are no longer available.
|
||||
|
||||
* A constraint-based layout manager has been added.
|
||||
|
||||
* Many classes have been made explicitly non-subclassable, and the widget hierarchy
|
||||
has been simplified, by making widgets derive directly from GtkWidget instead of
|
||||
a container.
|
||||
|
||||
* Menu-related changes:
|
||||
- GtkMenu, GtkMenuBar and related classes have been removed. They are being replaced
|
||||
by GMenu and popover-based variants. Popover menus can now do traditional, nested
|
||||
menus, and model buttons show accelerators.
|
||||
- Context menus are no longer created with ::populate-popup signals, but use menu
|
||||
models and actions.
|
||||
- Widget actions can be created in class_init, with gtk_widget_class_install_action.
|
||||
- GtkToolbar has been removed as well.
|
||||
|
||||
* Text-related changed:
|
||||
- Text cursor blinking has been made smooth.
|
||||
- GtkTextView is caching rendernodes for the visible text range now, improving the
|
||||
scrolling performance of text.
|
||||
- Add a simple undo stack for text edits has been added.
|
||||
|
||||
* The native Win32 filechooser backend supports choices.
|
||||
|
||||
* GtkTreeView renders tree and grid lines with textures.
|
||||
|
||||
* GtkEmojiChooser has been made public.
|
||||
|
||||
* GtkGestureMultiPress has been renamed to GtkGestureClick.
|
||||
|
||||
* GtkWidget has api to handle style classes: gtk_widget_add_style_class.
|
||||
This is the first step towards moving away from GtkStyleContext.
|
||||
|
||||
* X11-specific changes:
|
||||
- XI2 is now mandatory
|
||||
- The xim input method has been removed
|
||||
|
||||
* Wayland-specific changes:
|
||||
- The loading of cursor themes has been improved to load cursors on demand,
|
||||
and no longer relies on libwayland-cursor.
|
||||
|
||||
* The GL renderer is now sharing icon and glyph caches for all surfaces,
|
||||
and has better support for blurring and shadow rendering.
|
||||
|
||||
* Performance-related changes:
|
||||
- GTK provides profiling information for Sysprof when launched with GTK_TRACE=1.
|
||||
- Css computation has been optimized
|
||||
- Css lookups are using a Bloom filter
|
||||
- Icon loading IO has been moved to a thread
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.96.0
|
||||
==================================
|
||||
|
||||
@@ -360,7 +527,7 @@ Overview of Changes in GTK+ 3.92.1, 重庆市
|
||||
The bulk of the preparation for this release was done during
|
||||
and after the fantastic GNOME.Asia Summit 2017 in Chongqing, China.
|
||||
|
||||
* Drop autotools support. Meson 0.42.1 is now required
|
||||
* Drop autotools support. Meson 0.42.1 is now required
|
||||
|
||||
* Implement most of CSS3 font-variant
|
||||
|
||||
|
@@ -54,6 +54,36 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
|
@@ -54,6 +54,36 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
|
@@ -54,6 +54,36 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
|
@@ -221,9 +221,12 @@ open_cb (GtkWidget *button,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
"_Load",
|
||||
"_Cancel");
|
||||
|
||||
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), ".");
|
||||
|
||||
GFile *cwd = g_file_new_for_path (".");
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), cwd, NULL);
|
||||
g_object_unref (cwd);
|
||||
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (open_response_cb), self);
|
||||
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||
}
|
||||
@@ -290,29 +293,37 @@ save_response_cb (GtkNativeDialog *dialog,
|
||||
if (response == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
GListModel *model;
|
||||
char *text, *filename;
|
||||
GFile *file;
|
||||
char *text;
|
||||
GError *error = NULL;
|
||||
|
||||
model = constraint_view_get_model (CONSTRAINT_VIEW (self->view));
|
||||
text = serialize_model (model);
|
||||
|
||||
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
|
||||
if (!g_file_set_contents (filename, text, -1, &error))
|
||||
file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||
g_file_replace_contents (file, text, -1,
|
||||
NULL, FALSE,
|
||||
G_FILE_CREATE_NONE,
|
||||
NULL,
|
||||
NULL,
|
||||
&error);
|
||||
if (error != NULL)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *message_dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self))),
|
||||
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"Saving failed");
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
message_dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (self))),
|
||||
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"Saving failed");
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message_dialog),
|
||||
"%s", error->message);
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
gtk_widget_show (dialog);
|
||||
g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
gtk_widget_show (message_dialog);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (filename);
|
||||
|
||||
g_free (text);
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
gtk_native_dialog_destroy (dialog);
|
||||
@@ -329,9 +340,12 @@ save_cb (GtkWidget *button,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
"_Save",
|
||||
"_Cancel");
|
||||
|
||||
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (dialog), TRUE);
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), ".");
|
||||
|
||||
GFile *cwd = g_file_new_for_path (".");
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), cwd, NULL);
|
||||
g_object_unref (cwd);
|
||||
|
||||
g_signal_connect (dialog, "response", G_CALLBACK (save_response_cb), self);
|
||||
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||
}
|
||||
@@ -400,7 +414,7 @@ edit_constraint (ConstraintEditorWindow *win,
|
||||
ConstraintEditor *editor;
|
||||
GListModel *model;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (win));
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
if (constraint)
|
||||
@@ -440,7 +454,7 @@ edit_guide (ConstraintEditorWindow *win,
|
||||
GtkWidget *window;
|
||||
GuideEditor *editor;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (win));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Edit Guide");
|
||||
@@ -587,7 +601,10 @@ create_widget_func (gpointer item,
|
||||
g_object_bind_property (item, "name",
|
||||
label, "label",
|
||||
G_BINDING_DEFAULT);
|
||||
g_object_set (label, "margin", 10, NULL);
|
||||
gtk_widget_set_margin_start (label, 10);
|
||||
gtk_widget_set_margin_end (label, 10);
|
||||
gtk_widget_set_margin_top (label, 10);
|
||||
gtk_widget_set_margin_bottom (label, 10);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (row), box);
|
||||
|
@@ -3,7 +3,10 @@
|
||||
<template class="ConstraintEditor" parent="GtkWidget">
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="margin">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<child>
|
||||
|
@@ -77,7 +77,7 @@ update_weak_position (ConstraintView *self,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
x,
|
||||
GTK_CONSTRAINT_STRENGTH_WEAK);
|
||||
g_object_set_data (G_OBJECT (constraint), "internal", "yes");
|
||||
g_object_set_data (G_OBJECT (constraint), "internal", (char *)"yes");
|
||||
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (manager),
|
||||
constraint);
|
||||
g_object_set_data (G_OBJECT (child), "x-constraint", constraint);
|
||||
@@ -97,7 +97,7 @@ update_weak_position (ConstraintView *self,
|
||||
GTK_CONSTRAINT_RELATION_EQ,
|
||||
y,
|
||||
GTK_CONSTRAINT_STRENGTH_WEAK);
|
||||
g_object_set_data (G_OBJECT (constraint), "internal", "yes");
|
||||
g_object_set_data (G_OBJECT (constraint), "internal", (char *)"yes");
|
||||
gtk_constraint_layout_add_constraint (GTK_CONSTRAINT_LAYOUT (manager),
|
||||
constraint);
|
||||
g_object_set_data (G_OBJECT (child), "y-constraint", constraint);
|
||||
@@ -214,7 +214,7 @@ constraint_view_add_child (ConstraintView *view,
|
||||
|
||||
label = gtk_label_new (name);
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "child");
|
||||
gtk_widget_add_css_class (frame, "child");
|
||||
gtk_widget_set_name (frame, name);
|
||||
gtk_container_add (GTK_CONTAINER (frame), label);
|
||||
gtk_widget_set_parent (frame, GTK_WIDGET (view));
|
||||
@@ -257,8 +257,8 @@ constraint_view_add_guide (ConstraintView *view,
|
||||
G_BINDING_DEFAULT);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "guide");
|
||||
g_object_set_data (G_OBJECT (frame), "internal", "yes");
|
||||
gtk_widget_add_css_class (frame, "guide");
|
||||
g_object_set_data (G_OBJECT (frame), "internal", (char *)"yes");
|
||||
gtk_container_add (GTK_CONTAINER (frame), label);
|
||||
gtk_widget_insert_after (frame, GTK_WIDGET (view), NULL);
|
||||
|
||||
@@ -276,7 +276,7 @@ constraint_view_add_guide (ConstraintView *view,
|
||||
names[i].attr,
|
||||
1.0, 0.0,
|
||||
GTK_CONSTRAINT_STRENGTH_REQUIRED);
|
||||
g_object_set_data (G_OBJECT (constraint), "internal", "yes");
|
||||
g_object_set_data (G_OBJECT (constraint), "internal", (char *)"yes");
|
||||
gtk_constraint_layout_add_constraint (layout, constraint);
|
||||
g_object_set_data (G_OBJECT (guide), names[i].name, constraint);
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ get_strength (const char *id)
|
||||
return strength;
|
||||
}
|
||||
|
||||
const char *
|
||||
static const char *
|
||||
get_strength_nick (GtkConstraintStrength strength)
|
||||
{
|
||||
GEnumClass *class = g_type_class_ref (GTK_TYPE_CONSTRAINT_STRENGTH);
|
||||
|
@@ -45,7 +45,10 @@
|
||||
<template class="GuideEditor" parent="GtkWidget">
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="margin">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<child>
|
||||
|
@@ -13,6 +13,7 @@ constraint_editor_resources = gnome.compile_resources('constraint_editor_resourc
|
||||
|
||||
executable('gtk4-constraint-editor',
|
||||
constraint_editor_sources, constraint_editor_resources,
|
||||
c_args: common_cflags,
|
||||
dependencies: libgtk_dep,
|
||||
include_directories: confinc,
|
||||
gui_app: true,
|
||||
|
@@ -6,6 +6,7 @@
|
||||
typedef GtkApplication DemoApplication;
|
||||
typedef GtkApplicationClass DemoApplicationClass;
|
||||
|
||||
static GType demo_application_get_type (void);
|
||||
G_DEFINE_TYPE (DemoApplication, demo_application, GTK_TYPE_APPLICATION)
|
||||
|
||||
typedef struct {
|
||||
@@ -14,7 +15,7 @@ typedef struct {
|
||||
GtkWidget *message;
|
||||
GtkWidget *infobar;
|
||||
GtkWidget *status;
|
||||
GtkWidget *menutool;
|
||||
GtkWidget *menubutton;
|
||||
GMenuModel *toolmenu;
|
||||
GtkTextBuffer *buffer;
|
||||
|
||||
@@ -25,6 +26,7 @@ typedef struct {
|
||||
} DemoApplicationWindow;
|
||||
typedef GtkApplicationWindowClass DemoApplicationWindowClass;
|
||||
|
||||
static GType demo_application_window_get_type (void);
|
||||
G_DEFINE_TYPE (DemoApplicationWindow, demo_application_window, GTK_TYPE_APPLICATION_WINDOW)
|
||||
|
||||
static void create_window (GApplication *app, const char *contents);
|
||||
@@ -428,8 +430,8 @@ demo_application_window_init (DemoApplicationWindow *window)
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (window));
|
||||
|
||||
popover = gtk_popover_menu_new_from_model (window->menutool, window->toolmenu);
|
||||
gtk_menu_tool_button_set_popover (GTK_MENU_TOOL_BUTTON (window->menutool), popover);
|
||||
popover = gtk_popover_menu_new_from_model (window->toolmenu);
|
||||
gtk_menu_button_set_popover (GTK_MENU_BUTTON (window->menubutton), popover);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (window),
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
@@ -477,7 +479,7 @@ surface_state_changed (GtkWidget *widget)
|
||||
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
|
||||
GdkSurfaceState new_state;
|
||||
|
||||
new_state = gdk_surface_get_state (gtk_native_get_surface (GTK_NATIVE (widget)));
|
||||
new_state = gdk_toplevel_get_state (GDK_TOPLEVEL (gtk_native_get_surface (GTK_NATIVE (widget))));
|
||||
window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
|
||||
window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
|
||||
}
|
||||
@@ -528,7 +530,7 @@ demo_application_window_class_init (DemoApplicationWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, infobar);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, status);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, buffer);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, menutool);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, menubutton);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, toolmenu);
|
||||
gtk_widget_class_bind_template_callback (widget_class, clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, update_statusbar);
|
||||
|
@@ -8,27 +8,24 @@
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkMenuToolButton" id="menutool">
|
||||
<object class="GtkMenuButton" id="menubutton">
|
||||
<property name="icon-name">document-open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">application-exit</property>
|
||||
<property name="action-name">app.quit</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem"/>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">applications-other</property>
|
||||
<property name="action-name">win.logo</property>
|
||||
</object>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><Primary>q</attribute>
|
||||
<attribute name="accel"><Control>q</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *assistant = NULL;
|
||||
static GtkWidget *progress_bar = NULL;
|
||||
|
||||
static gboolean
|
||||
@@ -27,8 +26,7 @@ apply_changes_gradually (gpointer data)
|
||||
else
|
||||
{
|
||||
/* Close automatically once changes are fully applied. */
|
||||
gtk_widget_destroy (assistant);
|
||||
assistant = NULL;
|
||||
gtk_widget_destroy (data);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
}
|
||||
@@ -37,16 +35,13 @@ static void
|
||||
on_assistant_apply (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
/* Start a timer to simulate changes taking a few seconds to apply. */
|
||||
g_timeout_add (100, apply_changes_gradually, NULL);
|
||||
g_timeout_add (100, apply_changes_gradually, widget);
|
||||
}
|
||||
|
||||
static void
|
||||
on_assistant_close_cancel (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkWidget **assistant = (GtkWidget **) data;
|
||||
|
||||
gtk_widget_destroy (*assistant);
|
||||
*assistant = NULL;
|
||||
gtk_widget_destroy (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -94,7 +89,10 @@ create_page1 (GtkWidget *assistant)
|
||||
GtkWidget *box, *label, *entry;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
g_object_set (box, "margin", 12, NULL);
|
||||
gtk_widget_set_margin_start (box, 12);
|
||||
gtk_widget_set_margin_end (box, 12);
|
||||
gtk_widget_set_margin_top (box, 12);
|
||||
gtk_widget_set_margin_bottom (box, 12);
|
||||
|
||||
label = gtk_label_new ("You must fill out this entry to continue:");
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
@@ -117,7 +115,10 @@ create_page2 (GtkWidget *assistant)
|
||||
GtkWidget *box, *checkbutton;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
g_object_set (box, "margin", 12, NULL);
|
||||
gtk_widget_set_margin_start (box, 12);
|
||||
gtk_widget_set_margin_end (box, 12);
|
||||
gtk_widget_set_margin_top (box, 12);
|
||||
gtk_widget_set_margin_bottom (box, 12);
|
||||
|
||||
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
|
||||
"even if you do not check this");
|
||||
@@ -167,6 +168,8 @@ create_page4 (GtkWidget *assistant)
|
||||
GtkWidget*
|
||||
do_assistant (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *assistant;
|
||||
|
||||
if (!assistant)
|
||||
{
|
||||
assistant = gtk_assistant_new ();
|
||||
@@ -175,6 +178,8 @@ do_assistant (GtkWidget *do_widget)
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (assistant),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (assistant, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &assistant);
|
||||
|
||||
create_page1 (assistant);
|
||||
create_page2 (assistant);
|
||||
@@ -182,9 +187,9 @@ do_assistant (GtkWidget *do_widget)
|
||||
create_page4 (assistant);
|
||||
|
||||
g_signal_connect (G_OBJECT (assistant), "cancel",
|
||||
G_CALLBACK (on_assistant_close_cancel), &assistant);
|
||||
G_CALLBACK (on_assistant_close_cancel), NULL);
|
||||
g_signal_connect (G_OBJECT (assistant), "close",
|
||||
G_CALLBACK (on_assistant_close_cancel), &assistant);
|
||||
G_CALLBACK (on_assistant_close_cancel), NULL);
|
||||
g_signal_connect (G_OBJECT (assistant), "apply",
|
||||
G_CALLBACK (on_assistant_apply), NULL);
|
||||
g_signal_connect (G_OBJECT (assistant), "prepare",
|
||||
@@ -194,10 +199,7 @@ do_assistant (GtkWidget *do_widget)
|
||||
if (!gtk_widget_get_visible (assistant))
|
||||
gtk_widget_show (assistant);
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (assistant);
|
||||
assistant = NULL;
|
||||
}
|
||||
gtk_widget_destroy (assistant);
|
||||
|
||||
return assistant;
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="min-content-width">150</property>
|
||||
|
@@ -131,13 +131,11 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
|
||||
GtkAlign valign, halign;
|
||||
gboolean is_left, is_right, is_top, is_bottom;
|
||||
gboolean has_left, has_right, has_top, has_bottom;
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (child);
|
||||
has_left = gtk_style_context_has_class (context, GTK_STYLE_CLASS_LEFT);
|
||||
has_right = gtk_style_context_has_class (context, GTK_STYLE_CLASS_RIGHT);
|
||||
has_top = gtk_style_context_has_class (context, GTK_STYLE_CLASS_TOP);
|
||||
has_bottom = gtk_style_context_has_class (context, GTK_STYLE_CLASS_BOTTOM);
|
||||
has_left = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_LEFT);
|
||||
has_right = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_RIGHT);
|
||||
has_top = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_TOP);
|
||||
has_bottom = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_BOTTOM);
|
||||
|
||||
is_left = is_right = is_top = is_bottom = FALSE;
|
||||
|
||||
@@ -160,24 +158,24 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
|
||||
is_bottom = (child_allocation->y + child_allocation->height == height);
|
||||
|
||||
if (has_left && !is_left)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_LEFT);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_LEFT);
|
||||
else if (!has_left && is_left)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_LEFT);
|
||||
|
||||
if (has_right && !is_right)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_RIGHT);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_RIGHT);
|
||||
else if (!has_right && is_right)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_RIGHT);
|
||||
|
||||
if (has_top && !is_top)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TOP);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_TOP);
|
||||
else if (!has_top && is_top)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_TOP);
|
||||
|
||||
if (has_bottom && !is_bottom)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BOTTOM);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_BOTTOM);
|
||||
else if (!has_bottom && is_bottom)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_BOTTOM);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -63,7 +63,6 @@ GtkWidget *
|
||||
do_builder (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *toolbar;
|
||||
GActionGroup *actions;
|
||||
|
||||
if (!window)
|
||||
@@ -77,9 +76,6 @@ do_builder (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "toolbar1"));
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (toolbar),
|
||||
"primary-toolbar");
|
||||
actions = (GActionGroup*)g_simple_action_group_new ();
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions),
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
void
|
||||
static void
|
||||
copy_button_clicked (GtkWidget *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -31,7 +31,7 @@ copy_button_clicked (GtkWidget *button,
|
||||
gdk_clipboard_set_text (clipboard, gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
paste_received (GObject *source_object,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
@@ -75,7 +75,7 @@ paste_received (GObject *source_object,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
paste_button_clicked (GtkWidget *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconInfo *icon_info;
|
||||
GtkIconPaintable *icon;
|
||||
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
{
|
||||
@@ -107,10 +107,18 @@ get_image_paintable (GtkImage *image)
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
icon_name = gtk_image_get_icon_name (image);
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
|
||||
if (icon_info == NULL)
|
||||
icon = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
icon_name,
|
||||
NULL,
|
||||
48, 1,
|
||||
gtk_widget_get_direction (GTK_WIDGET (image)),
|
||||
0);
|
||||
if (icon == NULL)
|
||||
return NULL;
|
||||
return gtk_icon_info_load_icon (icon_info, NULL);
|
||||
return GDK_PAINTABLE (icon);
|
||||
|
||||
case GTK_IMAGE_EMPTY:
|
||||
case GTK_IMAGE_GICON:
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
@@ -133,62 +141,31 @@ drag_begin (GtkDragSource *source,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
get_texture (GValue *value,
|
||||
gpointer data)
|
||||
{
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (data));
|
||||
|
||||
if (GDK_IS_TEXTURE (paintable))
|
||||
g_value_set_object (value, paintable);
|
||||
}
|
||||
|
||||
static GdkContentProvider *
|
||||
prepare_drag (GtkDragSource *source,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
return gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
|
||||
}
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (image));
|
||||
|
||||
static void
|
||||
got_texture (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GdkDrop *drop = GDK_DROP (source);
|
||||
GtkWidget *image = data;
|
||||
const GValue *value;
|
||||
GError *error = NULL;
|
||||
if (!GDK_IS_TEXTURE (paintable))
|
||||
return NULL;
|
||||
|
||||
value = gdk_drop_read_value_finish (drop, result, &error);
|
||||
if (value)
|
||||
{
|
||||
GdkTexture *texture = g_value_get_object (value);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (texture));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("Failed to get data: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
return gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, paintable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_drop (GtkDropTarget *dest,
|
||||
GdkDrop *drop,
|
||||
int x,
|
||||
int y,
|
||||
GtkWidget *widget)
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y,
|
||||
GtkImage *image)
|
||||
{
|
||||
if (gdk_drop_has_value (drop, GDK_TYPE_TEXTURE))
|
||||
{
|
||||
gdk_drop_read_value_async (drop, GDK_TYPE_TEXTURE, G_PRIORITY_DEFAULT, NULL, got_texture, widget);
|
||||
return TRUE;
|
||||
}
|
||||
GdkTexture *texture = g_value_get_object (value);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (texture));
|
||||
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -248,7 +225,8 @@ pressed_cb (GtkGesture *gesture,
|
||||
item = g_menu_item_new (_("_Paste"), "clipboard.paste");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
popover = gtk_popover_menu_new_from_model (image, G_MENU_MODEL (menu));
|
||||
popover = gtk_popover_menu_new_from_model (G_MENU_MODEL (menu));
|
||||
gtk_widget_set_parent (popover, image);
|
||||
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &(GdkRectangle) { x, y, 1, 1});
|
||||
gtk_popover_popup (GTK_POPOVER (popover));
|
||||
@@ -273,9 +251,8 @@ do_clipboard (GtkWidget *do_widget)
|
||||
GActionGroup *actions;
|
||||
GtkDragSource *source;
|
||||
GtkDropTarget *dest;
|
||||
GdkContentFormats *formats;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Clipboard");
|
||||
@@ -284,7 +261,10 @@ do_clipboard (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
g_object_set (vbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
gtk_widget_set_margin_end (vbox, 8);
|
||||
gtk_widget_set_margin_top (vbox, 8);
|
||||
gtk_widget_set_margin_bottom (vbox, 8);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
@@ -293,7 +273,10 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
|
||||
g_object_set (hbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (hbox, 8);
|
||||
gtk_widget_set_margin_end (hbox, 8);
|
||||
gtk_widget_set_margin_top (hbox, 8);
|
||||
gtk_widget_set_margin_bottom (hbox, 8);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), hbox);
|
||||
|
||||
/* Create the first entry */
|
||||
@@ -310,7 +293,10 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
|
||||
g_object_set (hbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (hbox, 8);
|
||||
gtk_widget_set_margin_end (hbox, 8);
|
||||
gtk_widget_set_margin_top (hbox, 8);
|
||||
gtk_widget_set_margin_bottom (hbox, 8);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), hbox);
|
||||
|
||||
/* Create the second entry */
|
||||
@@ -327,7 +313,10 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
|
||||
g_object_set (hbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (hbox, 8);
|
||||
gtk_widget_set_margin_end (hbox, 8);
|
||||
gtk_widget_set_margin_top (hbox, 8);
|
||||
gtk_widget_set_margin_bottom (hbox, 8);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), hbox);
|
||||
|
||||
/* Create the first image */
|
||||
@@ -342,10 +331,8 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* accept drops on image */
|
||||
formats = gdk_content_formats_new_for_gtype (GDK_TYPE_TEXTURE);
|
||||
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
|
||||
gdk_content_formats_unref (formats);
|
||||
g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop), image);
|
||||
dest = gtk_drop_target_new (GDK_TYPE_TEXTURE, GDK_ACTION_COPY);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (drag_drop), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
/* context menu on image */
|
||||
@@ -373,10 +360,8 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* accept drops on image */
|
||||
formats = gdk_content_formats_new_for_gtype (GDK_TYPE_TEXTURE);
|
||||
dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
|
||||
gdk_content_formats_unref (formats);
|
||||
g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop), image);
|
||||
dest = gtk_drop_target_new (GDK_TYPE_TEXTURE, GDK_ACTION_COPY);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (drag_drop), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
/* context menu on image */
|
||||
|
@@ -16,7 +16,7 @@ static GtkWidget *frame;
|
||||
/* draw callback for the drawing area
|
||||
*/
|
||||
static void
|
||||
draw_function (GtkDrawingArea *da,
|
||||
draw_function (GtkDrawingArea *drawing_area,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
@@ -69,7 +69,7 @@ do_colorsel (GtkWidget *do_widget)
|
||||
color.green = 0;
|
||||
color.alpha = 1;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Color Chooser");
|
||||
@@ -79,7 +79,10 @@ do_colorsel (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (vbox, "margin", 12, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 12);
|
||||
gtk_widget_set_margin_end (vbox, 12);
|
||||
gtk_widget_set_margin_top (vbox, 12);
|
||||
gtk_widget_set_margin_bottom (vbox, 12);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/*
|
||||
|
@@ -19,7 +19,7 @@ enum
|
||||
static GtkTreeModel *
|
||||
create_icon_store (void)
|
||||
{
|
||||
const gchar *icon_names[6] = {
|
||||
const char *icon_names[6] = {
|
||||
"dialog-warning",
|
||||
"process-stop",
|
||||
"document-new",
|
||||
@@ -27,7 +27,7 @@ create_icon_store (void)
|
||||
NULL,
|
||||
"document-open"
|
||||
};
|
||||
const gchar *labels[6] = {
|
||||
const char *labels[6] = {
|
||||
N_("Warning"),
|
||||
N_("Stop"),
|
||||
N_("New"),
|
||||
@@ -111,8 +111,8 @@ static GtkTreeModel *
|
||||
create_capital_store (void)
|
||||
{
|
||||
struct {
|
||||
gchar *group;
|
||||
gchar *capital;
|
||||
const char *group;
|
||||
const char *capital;
|
||||
} capitals[] = {
|
||||
{ "A - B", NULL },
|
||||
{ NULL, "Albany" },
|
||||
@@ -234,7 +234,7 @@ typedef struct _MaskEntry MaskEntry;
|
||||
struct _MaskEntry
|
||||
{
|
||||
GtkEntry entry;
|
||||
gchar *mask;
|
||||
const char *mask;
|
||||
};
|
||||
|
||||
typedef struct _MaskEntryClass MaskEntryClass;
|
||||
@@ -246,6 +246,7 @@ struct _MaskEntryClass
|
||||
|
||||
static void mask_entry_editable_init (GtkEditableInterface *iface);
|
||||
|
||||
static GType mask_entry_get_type (void);
|
||||
G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
||||
mask_entry_editable_init));
|
||||
@@ -310,7 +311,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Combo Boxes");
|
||||
@@ -319,7 +320,10 @@ do_combobox (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
||||
g_object_set (vbox, "margin", 10, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 10);
|
||||
gtk_widget_set_margin_end (vbox, 10);
|
||||
gtk_widget_set_margin_top (vbox, 10);
|
||||
gtk_widget_set_margin_bottom (vbox, 10);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/* A combobox demonstrating cell renderers, separators and
|
||||
@@ -329,7 +333,10 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
g_object_set (box, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (box, 5);
|
||||
gtk_widget_set_margin_end (box, 5);
|
||||
gtk_widget_set_margin_top (box, 5);
|
||||
gtk_widget_set_margin_bottom (box, 5);
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
model = create_icon_store ();
|
||||
@@ -370,7 +377,10 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
g_object_set (box, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (box, 5);
|
||||
gtk_widget_set_margin_end (box, 5);
|
||||
gtk_widget_set_margin_top (box, 5);
|
||||
gtk_widget_set_margin_bottom (box, 5);
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
model = create_capital_store ();
|
||||
@@ -398,7 +408,10 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
g_object_set (box, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (box, 5);
|
||||
gtk_widget_set_margin_end (box, 5);
|
||||
gtk_widget_set_margin_top (box, 5);
|
||||
gtk_widget_set_margin_bottom (box, 5);
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
combo = gtk_combo_box_text_new_with_entry ();
|
||||
@@ -416,7 +429,10 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
g_object_set (box, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (box, 5);
|
||||
gtk_widget_set_margin_end (box, 5);
|
||||
gtk_widget_set_margin_top (box, 5);
|
||||
gtk_widget_set_margin_bottom (box, 5);
|
||||
gtk_container_add (GTK_CONTAINER (frame), box);
|
||||
|
||||
combo = gtk_combo_box_text_new ();
|
||||
|
@@ -255,7 +255,7 @@ do_constraints (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -211,7 +211,7 @@ do_constraints2 (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -131,7 +131,7 @@ do_constraints3 (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -24,7 +24,7 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
GtkWidget *container, *child;
|
||||
GtkStyleProvider *provider;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
|
||||
|
@@ -72,7 +72,7 @@ do_css_basics (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
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);
|
||||
|
@@ -11,8 +11,8 @@
|
||||
* These are the available blend modes.
|
||||
*/
|
||||
struct {
|
||||
gchar *name;
|
||||
gchar *id;
|
||||
const char *name;
|
||||
const char *id;
|
||||
} blend_modes[] =
|
||||
{
|
||||
{ "Color", "color" },
|
||||
|
@@ -86,7 +86,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
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);
|
||||
|
@@ -72,7 +72,7 @@ do_css_pixbufs (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
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);
|
||||
|
@@ -58,26 +58,23 @@ apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
||||
gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
static GtkWidget *
|
||||
create_toolbar (void)
|
||||
{
|
||||
GtkWidget *toolbar;
|
||||
GtkToolItem *item;
|
||||
GtkWidget *item;
|
||||
|
||||
toolbar = gtk_toolbar_new ();
|
||||
toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_widget_set_valign (toolbar, GTK_ALIGN_CENTER);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-next");
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
item = gtk_button_new_from_icon_name ("go-next");
|
||||
gtk_container_add (GTK_CONTAINER (toolbar), item);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-previous");
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
item = gtk_button_new_from_icon_name ("go-previous");
|
||||
gtk_container_add (GTK_CONTAINER (toolbar), item);
|
||||
|
||||
item = gtk_tool_button_new (NULL, "Hello World");
|
||||
gtk_tool_item_set_is_important (item, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
item = gtk_button_new_with_label ("Hello World");
|
||||
gtk_container_add (GTK_CONTAINER (toolbar), item);
|
||||
|
||||
return toolbar;
|
||||
}
|
||||
@@ -94,7 +91,7 @@ do_css_shadows (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
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);
|
||||
|
@@ -656,7 +656,10 @@
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">60</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="halign">center</property>
|
||||
<child>
|
||||
@@ -672,7 +675,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -729,7 +735,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -786,7 +795,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -856,7 +868,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -913,7 +928,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -970,7 +988,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1027,7 +1048,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1084,7 +1108,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1154,7 +1181,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1211,7 +1241,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1268,7 +1301,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1325,7 +1361,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1395,7 +1434,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1452,7 +1494,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1509,7 +1554,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1566,7 +1614,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1623,7 +1674,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1680,7 +1734,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1737,7 +1794,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1807,7 +1867,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1864,7 +1927,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1921,7 +1987,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -1978,7 +2047,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2035,7 +2107,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2092,7 +2167,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2149,7 +2227,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2206,7 +2287,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2263,7 +2347,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2320,7 +2407,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2377,7 +2467,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2434,7 +2527,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2491,7 +2587,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2548,7 +2647,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2605,7 +2707,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2675,7 +2780,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
@@ -2732,7 +2840,10 @@
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
|
@@ -104,6 +104,10 @@
|
||||
<file>gtkfishbowl.c</file>
|
||||
<file>gtkfishbowl.h</file>
|
||||
</gresource>
|
||||
<gresource prefix="/gears">
|
||||
<file>gtkgears.c</file>
|
||||
<file>gtkgears.h</file>
|
||||
</gresource>
|
||||
<gresource prefix="/iconscroll">
|
||||
<file>iconscroll.ui</file>
|
||||
</gresource>
|
||||
@@ -173,10 +177,10 @@
|
||||
<file>fishbowl.c</file>
|
||||
<file>fixed.c</file>
|
||||
<file>flowbox.c</file>
|
||||
<file>foreigndrawing.c</file>
|
||||
<file>font_features.c</file>
|
||||
<file>fontplane.c</file>
|
||||
<file>fontrendering.c</file>
|
||||
<file>gears.c</file>
|
||||
<file>gestures.c</file>
|
||||
<file>glarea.c</file>
|
||||
<file>headerbar.c</file>
|
||||
@@ -200,9 +204,9 @@
|
||||
<file>paintable_mediastream.c</file>
|
||||
<file>panes.c</file>
|
||||
<file>password_entry.c</file>
|
||||
<file>peg_solitaire.c</file>
|
||||
<file>pickers.c</file>
|
||||
<file>pixbufs.c</file>
|
||||
<file>popover.c</file>
|
||||
<file>printing.c</file>
|
||||
<file>revealer.c</file>
|
||||
<file>rotated_text.c</file>
|
||||
@@ -210,6 +214,7 @@
|
||||
<file>search_entry.c</file>
|
||||
<file>search_entry2.c</file>
|
||||
<file>shortcuts.c</file>
|
||||
<file>shortcut_triggers.c</file>
|
||||
<file>sizegroup.c</file>
|
||||
<file>sidebar.c</file>
|
||||
<file>sliding_puzzle.c</file>
|
||||
@@ -239,9 +244,6 @@
|
||||
<file>messages.txt</file>
|
||||
<file>apple-red.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/popover">
|
||||
<file>popover.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/glarea">
|
||||
<file>glarea-gl.fs.glsl</file>
|
||||
<file>glarea-gl.vs.glsl</file>
|
||||
|
@@ -29,29 +29,29 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_New</attribute>
|
||||
<attribute name="action">win.new</attribute>
|
||||
<attribute name="accel"><Primary>n</attribute>
|
||||
<attribute name="accel"><Control>n</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open</attribute>
|
||||
<attribute name="action">win.open</attribute>
|
||||
<attribute name="accel"><Primary>o</attribute>
|
||||
<attribute name="accel"><Control>o</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save</attribute>
|
||||
<attribute name="action">win.save</attribute>
|
||||
<attribute name="accel"><Primary>s</attribute>
|
||||
<attribute name="accel"><Control>s</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Save _As</attribute>
|
||||
<attribute name="action">win.save-as</attribute>
|
||||
<attribute name="accel"><Primary>q</attribute>
|
||||
<attribute name="accel"><Control>q</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">win.quit</attribute>
|
||||
<attribute name="accel"><Primary><Shift>s</attribute>
|
||||
<attribute name="accel"><Control><Shift>s</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
@@ -61,17 +61,17 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Copy</attribute>
|
||||
<attribute name="action">win.copy</attribute>
|
||||
<attribute name="accel"><Primary>c</attribute>
|
||||
<attribute name="accel"><Control>c</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Cut</attribute>
|
||||
<attribute name="action">win.cut</attribute>
|
||||
<attribute name="accel"><Primary>x</attribute>
|
||||
<attribute name="accel"><Control>x</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Paste</attribute>
|
||||
<attribute name="action">win.paste</attribute>
|
||||
<attribute name="accel"><Primary>v</attribute>
|
||||
<attribute name="accel"><Control>v</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
@@ -111,53 +111,52 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar" id="toolbar1">
|
||||
<object class="GtkBox" id="toolbar1">
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-toolbar">
|
||||
<property name="AtkObject::accessible-name">The toolbar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">New</property>
|
||||
<property name="tooltip-text" translatable="yes">Create a new file</property>
|
||||
<property name="icon-name">document-new</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Open</property>
|
||||
<property name="tooltip-text" translatable="yes">Open a file</property>
|
||||
<property name="icon-name">document-open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Save</property>
|
||||
<property name="tooltip-text" translatable="yes">Save a file</property>
|
||||
<property name="icon-name">document-save</property>
|
||||
<property name="is-important">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem"/>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Copy</property>
|
||||
<property name="tooltip-text" translatable="yes">Copy selected object into the clipboard</property>
|
||||
<property name="icon-name">edit-copy</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Cut</property>
|
||||
<property name="tooltip-text" translatable="yes">Cut selected object into the clipboard</property>
|
||||
<property name="icon-name">edit-cut</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Paste</property>
|
||||
<property name="tooltip-text" translatable="yes">Paste object from the clipboard</property>
|
||||
<property name="icon-name">edit-paste</property>
|
||||
@@ -168,7 +167,8 @@
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="expand">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="model">liststore1</property>
|
||||
|
@@ -105,7 +105,7 @@ do_dialog (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Dialogs and Message Boxes");
|
||||
@@ -114,11 +114,17 @@ do_dialog (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
frame = gtk_frame_new ("Dialogs");
|
||||
g_object_set (frame, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (frame, 8);
|
||||
gtk_widget_set_margin_end (frame, 8);
|
||||
gtk_widget_set_margin_top (frame, 8);
|
||||
gtk_widget_set_margin_bottom (frame, 8);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (vbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
gtk_widget_set_margin_end (vbox, 8);
|
||||
gtk_widget_set_margin_top (vbox, 8);
|
||||
gtk_widget_set_margin_bottom (vbox, 8);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
|
||||
/* Standard message dialog */
|
||||
|
@@ -42,7 +42,7 @@ free_demo_widget (gpointer data)
|
||||
}
|
||||
|
||||
#define GTK_TYPE_DEMO_WIDGET (gtk_demo_widget_get_type ())
|
||||
|
||||
static GType gtk_demo_widget_get_type (void);
|
||||
G_DEFINE_BOXED_TYPE (GtkDemoWidget, gtk_demo_widget, copy_demo_widget, free_demo_widget)
|
||||
|
||||
static GtkDemoWidget *
|
||||
@@ -59,7 +59,7 @@ serialize_widget (GtkWidget *widget)
|
||||
}
|
||||
else if (GTK_IS_SPINNER (widget))
|
||||
{
|
||||
g_object_get (widget, "active", &demo->active, NULL);
|
||||
g_object_get (widget, "spinning", &demo->active, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -80,8 +80,8 @@ deserialize_widget (GtkDemoWidget *demo)
|
||||
}
|
||||
else if (demo->type == GTK_TYPE_SPINNER)
|
||||
{
|
||||
widget = g_object_new (demo->type, "active", demo->active, NULL);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "demo");
|
||||
widget = g_object_new (demo->type, "spinning", demo->active, NULL);
|
||||
gtk_widget_add_css_class (widget, "demo");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -114,7 +114,7 @@ new_spinner_cb (GtkWidget *button,
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_spinner_new ();
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "demo");
|
||||
gtk_widget_add_css_class (widget, "demo");
|
||||
gtk_spinner_start (GTK_SPINNER (widget));
|
||||
gtk_fixed_put (fixed, widget, pos_x, pos_y);
|
||||
|
||||
@@ -240,8 +240,8 @@ edit_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
gboolean active;
|
||||
|
||||
g_object_get (child, "active", &active, NULL);
|
||||
g_object_set (child, "active", !active, NULL);
|
||||
g_object_get (child, "spinning", &active, NULL);
|
||||
g_object_set (child, "spinning", !active, NULL);
|
||||
}
|
||||
|
||||
if (button)
|
||||
@@ -271,7 +271,8 @@ pressed_cb (GtkGesture *gesture,
|
||||
pos_x = x;
|
||||
pos_y = y;
|
||||
|
||||
menu = gtk_popover_new (widget);
|
||||
menu = gtk_popover_new ();
|
||||
gtk_widget_set_parent (menu, widget);
|
||||
gtk_popover_set_has_arrow (GTK_POPOVER (menu), FALSE);
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (menu), &(GdkRectangle){ x, y, 1, 1});
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
@@ -356,7 +357,7 @@ do_dnd (GtkWidget *do_widget)
|
||||
GtkGesture *multipress;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drag-and-drop");
|
||||
|
@@ -189,7 +189,7 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
@@ -198,7 +198,10 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
G_CALLBACK (close_window), NULL);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (vbox, "margin", 16, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 16);
|
||||
gtk_widget_set_margin_end (vbox, 16);
|
||||
gtk_widget_set_margin_top (vbox, 16);
|
||||
gtk_widget_set_margin_bottom (vbox, 16);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/*
|
||||
|
@@ -275,6 +275,9 @@ cell_edited (GtkCellRendererText *cell,
|
||||
g_array_index (articles, Item, i).product, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
@@ -345,7 +348,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
GtkTreeModel *items_model;
|
||||
GtkTreeModel *numbers_model;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Editable Cells");
|
||||
@@ -353,7 +356,10 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
g_object_set (vbox, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
gtk_widget_set_margin_end (vbox, 5);
|
||||
gtk_widget_set_margin_top (vbox, 5);
|
||||
gtk_widget_set_margin_bottom (vbox, 5);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (vbox),
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Creates a tree model containing the completions */
|
||||
GtkTreeModel *
|
||||
static GtkTreeModel *
|
||||
create_completion_model (void)
|
||||
{
|
||||
GtkListStore *store;
|
||||
@@ -45,7 +45,7 @@ do_entry_completion (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Entry Completion");
|
||||
@@ -55,7 +55,10 @@ do_entry_completion (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
g_object_set (vbox, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
gtk_widget_set_margin_end (vbox, 5);
|
||||
gtk_widget_set_margin_top (vbox, 5);
|
||||
gtk_widget_set_margin_bottom (vbox, 5);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
|
@@ -20,7 +20,7 @@ do_entry_undo (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Entry Undo");
|
||||
@@ -29,7 +29,10 @@ do_entry_undo (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
g_object_set (vbox, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
gtk_widget_set_margin_end (vbox, 5);
|
||||
gtk_widget_set_margin_top (vbox, 5);
|
||||
gtk_widget_set_margin_bottom (vbox, 5);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
|
@@ -31,7 +31,10 @@
|
||||
<property name="title" translatable="yes">Filter Model</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="column-homogeneous">1</property>
|
||||
@@ -53,7 +56,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="headers-clickable">0</property>
|
||||
<child internal-child="selection">
|
||||
@@ -92,7 +94,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview2">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="headers-clickable">0</property>
|
||||
<property name="search-column">0</property>
|
||||
<child internal-child="selection">
|
||||
@@ -175,7 +176,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview3">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="headers-clickable">0</property>
|
||||
<property name="search-column">0</property>
|
||||
<child internal-child="selection">
|
||||
|
@@ -22,29 +22,11 @@ gsize n_icon_names = 0;
|
||||
static void
|
||||
init_icon_names (GtkIconTheme *theme)
|
||||
{
|
||||
GPtrArray *icons;
|
||||
GList *l, *icon_list;
|
||||
|
||||
if (icon_names)
|
||||
return;
|
||||
|
||||
icon_list = gtk_icon_theme_list_icons (theme, NULL);
|
||||
icons = g_ptr_array_new ();
|
||||
|
||||
for (l = icon_list; l; l = l->next)
|
||||
{
|
||||
if (g_str_has_suffix (l->data, "symbolic"))
|
||||
continue;
|
||||
|
||||
g_ptr_array_add (icons, g_strdup (l->data));
|
||||
}
|
||||
|
||||
n_icon_names = icons->len;
|
||||
g_ptr_array_add (icons, NULL); /* NULL-terminate the array */
|
||||
icon_names = (char **) g_ptr_array_free (icons, FALSE);
|
||||
|
||||
/* don't free strings, we assigned them to the array */
|
||||
g_list_free_full (icon_list, g_free);
|
||||
icon_names = gtk_icon_theme_get_icon_names (theme);
|
||||
n_icon_names = g_strv_length (icon_names);
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -55,13 +37,16 @@ get_random_icon_name (GtkIconTheme *theme)
|
||||
return icon_names[g_random_int_range(0, n_icon_names)];
|
||||
}
|
||||
|
||||
/* Can't be static because it's also used in iconscroll.c */
|
||||
GtkWidget *
|
||||
create_icon (void)
|
||||
{
|
||||
GtkWidget *image;
|
||||
|
||||
image = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ()));
|
||||
image = gtk_image_new ();
|
||||
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image),
|
||||
get_random_icon_name (gtk_icon_theme_get_for_display (gtk_widget_get_display (image))));
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -77,7 +62,7 @@ create_blurred_button (void)
|
||||
{
|
||||
GtkWidget *w = gtk_button_new ();
|
||||
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (w), "blurred-button");
|
||||
gtk_widget_add_css_class (w, "blurred-button");
|
||||
|
||||
return w;
|
||||
}
|
||||
@@ -174,7 +159,7 @@ static GtkWidget *
|
||||
create_menu_button (void)
|
||||
{
|
||||
GtkWidget *w = gtk_menu_button_new ();
|
||||
GtkWidget *popover = gtk_popover_new (NULL);
|
||||
GtkWidget *popover = gtk_popover_new ();
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (popover), gtk_button_new_with_label ("Hey!"));
|
||||
gtk_popover_set_autohide (GTK_POPOVER (popover), FALSE);
|
||||
|
@@ -52,7 +52,7 @@ create_faces (void)
|
||||
/* Add a face */
|
||||
faces[i].face = gtk_frame_new (NULL);
|
||||
gtk_widget_set_size_request (faces[i].face, face_size, face_size);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (faces[i].face), faces[i].css_class);
|
||||
gtk_widget_add_css_class (faces[i].face, faces[i].css_class);
|
||||
gtk_container_add (GTK_CONTAINER (fixed), faces[i].face);
|
||||
|
||||
/* Set up the transformation for each face */
|
||||
@@ -124,7 +124,7 @@ create_demo_window (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *window, *sw, *fixed, *cube;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Fixed layout");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
|
@@ -719,7 +719,7 @@ do_flowbox (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Flow Box");
|
||||
|
@@ -10,7 +10,6 @@
|
||||
<property name="title">Font Explorer</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="tooltip-text">Reset</property>
|
||||
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
|
||||
@@ -27,18 +26,19 @@
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkFontButton" id="font">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="font">Sans 12</property>
|
||||
<property name="level">family|style|size|variations|features</property>
|
||||
@@ -61,7 +61,6 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="script_lang">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="margin-top">10</property>
|
||||
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
|
||||
<child>
|
||||
@@ -109,7 +108,10 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="spacing">20</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
|
@@ -25,14 +25,14 @@
|
||||
|
||||
#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
||||
|
||||
static GtkWidget *label;
|
||||
static GtkWidget *the_label;
|
||||
static GtkWidget *settings;
|
||||
static GtkWidget *description;
|
||||
static GtkWidget *font;
|
||||
static GtkWidget *script_lang;
|
||||
static GtkWidget *resetbutton;
|
||||
static GtkWidget *stack;
|
||||
static GtkWidget *entry;
|
||||
static GtkWidget *the_entry;
|
||||
static GtkWidget *variations_heading;
|
||||
static GtkWidget *variations_grid;
|
||||
static GtkWidget *instance_combo;
|
||||
@@ -301,9 +301,9 @@ update_display (void)
|
||||
char *font_desc;
|
||||
char *features;
|
||||
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (entry));
|
||||
text = gtk_editable_get_text (GTK_EDITABLE (the_entry));
|
||||
|
||||
if (gtk_label_get_selection_bounds (GTK_LABEL (label), &ins, &bound))
|
||||
if (gtk_label_get_selection_bounds (GTK_LABEL (the_label), &ins, &bound))
|
||||
{
|
||||
start = g_utf8_offset_to_pointer (text, ins) - text;
|
||||
end = g_utf8_offset_to_pointer (text, bound) - text;
|
||||
@@ -409,8 +409,8 @@ update_display (void)
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (description), font_desc);
|
||||
gtk_label_set_text (GTK_LABEL (settings), features);
|
||||
gtk_label_set_text (GTK_LABEL (label), text);
|
||||
gtk_label_set_attributes (GTK_LABEL (label), attrs);
|
||||
gtk_label_set_text (GTK_LABEL (the_label), text);
|
||||
gtk_label_set_attributes (GTK_LABEL (the_label), attrs);
|
||||
|
||||
g_free (font_desc);
|
||||
pango_font_description_free (desc);
|
||||
@@ -548,7 +548,7 @@ update_script_combo (void)
|
||||
{
|
||||
const char *langname;
|
||||
char langbuf[5];
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter tree_iter;
|
||||
|
||||
if (pair->lang_tag == HB_OT_TAG_DEFAULT_LANGUAGE)
|
||||
langname = NC_("Language", "Default");
|
||||
@@ -563,7 +563,7 @@ update_script_combo (void)
|
||||
}
|
||||
}
|
||||
|
||||
gtk_list_store_insert_with_values (store, &iter, -1,
|
||||
gtk_list_store_insert_with_values (store, &tree_iter, -1,
|
||||
0, langname,
|
||||
1, pair->script_index,
|
||||
2, pair->lang_index,
|
||||
@@ -572,7 +572,7 @@ update_script_combo (void)
|
||||
if (pair->lang_tag == active)
|
||||
{
|
||||
have_active = TRUE;
|
||||
active_iter = iter;
|
||||
active_iter = tree_iter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ add_font_variations (GString *s)
|
||||
GHashTableIter iter;
|
||||
Axis *axis;
|
||||
char buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
char *sep = "";
|
||||
const char *sep = "";
|
||||
|
||||
g_hash_table_iter_init (&iter, axes);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *)NULL, (gpointer *)&axis))
|
||||
@@ -1129,7 +1129,7 @@ font_features_reset_features (void)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
gtk_label_select_region (GTK_LABEL (label), 0, 0);
|
||||
gtk_label_select_region (GTK_LABEL (the_label), 0, 0);
|
||||
|
||||
g_list_free_full (ranges, free_range);
|
||||
ranges = NULL;
|
||||
@@ -1156,9 +1156,9 @@ static char *text;
|
||||
static void
|
||||
switch_to_entry (void)
|
||||
{
|
||||
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (the_entry)));
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (stack), "entry");
|
||||
gtk_widget_grab_focus (entry);
|
||||
gtk_widget_grab_focus (the_entry);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1217,20 +1217,20 @@ do_font_features (GtkWidget *do_widget)
|
||||
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
feature_list = GTK_WIDGET (gtk_builder_get_object (builder, "feature_list"));
|
||||
label = GTK_WIDGET (gtk_builder_get_object (builder, "label"));
|
||||
the_label = GTK_WIDGET (gtk_builder_get_object (builder, "label"));
|
||||
settings = GTK_WIDGET (gtk_builder_get_object (builder, "settings"));
|
||||
description = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
|
||||
resetbutton = GTK_WIDGET (gtk_builder_get_object (builder, "reset"));
|
||||
font = GTK_WIDGET (gtk_builder_get_object (builder, "font"));
|
||||
script_lang = GTK_WIDGET (gtk_builder_get_object (builder, "script_lang"));
|
||||
stack = GTK_WIDGET (gtk_builder_get_object (builder, "stack"));
|
||||
entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
|
||||
the_entry = GTK_WIDGET (gtk_builder_get_object (builder, "entry"));
|
||||
edit_toggle = GTK_WIDGET (gtk_builder_get_object (builder, "edit_toggle"));
|
||||
|
||||
controller = gtk_event_controller_key_new ();
|
||||
g_object_set_data_full (G_OBJECT (entry), "controller", g_object_ref (controller), g_object_unref);
|
||||
g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), entry);
|
||||
gtk_widget_add_controller (entry, controller);
|
||||
g_object_set_data_full (G_OBJECT (the_entry), "controller", g_object_ref (controller), g_object_unref);
|
||||
g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), the_entry);
|
||||
gtk_widget_add_controller (the_entry, controller);
|
||||
|
||||
add_check_group (feature_list, _("Kerning"), (const char *[]){ "kern", NULL });
|
||||
add_check_group (feature_list, _("Ligatures"), (const char *[]){ "liga",
|
||||
|
@@ -140,17 +140,6 @@ update_value (GtkFontPlane *plane,
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
hold_action (GtkGestureLongPress *gesture,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
GtkFontPlane *plane)
|
||||
{
|
||||
gboolean handled;
|
||||
|
||||
g_signal_emit_by_name (plane, "popup-menu", &handled);
|
||||
}
|
||||
|
||||
static void
|
||||
plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
||||
gdouble start_x,
|
||||
@@ -161,13 +150,6 @@ plane_drag_gesture_begin (GtkGestureDrag *gesture,
|
||||
|
||||
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
||||
|
||||
if (button == GDK_BUTTON_SECONDARY)
|
||||
{
|
||||
gboolean handled;
|
||||
|
||||
g_signal_emit_by_name (plane, "popup-menu", &handled);
|
||||
}
|
||||
|
||||
if (button != GDK_BUTTON_PRIMARY)
|
||||
{
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
|
||||
@@ -207,8 +189,6 @@ gtk_font_plane_init (GtkFontPlane *plane)
|
||||
{
|
||||
GtkGesture *gesture;
|
||||
|
||||
gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE);
|
||||
|
||||
gesture = gtk_gesture_drag_new ();
|
||||
g_signal_connect (gesture, "drag-begin",
|
||||
G_CALLBACK (plane_drag_gesture_begin), plane);
|
||||
@@ -218,13 +198,6 @@ gtk_font_plane_init (GtkFontPlane *plane)
|
||||
G_CALLBACK (plane_drag_gesture_end), plane);
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
||||
gtk_widget_add_controller (GTK_WIDGET (plane), GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
gesture = gtk_gesture_long_press_new ();
|
||||
g_signal_connect (gesture, "pressed",
|
||||
G_CALLBACK (hold_action), plane);
|
||||
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture),
|
||||
TRUE);
|
||||
gtk_widget_add_controller (GTK_WIDGET (plane), GTK_EVENT_CONTROLLER (gesture));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -43,7 +43,6 @@ update_image (void)
|
||||
cairo_font_options_t *fopt;
|
||||
cairo_hint_style_t hintstyle;
|
||||
cairo_hint_metrics_t hintmetrics;
|
||||
int i;
|
||||
|
||||
if (!context)
|
||||
context = gtk_widget_create_pango_context (image);
|
||||
@@ -116,6 +115,7 @@ update_image (void)
|
||||
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_grid)))
|
||||
{
|
||||
int i;
|
||||
cairo_set_source_rgba (cr, 0.2, 0, 0, 0.2);
|
||||
for (i = 1; i < ink.height + 20; i++)
|
||||
{
|
||||
|
@@ -1,984 +0,0 @@
|
||||
/* Foreign drawing
|
||||
*
|
||||
* Many applications can't use GTK widgets, for a variety of reasons,
|
||||
* but still want their user interface to appear integrated with the
|
||||
* rest of the desktop, and follow GTK themes. This demo shows how to
|
||||
* use GtkStyleContext and the gtk_render_ APIs to achieve this.
|
||||
*
|
||||
* Note that this is a very simple, non-interactive example.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
static void
|
||||
append_element (GtkWidgetPath *path,
|
||||
const char *selector)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
GtkStateFlags state_flag;
|
||||
} pseudo_classes[] = {
|
||||
{ "active", GTK_STATE_FLAG_ACTIVE },
|
||||
{ "hover", GTK_STATE_FLAG_PRELIGHT },
|
||||
{ "selected", GTK_STATE_FLAG_SELECTED },
|
||||
{ "disabled", GTK_STATE_FLAG_INSENSITIVE },
|
||||
{ "indeterminate", GTK_STATE_FLAG_INCONSISTENT },
|
||||
{ "focus", GTK_STATE_FLAG_FOCUSED },
|
||||
{ "backdrop", GTK_STATE_FLAG_BACKDROP },
|
||||
{ "dir(ltr)", GTK_STATE_FLAG_DIR_LTR },
|
||||
{ "dir(rtl)", GTK_STATE_FLAG_DIR_RTL },
|
||||
{ "link", GTK_STATE_FLAG_LINK },
|
||||
{ "visited", GTK_STATE_FLAG_VISITED },
|
||||
{ "checked", GTK_STATE_FLAG_CHECKED },
|
||||
{ "drop(active)", GTK_STATE_FLAG_DROP_ACTIVE }
|
||||
};
|
||||
const char *next;
|
||||
char *name;
|
||||
char type;
|
||||
guint i;
|
||||
|
||||
next = strpbrk (selector, "#.:");
|
||||
if (next == NULL)
|
||||
next = selector + strlen (selector);
|
||||
|
||||
name = g_strndup (selector, next - selector);
|
||||
if (g_ascii_isupper (selector[0]))
|
||||
{
|
||||
GType gtype;
|
||||
gtype = g_type_from_name (name);
|
||||
if (gtype == G_TYPE_INVALID)
|
||||
{
|
||||
g_critical ("Unknown type name `%s'", name);
|
||||
g_free (name);
|
||||
return;
|
||||
}
|
||||
gtk_widget_path_append_type (path, gtype);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Omit type, we're using name */
|
||||
gtk_widget_path_append_type (path, G_TYPE_NONE);
|
||||
gtk_widget_path_iter_set_object_name (path, -1, name);
|
||||
}
|
||||
g_free (name);
|
||||
|
||||
while (*next != '\0')
|
||||
{
|
||||
type = *next;
|
||||
selector = next + 1;
|
||||
next = strpbrk (selector, "#.:");
|
||||
if (next == NULL)
|
||||
next = selector + strlen (selector);
|
||||
name = g_strndup (selector, next - selector);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case '#':
|
||||
gtk_widget_path_iter_set_name (path, -1, name);
|
||||
break;
|
||||
|
||||
case '.':
|
||||
gtk_widget_path_iter_add_class (path, -1, name);
|
||||
break;
|
||||
|
||||
case ':':
|
||||
for (i = 0; i < G_N_ELEMENTS (pseudo_classes); i++)
|
||||
{
|
||||
if (g_str_equal (pseudo_classes[i].name, name))
|
||||
{
|
||||
gtk_widget_path_iter_set_state (path,
|
||||
-1,
|
||||
gtk_widget_path_iter_get_state (path, -1)
|
||||
| pseudo_classes[i].state_flag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == G_N_ELEMENTS (pseudo_classes))
|
||||
g_critical ("Unknown pseudo-class :%s", name);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkStyleContext *
|
||||
create_context_for_path (GtkWidgetPath *path,
|
||||
GtkStyleContext *parent)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_style_context_new ();
|
||||
gtk_style_context_set_path (context, path);
|
||||
gtk_style_context_set_parent (context, parent);
|
||||
/* Unfortunately, we have to explicitly set the state again here
|
||||
* for it to take effect
|
||||
*/
|
||||
gtk_style_context_set_state (context, gtk_widget_path_iter_get_state (path, -1));
|
||||
gtk_widget_path_unref (path);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
static GtkStyleContext *
|
||||
get_style (GtkStyleContext *parent,
|
||||
const char *selector)
|
||||
{
|
||||
GtkWidgetPath *path;
|
||||
|
||||
if (parent)
|
||||
path = gtk_widget_path_copy (gtk_style_context_get_path (parent));
|
||||
else
|
||||
path = gtk_widget_path_new ();
|
||||
|
||||
append_element (path, selector);
|
||||
|
||||
return create_context_for_path (path, parent);
|
||||
}
|
||||
|
||||
static GtkStyleContext *
|
||||
get_style_with_siblings (GtkStyleContext *parent,
|
||||
const char *selector,
|
||||
const char **siblings,
|
||||
gint position)
|
||||
{
|
||||
GtkWidgetPath *path, *siblings_path;
|
||||
guint i;
|
||||
|
||||
if (parent)
|
||||
path = gtk_widget_path_copy (gtk_style_context_get_path (parent));
|
||||
else
|
||||
path = gtk_widget_path_new ();
|
||||
|
||||
siblings_path = gtk_widget_path_new ();
|
||||
for (i = 0; siblings[i]; i++)
|
||||
append_element (siblings_path, siblings[i]);
|
||||
|
||||
gtk_widget_path_append_with_siblings (path, siblings_path, position);
|
||||
gtk_widget_path_unref (siblings_path);
|
||||
|
||||
return create_context_for_path (path, parent);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_style_common (GtkStyleContext *context,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint *contents_x,
|
||||
gint *contents_y,
|
||||
gint *contents_width,
|
||||
gint *contents_height)
|
||||
{
|
||||
GtkBorder margin, border, padding;
|
||||
int min_width, min_height;
|
||||
|
||||
gtk_style_context_get_margin (context, &margin);
|
||||
gtk_style_context_get_border (context, &border);
|
||||
gtk_style_context_get_padding (context, &padding);
|
||||
|
||||
gtk_style_context_get (context,
|
||||
"min-width", &min_width,
|
||||
"min-height", &min_height,
|
||||
NULL);
|
||||
x += margin.left;
|
||||
y += margin.top;
|
||||
width -= margin.left + margin.right;
|
||||
height -= margin.top + margin.bottom;
|
||||
|
||||
width = MAX (width, min_width);
|
||||
height = MAX (height, min_height);
|
||||
|
||||
gtk_render_background (context, cr, x, y, width, height);
|
||||
gtk_render_frame (context, cr, x, y, width, height);
|
||||
|
||||
if (contents_x)
|
||||
*contents_x = x + border.left + padding.left;
|
||||
if (contents_y)
|
||||
*contents_y = y + border.top + padding.top;
|
||||
if (contents_width)
|
||||
*contents_width = width - border.left - border.right - padding.left - padding.right;
|
||||
if (contents_height)
|
||||
*contents_height = height - border.top - border.bottom - padding.top - padding.bottom;
|
||||
}
|
||||
|
||||
static void
|
||||
query_size (GtkStyleContext *context,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkBorder margin, border, padding;
|
||||
int min_width, min_height;
|
||||
|
||||
gtk_style_context_get_margin (context, &margin);
|
||||
gtk_style_context_get_border (context, &border);
|
||||
gtk_style_context_get_padding (context, &padding);
|
||||
|
||||
gtk_style_context_get (context,
|
||||
"min-width", &min_width,
|
||||
"min-height", &min_height,
|
||||
NULL);
|
||||
|
||||
min_width += margin.left + margin.right + border.left + border.right + padding.left + padding.right;
|
||||
min_height += margin.top + margin.bottom + border.top + border.bottom + padding.top + padding.bottom;
|
||||
|
||||
if (width)
|
||||
*width = MAX (*width, min_width);
|
||||
if (height)
|
||||
*height = MAX (*height, min_height);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_menu (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *menu_context;
|
||||
GtkStyleContext *menuitem_context;
|
||||
GtkStyleContext *hovermenuitem_context;
|
||||
GtkStyleContext *hoveredarrowmenuitem_context;
|
||||
GtkStyleContext *arrowmenuitem_context;
|
||||
GtkStyleContext *checkmenuitem_context;
|
||||
GtkStyleContext *disabledarrowmenuitem_context;
|
||||
GtkStyleContext *disabledcheckmenuitem_context;
|
||||
GtkStyleContext *radiomenuitem_context;
|
||||
GtkStyleContext *disablemenuitem_context;
|
||||
GtkStyleContext *disabledradiomenuitem_context;
|
||||
GtkStyleContext *separatormenuitem_context;
|
||||
gint menuitem1_height, menuitem2_height, menuitem3_height, menuitem4_height, menuitem5_height;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint menu_x, menu_y, menu_width, menu_height;
|
||||
gint arrow_width, arrow_height, arrow_size;
|
||||
gint toggle_x, toggle_y, toggle_width, toggle_height;
|
||||
|
||||
/* This information is taken from the GtkMenu docs, see "CSS nodes" */
|
||||
menu_context = get_style (NULL, "menu");
|
||||
hovermenuitem_context = get_style (menu_context, "menuitem:hover");
|
||||
hoveredarrowmenuitem_context = get_style (hovermenuitem_context, "arrow.right:dir(ltr)");
|
||||
menuitem_context = get_style (menu_context, "menuitem");
|
||||
arrowmenuitem_context = get_style (menuitem_context, "arrow:dir(rtl)");
|
||||
disablemenuitem_context = get_style (menu_context, "menuitem:disabled");
|
||||
disabledarrowmenuitem_context = get_style (disablemenuitem_context, "arrow:dir(rtl)");
|
||||
checkmenuitem_context = get_style (menuitem_context, "check:checked");
|
||||
disabledcheckmenuitem_context = get_style (disablemenuitem_context, "check");
|
||||
separatormenuitem_context = get_style (menu_context, "separator:disabled");
|
||||
radiomenuitem_context = get_style (menuitem_context, "radio:checked");
|
||||
disabledradiomenuitem_context = get_style (disablemenuitem_context, "radio");
|
||||
|
||||
*height = 0;
|
||||
query_size (menu_context, NULL, height);
|
||||
menuitem1_height = 0;
|
||||
query_size (hovermenuitem_context, NULL, &menuitem1_height);
|
||||
query_size (hoveredarrowmenuitem_context, NULL, &menuitem1_height);
|
||||
*height += menuitem1_height;
|
||||
menuitem2_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (menuitem_context, NULL, &menuitem2_height);
|
||||
query_size (arrowmenuitem_context, NULL, &menuitem2_height);
|
||||
query_size (disabledarrowmenuitem_context, NULL, &menuitem2_height);
|
||||
*height += menuitem2_height;
|
||||
menuitem3_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (menuitem_context, NULL, &menuitem3_height);
|
||||
query_size (checkmenuitem_context, NULL, &menuitem3_height);
|
||||
query_size (disabledcheckmenuitem_context, NULL, &menuitem3_height);
|
||||
*height += menuitem3_height;
|
||||
menuitem4_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (separatormenuitem_context, NULL, &menuitem4_height);
|
||||
*height += menuitem4_height;
|
||||
menuitem5_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (menuitem_context, NULL, &menuitem5_height);
|
||||
query_size (radiomenuitem_context, NULL, &menuitem5_height);
|
||||
query_size (disabledradiomenuitem_context, NULL, &menuitem5_height);
|
||||
*height += menuitem5_height;
|
||||
|
||||
draw_style_common (menu_context, cr, x, y, width, *height,
|
||||
&menu_x, &menu_y, &menu_width, &menu_height);
|
||||
|
||||
/* Hovered with right arrow */
|
||||
gtk_style_context_get (hoveredarrowmenuitem_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
draw_style_common (hovermenuitem_context, cr, menu_x, menu_y, menu_width, menuitem1_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_arrow (hoveredarrowmenuitem_context, cr, G_PI / 2,
|
||||
contents_x + contents_width - arrow_size,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
|
||||
/* Left arrow sensitive, and right arrow insensitive */
|
||||
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height, menu_width, menuitem2_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_style_context_get (arrowmenuitem_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
gtk_render_arrow (arrowmenuitem_context, cr, G_PI / 2,
|
||||
contents_x,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
gtk_style_context_get (disabledarrowmenuitem_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
gtk_render_arrow (disabledarrowmenuitem_context, cr, G_PI / 2,
|
||||
contents_x + contents_width - arrow_size,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
|
||||
|
||||
/* Left check enabled, sensitive, and right check unchecked, insensitive */
|
||||
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height, menu_width, menuitem3_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_style_context_get (checkmenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (checkmenuitem_context, cr,
|
||||
contents_x,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (checkmenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
gtk_style_context_get (disabledcheckmenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (disabledcheckmenuitem_context, cr,
|
||||
contents_x + contents_width - toggle_width,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (disabledcheckmenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
|
||||
/* Separator */
|
||||
draw_style_common (separatormenuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height + menuitem3_height,
|
||||
menu_width, menuitem4_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
/* Left check enabled, sensitive, and right check unchecked, insensitive */
|
||||
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height + menuitem3_height + menuitem4_height,
|
||||
menu_width, menuitem5_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_style_context_get (radiomenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (radiomenuitem_context, cr,
|
||||
contents_x,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (radiomenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
gtk_style_context_get (disabledradiomenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (disabledradiomenuitem_context, cr,
|
||||
contents_x + contents_width - toggle_width,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (disabledradiomenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
|
||||
g_object_unref (menu_context);
|
||||
g_object_unref (menuitem_context);
|
||||
g_object_unref (hovermenuitem_context);
|
||||
g_object_unref (hoveredarrowmenuitem_context);
|
||||
g_object_unref (arrowmenuitem_context);
|
||||
g_object_unref (checkmenuitem_context);
|
||||
g_object_unref (disabledarrowmenuitem_context);
|
||||
g_object_unref (disabledcheckmenuitem_context);
|
||||
g_object_unref (radiomenuitem_context);
|
||||
g_object_unref (disablemenuitem_context);
|
||||
g_object_unref (disabledradiomenuitem_context);
|
||||
g_object_unref (separatormenuitem_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_menubar (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *frame_context;
|
||||
GtkStyleContext *border_context;
|
||||
GtkStyleContext *menubar_context;
|
||||
GtkStyleContext *hovered_menuitem_context;
|
||||
GtkStyleContext *menuitem_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint item_width;
|
||||
|
||||
/* Menubar background is the same color as our base background, so use a frame */
|
||||
frame_context = get_style (NULL, "frame");
|
||||
border_context = get_style (frame_context, "border");
|
||||
|
||||
/* This information is taken from the GtkPopoverMenuBar docs, see "CSS nodes" */
|
||||
menubar_context = get_style (NULL, "menubar");
|
||||
hovered_menuitem_context = get_style (menubar_context, "menuitem:hover");
|
||||
menuitem_context = get_style (menubar_context, "menuitem");
|
||||
|
||||
*height = 0;
|
||||
query_size (frame_context, NULL, height);
|
||||
query_size (border_context, NULL, height);
|
||||
query_size (menubar_context, NULL, height);
|
||||
query_size (hovered_menuitem_context, NULL, height);
|
||||
query_size (menuitem_context, NULL, height);
|
||||
|
||||
draw_style_common (frame_context, cr, x, y, width, *height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (border_context, cr, x, y, width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (menubar_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
item_width = contents_width / 3;
|
||||
draw_style_common (hovered_menuitem_context, cr, contents_x, contents_y, item_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (menuitem_context, cr, contents_x + item_width * 2, contents_y, item_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (menuitem_context);
|
||||
g_object_unref (hovered_menuitem_context);
|
||||
g_object_unref (menubar_context);
|
||||
g_object_unref (border_context);
|
||||
g_object_unref (frame_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_notebook (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GtkStyleContext *notebook_context;
|
||||
GtkStyleContext *header_context;
|
||||
GtkStyleContext *tabs_context;
|
||||
GtkStyleContext *tab1_context, *tab2_context;
|
||||
GtkStyleContext *stack_context;
|
||||
gint header_height;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkNotebook docs, see "CSS nodes" */
|
||||
notebook_context = get_style (NULL, "notebook.frame");
|
||||
header_context = get_style (notebook_context, "header.top");
|
||||
tabs_context = get_style (header_context, "tabs");
|
||||
tab1_context = get_style (tabs_context, "tab:checked");
|
||||
tab2_context = get_style (tabs_context, "tab:hover");
|
||||
stack_context = get_style (notebook_context, "stack");
|
||||
|
||||
header_height = 0;
|
||||
query_size (notebook_context, NULL, &header_height);
|
||||
query_size (header_context, NULL, &header_height);
|
||||
query_size (tabs_context, NULL, &header_height);
|
||||
query_size (tab1_context, NULL, &header_height);
|
||||
query_size (tab2_context, NULL, &header_height);
|
||||
|
||||
draw_style_common (notebook_context, cr, x, y, width, height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (header_context, cr, x, y, width, header_height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (tabs_context, cr, x, y, width, header_height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (tab1_context, cr, x, y, width / 2, header_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (tab2_context, cr, x + width / 2, y, width / 2, header_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (stack_context, cr, x, y + header_height, width,height - header_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (stack_context);
|
||||
g_object_unref (tabs_context);
|
||||
g_object_unref (tab1_context);
|
||||
g_object_unref (tab2_context);
|
||||
g_object_unref (header_context);
|
||||
g_object_unref (notebook_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_horizontal_scrollbar (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint position,
|
||||
GtkStateFlags state,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *scrollbar_context;
|
||||
GtkStyleContext *contents_context;
|
||||
GtkStyleContext *trough_context;
|
||||
GtkStyleContext *slider_context;
|
||||
gint slider_width;
|
||||
|
||||
/* This information is taken from the GtkScrollbar docs, see "CSS nodes" */
|
||||
scrollbar_context = get_style (NULL, "scrollbar.horizontal.bottom");
|
||||
contents_context = get_style (scrollbar_context, "contents");
|
||||
trough_context = get_style (contents_context, "trough");
|
||||
slider_context = get_style (trough_context, "slider");
|
||||
|
||||
gtk_style_context_set_state (scrollbar_context, state);
|
||||
gtk_style_context_set_state (contents_context, state);
|
||||
gtk_style_context_set_state (trough_context, state);
|
||||
gtk_style_context_set_state (slider_context, state);
|
||||
|
||||
*height = 0;
|
||||
query_size (scrollbar_context, NULL, height);
|
||||
query_size (contents_context, NULL, height);
|
||||
query_size (trough_context, NULL, height);
|
||||
query_size (slider_context, NULL, height);
|
||||
|
||||
gtk_style_context_get (slider_context,
|
||||
"min-width", &slider_width, NULL);
|
||||
|
||||
draw_style_common (scrollbar_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (contents_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (trough_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (slider_context, cr, x + position, y, slider_width, *height, NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (slider_context);
|
||||
g_object_unref (trough_context);
|
||||
g_object_unref (contents_context);
|
||||
g_object_unref (scrollbar_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_text (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
const gchar *text,
|
||||
GtkStateFlags state)
|
||||
{
|
||||
GtkStyleContext *label_context;
|
||||
GtkStyleContext *selection_context;
|
||||
GtkStyleContext *context;
|
||||
PangoLayout *layout;
|
||||
|
||||
/* This information is taken from the GtkLabel docs, see "CSS nodes" */
|
||||
label_context = get_style (NULL, "label.view");
|
||||
selection_context = get_style (label_context, "selection");
|
||||
|
||||
gtk_style_context_set_state (label_context, state);
|
||||
|
||||
if (state & GTK_STATE_FLAG_SELECTED)
|
||||
context = selection_context;
|
||||
else
|
||||
context = label_context;
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
|
||||
gtk_render_background (context, cr, x, y, width, height);
|
||||
gtk_render_frame (context, cr, x, y, width, height);
|
||||
gtk_render_layout (context, cr, x, y, layout);
|
||||
|
||||
g_object_unref (layout);
|
||||
|
||||
g_object_unref (selection_context);
|
||||
g_object_unref (label_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_check (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkStateFlags state,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *button_context;
|
||||
GtkStyleContext *check_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkCheckButton docs, see "CSS nodes" */
|
||||
button_context = get_style (NULL, "checkbutton");
|
||||
check_context = get_style (button_context, "check");
|
||||
|
||||
gtk_style_context_set_state (check_context, state);
|
||||
|
||||
*width = *height = 0;
|
||||
query_size (button_context, width, height);
|
||||
query_size (check_context, width, height);
|
||||
|
||||
draw_style_common (button_context, cr, x, y, *width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (check_context, cr, x, y, *width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_check (check_context, cr, contents_x, contents_y, contents_width, contents_height);
|
||||
|
||||
g_object_unref (check_context);
|
||||
g_object_unref (button_context);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
draw_radio (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkStateFlags state,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *button_context;
|
||||
GtkStyleContext *check_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkRadioButton docs, see "CSS nodes" */
|
||||
button_context = get_style (NULL, "radiobutton");
|
||||
check_context = get_style (button_context, "radio");
|
||||
|
||||
gtk_style_context_set_state (check_context, state);
|
||||
|
||||
*width = *height = 0;
|
||||
query_size (button_context, width, height);
|
||||
query_size (check_context, width, height);
|
||||
|
||||
draw_style_common (button_context, cr, x, y, *width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (check_context, cr, x, y, *width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_check (check_context, cr, contents_x, contents_y, contents_width, contents_height);
|
||||
|
||||
g_object_unref (check_context);
|
||||
g_object_unref (button_context);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
draw_progress (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint position,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *bar_context;
|
||||
GtkStyleContext *trough_context;
|
||||
GtkStyleContext *progress_context;
|
||||
|
||||
/* This information is taken from the GtkProgressBar docs, see "CSS nodes" */
|
||||
bar_context = get_style (NULL, "progressbar.horizontal");
|
||||
trough_context = get_style (bar_context, "trough");
|
||||
progress_context = get_style (trough_context, "progress.left");
|
||||
|
||||
*height = 0;
|
||||
query_size (bar_context, NULL, height);
|
||||
query_size (trough_context, NULL, height);
|
||||
query_size (progress_context, NULL, height);
|
||||
|
||||
draw_style_common (bar_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (trough_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (progress_context, cr, x, y, position, *height, NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (progress_context);
|
||||
g_object_unref (trough_context);
|
||||
g_object_unref (bar_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_scale (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint position,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *scale_context;
|
||||
GtkStyleContext *contents_context;
|
||||
GtkStyleContext *trough_context;
|
||||
GtkStyleContext *slider_context;
|
||||
GtkStyleContext *highlight_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint trough_height, slider_height;
|
||||
|
||||
scale_context = get_style (NULL, "scale.horizontal");
|
||||
contents_context = get_style (scale_context, "contents");
|
||||
trough_context = get_style (contents_context, "trough");
|
||||
slider_context = get_style (trough_context, "slider");
|
||||
highlight_context = get_style (trough_context, "highlight.top");
|
||||
|
||||
*height = 0;
|
||||
query_size (scale_context, NULL, height);
|
||||
query_size (contents_context, NULL, height);
|
||||
query_size (trough_context, NULL, height);
|
||||
query_size (slider_context, NULL, height);
|
||||
query_size (highlight_context, NULL, height);
|
||||
|
||||
draw_style_common (scale_context, cr, x, y, width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (contents_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
/* Scale trough defines its size querying slider and highlight */
|
||||
trough_height = 0;
|
||||
query_size (trough_context, NULL, &trough_height);
|
||||
slider_height = 0;
|
||||
query_size (slider_context, NULL, &slider_height);
|
||||
query_size (highlight_context, NULL, &slider_height);
|
||||
trough_height += slider_height;
|
||||
draw_style_common (trough_context, cr, contents_x, contents_y, contents_width, trough_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (highlight_context, cr, contents_x, contents_y,
|
||||
contents_width / 2, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (slider_context, cr, contents_x + position, contents_y, contents_height, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (scale_context);
|
||||
g_object_unref (contents_context);
|
||||
g_object_unref (trough_context);
|
||||
g_object_unref (slider_context);
|
||||
g_object_unref (highlight_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_combobox (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gboolean has_entry,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *combo_context;
|
||||
GtkStyleContext *box_context;
|
||||
GtkStyleContext *button_context;
|
||||
GtkStyleContext *button_box_context;
|
||||
GtkStyleContext *entry_context;
|
||||
GtkStyleContext *arrow_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint button_width;
|
||||
gint arrow_width, arrow_height, arrow_size;
|
||||
|
||||
/* This information is taken from the GtkComboBox docs, see "CSS nodes" */
|
||||
combo_context = get_style (NULL, "combobox:focus");
|
||||
box_context = get_style (combo_context, "box.horizontal.linked");
|
||||
if (has_entry)
|
||||
{
|
||||
const char *siblings[3] = { "entry.combo:focus", "button.combo" , NULL };
|
||||
|
||||
entry_context = get_style_with_siblings (box_context, "entry.combo:focus", siblings, 0);
|
||||
button_context = get_style_with_siblings (box_context, "button.combo", siblings, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *siblings[2] = { "button.combo" , NULL };
|
||||
|
||||
button_context = get_style_with_siblings (box_context, "button.combo", siblings, 0);
|
||||
}
|
||||
button_box_context = get_style (button_context, "box.horizontal");
|
||||
arrow_context = get_style (button_box_context, "arrow");
|
||||
|
||||
*height = 0;
|
||||
query_size (combo_context, NULL, height);
|
||||
query_size (box_context, NULL, height);
|
||||
if (has_entry)
|
||||
query_size (entry_context, NULL, height);
|
||||
query_size (button_context, NULL, height);
|
||||
query_size (button_box_context, NULL, height);
|
||||
query_size (arrow_context, NULL, height);
|
||||
|
||||
gtk_style_context_get (arrow_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
|
||||
draw_style_common (combo_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (box_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
if (has_entry)
|
||||
{
|
||||
button_width = *height;
|
||||
draw_style_common (entry_context, cr, x, y, width - button_width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (button_context, cr, x + width - button_width, y, button_width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
button_width = width;
|
||||
draw_style_common (button_context, cr, x, y, width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
}
|
||||
|
||||
draw_style_common (button_box_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (arrow_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
gtk_render_arrow (arrow_context, cr, G_PI / 2,
|
||||
contents_x + contents_width - arrow_size,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
|
||||
g_object_unref (arrow_context);
|
||||
if (has_entry)
|
||||
g_object_unref (entry_context);
|
||||
g_object_unref (button_context);
|
||||
g_object_unref (combo_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_spinbutton (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *spin_context;
|
||||
GtkStyleContext *entry_context;
|
||||
GtkStyleContext *up_context;
|
||||
GtkStyleContext *down_context;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconInfo *icon_info;
|
||||
GdkTexture *texture;
|
||||
gint icon_width, icon_height, icon_size;
|
||||
gint button_width;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkSpinButton docs, see "CSS nodes" */
|
||||
spin_context = get_style (NULL, "spinbutton.horizontal:focus");
|
||||
entry_context = get_style (spin_context, "entry:focus");
|
||||
up_context = get_style (spin_context, "button.up:focus:active");
|
||||
down_context = get_style (spin_context, "button.down:focus");
|
||||
|
||||
*height = 0;
|
||||
query_size (spin_context, NULL, height);
|
||||
query_size (entry_context, NULL, height);
|
||||
query_size (up_context, NULL, height);
|
||||
query_size (down_context, NULL, height);
|
||||
button_width = *height;
|
||||
|
||||
draw_style_common (spin_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (entry_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
|
||||
|
||||
gtk_style_context_get (up_context,
|
||||
"min-width", &icon_width, "min-height", &icon_height, NULL);
|
||||
icon_size = MIN (icon_width, icon_height);
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, "list-add-symbolic", icon_size, 0);
|
||||
texture = GDK_TEXTURE (gtk_icon_info_load_symbolic_for_context (icon_info, up_context, NULL, NULL));
|
||||
g_object_unref (icon_info);
|
||||
draw_style_common (up_context, cr, x + width - button_width, y, button_width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_icon (up_context, cr, texture, contents_x, contents_y + (contents_height - icon_size) / 2);
|
||||
g_object_unref (texture);
|
||||
|
||||
gtk_style_context_get (down_context,
|
||||
"min-width", &icon_width, "min-height", &icon_height, NULL);
|
||||
icon_size = MIN (icon_width, icon_height);
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, "list-remove-symbolic", icon_size, 0);
|
||||
texture = GDK_TEXTURE (gtk_icon_info_load_symbolic_for_context (icon_info, down_context, NULL, NULL));
|
||||
g_object_unref (icon_info);
|
||||
draw_style_common (down_context, cr, x + width - 2 * button_width, y, button_width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_icon (down_context, cr, texture, contents_x, contents_y + (contents_height - icon_size) / 2);
|
||||
g_object_unref (texture);
|
||||
|
||||
g_object_unref (down_context);
|
||||
g_object_unref (up_context);
|
||||
g_object_unref (entry_context);
|
||||
g_object_unref (spin_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_func (GtkDrawingArea *da,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (da);
|
||||
gint panewidth;
|
||||
gint x, y;
|
||||
|
||||
panewidth = width / 2;
|
||||
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_set_source_rgb (cr, 0.9, 0.9, 0.9);
|
||||
cairo_fill (cr);
|
||||
|
||||
x = y = 10;
|
||||
draw_horizontal_scrollbar (widget, cr, x, y, panewidth - 20, 30, GTK_STATE_FLAG_NORMAL, &height);
|
||||
y += height + 8;
|
||||
draw_horizontal_scrollbar (widget, cr, x, y, panewidth - 20, 40, GTK_STATE_FLAG_PRELIGHT, &height);
|
||||
y += height + 8;
|
||||
draw_horizontal_scrollbar (widget, cr, x, y, panewidth - 20, 50, GTK_STATE_FLAG_ACTIVE|GTK_STATE_FLAG_PRELIGHT, &height);
|
||||
|
||||
y += height + 8;
|
||||
draw_text (widget, cr, x, y, panewidth - 20, 20, "Not selected", GTK_STATE_FLAG_NORMAL);
|
||||
y += 20 + 10;
|
||||
draw_text (widget, cr, x, y, panewidth - 20, 20, "Selected", GTK_STATE_FLAG_SELECTED);
|
||||
|
||||
x = 10;
|
||||
y += 20 + 10;
|
||||
draw_check (widget, cr, x, y, GTK_STATE_FLAG_NORMAL, &width, &height);
|
||||
x += width + 10;
|
||||
draw_check (widget, cr, x, y, GTK_STATE_FLAG_CHECKED, &width, &height);
|
||||
x += width + 10;
|
||||
draw_radio (widget, cr, x, y, GTK_STATE_FLAG_NORMAL, &width, &height);
|
||||
x += width + 10;
|
||||
draw_radio (widget, cr, x, y, GTK_STATE_FLAG_CHECKED, &width, &height);
|
||||
x = 10;
|
||||
|
||||
y += height + 10;
|
||||
draw_progress (widget, cr, x, y, panewidth - 20, 50, &height);
|
||||
|
||||
y += height + 10;
|
||||
draw_scale (widget, cr, x, y, panewidth - 20, 75, &height);
|
||||
|
||||
y += height + 20;
|
||||
draw_notebook (widget, cr, x, y, panewidth - 20, 160);
|
||||
|
||||
/* Second column */
|
||||
x += panewidth;
|
||||
y = 10;
|
||||
draw_menu (widget, cr, x, y, panewidth - 20, &height);
|
||||
|
||||
y += height + 10;
|
||||
draw_menubar (widget, cr, x, y, panewidth - 20, &height);
|
||||
|
||||
y += height + 20;
|
||||
draw_spinbutton (widget, cr, x, y, panewidth - 20, &height);
|
||||
|
||||
y += height + 30;
|
||||
draw_combobox (widget, cr, x, y, panewidth - 20, FALSE, &height);
|
||||
|
||||
y += height + 10;
|
||||
draw_combobox (widget, cr, 10 + panewidth, y, panewidth - 20, TRUE, &height);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_foreigndrawing (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *da;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Foreign drawing");
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
da = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 400);
|
||||
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 400);
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_func, NULL, NULL);
|
||||
gtk_widget_set_hexpand (da, TRUE);
|
||||
gtk_widget_set_vexpand (da, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), da);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
137
demos/gtk-demo/gears.c
Normal file
137
demos/gtk-demo/gears.c
Normal file
@@ -0,0 +1,137 @@
|
||||
/* OpenGL/Gears
|
||||
*
|
||||
* This is a classic OpenGL demo, running in a GtkGLArea.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtkgears.h"
|
||||
|
||||
/************************************************************************
|
||||
* DEMO CODE *
|
||||
************************************************************************/
|
||||
|
||||
static void
|
||||
on_axis_value_change (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
GtkGears *gears = GTK_GEARS (data);
|
||||
int axis = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (adjustment), "axis"));
|
||||
|
||||
gtk_gears_set_axis (gears, axis, gtk_adjustment_get_value (adjustment));
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
create_axis_slider (GtkGears *gears,
|
||||
int axis)
|
||||
{
|
||||
GtkWidget *box, *label, *slider;
|
||||
GtkAdjustment *adj;
|
||||
const char *text;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case GTK_GEARS_X_AXIS:
|
||||
text = "X";
|
||||
break;
|
||||
|
||||
case GTK_GEARS_Y_AXIS:
|
||||
text = "Y";
|
||||
break;
|
||||
|
||||
case GTK_GEARS_Z_AXIS:
|
||||
text = "Z";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
gtk_widget_show (label);
|
||||
|
||||
adj = gtk_adjustment_new (gtk_gears_get_axis (gears, axis), 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||
g_object_set_data (G_OBJECT (adj), "axis", GINT_TO_POINTER (axis));
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (on_axis_value_change),
|
||||
gears);
|
||||
slider = gtk_scale_new (GTK_ORIENTATION_VERTICAL, adj);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (box), slider);
|
||||
gtk_widget_set_vexpand (slider, TRUE);
|
||||
gtk_widget_show (slider);
|
||||
|
||||
gtk_widget_show (box);
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_gears (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *box, *hbox, *fps_label, *gears, *overlay, *frame;
|
||||
int i;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Gears");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 640);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
overlay = gtk_overlay_new ();
|
||||
gtk_widget_set_margin_start (overlay, 12);
|
||||
gtk_widget_set_margin_end (overlay, 12);
|
||||
gtk_widget_set_margin_top (overlay, 12);
|
||||
gtk_widget_set_margin_bottom (overlay, 12);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), overlay);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_START);
|
||||
gtk_widget_add_css_class (frame, "app-notification");
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), frame);
|
||||
|
||||
fps_label = gtk_label_new ("");
|
||||
gtk_widget_set_halign (fps_label, GTK_ALIGN_START);
|
||||
gtk_container_add (GTK_CONTAINER (frame), fps_label);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (overlay), box);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (box), hbox);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_widget_set_hexpand (gears, TRUE);
|
||||
gtk_widget_set_vexpand (gears, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), gears);
|
||||
|
||||
for (i = 0; i < GTK_GEARS_N_AXIS; i++)
|
||||
gtk_container_add (GTK_CONTAINER (hbox), create_axis_slider (GTK_GEARS (gears), i));
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (hbox), 6);
|
||||
gtk_container_add (GTK_CONTAINER (box), hbox);
|
||||
|
||||
gtk_gears_set_fps_label (GTK_GEARS (gears), GTK_LABEL (fps_label));
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -17,9 +17,9 @@ typedef struct _Demo Demo;
|
||||
|
||||
struct _Demo
|
||||
{
|
||||
gchar *name;
|
||||
gchar *title;
|
||||
gchar *filename;
|
||||
const char *name;
|
||||
const char *title;
|
||||
const char *filename;
|
||||
GDoDemoFunc func;
|
||||
Demo *children;
|
||||
};
|
||||
|
@@ -146,7 +146,7 @@ do_gestures (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Gestures");
|
||||
g_signal_connect (window, "destroy",
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* OpenGL Area
|
||||
/* OpenGL/OpenGL Area
|
||||
*
|
||||
* GtkGLArea is a widget that allows custom drawing using OpenGL calls.
|
||||
*/
|
||||
@@ -383,20 +383,23 @@ close_window (GtkWidget *widget)
|
||||
rotation_angles[Z_AXIS] = 0.0;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
static GtkWidget *
|
||||
create_glarea_window (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *window, *box, *button, *controls;
|
||||
int i;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "OpenGL Area");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
g_object_set (box, "margin", 12, NULL);
|
||||
gtk_widget_set_margin_start (box, 12);
|
||||
gtk_widget_set_margin_end (box, 12);
|
||||
gtk_widget_set_margin_top (box, 12);
|
||||
gtk_widget_set_margin_bottom (box, 12);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
|
@@ -23,7 +23,7 @@ do_headerbar (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
@@ -42,7 +42,7 @@ do_headerbar (GtkWidget *do_widget)
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (box), "linked");
|
||||
gtk_widget_add_css_class (box, "linked");
|
||||
button = gtk_button_new ();
|
||||
gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-start-symbolic"));
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
static void
|
||||
insert_link (GtkTextBuffer *buffer,
|
||||
GtkTextIter *iter,
|
||||
gchar *text,
|
||||
const char *text,
|
||||
gint page)
|
||||
{
|
||||
GtkTextTag *tag;
|
||||
@@ -232,7 +232,7 @@ do_hypertext (GtkWidget *do_widget)
|
||||
GtkTextBuffer *buffer;
|
||||
GtkEventController *controller;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hypertext");
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -52,7 +52,10 @@ populate_icons (void)
|
||||
|
||||
grid = gtk_grid_new ();
|
||||
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
|
||||
g_object_set (grid, "margin", 10, NULL);
|
||||
gtk_widget_set_margin_start (grid, 10);
|
||||
gtk_widget_set_margin_end (grid, 10);
|
||||
gtk_widget_set_margin_top (grid, 10);
|
||||
gtk_widget_set_margin_bottom (grid, 10);
|
||||
gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
|
||||
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
|
||||
|
||||
|
@@ -26,7 +26,7 @@ enum
|
||||
|
||||
static GdkPixbuf *file_pixbuf, *folder_pixbuf;
|
||||
gchar *parent;
|
||||
GtkToolItem *up_button;
|
||||
GtkWidget *up_button;
|
||||
|
||||
/* Loads the images for the demo and returns whether the operation succeeded */
|
||||
static void
|
||||
@@ -188,8 +188,8 @@ item_activated (GtkIconView *icon_view,
|
||||
}
|
||||
|
||||
static void
|
||||
up_clicked (GtkToolItem *item,
|
||||
gpointer user_data)
|
||||
up_clicked (GtkButton *item,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListStore *store;
|
||||
gchar *dir_name;
|
||||
@@ -209,8 +209,8 @@ up_clicked (GtkToolItem *item,
|
||||
}
|
||||
|
||||
static void
|
||||
home_clicked (GtkToolItem *item,
|
||||
gpointer user_data)
|
||||
home_clicked (GtkButton *item,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListStore *store;
|
||||
|
||||
@@ -248,9 +248,9 @@ do_iconview (GtkWidget *do_widget)
|
||||
GtkListStore *store;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *tool_bar;
|
||||
GtkToolItem *home_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
@@ -265,23 +265,15 @@ do_iconview (GtkWidget *do_widget)
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
tool_bar = gtk_toolbar_new ();
|
||||
tool_bar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), tool_bar);
|
||||
|
||||
up_button = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (up_button), TRUE);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (up_button), "go-up");
|
||||
gtk_tool_item_set_is_important (up_button, TRUE);
|
||||
up_button = gtk_button_new_with_mnemonic ("_Up");
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1);
|
||||
gtk_container_add (GTK_CONTAINER (tool_bar), up_button);
|
||||
|
||||
home_button = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (home_button), _("_Home"));
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (home_button), TRUE);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (home_button), "go-home");
|
||||
gtk_tool_item_set_is_important (home_button, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), home_button, -1);
|
||||
home_button = gtk_button_new_with_mnemonic ("_Home");
|
||||
gtk_container_add (GTK_CONTAINER (tool_bar), home_button);
|
||||
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
|
@@ -106,7 +106,7 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
GtkListStore *store;
|
||||
GtkCellRenderer *renderer;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -331,7 +331,7 @@ do_images (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Images");
|
||||
@@ -342,7 +342,10 @@ do_images (GtkWidget *do_widget)
|
||||
G_CALLBACK (cleanup_callback), NULL);
|
||||
|
||||
base_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (base_vbox, "margin", 16, NULL);
|
||||
gtk_widget_set_margin_start (base_vbox, 16);
|
||||
gtk_widget_set_margin_end (base_vbox, 16);
|
||||
gtk_widget_set_margin_top (base_vbox, 16);
|
||||
gtk_widget_set_margin_bottom (base_vbox, 16);
|
||||
gtk_container_add (GTK_CONTAINER (window), base_vbox);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
|
||||
|
@@ -53,7 +53,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
{
|
||||
actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
|
||||
@@ -61,7 +61,10 @@ do_infobar (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
g_object_set (vbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
gtk_widget_set_margin_end (vbox, 8);
|
||||
gtk_widget_set_margin_top (vbox, 8);
|
||||
gtk_widget_set_margin_bottom (vbox, 8);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
bar = gtk_info_bar_new ();
|
||||
@@ -70,7 +73,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
|
||||
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
|
||||
gtk_container_add (GTK_CONTAINER (bar), label);
|
||||
|
||||
button = gtk_toggle_button_new_with_label ("Message");
|
||||
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
@@ -82,7 +85,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
|
||||
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
|
||||
gtk_container_add (GTK_CONTAINER (bar), label);
|
||||
|
||||
button = gtk_toggle_button_new_with_label ("Warning");
|
||||
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
@@ -96,7 +99,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
|
||||
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
|
||||
gtk_container_add (GTK_CONTAINER (bar), label);
|
||||
gtk_info_bar_set_default_response (GTK_INFO_BAR (bar), GTK_RESPONSE_OK);
|
||||
|
||||
button = gtk_toggle_button_new_with_label ("Question");
|
||||
@@ -109,7 +112,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
|
||||
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
|
||||
gtk_container_add (GTK_CONTAINER (bar), label);
|
||||
|
||||
button = gtk_toggle_button_new_with_label ("Error");
|
||||
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
@@ -122,7 +125,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
|
||||
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
|
||||
gtk_container_add (GTK_CONTAINER (bar), label);
|
||||
|
||||
button = gtk_toggle_button_new_with_label ("Other");
|
||||
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
@@ -134,7 +137,10 @@ do_infobar (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (vbox2, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (vbox2, 8);
|
||||
gtk_widget_set_margin_end (vbox2, 8);
|
||||
gtk_widget_set_margin_top (vbox2, 8);
|
||||
gtk_widget_set_margin_bottom (vbox2, 8);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
||||
|
||||
/* Standard message dialog */
|
||||
|
@@ -52,7 +52,7 @@ do_links (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Links");
|
||||
|
@@ -16,10 +16,9 @@ typedef struct
|
||||
{
|
||||
const gboolean fixed;
|
||||
const guint number;
|
||||
const gchar *severity;
|
||||
const gchar *description;
|
||||
}
|
||||
Bug;
|
||||
const char *severity;
|
||||
const char *description;
|
||||
} Bug;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -34,7 +33,7 @@ enum
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
static Bug data[] =
|
||||
static Bug bugs[] =
|
||||
{
|
||||
{ FALSE, 60482, "Normal", "scrollable notebooks and hidden tabs" },
|
||||
{ FALSE, 60620, "Critical", "gdk_surface_clear_area (gdksurface-win32.c) is not thread-safe" },
|
||||
@@ -98,9 +97,9 @@ create_model (void)
|
||||
G_TYPE_BOOLEAN);
|
||||
|
||||
/* add data to the list store */
|
||||
for (i = 0; i < G_N_ELEMENTS (data); i++)
|
||||
for (i = 0; i < G_N_ELEMENTS (bugs); i++)
|
||||
{
|
||||
gchar *icon_name;
|
||||
const char *icon_name;
|
||||
gboolean sensitive;
|
||||
|
||||
if (i == 1 || i == 3)
|
||||
@@ -113,10 +112,10 @@ create_model (void)
|
||||
sensitive = TRUE;
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter,
|
||||
COLUMN_FIXED, data[i].fixed,
|
||||
COLUMN_NUMBER, data[i].number,
|
||||
COLUMN_SEVERITY, data[i].severity,
|
||||
COLUMN_DESCRIPTION, data[i].description,
|
||||
COLUMN_FIXED, bugs[i].fixed,
|
||||
COLUMN_NUMBER, bugs[i].number,
|
||||
COLUMN_SEVERITY, bugs[i].severity,
|
||||
COLUMN_DESCRIPTION, bugs[i].description,
|
||||
COLUMN_PULSE, 0,
|
||||
COLUMN_ICON, icon_name,
|
||||
COLUMN_ACTIVE, FALSE,
|
||||
@@ -129,23 +128,23 @@ create_model (void)
|
||||
|
||||
static void
|
||||
fixed_toggled (GtkCellRendererToggle *cell,
|
||||
gchar *path_str,
|
||||
char *path_str,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModel *model = (GtkTreeModel *)data;
|
||||
GtkTreeModel *tree_model = (GtkTreeModel *)data;
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath *path = gtk_tree_path_new_from_string (path_str);
|
||||
gboolean fixed;
|
||||
|
||||
/* get toggled iter */
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_model_get (model, &iter, COLUMN_FIXED, &fixed, -1);
|
||||
gtk_tree_model_get_iter (tree_model, &iter, path);
|
||||
gtk_tree_model_get (tree_model, &iter, COLUMN_FIXED, &fixed, -1);
|
||||
|
||||
/* do something with the value */
|
||||
fixed ^= 1;
|
||||
|
||||
/* set new value */
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter, COLUMN_FIXED, fixed, -1);
|
||||
gtk_list_store_set (GTK_LIST_STORE (tree_model), &iter, COLUMN_FIXED, fixed, -1);
|
||||
|
||||
/* clean up */
|
||||
gtk_tree_path_free (path);
|
||||
@@ -156,7 +155,6 @@ add_columns (GtkTreeView *treeview)
|
||||
{
|
||||
GtkCellRenderer *renderer;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeModel *model = gtk_tree_view_get_model (treeview);
|
||||
|
||||
/* column for fixed toggles */
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
@@ -255,7 +253,7 @@ do_list_store (GtkWidget *do_widget)
|
||||
GtkWidget *treeview;
|
||||
|
||||
/* create window, etc */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "List Store");
|
||||
@@ -264,7 +262,10 @@ do_list_store (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
g_object_set (vbox, "margin", 8, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
gtk_widget_set_margin_end (vbox, 8);
|
||||
gtk_widget_set_margin_top (vbox, 8);
|
||||
gtk_widget_set_margin_bottom (vbox, 8);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
|
||||
|
@@ -347,7 +347,7 @@ do_listbox (GtkWidget *do_widget)
|
||||
{
|
||||
avatar_pixbuf_other = gdk_pixbuf_new_from_resource_at_scale ("/listbox/apple-red.png", 32, 32, FALSE, NULL);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "List Box");
|
||||
|
@@ -38,7 +38,6 @@
|
||||
<property name="baseline-position">top</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="relief">none</property>
|
||||
@@ -109,7 +108,6 @@
|
||||
<child>
|
||||
<object class="GtkLinkButton" id="resent_by_button">
|
||||
<property name="label" translatable="0">reshareer</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="uri">http://www.gtk.org</property>
|
||||
@@ -127,7 +125,6 @@
|
||||
<child>
|
||||
<object class="GtkButton" id="expand_button">
|
||||
<property name="label" translatable="yes">Expand</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="expand_clicked" swapped="yes"/>
|
||||
@@ -140,7 +137,6 @@
|
||||
<child>
|
||||
<object class="GtkButton" id="reply-button">
|
||||
<property name="label" translatable="yes">Reply</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
</object>
|
||||
@@ -148,7 +144,6 @@
|
||||
<child>
|
||||
<object class="GtkButton" id="reshare-button">
|
||||
<property name="label" translatable="yes">Reshare</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="reshare_clicked" swapped="yes"/>
|
||||
@@ -157,7 +152,6 @@
|
||||
<child>
|
||||
<object class="GtkButton" id="favorite-buttton">
|
||||
<property name="label" translatable="yes">Favorite</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="favorite_clicked" swapped="yes"/>
|
||||
@@ -165,7 +159,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="more-button">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="menu-model">menu1</property>
|
||||
<property name="relief">none</property>
|
||||
@@ -231,7 +224,6 @@ FAVORITES</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button5">
|
||||
<property name="label" translatable="yes">Details</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<style>
|
||||
|
@@ -205,14 +205,14 @@ enum {
|
||||
STATE_IN_COMMENT
|
||||
};
|
||||
|
||||
static gchar *tokens[] =
|
||||
static const char *tokens[] =
|
||||
{
|
||||
"/*",
|
||||
"\"",
|
||||
NULL
|
||||
};
|
||||
|
||||
static gchar *types[] =
|
||||
static const char *types[] =
|
||||
{
|
||||
"static",
|
||||
"const ",
|
||||
@@ -310,7 +310,6 @@ static gchar *types[] =
|
||||
"GtkIconView ",
|
||||
"GtkCellRendererText ",
|
||||
"GtkContainer ",
|
||||
"GtkAccelGroup ",
|
||||
"GtkPaned ",
|
||||
"GtkPrintOperation ",
|
||||
"GtkPrintContext ",
|
||||
@@ -337,7 +336,7 @@ static gchar *types[] =
|
||||
NULL
|
||||
};
|
||||
|
||||
static gchar *control[] =
|
||||
static const char *control[] =
|
||||
{
|
||||
" if ",
|
||||
" while ",
|
||||
@@ -351,11 +350,11 @@ static gchar *control[] =
|
||||
NULL
|
||||
};
|
||||
void
|
||||
parse_chars (gchar *text,
|
||||
gchar **end_ptr,
|
||||
gint *state,
|
||||
gchar **tag,
|
||||
gboolean start)
|
||||
parse_chars (gchar *text,
|
||||
gchar **end_ptr,
|
||||
gint *state,
|
||||
const char **tag,
|
||||
gboolean start)
|
||||
{
|
||||
gint i;
|
||||
gchar *next_token;
|
||||
@@ -494,7 +493,7 @@ fontify (GtkTextBuffer *source_buffer)
|
||||
gint state;
|
||||
gchar *text;
|
||||
gchar *start_ptr, *end_ptr;
|
||||
gchar *tag;
|
||||
const char *tag;
|
||||
|
||||
gtk_text_buffer_create_tag (source_buffer, "source",
|
||||
"font", "monospace",
|
||||
@@ -868,7 +867,7 @@ load_file (const gchar *demoname,
|
||||
|
||||
p = lines[i];
|
||||
state++;
|
||||
/* Fall through */
|
||||
G_GNUC_FALLTHROUGH;
|
||||
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
@@ -876,6 +875,9 @@ load_file (const gchar *demoname,
|
||||
if (lines[i+1] != NULL)
|
||||
gtk_text_buffer_insert (source_buffer, &start, "\n", 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -975,7 +977,7 @@ startup (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GMenuModel *appmenu;
|
||||
gchar *ids[] = { "appmenu", NULL };
|
||||
const char *ids[] = { "appmenu", NULL };
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_objects_from_resource (builder, "/ui/appmenu.ui", ids, NULL);
|
||||
|
@@ -28,14 +28,12 @@
|
||||
<property name="default-width">800</property>
|
||||
<property name="default-height">600</property>
|
||||
<property name="title">GTK Demo</property>
|
||||
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="headerbar">
|
||||
<property name="show-title-buttons">1</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="valign">center</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="action-name">win.run</property>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
@@ -63,12 +61,10 @@
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="width-request">120</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="min-content-width">150</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="model">treestore</property>
|
||||
<property name="headers-visible">0</property>
|
||||
<child internal-child="selection">
|
||||
@@ -100,20 +96,18 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="notebook">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="scrollable">1</property>
|
||||
<property name="enable-popup">1</property>
|
||||
<property name="show-border">0</property>
|
||||
<property name="expand">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkNotebookPage">
|
||||
<property name="tab-expand">1</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="can-focus">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="info-textview">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="top-margin">20</property>
|
||||
@@ -141,10 +135,8 @@
|
||||
<property name="tab-expand">1</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow" id="source-scrolledwindow">
|
||||
<property name="can-focus">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="source-textview">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="left-margin">20</property>
|
||||
<property name="right-margin">20</property>
|
||||
<property name="top-margin">20</property>
|
||||
|
@@ -54,7 +54,7 @@ do_markup (GtkWidget *do_widget)
|
||||
GtkWidget *header;
|
||||
GtkWidget *show_source;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
@@ -78,7 +78,7 @@ do_markup (GtkWidget *do_widget)
|
||||
|
||||
view = gtk_text_view_new ();
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD_CHAR);
|
||||
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 10);
|
||||
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 10);
|
||||
|
||||
|
@@ -14,3 +14,7 @@ Superscripts and subscripts: 𝜀<span rise="-6000" size="x-small" font_desc="it
|
||||
OpenType font features: <span font_desc="sans regular" font_features="dlig=0">feast</span> versus <span font_desc="sans regular" font_features="dlig=1">feast</span>
|
||||
|
||||
Shortcuts: <tt>Monospace</tt> – <b>Bold</b> – <i>Italic</i> – <big>Big</big> – <small>Small</small> – <u>Underlined</u> – <s>Strikethrough</s> – Super<sup>script</sup> – Sub<sub>script</sub>
|
||||
|
||||
<span allow_breaks="false">A</span> hyphenation algorithm is a set of rules, especially one codified for implementation in a computer program, that decides at which points a word can be broken over two lines with a hyphen. For example, a hyphenation algorithm might decide that impeachment can be broken as <span allow_breaks="false">impeach‧ment</span> or <span allow_breaks="false">im‧peachment</span> but not <span allow_breaks="false">impe‧achment.</span>
|
||||
|
||||
<span insert_hyphens="false">one/two three/four five/six seven/eight nine/ten</span>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_New</attribute>
|
||||
<attribute name="action">app.new</attribute>
|
||||
<attribute name="accel"><Primary>n</attribute>
|
||||
<attribute name="accel"><Control>n</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open</attribute>
|
||||
@@ -14,19 +14,19 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save</attribute>
|
||||
<attribute name="action">app.save</attribute>
|
||||
<attribute name="accel"><Primary>s</attribute>
|
||||
<attribute name="accel"><Control>s</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Save _As...</attribute>
|
||||
<attribute name="action">app.save-as</attribute>
|
||||
<attribute name="accel"><Primary>s</attribute>
|
||||
<attribute name="accel"><Control>s</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">app.quit</attribute>
|
||||
<attribute name="accel"><Primary>q</attribute>
|
||||
<attribute name="accel"><Control>q</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
@@ -45,19 +45,19 @@
|
||||
<attribute name="label" translatable="yes">_Red</attribute>
|
||||
<attribute name="action">app.color</attribute>
|
||||
<attribute name="target">red</attribute>
|
||||
<attribute name="accel"><Primary>r</attribute>
|
||||
<attribute name="accel"><Control>r</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Green</attribute>
|
||||
<attribute name="action">app.color</attribute>
|
||||
<attribute name="target">green</attribute>
|
||||
<attribute name="accel"><Primary>g</attribute>
|
||||
<attribute name="accel"><Control>g</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Blue</attribute>
|
||||
<attribute name="action">app.color</attribute>
|
||||
<attribute name="target">blue</attribute>
|
||||
<attribute name="accel"><Primary>b</attribute>
|
||||
<attribute name="accel"><Control>b</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
@@ -68,26 +68,26 @@
|
||||
<attribute name="label" translatable="yes">_Square</attribute>
|
||||
<attribute name="action">win.shape</attribute>
|
||||
<attribute name="target">square</attribute>
|
||||
<attribute name="accel"><Primary>s</attribute>
|
||||
<attribute name="accel"><Control>s</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Rectangle</attribute>
|
||||
<attribute name="action">win.shape</attribute>
|
||||
<attribute name="target">rectangle</attribute>
|
||||
<attribute name="accel"><Primary>r</attribute>
|
||||
<attribute name="accel"><Control>r</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Oval</attribute>
|
||||
<attribute name="action">win.shape</attribute>
|
||||
<attribute name="target">oval</attribute>
|
||||
<attribute name="accel"><Primary>o</attribute>
|
||||
<attribute name="accel"><Control>o</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Bold</attribute>
|
||||
<attribute name="action">win.bold</attribute>
|
||||
<attribute name="accel"><Primary><Shift>b</attribute>
|
||||
<attribute name="accel"><Control><Shift>b</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
@@ -96,7 +96,7 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_About</attribute>
|
||||
<attribute name="action">win.about</attribute>
|
||||
<attribute name="accel"><Primary>a</attribute>
|
||||
<attribute name="accel"><Control>a</attribute>
|
||||
</item>
|
||||
</submenu>
|
||||
</menu>
|
||||
|
@@ -28,7 +28,7 @@ demos = files([
|
||||
'fishbowl.c',
|
||||
'fixed.c',
|
||||
'fontrendering.c',
|
||||
'foreigndrawing.c',
|
||||
'gears.c',
|
||||
'gestures.c',
|
||||
'glarea.c',
|
||||
'headerbar.c',
|
||||
@@ -52,9 +52,9 @@ demos = files([
|
||||
'paintable_mediastream.c',
|
||||
'panes.c',
|
||||
'password_entry.c',
|
||||
'peg_solitaire.c',
|
||||
'pickers.c',
|
||||
'pixbufs.c',
|
||||
'popover.c',
|
||||
'printing.c',
|
||||
'revealer.c',
|
||||
'rotated_text.c',
|
||||
@@ -62,6 +62,7 @@ demos = files([
|
||||
'search_entry.c',
|
||||
'search_entry2.c',
|
||||
'shortcuts.c',
|
||||
'shortcut_triggers.c',
|
||||
'sidebar.c',
|
||||
'sizegroup.c',
|
||||
'sliding_puzzle.c',
|
||||
@@ -112,9 +113,16 @@ gtkdemo_resources = gnome.compile_resources('gtkdemo_resources',
|
||||
'demo.gresource.xml',
|
||||
source_dir: '.')
|
||||
|
||||
demo_cflags = []
|
||||
foreach flag: common_cflags
|
||||
if flag not in ['-Werror=missing-prototypes', '-Werror=missing-declarations', '-fvisibility=hidden']
|
||||
demo_cflags += flag
|
||||
endif
|
||||
endforeach
|
||||
|
||||
executable('gtk4-demo',
|
||||
demos, demos_h, extra_demo_sources, gtkdemo_resources,
|
||||
c_args: gtkdemo_args,
|
||||
c_args: gtkdemo_args + demo_cflags,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
gui_app: true,
|
||||
@@ -123,7 +131,7 @@ executable('gtk4-demo',
|
||||
|
||||
executable('gtk4-demo-application',
|
||||
'application.c', gtkdemo_resources,
|
||||
c_args: gtkdemo_args,
|
||||
c_args: gtkdemo_args + common_cflags,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
gui_app: true,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="resizable">0</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="show-title-buttons">1</property>
|
||||
@@ -10,32 +11,40 @@
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">80</property>
|
||||
<property name="margin-start">80</property>
|
||||
<property name="margin-end">80</property>
|
||||
<property name="margin-top">80</property>
|
||||
<property name="margin-bottom">80</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="popover">thing_a</property>
|
||||
<property name="label">Color</property>
|
||||
<property name="label">_Color</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="popover">thing_b</property>
|
||||
<property name="label">Flavors</property>
|
||||
<property name="label">_Flavors</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="popover">thing_c</property>
|
||||
<property name="label">Tools</property>
|
||||
<property name="label">_Tools</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="thing_a">
|
||||
<style>
|
||||
<class name="menu"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
@@ -62,11 +71,12 @@
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="thing_b">
|
||||
<style>
|
||||
<class name="menu"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">win.chocolate</property>
|
||||
@@ -92,11 +102,12 @@
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="thing_c">
|
||||
<style>
|
||||
<class name="menu"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Hammer</property>
|
||||
|
@@ -31,7 +31,7 @@ do_overlay (GtkWidget *do_widget)
|
||||
int i, j;
|
||||
char *text;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 500, 510);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Interactive Overlay");
|
||||
|
||||
@@ -56,23 +56,25 @@ do_overlay (GtkWidget *do_widget)
|
||||
}
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
|
||||
gtk_widget_set_can_target (vbox, FALSE);
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
|
||||
gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (vbox, GTK_ALIGN_START);
|
||||
|
||||
label = gtk_label_new ("<span foreground='blue' weight='ultrabold' font='40'>Numbers</span>");
|
||||
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
|
||||
gtk_widget_set_can_target (label, FALSE);
|
||||
gtk_widget_set_margin_top (label, 8);
|
||||
gtk_widget_set_margin_bottom (label, 50);
|
||||
gtk_widget_set_margin_bottom (label, 8);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
|
||||
gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);
|
||||
|
||||
gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "Your Lucky Number");
|
||||
gtk_widget_set_margin_top (entry, 50);
|
||||
gtk_widget_set_margin_top (entry, 8);
|
||||
gtk_widget_set_margin_bottom (entry, 8);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), entry);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ do_overlay2 (GtkWidget *do_widget)
|
||||
GtkTextIter start, end;
|
||||
GtkAdjustment *adjustment;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 500, 510);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Decorative Overlay");
|
||||
|
||||
|
@@ -47,6 +47,7 @@ static const gchar *pad_colors[] = {
|
||||
"orange"
|
||||
};
|
||||
|
||||
static GType drawing_area_get_type (void);
|
||||
G_DEFINE_TYPE (DrawingArea, drawing_area, GTK_TYPE_WIDGET)
|
||||
|
||||
static void drawing_area_set_color (DrawingArea *area,
|
||||
@@ -340,7 +341,7 @@ drawing_area_init (DrawingArea *area)
|
||||
area->draw_color = (GdkRGBA) { 0, 0, 0, 1 };
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
static GtkWidget *
|
||||
drawing_area_new (void)
|
||||
{
|
||||
return g_object_new (drawing_area_get_type (), NULL);
|
||||
@@ -384,7 +385,7 @@ do_paint (GtkWidget *toplevel)
|
||||
{
|
||||
GtkWidget *draw_area, *headerbar, *colorbutton;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
|
||||
draw_area = drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), draw_area);
|
||||
|
@@ -156,7 +156,7 @@ do_paintable (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear Icon");
|
||||
|
@@ -188,7 +188,7 @@ do_paintable_animated (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear Animation");
|
||||
|
@@ -288,7 +288,7 @@ do_paintable_mediastream (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear MediaStream");
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void
|
||||
static void
|
||||
toggle_resize (GtkWidget *widget,
|
||||
GtkWidget *child)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ toggle_resize (GtkWidget *widget,
|
||||
g_object_unref (child);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
toggle_shrink (GtkWidget *widget,
|
||||
GtkWidget *child)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ toggle_shrink (GtkWidget *widget,
|
||||
g_object_unref (child);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
static GtkWidget *
|
||||
create_pane_options (GtkPaned *paned,
|
||||
const gchar *frame_label,
|
||||
const gchar *label1,
|
||||
@@ -97,7 +97,10 @@ create_pane_options (GtkPaned *paned,
|
||||
child2 = gtk_paned_get_child2 (paned);
|
||||
|
||||
frame = gtk_frame_new (frame_label);
|
||||
g_object_set (frame, "margin", 4, NULL);
|
||||
gtk_widget_set_margin_start (frame, 4);
|
||||
gtk_widget_set_margin_end (frame, 4);
|
||||
gtk_widget_set_margin_top (frame, 4);
|
||||
gtk_widget_set_margin_bottom (frame, 4);
|
||||
|
||||
table = gtk_grid_new ();
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
@@ -146,7 +149,7 @@ do_panes (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
||||
@@ -159,7 +162,10 @@ do_panes (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
g_object_set (vpaned, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (vpaned, 5);
|
||||
gtk_widget_set_margin_end (vpaned, 5);
|
||||
gtk_widget_set_margin_top (vpaned, 5);
|
||||
gtk_widget_set_margin_bottom (vpaned, 5);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), vpaned);
|
||||
|
||||
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
|
@@ -36,7 +36,7 @@ do_password_entry (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
header = gtk_header_bar_new ();
|
||||
@@ -49,7 +49,10 @@ do_password_entry (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
|
||||
g_object_set (box, "margin", 18, NULL);
|
||||
gtk_widget_set_margin_start (box, 18);
|
||||
gtk_widget_set_margin_end (box, 18);
|
||||
gtk_widget_set_margin_top (box, 18);
|
||||
gtk_widget_set_margin_bottom (box, 18);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
entry = gtk_password_entry_new ();
|
||||
@@ -71,7 +74,7 @@ do_password_entry (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (box), entry2);
|
||||
|
||||
button = gtk_button_new_with_mnemonic ("_Done");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
|
||||
gtk_widget_add_css_class (button, "suggested-action");
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_widget_set_sensitive (button, FALSE);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
356
demos/gtk-demo/peg_solitaire.c
Normal file
356
demos/gtk-demo/peg_solitaire.c
Normal file
@@ -0,0 +1,356 @@
|
||||
/* Peg Solitaire
|
||||
*
|
||||
* This demo demonstrates how to use drag'n'drop to implement peg solitaire.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
/* Create an object for the pegs that get moved around in the game.
|
||||
*
|
||||
* We implement the GdkPaintable interface for them, so we can use GtkPicture
|
||||
* objects for the wholes we put the pegs into.
|
||||
*/
|
||||
#define SOLITAIRE_TYPE_PEG (solitaire_peg_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (SolitairePeg, solitaire_peg, SOLITAIRE, PEG, GObject)
|
||||
|
||||
/* Declare the struct. */
|
||||
struct _SolitairePeg
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct _SolitairePegClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
/* Here, we implement the functionality required by the GdkPaintable interface */
|
||||
static void
|
||||
solitaire_peg_snapshot (GdkPaintable *paintable,
|
||||
GdkSnapshot *snapshot,
|
||||
double width,
|
||||
double height)
|
||||
{
|
||||
/* The snapshot function is the only function we need to implement.
|
||||
* It does the actual drawing of the paintable.
|
||||
*/
|
||||
gtk_snapshot_append_color (snapshot,
|
||||
&(GdkRGBA) { 0.6, 0.3, 0.0, 1.0 },
|
||||
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
solitaire_peg_get_flags (GdkPaintable *paintable)
|
||||
{
|
||||
/* The flags are very useful to let GTK know that this image
|
||||
* is never going to change.
|
||||
* This allows many optimizations and should therefore always
|
||||
* be set.
|
||||
*/
|
||||
return GDK_PAINTABLE_STATIC_CONTENTS | GDK_PAINTABLE_STATIC_SIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
solitaire_peg_paintable_init (GdkPaintableInterface *iface)
|
||||
{
|
||||
iface->snapshot = solitaire_peg_snapshot;
|
||||
iface->get_flags = solitaire_peg_get_flags;
|
||||
}
|
||||
|
||||
/* When defining the GType, we need to implement the GdkPaintable interface */
|
||||
G_DEFINE_TYPE_WITH_CODE (SolitairePeg, solitaire_peg, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
solitaire_peg_paintable_init))
|
||||
|
||||
/* Here's the boilerplate for the GObject declaration.
|
||||
* We don't need to do anything special here, because we keep no
|
||||
* data of our own.
|
||||
*/
|
||||
static void
|
||||
solitaire_peg_class_init (SolitairePegClass *klass)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
solitaire_peg_init (SolitairePeg *peg)
|
||||
{
|
||||
}
|
||||
|
||||
/* Add a little setter for the peg's position.
|
||||
* We want to track those so that we can check for legal moves
|
||||
* during drag'n'drop operations.
|
||||
*/
|
||||
static void
|
||||
solitaire_peg_set_position (SolitairePeg *peg,
|
||||
guint x,
|
||||
guint y)
|
||||
{
|
||||
peg->x = x;
|
||||
peg->y = y;
|
||||
}
|
||||
|
||||
/* And finally, we add a simple constructor.
|
||||
*/
|
||||
static SolitairePeg *
|
||||
solitaire_peg_new (void)
|
||||
{
|
||||
return g_object_new (SOLITAIRE_TYPE_PEG, NULL);
|
||||
}
|
||||
|
||||
/*** DRAG AND DROP ***/
|
||||
|
||||
/* The user tries to start a drag operation.
|
||||
* We check if the image contains a peg, and if so, we return the
|
||||
* peg as the content to be dragged.
|
||||
*/
|
||||
static GdkContentProvider *
|
||||
drag_prepare (GtkDragSource *source,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GdkPaintable *paintable = gtk_image_get_paintable (GTK_IMAGE (image));
|
||||
|
||||
if (!SOLITAIRE_IS_PEG (paintable))
|
||||
return NULL;
|
||||
|
||||
return gdk_content_provider_new_typed (SOLITAIRE_TYPE_PEG, paintable);
|
||||
}
|
||||
|
||||
/* This notifies us that the drag has begun.
|
||||
* We can now set up the icon and the widget for the ongoing drag.
|
||||
*/
|
||||
static void
|
||||
drag_begin (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GdkPaintable *paintable = gtk_image_get_paintable (GTK_IMAGE (image));
|
||||
|
||||
/* We guaranteed in the drag_prepare function above that we
|
||||
* only start a drag if a peg is available.
|
||||
* So let's make sure we did not screw that up.
|
||||
*/
|
||||
g_assert (SOLITAIRE_IS_PEG (paintable));
|
||||
|
||||
/* We use the peg as the drag icon.
|
||||
*/
|
||||
gtk_drag_source_set_icon (source, paintable, -2, -2);
|
||||
|
||||
/* We also attach it to the drag operation as custom user data,
|
||||
* so that we can get it back later if the drag fails.
|
||||
*/
|
||||
g_object_set_data (G_OBJECT (drag), "the peg", paintable);
|
||||
|
||||
/* Because we are busy dragging the peg, we want to unset it
|
||||
* on the image.
|
||||
*/
|
||||
gtk_image_clear (GTK_IMAGE (image));
|
||||
}
|
||||
|
||||
/* Thie is called once a drag operation has ended (successfully or not).
|
||||
* We want to undo what we did in drag_begin() above and react
|
||||
* to a potential move of the peg.
|
||||
*/
|
||||
static void
|
||||
drag_end (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
gboolean delete_data,
|
||||
GtkWidget *image)
|
||||
{
|
||||
SolitairePeg *peg;
|
||||
|
||||
/* If the drag was successful, we should now delete the peg.
|
||||
* We did this in drag_begin() above to prepare for the drag, so
|
||||
* there's no need to do anything anymore.
|
||||
*/
|
||||
if (delete_data)
|
||||
return;
|
||||
|
||||
/* However, if the drag did not succeed, we need to undo what
|
||||
* we did in drag_begin() and reinsert the peg here.
|
||||
* Because we used it as the drag data
|
||||
*/
|
||||
peg = g_object_get_data (G_OBJECT (drag), "the peg");
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (peg));
|
||||
}
|
||||
|
||||
/* Whenever a new drop operation starts, we need to check if we can
|
||||
* accept it.
|
||||
* The default check unfortunately is not good enough, because it only
|
||||
* checks the data type. But we also need to check if our image can
|
||||
* even accept data.
|
||||
*/
|
||||
static gboolean
|
||||
drop_accept (GtkDropTarget *target,
|
||||
GdkDrop *drop,
|
||||
GtkWidget *image)
|
||||
{
|
||||
/* First, check the drop is actually trying to drop a peg */
|
||||
if (!gdk_content_formats_contain_gtype (gdk_drop_get_formats (drop), SOLITAIRE_TYPE_PEG))
|
||||
return FALSE;
|
||||
|
||||
/* If the image already contains a peg, we cannot accept another one */
|
||||
if (SOLITAIRE_IS_PEG (gtk_image_get_paintable (GTK_IMAGE (image))))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drop_drop (GtkDropTarget *target,
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GtkGrid *grid;
|
||||
SolitairePeg *peg;
|
||||
int image_x, image_y;
|
||||
GtkWidget *jumped;
|
||||
|
||||
grid = GTK_GRID (gtk_widget_get_parent (image));
|
||||
/* The value contains the data in the type we demanded.
|
||||
* We demanded a SolitairePeg, so that's what we get.
|
||||
*/
|
||||
peg = g_value_get_object (value);
|
||||
|
||||
/* Make sure this was a legal move. */
|
||||
/* First, figure out the image's position in the grid. */
|
||||
gtk_grid_query_child (grid,
|
||||
image,
|
||||
&image_x, &image_y,
|
||||
NULL, NULL);
|
||||
|
||||
/* If the peg was not moved 2 spaces horizontally or vertically,
|
||||
* this was not a valid jump. Reject it.
|
||||
*/
|
||||
if (!((ABS (image_x - peg->x) == 2 && image_y == peg->y) ||
|
||||
(ABS (image_y - peg->y) == 2 && image_x == peg->x)))
|
||||
return FALSE;
|
||||
|
||||
/* Get the widget that was jumped over
|
||||
*/
|
||||
jumped = gtk_grid_get_child_at (grid,
|
||||
(image_x + peg->x) / 2,
|
||||
(image_y + peg->y) / 2);
|
||||
/* If the jumped widget does not have a peg in it, this move
|
||||
* isn't valid.
|
||||
*/
|
||||
if (!SOLITAIRE_IS_PEG (gtk_image_get_paintable (GTK_IMAGE (jumped))))
|
||||
return FALSE;
|
||||
|
||||
/* Finally, we know it's a legal move. */
|
||||
|
||||
/* Clear the peg of the jumped-over image */
|
||||
gtk_image_clear (GTK_IMAGE (jumped));
|
||||
|
||||
/* Add the peg to this image */
|
||||
solitaire_peg_set_position (peg, image_x, image_y);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (peg));
|
||||
|
||||
/* Success! */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_peg_solitaire (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *header;
|
||||
GtkWidget *restart;
|
||||
GtkWidget *grid;
|
||||
GtkWidget *image;
|
||||
int x, y;
|
||||
GtkDragSource *source;
|
||||
GtkDropTarget *target;
|
||||
|
||||
restart = gtk_button_new_from_icon_name ("view-refresh-symbolic");
|
||||
g_signal_connect (restart, "clicked", G_CALLBACK (restart), NULL);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (header), "Peg Solitaire");
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), restart);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Sliding Puzzle");
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
grid = gtk_grid_new ();
|
||||
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (grid, GTK_ALIGN_CENTER);
|
||||
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
|
||||
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
|
||||
gtk_grid_set_row_homogeneous (GTK_GRID (grid), TRUE);
|
||||
gtk_grid_set_column_homogeneous (GTK_GRID (grid), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (window), grid);
|
||||
|
||||
for (x = 0; x < 7; x++)
|
||||
{
|
||||
for (y = 0; y < 7; y++)
|
||||
{
|
||||
if ((x < 2 || x >= 5) && (y < 2 || y >= 5))
|
||||
continue;
|
||||
|
||||
image = gtk_image_new ();
|
||||
if (x != 3 || y != 3)
|
||||
{
|
||||
SolitairePeg *peg = solitaire_peg_new ();
|
||||
solitaire_peg_set_position (peg, x, y);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (peg));
|
||||
}
|
||||
|
||||
gtk_grid_attach (GTK_GRID (grid), image, x, y, 1, 1);
|
||||
|
||||
/* Set up the drag source.
|
||||
* This is rather straightforward: Set the supported actions
|
||||
* (in our case, pegs can only be moved) and connect all the
|
||||
* relevant signals.
|
||||
* And because all drag'n'drop handling is done via event controllers,
|
||||
* we need to add the controller to the widget.
|
||||
*/
|
||||
source = gtk_drag_source_new ();
|
||||
gtk_drag_source_set_actions (source, GDK_ACTION_MOVE);
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (drag_prepare), image);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
g_signal_connect (source, "drag-end", G_CALLBACK (drag_end), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* Set up the drop target.
|
||||
* This is more involved, because the game logic goes here.
|
||||
*/
|
||||
|
||||
/* First we specify the data we accept: pegs.
|
||||
* And we only want moves.
|
||||
*/
|
||||
target = gtk_drop_target_new (SOLITAIRE_TYPE_PEG, GDK_ACTION_MOVE);
|
||||
/* Then we connect our signals.
|
||||
*/
|
||||
g_signal_connect (target, "accept", G_CALLBACK (drop_accept), image);
|
||||
g_signal_connect (target, "drop", G_CALLBACK (drop_drop), image);
|
||||
/* Finally, like above, we add it to the widget.
|
||||
*/
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (target));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -14,7 +14,7 @@ do_pickers (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
|
||||
@@ -23,7 +23,10 @@ do_pickers (GtkWidget *do_widget)
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
table = gtk_grid_new ();
|
||||
g_object_set (table, "margin", 20, NULL);
|
||||
gtk_widget_set_margin_start (table, 20);
|
||||
gtk_widget_set_margin_end (table, 20);
|
||||
gtk_widget_set_margin_top (table, 20);
|
||||
gtk_widget_set_margin_bottom (table, 20);
|
||||
gtk_grid_set_row_spacing (GTK_GRID (table), 3);
|
||||
gtk_grid_set_column_spacing (GTK_GRID (table), 10);
|
||||
gtk_container_add (GTK_CONTAINER (window), table);
|
||||
@@ -50,7 +53,6 @@ do_pickers (GtkWidget *do_widget)
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
picker = gtk_file_chooser_button_new ("Pick a File",
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN);
|
||||
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (picker), FALSE);
|
||||
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
|
||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1);
|
||||
|
||||
|
@@ -174,7 +174,7 @@ do_pixbufs (GtkWidget *do_widget)
|
||||
{
|
||||
GError *error;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
|
||||
|
@@ -1,176 +0,0 @@
|
||||
/* Popovers
|
||||
*
|
||||
* A bubble-like window containing contextual information or options.
|
||||
* GtkPopovers can be attached to any widget, and will be displayed
|
||||
* within the same window, but on top of all its content.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
toggle_changed_cb (GtkToggleButton *button,
|
||||
GtkWidget *popover)
|
||||
{
|
||||
gtk_widget_set_visible (popover,
|
||||
gtk_toggle_button_get_active (button));
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_popover (GtkWidget *parent,
|
||||
GtkWidget *child,
|
||||
GtkPositionType pos)
|
||||
{
|
||||
GtkWidget *popover;
|
||||
|
||||
popover = gtk_popover_new (parent);
|
||||
gtk_popover_set_position (GTK_POPOVER (popover), pos);
|
||||
gtk_container_add (GTK_CONTAINER (popover), child);
|
||||
g_object_set (child, "margin", 6, NULL);
|
||||
gtk_widget_show (child);
|
||||
|
||||
return popover;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_complex_popover (GtkWidget *parent,
|
||||
GtkPositionType pos)
|
||||
{
|
||||
GtkWidget *popover, *window, *content;
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_resource (builder, "/popover/popover.ui", NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
content = gtk_bin_get_child (GTK_BIN (window));
|
||||
g_object_ref (content);
|
||||
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (content)),
|
||||
content);
|
||||
gtk_widget_destroy (window);
|
||||
g_object_unref (builder);
|
||||
|
||||
popover = create_popover (parent, content, GTK_POS_BOTTOM);
|
||||
g_object_unref (content);
|
||||
|
||||
return popover;
|
||||
}
|
||||
|
||||
static void
|
||||
entry_size_allocate_cb (GtkEntry *entry,
|
||||
int width,
|
||||
int height,
|
||||
int baseline,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkEntryIconPosition popover_pos;
|
||||
GtkPopover *popover = user_data;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
if (gtk_widget_is_visible (GTK_WIDGET (popover)))
|
||||
{
|
||||
popover_pos =
|
||||
GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry),
|
||||
"popover-icon-pos"));
|
||||
gtk_entry_get_icon_area (entry, popover_pos, &rect);
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
entry_icon_press_cb (GtkEntry *entry,
|
||||
GtkEntryIconPosition icon_pos,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *popover = user_data;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
gtk_entry_get_icon_area (entry, icon_pos, &rect);
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect);
|
||||
gtk_widget_show (popover);
|
||||
|
||||
g_object_set_data (G_OBJECT (entry), "popover-icon-pos",
|
||||
GUINT_TO_POINTER (icon_pos));
|
||||
}
|
||||
|
||||
static void
|
||||
day_selected_cb (GtkCalendar *calendar,
|
||||
gpointer user_data)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
GtkWidget *popover;
|
||||
GdkEvent *event;
|
||||
gdouble x, y;
|
||||
|
||||
event = gtk_get_current_event ();
|
||||
|
||||
if (gdk_event_get_event_type (event) != GDK_BUTTON_PRESS)
|
||||
return;
|
||||
|
||||
gdk_event_get_coords (event, &x, &y);
|
||||
gtk_widget_translate_coordinates (gtk_get_event_widget (event),
|
||||
GTK_WIDGET (calendar),
|
||||
x, y,
|
||||
&rect.x, &rect.y);
|
||||
rect.width = rect.height = 1;
|
||||
|
||||
popover = create_popover (GTK_WIDGET (calendar),
|
||||
gtk_entry_new (),
|
||||
GTK_POS_BOTTOM);
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect);
|
||||
|
||||
gtk_widget_show (popover);
|
||||
|
||||
g_object_unref (event);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_popover (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *popover, *box, *widget;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Popovers");
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
|
||||
g_object_set (box, "margin", 24, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
widget = gtk_toggle_button_new_with_label ("Button");
|
||||
popover = create_popover (widget,
|
||||
gtk_label_new ("This popover does not grab input"),
|
||||
GTK_POS_TOP);
|
||||
gtk_popover_set_autohide (GTK_POPOVER (popover), FALSE);
|
||||
g_signal_connect (widget, "toggled",
|
||||
G_CALLBACK (toggle_changed_cb), popover);
|
||||
gtk_container_add (GTK_CONTAINER (box), widget);
|
||||
|
||||
widget = gtk_entry_new ();
|
||||
popover = create_complex_popover (widget, GTK_POS_TOP);
|
||||
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget),
|
||||
GTK_ENTRY_ICON_PRIMARY, "edit-find");
|
||||
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget),
|
||||
GTK_ENTRY_ICON_SECONDARY, "edit-clear");
|
||||
|
||||
g_signal_connect (widget, "icon-press",
|
||||
G_CALLBACK (entry_icon_press_cb), popover);
|
||||
g_signal_connect (widget, "size-allocate",
|
||||
G_CALLBACK (entry_size_allocate_cb), popover);
|
||||
gtk_container_add (GTK_CONTAINER (box), widget);
|
||||
|
||||
widget = gtk_calendar_new ();
|
||||
g_signal_connect (widget, "day-selected",
|
||||
G_CALLBACK (day_selected_cb), NULL);
|
||||
gtk_container_add (GTK_CONTAINER (box), widget);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkListStore" id="liststore1">
|
||||
<columns>
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<data>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 1</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 2</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 3</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 4</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 5</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 6</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 7</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 8</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 9</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Item 10</col>
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window">
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="primary-icon-name">edit-find</property>
|
||||
<property name="secondary-icon-name">edit-clear</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="max-content-height">100</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="model">liststore1</property>
|
||||
<property name="headers-visible">0</property>
|
||||
<property name="enable-search">0</property>
|
||||
<property name="search-column">2</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="column1">
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="cellrenderer1"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -28,26 +28,23 @@ fancy_shape_renderer (cairo_t *cr,
|
||||
(double) attr->ink_rect.width / PANGO_SCALE,
|
||||
(double) attr->ink_rect.height / PANGO_SCALE);
|
||||
|
||||
switch (GPOINTER_TO_UINT (attr->data))
|
||||
if (GPOINTER_TO_UINT (attr->data) == 0x2665) /* U+2665 BLACK HEART SUIT */
|
||||
{
|
||||
case 0x2665: /* U+2665 BLACK HEART SUIT */
|
||||
{
|
||||
cairo_move_to (cr, .5, .0);
|
||||
cairo_line_to (cr, .9, -.4);
|
||||
cairo_curve_to (cr, 1.1, -.8, .5, -.9, .5, -.5);
|
||||
cairo_curve_to (cr, .5, -.9, -.1, -.8, .1, -.4);
|
||||
cairo_close_path (cr);
|
||||
}
|
||||
break;
|
||||
cairo_move_to (cr, .5, .0);
|
||||
cairo_line_to (cr, .9, -.4);
|
||||
cairo_curve_to (cr, 1.1, -.8, .5, -.9, .5, -.5);
|
||||
cairo_curve_to (cr, .5, -.9, -.1, -.8, .1, -.4);
|
||||
cairo_close_path (cr);
|
||||
}
|
||||
|
||||
if (!do_path) {
|
||||
cairo_set_source_rgb (cr, 1., 0., 0.);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
if (!do_path)
|
||||
{
|
||||
cairo_set_source_rgb (cr, 1., 0., 0.);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
}
|
||||
|
||||
PangoAttrList *
|
||||
static PangoAttrList *
|
||||
create_fancy_attr_list_for_layout (PangoLayout *layout)
|
||||
{
|
||||
PangoAttrList *attrs;
|
||||
@@ -145,13 +142,13 @@ rotated_text_draw (GtkDrawingArea *da,
|
||||
/* Draw the layout N_WORDS times in a circle */
|
||||
for (i = 0; i < N_WORDS; i++)
|
||||
{
|
||||
int width, height;
|
||||
int layout_width, layout_height;
|
||||
|
||||
/* Inform Pango to re-layout the text with the new transformation matrix */
|
||||
pango_cairo_update_layout (cr, layout);
|
||||
|
||||
pango_layout_get_pixel_size (layout, &width, &height);
|
||||
cairo_move_to (cr, - width / 2, - RADIUS * .9);
|
||||
pango_layout_get_pixel_size (layout, &layout_width, &layout_height);
|
||||
cairo_move_to (cr, - layout_width / 2, - RADIUS * .9);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
|
||||
/* Rotate for the next turn */
|
||||
@@ -178,7 +175,7 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
PangoLayout *layout;
|
||||
PangoAttrList *attrs;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
|
||||
@@ -193,8 +190,7 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
/* Add a drawing area */
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (box), drawing_area);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area),
|
||||
GTK_STYLE_CLASS_VIEW);
|
||||
gtk_widget_add_css_class (drawing_area, GTK_STYLE_CLASS_VIEW);
|
||||
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area),
|
||||
rotated_text_draw,
|
||||
|
@@ -24,7 +24,10 @@
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="margin">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_plain">
|
||||
<property name="label">Plain</property>
|
||||
@@ -40,7 +43,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="scale_plain">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-request">200</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
@@ -69,7 +71,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="scale_marks">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-request">200</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
@@ -105,7 +106,6 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="scale_discrete">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-request">200</property>
|
||||
<property name="round-digits">0</property>
|
||||
<property name="draw-value">0</property>
|
||||
|
@@ -185,13 +185,13 @@ text_changed (GObject *object,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntry *entry = GTK_ENTRY (object);
|
||||
GActionMap *actions = data;
|
||||
GActionMap *action_map = data;
|
||||
GAction *action;
|
||||
gboolean has_text;
|
||||
|
||||
has_text = gtk_entry_get_text_length (entry) > 0;
|
||||
|
||||
action = g_action_map_lookup_action (actions, "clear");
|
||||
action = g_action_map_lookup_action (action_map, "clear");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), has_text);
|
||||
}
|
||||
|
||||
@@ -216,11 +216,18 @@ entry_add_to_context_menu (GtkEntry *entry)
|
||||
};
|
||||
GMenuModel *submenu;
|
||||
GMenuItem *item;
|
||||
GAction *action;
|
||||
GVariant *value;
|
||||
|
||||
actions = g_simple_action_group_new ();
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS(entries), entry);
|
||||
gtk_widget_insert_action_group (GTK_WIDGET (entry), "search", G_ACTION_GROUP (actions));
|
||||
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (actions), "search-by");
|
||||
value = g_variant_ref_sink (g_variant_new_string ("name"));
|
||||
set_search_by (G_SIMPLE_ACTION (action), value, entry);
|
||||
g_variant_unref (value);
|
||||
|
||||
menu = g_menu_new ();
|
||||
item = g_menu_item_new (_("C_lear"), "search.clear");
|
||||
g_menu_item_set_attribute (item, "touch-icon", "s", "edit-clear-symbolic");
|
||||
@@ -250,7 +257,7 @@ do_search_entry (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Search Entry");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
@@ -258,7 +265,10 @@ do_search_entry (GtkWidget *do_widget)
|
||||
G_CALLBACK (search_entry_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
g_object_set (vbox, "margin", 5, NULL);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
gtk_widget_set_margin_end (vbox, 5);
|
||||
gtk_widget_set_margin_top (vbox, 5);
|
||||
gtk_widget_set_margin_bottom (vbox, 5);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
@@ -294,10 +304,6 @@ do_search_entry (GtkWidget *do_widget)
|
||||
gtk_widget_show (cancel_button);
|
||||
|
||||
/* Set up the search icon */
|
||||
GVariant *value = g_variant_ref_sink (g_variant_new_string ("name"));
|
||||
set_search_by (NULL, value, entry);
|
||||
g_variant_unref (value);
|
||||
|
||||
gtk_entry_set_icon_activatable (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE);
|
||||
gtk_entry_set_icon_sensitive (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, TRUE);
|
||||
|
||||
|
@@ -68,7 +68,7 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Delayed Search Entry");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
|
94
demos/gtk-demo/shortcut_triggers.c
Normal file
94
demos/gtk-demo/shortcut_triggers.c
Normal file
@@ -0,0 +1,94 @@
|
||||
/* Shortcuts
|
||||
*
|
||||
* GtkShortcut is the abstraction used by GTK to handle shortcuts from
|
||||
* keyboard or other input devices.
|
||||
*
|
||||
* Shortcut triggers can be used to weave complex sequences of key
|
||||
* presses into sophisticated mechanisms to activate shortcuts.
|
||||
*
|
||||
* This demo code shows creative ways to do that.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
static gboolean
|
||||
shortcut_activated (GtkWidget *widget,
|
||||
GVariant *unused,
|
||||
gpointer row)
|
||||
{
|
||||
g_print ("activated %s\n", gtk_label_get_label (row));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GtkShortcutTrigger *
|
||||
create_ctrl_g (void)
|
||||
{
|
||||
return gtk_keyval_trigger_new (GDK_KEY_g, GDK_CONTROL_MASK);
|
||||
}
|
||||
|
||||
static GtkShortcutTrigger *
|
||||
create_x (void)
|
||||
{
|
||||
return gtk_keyval_trigger_new (GDK_KEY_x, 0);
|
||||
}
|
||||
|
||||
struct {
|
||||
const char *description;
|
||||
GtkShortcutTrigger * (* create_trigger_func) (void);
|
||||
} shortcuts[] = {
|
||||
{ "Press Ctrl-G", create_ctrl_g },
|
||||
{ "Press X", create_x },
|
||||
};
|
||||
|
||||
GtkWidget *
|
||||
do_shortcut_triggers (GtkWidget *do_widget)
|
||||
{
|
||||
guint i;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *list;
|
||||
GtkEventController *controller;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Shortcuts");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
list = gtk_list_box_new ();
|
||||
gtk_widget_set_margin_top (list, 6);
|
||||
gtk_widget_set_margin_bottom (list, 6);
|
||||
gtk_widget_set_margin_start (list, 6);
|
||||
gtk_widget_set_margin_end (list, 6);
|
||||
gtk_container_add (GTK_CONTAINER (window), list);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (shortcuts); i++)
|
||||
{
|
||||
GtkShortcut *shortcut;
|
||||
GtkWidget *row;
|
||||
|
||||
row = gtk_label_new (shortcuts[i].description);
|
||||
gtk_container_add (GTK_CONTAINER (list), row);
|
||||
|
||||
controller = gtk_shortcut_controller_new ();
|
||||
gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER (controller), GTK_SHORTCUT_SCOPE_GLOBAL);
|
||||
gtk_widget_add_controller (row, controller);
|
||||
|
||||
shortcut = gtk_shortcut_new (shortcuts[i].create_trigger_func(),
|
||||
gtk_callback_action_new (shortcut_activated, row, NULL));
|
||||
gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut);
|
||||
}
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -76,7 +76,7 @@ do_shortcuts (GtkWidget *do_widget)
|
||||
if (!icons_added)
|
||||
{
|
||||
icons_added = TRUE;
|
||||
gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (), "/icons");
|
||||
gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gtk_widget_get_display (do_widget)), "/icons");
|
||||
}
|
||||
|
||||
g_type_ensure (G_TYPE_FILE_ICON);
|
||||
|
@@ -5,7 +5,10 @@
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin">50</property>
|
||||
<property name="margin-start">50</property>
|
||||
<property name="margin-end">50</property>
|
||||
<property name="margin-top">50</property>
|
||||
<property name="margin-end">50</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user