Compare commits
700 Commits
issue-377
...
matthiasc/
Author | SHA1 | Date | |
---|---|---|---|
|
d14bace6d0 | ||
|
77f71448d5 | ||
|
1e69a4cf37 | ||
|
ac5e686cfa | ||
|
fdfb3e9177 | ||
|
97d5486d53 | ||
|
4b314f2f2a | ||
|
435045fb58 | ||
|
fb90c45883 | ||
|
34af26a80b | ||
|
10ca79050f | ||
|
e90d3173b9 | ||
|
bfc0e213a0 | ||
|
d4898fc37f | ||
|
4bdee4d3ae | ||
|
c4b77a5945 | ||
|
371625e7f2 | ||
|
ce755144f5 | ||
|
e8eb1df29f | ||
|
82dc7b903c | ||
|
b020a3fcf9 | ||
|
cb88de5938 | ||
|
94b1e72aa3 | ||
|
20b92638ec | ||
|
dccb83c9ec | ||
|
d668d2fa25 | ||
|
34f1ae8fad | ||
|
042537cf0d | ||
|
d03f38470e | ||
|
a7d72cf69b | ||
|
256139baab | ||
|
a935aae6f1 | ||
|
9955d686ee | ||
|
a9da41c66a | ||
|
4d8691b762 | ||
|
806e159b8b | ||
|
794ee0b8c0 | ||
|
2b7de841a9 | ||
|
45309811c5 | ||
|
2b695ac8d1 | ||
|
cb03969c5f | ||
|
57e71a6a69 | ||
|
15b5a404b8 | ||
|
4056a40d2d | ||
|
c1e9523f0e | ||
|
4c1ccfd7be | ||
|
823e00dec9 | ||
|
3e51966ea9 | ||
|
e292767a01 | ||
|
75c433fb5f | ||
|
83867f9cbf | ||
|
ea9f0df67b | ||
|
15c7980ba6 | ||
|
de5fde1e12 | ||
|
a83b360224 | ||
|
4d55d23c1a | ||
|
2b6162116d | ||
|
b2ca947934 | ||
|
3eaf88b84c | ||
|
9e9eae3ad4 | ||
|
903afcbddd | ||
|
d37612a476 | ||
|
f5daecf353 | ||
|
b76940bab5 | ||
|
ec255f9bb1 | ||
|
9dc6be4fb0 | ||
|
186b783f9d | ||
|
2f3518c80d | ||
|
4a7f68e79e | ||
|
65af983ddb | ||
|
f0dc5e0be5 | ||
|
f0cbd175cd | ||
|
99aa47185e | ||
|
898e29c989 | ||
|
cf1700fd13 | ||
|
112aed590f | ||
|
6763443c5d | ||
|
7d99339c39 | ||
|
f33fe6daed | ||
|
c7dc17d837 | ||
|
a51ee20ed9 | ||
|
8d3e1eb314 | ||
|
c941a2d9c6 | ||
|
1c03bbeb9c | ||
|
a4059cd02d | ||
|
eab6df31ac | ||
|
8a085fcc5a | ||
|
7668669d56 | ||
|
5e57b3d07a | ||
|
187a701a99 | ||
|
d5f4579384 | ||
|
0297039b38 | ||
|
5206a92522 | ||
|
233ec1a5d6 | ||
|
579d8e427b | ||
|
9c11c60530 | ||
|
66c8da4750 | ||
|
05a9b72fc8 | ||
|
4fe5710456 | ||
|
ac5b4a6307 | ||
|
5ce7bfbbd8 | ||
|
7646d1b22c | ||
|
61db81ab8e | ||
|
24d7586163 | ||
|
b150625105 | ||
|
5787146238 | ||
|
8a72031e99 | ||
|
201a791076 | ||
|
359003670a | ||
|
6b7c5174ed | ||
|
8a521accbc | ||
|
d116bbf0c8 | ||
|
42e440a111 | ||
|
13adb2591c | ||
|
7b73824dfe | ||
|
403aba82a9 | ||
|
a053d7ddb1 | ||
|
c878f650ce | ||
|
2d2cdeae88 | ||
|
009228471c | ||
|
379166e1ff | ||
|
a59a20c1d4 | ||
|
fb4b5c666b | ||
|
b59c70aaeb | ||
|
6fcae42dde | ||
|
2ee087f25f | ||
|
9cc29efa25 | ||
|
a04d314910 | ||
|
f83f7a2b4d | ||
|
edb175cf75 | ||
|
1eefaf8b41 | ||
|
0224517806 | ||
|
27c521cce8 | ||
|
62b87182c5 | ||
|
c95659bf32 | ||
|
865fc9c925 | ||
|
a1f4f52fcb | ||
|
bdb4bf00c5 | ||
|
aca252837d | ||
|
8b058572f0 | ||
|
df050c51bb | ||
|
bd20ae4fa5 | ||
|
818b456f9f | ||
|
c1c8abf275 | ||
|
c1029535ca | ||
|
a5ca5eb865 | ||
|
2227d2a2b5 | ||
|
61559e38f4 | ||
|
134fca47e3 | ||
|
4630dd8d68 | ||
|
d2f7d1b1d7 | ||
|
cfa9e6da4a | ||
|
ceca2f9202 | ||
|
bf98ebcb12 | ||
|
1a5dece09c | ||
|
8e8254feae | ||
|
90cda9e307 | ||
|
fdfa371d90 | ||
|
deb16c1a00 | ||
|
8c3736709e | ||
|
f459164f8a | ||
|
00169a06bf | ||
|
e09f2b8b56 | ||
|
092c115ff0 | ||
|
5144d15168 | ||
|
5a6ab8cbd3 | ||
|
8c73f882af | ||
|
78832c65b5 | ||
|
e8b830a3dd | ||
|
38974d7d2b | ||
|
f6f331efe3 | ||
|
dbb3727b03 | ||
|
508570864d | ||
|
96c77b61c1 | ||
|
2b819c830b | ||
|
f3be49838f | ||
|
e9067ae2db | ||
|
f898bee032 | ||
|
6a7f39e6d2 | ||
|
dfb2cbdfdb | ||
|
f960eb6ab4 | ||
|
60fc2c6a7a | ||
|
3080592234 | ||
|
532fdde720 | ||
|
f8399588e9 | ||
|
ad019be75b | ||
|
e505dab487 | ||
|
1262184269 | ||
|
46f42fc53d | ||
|
cb26cd7391 | ||
|
1a3eeb1233 | ||
|
e1f74c8f69 | ||
|
58106af54d | ||
|
1e000c3dac | ||
|
19ee9b4c57 | ||
|
1075607528 | ||
|
d2bd9b0850 | ||
|
74d445636c | ||
|
7048790931 | ||
|
b9034015d7 | ||
|
c7b70b122a | ||
|
6e01a49d10 | ||
|
c290bd6367 | ||
|
853063bea7 | ||
|
69e3fee5e2 | ||
|
aa276a181e | ||
|
583705b4ae | ||
|
cd7303d47c | ||
|
0f9cbf49ac | ||
|
a309e74be7 | ||
|
ccaf70e1b7 | ||
|
2fd9431f23 | ||
|
3f33a0ed27 | ||
|
4ea18a22e6 | ||
|
746dc5c3a2 | ||
|
17131f1137 | ||
|
07c889c5ea | ||
|
b0d9a6ff20 | ||
|
802c7975e2 | ||
|
6e602e052b | ||
|
025eee112c | ||
|
70cdd4e951 | ||
|
75b789f20f | ||
|
ac09500d74 | ||
|
a76b187a5b | ||
|
45679d7bc3 | ||
|
6dc8fc3a4d | ||
|
e53e0f461e | ||
|
37b849b808 | ||
|
e03bdbe307 | ||
|
9b01d9a784 | ||
|
b4c689ecd6 | ||
|
78a0913f0f | ||
|
74722fb10e | ||
|
3891ce36fe | ||
|
5a940408fe | ||
|
efce8c2899 | ||
|
ea9f2abcc4 | ||
|
993d6388ee | ||
|
5ad4b75ae2 | ||
|
24ef9df0f1 | ||
|
5d49b11ffd | ||
|
8e3db48482 | ||
|
fdcfe0e80a | ||
|
8137dea8c1 | ||
|
b15c31a3f7 | ||
|
a52757874e | ||
|
e9203eeef7 | ||
|
337057eb35 | ||
|
2803a15a51 | ||
|
d145032cb6 | ||
|
2612331282 | ||
|
d3fd071809 | ||
|
303c9becf8 | ||
|
6bf46c8f30 | ||
|
1e2c03beee | ||
|
b24e10fa30 | ||
|
173952cbc8 | ||
|
b31f4f2bae | ||
|
df9d9c1f8a | ||
|
7dcb25bd46 | ||
|
d131c8d0e7 | ||
|
0582a4ef1b | ||
|
a9b1d4a389 | ||
|
ea810f176b | ||
|
262ac4247a | ||
|
8e4f0b9484 | ||
|
7669e6e42e | ||
|
a3f14a3395 | ||
|
73b8212bf3 | ||
|
6ba6f361be | ||
|
726909d735 | ||
|
04899e3707 | ||
|
7a27122dab | ||
|
73ce437459 | ||
|
ca4ae81170 | ||
|
21a7dfae96 | ||
|
6c188f7c93 | ||
|
c30e0f78ad | ||
|
76795ffba9 | ||
|
c38c5c4ce1 | ||
|
108aac9ee3 | ||
|
c427c2b22a | ||
|
59111d100f | ||
|
cee8f78c6e | ||
|
0fc35b2124 | ||
|
eebe67cf0a | ||
|
b9726901a5 | ||
|
df1d2b8417 | ||
|
8b1af398a0 | ||
|
982d73df0b | ||
|
1e55e01692 | ||
|
412fcb0330 | ||
|
b8d1c3ab55 | ||
|
4fb519f04d | ||
|
054d69aaf9 | ||
|
1dea6d4fc7 | ||
|
022d19a4c6 | ||
|
ef7276c398 | ||
|
0a8ca49b5e | ||
|
74f18f71d3 | ||
|
c0d4a6fc81 | ||
|
1dd31d58fb | ||
|
766d4dff76 | ||
|
e62f135c6a | ||
|
4788f88840 | ||
|
587bc82c37 | ||
|
750dc8dbe2 | ||
|
d490d8f1f3 | ||
|
cb2f523994 | ||
|
075a0ccb5e | ||
|
db91b6dc61 | ||
|
44ac2d5abb | ||
|
d7df56b6cb | ||
|
6a9bc5daef | ||
|
b8aa51d522 | ||
|
f79c807645 | ||
|
d0d2ad9f5b | ||
|
0b8298038a | ||
|
6ef0bb8bea | ||
|
91472b2ecd | ||
|
80ddcf38d4 | ||
|
1477882b31 | ||
|
73f2167fe4 | ||
|
2079c898e7 | ||
|
c79c18f39c | ||
|
cef7f7f87d | ||
|
fdce30d3f8 | ||
|
f07397f4dd | ||
|
f1751f514c | ||
|
2cbfb0e980 | ||
|
8dd7f5aefe | ||
|
398f49ad31 | ||
|
3d260a950e | ||
|
f31667f437 | ||
|
219493c818 | ||
|
06f63764fb | ||
|
1243174e53 | ||
|
cc909b160f | ||
|
d12dde07c3 | ||
|
5191b6fccd | ||
|
2e6e6c1779 | ||
|
a29b8fbef4 | ||
|
5b072e716c | ||
|
49845795d9 | ||
|
ab04c74ec9 | ||
|
4744bb9099 | ||
|
91522dda63 | ||
|
095a378dbc | ||
|
0956c30ee5 | ||
|
f85448ffbf | ||
|
d3852ca33a | ||
|
9d9a730659 | ||
|
3f4cd4190f | ||
|
448a402353 | ||
|
2ee9752822 | ||
|
f8a1f796b5 | ||
|
3b5a4cf215 | ||
|
759d53cfa0 | ||
|
814d20d61a | ||
|
6cef520804 | ||
|
8c77491150 | ||
|
709ebcedd4 | ||
|
47e6b88555 | ||
|
df58d0acf3 | ||
|
9c2c5665df | ||
|
1be9c6aa3f | ||
|
96d2bf10b9 | ||
|
7a1aefc7f3 | ||
|
f7f06f810b | ||
|
e02fd80adb | ||
|
4b818495ca | ||
|
1841ec4f8e | ||
|
21708e4352 | ||
|
662bcb34b1 | ||
|
f8a19506ab | ||
|
67d1d5ec80 | ||
|
49c6e99970 | ||
|
15242d66e1 | ||
|
94a0bc01f9 | ||
|
677c4b140c | ||
|
838ad5ed6d | ||
|
772ac2b0c5 | ||
|
68b3b66c03 | ||
|
0d1614be63 | ||
|
62b95e33b8 | ||
|
dc5c8d2d29 | ||
|
425d5cc7c6 | ||
|
baf99bb868 | ||
|
538efd0cc6 | ||
|
9ba184adf7 | ||
|
710b8d7f40 | ||
|
a6244a95be | ||
|
133b6f2f23 | ||
|
53a634e23e | ||
|
156935e0e9 | ||
|
f31a016efb | ||
|
e56eb7b17b | ||
|
de694958b5 | ||
|
e12a580b0b | ||
|
52e0eef6cb | ||
|
85bf4cf895 | ||
|
b06331218d | ||
|
9b165c8bec | ||
|
3fd427cfce | ||
|
0bb9fc65ad | ||
|
3dd6cc405e | ||
|
06860bb2be | ||
|
7ee5779efc | ||
|
53d9445715 | ||
|
54b2727b50 | ||
|
a2aefa83bb | ||
|
0854140b22 | ||
|
57a861723c | ||
|
b59521bb82 | ||
|
7e8393ba0f | ||
|
9e15f3df75 | ||
|
5c97f09796 | ||
|
bf4ec504b2 | ||
|
59aeae3c8e | ||
|
941f22c033 | ||
|
27543120f2 | ||
|
901518ec25 | ||
|
4c9b0d82af | ||
|
2c5f4c5871 | ||
|
8ee44d200d | ||
|
57b7e87d76 | ||
|
e424246134 | ||
|
ca87048045 | ||
|
5ec9b15d84 | ||
|
6b691bc02d | ||
|
abcd83dd78 | ||
|
5d2113ff5d | ||
|
5c086b9d44 | ||
|
8efa612288 | ||
|
928f7faf7d | ||
|
4b4cf36b03 | ||
|
5d821425b3 | ||
|
8b3066127f | ||
|
360239a6c8 | ||
|
80e903afeb | ||
|
62e9ea412a | ||
|
3d4acf6360 | ||
|
0cf1e1e106 | ||
|
b23fbe1f39 | ||
|
f5e79b9bc5 | ||
|
94e238c467 | ||
|
22f6787283 | ||
|
6255dcd8ec | ||
|
6f80eee962 | ||
|
fd0f01bcad | ||
|
0b6e521dc5 | ||
|
ad6fe9d6a0 | ||
|
7078765903 | ||
|
a73947e54f | ||
|
7525271de1 | ||
|
0bc65f0bde | ||
|
4a0476752c | ||
|
9543a5daeb | ||
|
28b91a4450 | ||
|
6b89d8a199 | ||
|
e999016273 | ||
|
7c6e620f16 | ||
|
267d5ae011 | ||
|
08d4bb4785 | ||
|
a02e25ffff | ||
|
280bdb0567 | ||
|
1a94e5fb0e | ||
|
b6cfe59460 | ||
|
7db2abf918 | ||
|
b398af914f | ||
|
29e1dac1ff | ||
|
3af8a658a7 | ||
|
b5aeb29146 | ||
|
85b702b0d1 | ||
|
77c57b4b14 | ||
|
10d260ec71 | ||
|
1ac8bb0128 | ||
|
28539ba838 | ||
|
f1bb6ef658 | ||
|
24c66f831f | ||
|
87502b4f2e | ||
|
3644d3a100 | ||
|
9e3147f78d | ||
|
cc3ecac6d8 | ||
|
72932d2776 | ||
|
58bc9452f6 | ||
|
2a7b5d8229 | ||
|
245546de61 | ||
|
a3793ff137 | ||
|
0a98817a6f | ||
|
663fb93af7 | ||
|
db42c23c0a | ||
|
33716d1e50 | ||
|
65769fd7a6 | ||
|
e6d3f3d91e | ||
|
79a17d5a25 | ||
|
c924b48a6c | ||
|
519ff576cd | ||
|
5bc3bed461 | ||
|
442f13ef6f | ||
|
95aeadf36c | ||
|
267ea7552b | ||
|
08f7526f8f | ||
|
0604924c20 | ||
|
5ef2748cef | ||
|
8f8229dcd2 | ||
|
a5b5657e96 | ||
|
0f2281e267 | ||
|
994a807819 | ||
|
79f42cec8e | ||
|
0546fd7c8a | ||
|
d51e3e835e | ||
|
3d8d4921af | ||
|
ba3549fa34 | ||
|
721595edea | ||
|
46d960ddfd | ||
|
ed24f93fb9 | ||
|
c4043a8eef | ||
|
dff86c0e12 | ||
|
9a5ec33d61 | ||
|
78227bf5b0 | ||
|
bf2c29a36a | ||
|
47285c6642 | ||
|
e4fb4116fd | ||
|
6d3373cb2c | ||
|
6ddc214e68 | ||
|
91a802a1e5 | ||
|
886ab54eda | ||
|
4470e5bc93 | ||
|
9bbacd3e4c | ||
|
353df67c0b | ||
|
050eb9ba73 | ||
|
4fa5f5497a | ||
|
21a032b783 | ||
|
207efd8932 | ||
|
43c943e48a | ||
|
d6dc5da6db | ||
|
12d787286e | ||
|
c33a7670d0 | ||
|
bbb56d8216 | ||
|
a20c8af678 | ||
|
0eb2b382a2 | ||
|
101298c54d | ||
|
f6bdfc32d3 | ||
|
5015730212 | ||
|
f8a7f30a0d | ||
|
1f94028ff7 | ||
|
512c4c13a6 | ||
|
552db7cb08 | ||
|
d564cb2a7e | ||
|
a6e3fc2d2f | ||
|
e54049bc26 | ||
|
e331b39ca5 | ||
|
e6270ca43f | ||
|
88da95d921 | ||
|
44f9c67466 | ||
|
02bbe399df | ||
|
41bb40feee | ||
|
336d652be5 | ||
|
d3e8678955 | ||
|
503d988c1b | ||
|
7a46378e71 | ||
|
9f6d12551f | ||
|
43c93d6f85 | ||
|
d683d085c0 | ||
|
92ab450983 | ||
|
7b14c65b41 | ||
|
c89c652401 | ||
|
f0f57d156b | ||
|
cecf4f2763 | ||
|
4eeed47c7b | ||
|
bd1f7e057a | ||
|
174d8b72a5 | ||
|
1437b0856c | ||
|
917181cb67 | ||
|
a207a4b3cd | ||
|
39a1d27960 | ||
|
5ef4a64084 | ||
|
baacd9efbf | ||
|
abde37a4d7 | ||
|
3ee9b0cf4b | ||
|
88049915a2 | ||
|
585397937d | ||
|
256b6f1aff | ||
|
acabdafb35 | ||
|
168c1f440d | ||
|
33a8ef4bce | ||
|
33bd8f322c | ||
|
bfe4255807 | ||
|
a15fb95c46 | ||
|
292371932b | ||
|
564e8f483c | ||
|
ba74f41a70 | ||
|
d6a6313493 | ||
|
9b5a7ae802 | ||
|
e4b8481dd0 | ||
|
d868b23c76 | ||
|
56b456ff21 | ||
|
b91913d10d | ||
|
ac1497eb2d | ||
|
1854f3f49c | ||
|
a75523da68 | ||
|
ca66e9788c | ||
|
83ec7d562a | ||
|
05e9a9b572 | ||
|
bc7b37d307 | ||
|
fb5dc73841 | ||
|
8d61d9f627 | ||
|
22b6085c32 | ||
|
2deb1a05a0 | ||
|
8ca46169b1 | ||
|
642ced0cfc | ||
|
a635076106 | ||
|
23d8aa40fe | ||
|
0933630ee5 | ||
|
797cecd9ae | ||
|
4c2707916c | ||
|
ab32b1bba2 | ||
|
619c892032 | ||
|
87ea0253aa | ||
|
e81a90c432 | ||
|
fe385c28f6 | ||
|
6c4ab7d208 | ||
|
dd52dd8bb0 | ||
|
174cdb09a7 | ||
|
c3ca34cf51 | ||
|
85950afbbd | ||
|
da063a8aa5 | ||
|
9d94627f75 | ||
|
5bdd25627f | ||
|
7bb8a480f1 | ||
|
be74be0e3b | ||
|
982890515d | ||
|
1817025f46 | ||
|
c5d24fc5cd | ||
|
965e37bee9 | ||
|
def700739d | ||
|
5590bcb9cc | ||
|
9f69c7f3e8 | ||
|
0df45f0de0 | ||
|
9c5ea8eba4 | ||
|
8f6de1f955 | ||
|
4f532224e0 | ||
|
1c2661ed12 | ||
|
91f7ac2d58 | ||
|
3d1a9c7484 | ||
|
25e4174a38 | ||
|
04bb5aad36 | ||
|
4f82a0de89 | ||
|
9e4901e8ce | ||
|
7523a3f2f2 | ||
|
fd1630e049 | ||
|
e3c3cbbbcb | ||
|
4fbb0d7ce4 | ||
|
245fdc8b38 | ||
|
420169d5cd | ||
|
b025ee428c | ||
|
82395a93b0 | ||
|
b7ff017f8d | ||
|
0627bba5a0 | ||
|
ab53731f4a | ||
|
094c537001 | ||
|
27d05102ab | ||
|
f5e4dc824c | ||
|
80acc8f296 | ||
|
e3860d25e9 | ||
|
a2634077e7 | ||
|
c72c0f4d43 | ||
|
d92cfa2179 | ||
|
bbdaa4a0ff | ||
|
5e11a2ae6a | ||
|
053360df85 | ||
|
39a48de025 | ||
|
600ce68210 | ||
|
604f44da11 | ||
|
581f5bd749 | ||
|
ecc40cf115 | ||
|
3d7817154c | ||
|
232e313823 | ||
|
914e2a6656 | ||
|
9a88d17ef2 | ||
|
907a86fd93 | ||
|
d4180931f8 | ||
|
dd913423d3 | ||
|
c296101a2f | ||
|
a439be5161 | ||
|
1ba2923616 | ||
|
1ec4cb7f17 | ||
|
b70e4f6de9 | ||
|
3c11c57755 | ||
|
1b7c6e5687 | ||
|
d32cd210bb | ||
|
e056e4ff58 | ||
|
ae66c07a70 | ||
|
3936412332 | ||
|
ea5eeb7c7a | ||
|
13f4d639fd | ||
|
bb9c07d8fe | ||
|
bfa0509f08 |
@@ -12,8 +12,8 @@ stages:
|
||||
- subprojects/libepoxy/
|
||||
- subprojects/pango/
|
||||
|
||||
fedora-x86_64:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v7
|
||||
fedora-x86_64: &fedora-x86_64-defaults
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v8
|
||||
stage: build
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/test-docker.sh
|
||||
@@ -33,6 +33,11 @@ fedora-x86_64:
|
||||
key: "$CI_JOB_NAME"
|
||||
<<: *cache-paths
|
||||
|
||||
fedora-x86_64-staticlibs:
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
|
||||
<<: *fedora-x86_64-defaults
|
||||
|
||||
.mingw-defaults: &mingw-defaults
|
||||
stage: build
|
||||
tags:
|
||||
@@ -40,7 +45,6 @@ fedora-x86_64:
|
||||
script:
|
||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
|
||||
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
|
||||
allow_failure: true
|
||||
cache:
|
||||
key: "%CI_JOB_NAME%"
|
||||
<<: *cache-paths
|
||||
|
@@ -53,6 +53,7 @@ RUN dnf -y install \
|
||||
libxkbcommon-devel \
|
||||
libXrandr-devel \
|
||||
libXrender-devel \
|
||||
libXtst-devel \
|
||||
libxslt \
|
||||
mesa-dri-drivers \
|
||||
mesa-libEGL-devel \
|
||||
|
@@ -17,6 +17,7 @@ meson \
|
||||
-Dbroadway-backend=true \
|
||||
-Dvulkan=yes \
|
||||
--werror \
|
||||
${EXTRA_MESON_FLAGS:-} \
|
||||
_build $srcdir
|
||||
unset CCACHE_DISABLE
|
||||
|
||||
|
@@ -33,6 +33,10 @@ pacman --noconfirm -S --needed \
|
||||
mingw-w64-$MSYS2_ARCH-gst-plugins-bad \
|
||||
mingw-w64-$MSYS2_ARCH-shared-mime-info
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/gtk/issues/2243
|
||||
wget "https://gitlab.gnome.org/creiter/gitlab-ci-win32-runner/raw/master/pango/mingw-w64-$MSYS2_ARCH-pango-1.44.7-1-any.pkg.tar.xz"
|
||||
pacman --noconfirm -U "mingw-w64-$MSYS2_ARCH-pango-1.44.7-1-any.pkg.tar.xz"
|
||||
|
||||
mkdir -p _ccache
|
||||
export CCACHE_BASEDIR="$(pwd)"
|
||||
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
||||
|
@@ -174,7 +174,7 @@ maintainers review your contribution.
|
||||
|
||||
Each contribution is reviewed by the core developers of the GTK project.
|
||||
|
||||
The [CODE-OWNERS](./docs/CODE-OWNERS) document contains the list of core
|
||||
The [CODEOWNERS](./docs/CODEOWNERS) document contains the list of core
|
||||
contributors to GTK and the areas for which they are responsible; you
|
||||
should ensure to receive their review and signoff on your changes.
|
||||
|
||||
|
@@ -419,7 +419,7 @@ demo_application_window_load_state (DemoApplicationWindow *win)
|
||||
static void
|
||||
demo_application_window_init (DemoApplicationWindow *window)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *popover;
|
||||
|
||||
window->width = -1;
|
||||
window->height = -1;
|
||||
@@ -428,8 +428,8 @@ demo_application_window_init (DemoApplicationWindow *window)
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (window));
|
||||
|
||||
menu = gtk_menu_new_from_model (window->toolmenu);
|
||||
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (window->menutool), menu);
|
||||
popover = gtk_popover_menu_new_from_model (window->menutool, window->toolmenu);
|
||||
gtk_menu_tool_button_set_popover (GTK_MENU_TOOL_BUTTON (window->menutool), popover);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (window),
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
|
@@ -43,25 +43,17 @@
|
||||
<object class="GtkInfoBar" id="infobar">
|
||||
<property name="visible">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="content_area">
|
||||
<child>
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="valign">center</property>
|
||||
<property name="label" translatable="yes">_OK</property>
|
||||
<property name="use-underline">1</property>
|
||||
<signal name="clicked" handler="clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
<child type="action">
|
||||
<object class="GtkButton">
|
||||
<property name="valign">center</property>
|
||||
<property name="label" translatable="yes">_OK</property>
|
||||
<property name="use-underline">1</property>
|
||||
<signal name="clicked" handler="clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
<layout>
|
||||
|
@@ -94,6 +94,7 @@ create_page1 (GtkWidget *assistant)
|
||||
GtkWidget *box, *label, *entry;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
g_object_set (box, "margin", 12, NULL);
|
||||
|
||||
label = gtk_label_new ("You must fill out this entry to continue:");
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
@@ -115,10 +116,12 @@ create_page2 (GtkWidget *assistant)
|
||||
{
|
||||
GtkWidget *box, *checkbutton;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
g_object_set (box, "margin", 12, NULL);
|
||||
|
||||
checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue "
|
||||
"even if you do not check this");
|
||||
gtk_widget_set_valign (checkbutton, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (box), checkbutton);
|
||||
|
||||
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
|
||||
|
@@ -38,7 +38,22 @@ help_activate (GSimpleAction *action,
|
||||
g_print ("Help not available\n");
|
||||
}
|
||||
|
||||
static void
|
||||
not_implemented (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_print ("Action “%s” not implemented\n", g_action_get_name (G_ACTION (action)));
|
||||
}
|
||||
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "new", not_implemented, NULL, NULL, NULL },
|
||||
{ "open", not_implemented, NULL, NULL, NULL },
|
||||
{ "save", not_implemented, NULL, NULL, NULL },
|
||||
{ "save-as", not_implemented, NULL, NULL, NULL },
|
||||
{ "copy", not_implemented, NULL, NULL, NULL },
|
||||
{ "cut", not_implemented, NULL, NULL, NULL },
|
||||
{ "paste", not_implemented, NULL, NULL, NULL },
|
||||
{ "quit", quit_activate, NULL, NULL, NULL },
|
||||
{ "about", about_activate, NULL, NULL, NULL },
|
||||
{ "help", help_activate, NULL, NULL, NULL }
|
||||
@@ -50,8 +65,6 @@ do_builder (GtkWidget *do_widget)
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *toolbar;
|
||||
GActionGroup *actions;
|
||||
GtkAccelGroup *accel_group;
|
||||
GtkWidget *item;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
@@ -59,7 +72,6 @@ do_builder (GtkWidget *do_widget)
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/builder/demo.ui");
|
||||
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
@@ -73,44 +85,6 @@ do_builder (GtkWidget *do_widget)
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
window);
|
||||
gtk_widget_insert_action_group (window, "win", actions);
|
||||
accel_group = gtk_accel_group_new ();
|
||||
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "new_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_n, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "open_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_o, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "save_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "quit_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "copy_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_c, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "cut_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_x, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "paste_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_v, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "help_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_F1, 0, GTK_ACCEL_VISIBLE);
|
||||
|
||||
item = (GtkWidget*)gtk_builder_get_object (builder, "about_item");
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
GDK_KEY_F7, 0, GTK_ACCEL_VISIBLE);
|
||||
|
||||
g_object_set_data_full (G_OBJECT(window), "builder", builder, g_object_unref);
|
||||
}
|
||||
|
@@ -1,551 +0,0 @@
|
||||
/* Change Display
|
||||
*
|
||||
* Demonstrates migrating a window between different displays.
|
||||
* A display is a mouse and keyboard with some number of
|
||||
* associated monitors. The neat thing about having multiple
|
||||
* displays is that they can be on a completely separate
|
||||
* computers, as long as there is a network connection to the
|
||||
* computer where the application is running.
|
||||
*
|
||||
* Only some of the windowing systems where GTK runs have the
|
||||
* concept of multiple displays. (The X Window System is the
|
||||
* main example.) Other windowing systems can only handle one
|
||||
* keyboard and mouse, and combine all monitors into
|
||||
* a single display.
|
||||
*
|
||||
* This is a moderately complex example, and demonstrates:
|
||||
*
|
||||
* - Tracking the currently open displays
|
||||
*
|
||||
* - Changing the display for a window
|
||||
*
|
||||
* - Letting the user choose a window by clicking on it
|
||||
*
|
||||
* - Using GtkListStore and GtkTreeView
|
||||
*
|
||||
* - Using GtkDialog
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* The ChangeDisplayInfo structure corresponds to a toplevel window and
|
||||
* holds pointers to widgets inside the toplevel window along with other
|
||||
* information about the contents of the window.
|
||||
* This is a common organizational structure in real applications.
|
||||
*/
|
||||
typedef struct _ChangeDisplayInfo ChangeDisplayInfo;
|
||||
|
||||
struct _ChangeDisplayInfo
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkSizeGroup *size_group;
|
||||
|
||||
GtkTreeModel *display_model;
|
||||
|
||||
GdkDisplay *current_display;
|
||||
};
|
||||
|
||||
/* These enumerations provide symbolic names for the columns
|
||||
* in the two GtkListStore models.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
DISPLAY_COLUMN_NAME,
|
||||
DISPLAY_COLUMN_DISPLAY,
|
||||
DISPLAY_NUM_COLUMNS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SCREEN_COLUMN_NUMBER,
|
||||
SCREEN_COLUMN_SCREEN,
|
||||
SCREEN_NUM_COLUMNS
|
||||
};
|
||||
|
||||
/* Finds the toplevel window under the mouse pointer, if any.
|
||||
*/
|
||||
static GtkWidget *
|
||||
find_toplevel_at_pointer (GdkDisplay *display)
|
||||
{
|
||||
GdkSurface *pointer_window;
|
||||
GtkWidget *widget = NULL;
|
||||
|
||||
pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (), NULL, NULL);
|
||||
|
||||
if (pointer_window)
|
||||
widget = GTK_WIDGET (gtk_native_get_for_surface (pointer_window));
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
static void
|
||||
released_cb (GtkGestureClick *gesture,
|
||||
guint n_press,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
gboolean *clicked)
|
||||
{
|
||||
*clicked = TRUE;
|
||||
}
|
||||
|
||||
/* Asks the user to click on a window, then waits for them click
|
||||
* the mouse. When the mouse is released, returns the toplevel
|
||||
* window under the pointer, or NULL, if there is none.
|
||||
*/
|
||||
static GtkWidget *
|
||||
query_for_toplevel (GdkDisplay *display,
|
||||
const char *prompt)
|
||||
{
|
||||
GtkWidget *popup, *label, *frame;
|
||||
GdkCursor *cursor;
|
||||
GtkWidget *toplevel = NULL;
|
||||
GdkDevice *device;
|
||||
|
||||
popup = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_window_set_display (GTK_WINDOW (popup), display);
|
||||
gtk_window_set_modal (GTK_WINDOW (popup), TRUE);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
||||
gtk_container_add (GTK_CONTAINER (popup), frame);
|
||||
|
||||
label = gtk_label_new (prompt);
|
||||
g_object_set (label, "margin", 10, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (frame), label);
|
||||
|
||||
gtk_widget_show (popup);
|
||||
cursor = gdk_cursor_new_from_name ("crosshair", NULL);
|
||||
device = gtk_get_current_event_device ();
|
||||
|
||||
if (gdk_seat_grab (gdk_device_get_seat (device),
|
||||
gtk_native_get_surface (GTK_NATIVE (popup)),
|
||||
GDK_SEAT_CAPABILITY_ALL_POINTING,
|
||||
FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS)
|
||||
{
|
||||
GtkGesture *gesture = gtk_gesture_click_new ();
|
||||
gboolean clicked = FALSE;
|
||||
|
||||
g_signal_connect (gesture, "released",
|
||||
G_CALLBACK (released_cb), &clicked);
|
||||
gtk_widget_add_controller (popup, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
/* Process events until clicked is set by our button release event handler.
|
||||
* We pass in may_block=TRUE since we want to wait if there
|
||||
* are no events currently.
|
||||
*/
|
||||
while (!clicked)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
gdk_seat_ungrab (gdk_device_get_seat (device));
|
||||
|
||||
toplevel = find_toplevel_at_pointer (display);
|
||||
if (toplevel == popup)
|
||||
toplevel = NULL;
|
||||
}
|
||||
|
||||
g_object_unref (cursor);
|
||||
gtk_widget_destroy (popup);
|
||||
|
||||
return toplevel;
|
||||
}
|
||||
|
||||
/* Prompts the user for a toplevel window to move, and then moves
|
||||
* that window to the currently selected display
|
||||
*/
|
||||
static void
|
||||
query_change_display (ChangeDisplayInfo *info)
|
||||
{
|
||||
GdkDisplay *display = gtk_widget_get_display (info->window);
|
||||
GtkWidget *toplevel;
|
||||
|
||||
toplevel = query_for_toplevel (display,
|
||||
"Please select the toplevel\n"
|
||||
"to move to the new display");
|
||||
|
||||
if (toplevel)
|
||||
gtk_window_set_display (GTK_WINDOW (toplevel), info->current_display);
|
||||
else
|
||||
gdk_display_beep (display);
|
||||
}
|
||||
|
||||
/* Called when the user clicks on a button in our dialog or
|
||||
* closes the dialog through the window manager. Unless the
|
||||
* "Change" button was clicked, we destroy the dialog.
|
||||
*/
|
||||
static void
|
||||
response_cb (GtkDialog *dialog,
|
||||
gint response_id,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
query_change_display (info);
|
||||
else
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
}
|
||||
|
||||
/* Called when the user clicks on "Open..." in the display
|
||||
* frame. Prompts for a new display, and then opens a connection
|
||||
* to that display.
|
||||
*/
|
||||
static void
|
||||
open_display_cb (GtkWidget *button,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
GtkWidget *content_area;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *display_entry;
|
||||
GtkWidget *dialog_label;
|
||||
gchar *new_screen_name = NULL;
|
||||
GdkDisplay *result = NULL;
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons ("Open Display",
|
||||
GTK_WINDOW (info->window),
|
||||
GTK_DIALOG_MODAL,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_OK"), GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
|
||||
display_entry = gtk_entry_new ();
|
||||
gtk_entry_set_activates_default (GTK_ENTRY (display_entry), TRUE);
|
||||
dialog_label =
|
||||
gtk_label_new ("Please enter the name of\nthe new display\n");
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (content_area), dialog_label);
|
||||
gtk_container_add (GTK_CONTAINER (content_area), display_entry);
|
||||
|
||||
gtk_widget_grab_focus (display_entry);
|
||||
|
||||
while (!result)
|
||||
{
|
||||
gint response_id = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
if (response_id != GTK_RESPONSE_OK)
|
||||
break;
|
||||
|
||||
new_screen_name = gtk_editable_get_chars (GTK_EDITABLE (display_entry),
|
||||
0, -1);
|
||||
|
||||
if (strcmp (new_screen_name, "") != 0)
|
||||
{
|
||||
result = gdk_display_open (new_screen_name);
|
||||
if (!result)
|
||||
{
|
||||
gchar *error_msg =
|
||||
g_strdup_printf ("Can't open display:\n\t%s\nplease try another one\n",
|
||||
new_screen_name);
|
||||
gtk_label_set_text (GTK_LABEL (dialog_label), error_msg);
|
||||
g_free (error_msg);
|
||||
}
|
||||
|
||||
g_free (new_screen_name);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
/* Called when the user clicks on the "Close" button in the
|
||||
* "Display" frame. Closes the selected display.
|
||||
*/
|
||||
static void
|
||||
close_display_cb (GtkWidget *button,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
if (info->current_display)
|
||||
gdk_display_close (info->current_display);
|
||||
}
|
||||
|
||||
/* Called when the selected row in the display list changes.
|
||||
* Updates info->current_display, then refills the list of
|
||||
* screens.
|
||||
*/
|
||||
static void
|
||||
display_changed_cb (GtkTreeSelection *selection,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (info->current_display)
|
||||
g_object_unref (info->current_display);
|
||||
if (gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||
gtk_tree_model_get (model, &iter,
|
||||
DISPLAY_COLUMN_DISPLAY, &info->current_display,
|
||||
-1);
|
||||
else
|
||||
info->current_display = NULL;
|
||||
}
|
||||
|
||||
/* This function is used both for creating the "Display" and
|
||||
* "Screen" frames, since they have a similar structure. The
|
||||
* caller hooks up the right context for the value returned
|
||||
* in tree_view, and packs any relevant buttons into button_vbox.
|
||||
*/
|
||||
static void
|
||||
create_frame (ChangeDisplayInfo *info,
|
||||
const char *title,
|
||||
GtkWidget **frame,
|
||||
GtkWidget **tree_view,
|
||||
GtkWidget **button_vbox)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkWidget *scrollwin;
|
||||
GtkWidget *hbox;
|
||||
|
||||
*frame = gtk_frame_new (title);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
|
||||
g_object_set (hbox, "margin", 8, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (*frame), hbox);
|
||||
|
||||
scrollwin = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin),
|
||||
GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), scrollwin);
|
||||
|
||||
*tree_view = gtk_tree_view_new ();
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (*tree_view), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (scrollwin), *tree_view);
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (*tree_view));
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
|
||||
|
||||
*button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), *button_vbox);
|
||||
|
||||
if (!info->size_group)
|
||||
info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
||||
gtk_size_group_add_widget (GTK_SIZE_GROUP (info->size_group), *button_vbox);
|
||||
}
|
||||
|
||||
/* If we have a stack of buttons, it often looks better if their contents
|
||||
* are left-aligned, rather than centered. This function creates a button
|
||||
* and left-aligns it contents.
|
||||
*/
|
||||
GtkWidget *
|
||||
left_align_button_new (const char *label)
|
||||
{
|
||||
GtkWidget *button = gtk_button_new_with_mnemonic (label);
|
||||
GtkWidget *child = gtk_bin_get_child (GTK_BIN (button));
|
||||
|
||||
gtk_widget_set_halign (child, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
/* Creates the "Display" frame in the main window.
|
||||
*/
|
||||
GtkWidget *
|
||||
create_display_frame (ChangeDisplayInfo *info)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *tree_view;
|
||||
GtkWidget *button_vbox;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeSelection *selection;
|
||||
GtkWidget *button;
|
||||
|
||||
create_frame (info, "Display", &frame, &tree_view, &button_vbox);
|
||||
|
||||
button = left_align_button_new ("_Open...");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info);
|
||||
gtk_container_add (GTK_CONTAINER (button_vbox), button);
|
||||
|
||||
button = left_align_button_new ("_Close");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info);
|
||||
gtk_container_add (GTK_CONTAINER (button_vbox), button);
|
||||
|
||||
info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS,
|
||||
G_TYPE_STRING,
|
||||
GDK_TYPE_DISPLAY);
|
||||
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), info->display_model);
|
||||
|
||||
column = gtk_tree_view_column_new_with_attributes ("Name",
|
||||
gtk_cell_renderer_text_new (),
|
||||
"text", DISPLAY_COLUMN_NAME,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
g_signal_connect (selection, "changed",
|
||||
G_CALLBACK (display_changed_cb), info);
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* Called when one of the currently open displays is closed.
|
||||
* Remove it from our list of displays.
|
||||
*/
|
||||
static void
|
||||
display_closed_cb (GdkDisplay *display,
|
||||
gboolean is_error,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean valid;
|
||||
|
||||
for (valid = gtk_tree_model_get_iter_first (info->display_model, &iter);
|
||||
valid;
|
||||
valid = gtk_tree_model_iter_next (info->display_model, &iter))
|
||||
{
|
||||
GdkDisplay *tmp_display;
|
||||
|
||||
gtk_tree_model_get (info->display_model, &iter,
|
||||
DISPLAY_COLUMN_DISPLAY, &tmp_display,
|
||||
-1);
|
||||
if (tmp_display == display)
|
||||
{
|
||||
gtk_list_store_remove (GTK_LIST_STORE (info->display_model), &iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Adds a new display to our list of displays, and connects
|
||||
* to the "closed" signal so that we can remove it from the
|
||||
* list of displays again.
|
||||
*/
|
||||
static void
|
||||
add_display (ChangeDisplayInfo *info,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
const gchar *name = gdk_display_get_name (display);
|
||||
GtkTreeIter iter;
|
||||
|
||||
gtk_list_store_append (GTK_LIST_STORE (info->display_model), &iter);
|
||||
gtk_list_store_set (GTK_LIST_STORE (info->display_model), &iter,
|
||||
DISPLAY_COLUMN_NAME, name,
|
||||
DISPLAY_COLUMN_DISPLAY, display,
|
||||
-1);
|
||||
|
||||
g_signal_connect (display, "closed",
|
||||
G_CALLBACK (display_closed_cb), info);
|
||||
}
|
||||
|
||||
/* Called when a new display is opened
|
||||
*/
|
||||
static void
|
||||
display_opened_cb (GdkDisplayManager *manager,
|
||||
GdkDisplay *display,
|
||||
ChangeDisplayInfo *info)
|
||||
{
|
||||
add_display (info, display);
|
||||
}
|
||||
|
||||
/* Adds all currently open displays to our list of displays,
|
||||
* and set up a signal connection so that we'll be notified
|
||||
* when displays are opened in the future as well.
|
||||
*/
|
||||
static void
|
||||
initialize_displays (ChangeDisplayInfo *info)
|
||||
{
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
GSList *displays = gdk_display_manager_list_displays (manager);
|
||||
GSList *tmp_list;
|
||||
|
||||
for (tmp_list = displays; tmp_list; tmp_list = tmp_list->next)
|
||||
add_display (info, tmp_list->data);
|
||||
|
||||
g_slist_free (tmp_list);
|
||||
|
||||
g_signal_connect (manager, "display-opened",
|
||||
G_CALLBACK (display_opened_cb), info);
|
||||
}
|
||||
|
||||
/* Cleans up when the toplevel is destroyed; we remove the
|
||||
* connections we use to track currently open displays, then
|
||||
* free the ChangeDisplayInfo structure.
|
||||
*/
|
||||
static void
|
||||
destroy_info (ChangeDisplayInfo *info)
|
||||
{
|
||||
GdkDisplayManager *manager = gdk_display_manager_get ();
|
||||
GSList *displays = gdk_display_manager_list_displays (manager);
|
||||
GSList *tmp_list;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (manager,
|
||||
display_opened_cb,
|
||||
info);
|
||||
|
||||
for (tmp_list = displays; tmp_list; tmp_list = tmp_list->next)
|
||||
g_signal_handlers_disconnect_by_func (tmp_list->data,
|
||||
display_closed_cb,
|
||||
info);
|
||||
|
||||
g_slist_free (tmp_list);
|
||||
|
||||
g_object_unref (info->size_group);
|
||||
g_object_unref (info->display_model);
|
||||
|
||||
if (info->current_display)
|
||||
g_object_unref (info->current_display);
|
||||
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_cb (GObject *object,
|
||||
ChangeDisplayInfo **info)
|
||||
{
|
||||
destroy_info (*info);
|
||||
*info = NULL;
|
||||
}
|
||||
|
||||
/* Main entry point. If the dialog for this demo doesn't yet exist, creates
|
||||
* it. Otherwise, destroys it.
|
||||
*/
|
||||
GtkWidget *
|
||||
do_changedisplay (GtkWidget *do_widget)
|
||||
{
|
||||
static ChangeDisplayInfo *info = NULL;
|
||||
|
||||
if (!info)
|
||||
{
|
||||
GtkWidget *content_area;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *frame;
|
||||
|
||||
info = g_new0 (ChangeDisplayInfo, 1);
|
||||
|
||||
info->window = gtk_dialog_new_with_buttons ("Change Display",
|
||||
GTK_WINDOW (do_widget),
|
||||
0,
|
||||
"Close", GTK_RESPONSE_CLOSE,
|
||||
"Change", GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (info->window), 300, 400);
|
||||
|
||||
g_signal_connect (info->window, "response",
|
||||
G_CALLBACK (response_cb), info);
|
||||
g_signal_connect (info->window, "destroy",
|
||||
G_CALLBACK (destroy_cb), &info);
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window));
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
g_object_set (vbox, "margin", 8, NULL);
|
||||
gtk_container_add (GTK_CONTAINER (content_area), vbox);
|
||||
|
||||
frame = create_display_frame (info);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
initialize_displays (info);
|
||||
|
||||
gtk_widget_show (info->window);
|
||||
return info->window;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (info->window);
|
||||
return NULL;
|
||||
}
|
||||
}
|
@@ -119,59 +119,85 @@ get_image_paintable (GtkImage *image)
|
||||
}
|
||||
|
||||
static void
|
||||
drag_begin (GtkWidget *widget,
|
||||
GdkDrag *drag,
|
||||
gpointer data)
|
||||
drag_begin (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
|
||||
paintable = get_image_paintable (GTK_IMAGE (widget));
|
||||
if (paintable)
|
||||
{
|
||||
gtk_drag_set_icon_paintable (drag, paintable, -2, -2);
|
||||
gtk_drag_source_set_icon (source, paintable, -2, -2);
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
drag_data_get (GtkWidget *widget,
|
||||
GdkDrag *drag,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
gpointer data)
|
||||
static void
|
||||
get_texture (GValue *value,
|
||||
gpointer data)
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (data));
|
||||
|
||||
paintable = get_image_paintable (GTK_IMAGE (widget));
|
||||
if (GDK_IS_TEXTURE (paintable))
|
||||
gtk_selection_data_set_texture (selection_data, GDK_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);
|
||||
}
|
||||
|
||||
static void
|
||||
drag_data_received (GtkWidget *widget,
|
||||
GdkDrop *drop,
|
||||
GtkSelectionData *selection_data,
|
||||
gpointer data)
|
||||
got_texture (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
if (gtk_selection_data_get_length (selection_data) > 0)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
GdkDrop *drop = GDK_DROP (source);
|
||||
GtkWidget *image = data;
|
||||
const GValue *value;
|
||||
GError *error = NULL;
|
||||
|
||||
texture = gtk_selection_data_get_texture (selection_data);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (data), GDK_PAINTABLE (texture));
|
||||
g_object_unref (texture);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
copy_image (GtkMenuItem *item,
|
||||
gpointer data)
|
||||
static gboolean
|
||||
drag_drop (GtkDropTarget *dest,
|
||||
GdkDrop *drop,
|
||||
int x,
|
||||
int y,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
GdkPaintable *paintable;
|
||||
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;
|
||||
}
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
paintable = get_image_paintable (GTK_IMAGE (data));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
copy_image (GSimpleAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (data));
|
||||
|
||||
if (GDK_IS_TEXTURE (paintable))
|
||||
gdk_clipboard_set_texture (clipboard, GDK_TEXTURE (paintable));
|
||||
@@ -196,16 +222,12 @@ paste_image_received (GObject *source,
|
||||
}
|
||||
|
||||
static void
|
||||
paste_image (GtkMenuItem *item,
|
||||
gpointer data)
|
||||
paste_image (GSimpleAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
|
||||
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
gdk_clipboard_read_texture_async (clipboard,
|
||||
NULL,
|
||||
paste_image_received,
|
||||
data);
|
||||
GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
gdk_clipboard_read_texture_async (clipboard, NULL, paste_image_received, data);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -215,22 +237,23 @@ pressed_cb (GtkGesture *gesture,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *item;
|
||||
GtkWidget *popover;
|
||||
GMenu *menu;
|
||||
GMenuItem *item;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
menu = g_menu_new ();
|
||||
item = g_menu_item_new (_("_Copy"), "clipboard.copy");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic (_("_Copy"));
|
||||
g_signal_connect (item, "activate", G_CALLBACK (copy_image), image);
|
||||
gtk_widget_show (item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
item = g_menu_item_new (_("_Paste"), "clipboard.paste");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic (_("_Paste"));
|
||||
g_signal_connect (item, "activate", G_CALLBACK (paste_image), image);
|
||||
gtk_widget_show (item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
popover = gtk_popover_menu_new_from_model (image, G_MENU_MODEL (menu));
|
||||
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), NULL);
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &(GdkRectangle) { x, y, 1, 1});
|
||||
gtk_popover_popup (GTK_POPOVER (popover));
|
||||
|
||||
g_object_unref (menu);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
@@ -243,6 +266,14 @@ do_clipboard (GtkWidget *do_widget)
|
||||
GtkWidget *entry, *button;
|
||||
GtkWidget *image;
|
||||
GtkGesture *gesture;
|
||||
GActionEntry entries[] = {
|
||||
{ "copy", copy_image, NULL, NULL, NULL },
|
||||
{ "paste", paste_image, NULL, NULL, NULL },
|
||||
};
|
||||
GActionGroup *actions;
|
||||
GtkDragSource *source;
|
||||
GtkDropTarget *dest;
|
||||
GdkContentFormats *formats;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
@@ -301,22 +332,21 @@ do_clipboard (GtkWidget *do_widget)
|
||||
|
||||
/* Create the first image */
|
||||
image = gtk_image_new_from_icon_name ("dialog-warning");
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 48);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), image);
|
||||
|
||||
/* make image a drag source */
|
||||
gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (image);
|
||||
g_signal_connect (image, "drag-begin",
|
||||
G_CALLBACK (drag_begin), image);
|
||||
g_signal_connect (image, "drag-data-get",
|
||||
G_CALLBACK (drag_data_get), image);
|
||||
source = gtk_drag_source_new ();
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* accept drops on image */
|
||||
gtk_drag_dest_set (image, GTK_DEST_DEFAULT_ALL,
|
||||
NULL, GDK_ACTION_COPY);
|
||||
gtk_drag_dest_add_image_targets (image);
|
||||
g_signal_connect (image, "drag-data-received",
|
||||
G_CALLBACK (drag_data_received), 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);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
/* context menu on image */
|
||||
gesture = gtk_gesture_click_new ();
|
||||
@@ -324,30 +354,43 @@ do_clipboard (GtkWidget *do_widget)
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
actions = G_ACTION_GROUP (g_simple_action_group_new ());
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), image);
|
||||
|
||||
gtk_widget_insert_action_group (image, "clipboard", actions);
|
||||
|
||||
g_object_unref (actions);
|
||||
|
||||
/* Create the second image */
|
||||
image = gtk_image_new_from_icon_name ("process-stop");
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 48);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), image);
|
||||
|
||||
/* make image a drag source */
|
||||
gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (image);
|
||||
g_signal_connect (image, "drag-begin",
|
||||
G_CALLBACK (drag_begin), image);
|
||||
g_signal_connect (image, "drag-data-get",
|
||||
G_CALLBACK (drag_data_get), image);
|
||||
source = gtk_drag_source_new ();
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* accept drops on image */
|
||||
gtk_drag_dest_set (image, GTK_DEST_DEFAULT_ALL,
|
||||
NULL, GDK_ACTION_COPY);
|
||||
gtk_drag_dest_add_image_targets (image);
|
||||
g_signal_connect (image, "drag-data-received",
|
||||
G_CALLBACK (drag_data_received), 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);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
/* context menu on image */
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
actions = G_ACTION_GROUP (g_simple_action_group_new ());
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), image);
|
||||
|
||||
gtk_widget_insert_action_group (image, "clipboard", actions);
|
||||
|
||||
g_object_unref (actions);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -24,7 +24,6 @@ do_cursors (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/cursors/cursors.ui");
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -149,7 +149,6 @@
|
||||
<file>application_demo.c</file>
|
||||
<file>assistant.c</file>
|
||||
<file>builder.c</file>
|
||||
<file>changedisplay.c</file>
|
||||
<file>clipboard.c</file>
|
||||
<file>colorsel.c</file>
|
||||
<file>combobox.c</file>
|
||||
@@ -191,7 +190,6 @@
|
||||
<file>listbox.c</file>
|
||||
<file>list_store.c</file>
|
||||
<file>markup.c</file>
|
||||
<file>menus.c</file>
|
||||
<file>modelbutton.c</file>
|
||||
<file>overlay.c</file>
|
||||
<file>overlay2.c</file>
|
||||
|
@@ -22,6 +22,75 @@
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<menu id="menubar">
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_File</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_New</attribute>
|
||||
<attribute name="action">win.new</attribute>
|
||||
<attribute name="accel"><Primary>n</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open</attribute>
|
||||
<attribute name="action">win.open</attribute>
|
||||
<attribute name="accel"><Primary>o</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Save</attribute>
|
||||
<attribute name="action">win.save</attribute>
|
||||
<attribute name="accel"><Primary>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>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Quit</attribute>
|
||||
<attribute name="action">win.quit</attribute>
|
||||
<attribute name="accel"><Primary><Shift>s</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Edit</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Copy</attribute>
|
||||
<attribute name="action">win.copy</attribute>
|
||||
<attribute name="accel"><Primary>c</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Cut</attribute>
|
||||
<attribute name="action">win.cut</attribute>
|
||||
<attribute name="accel"><Primary>x</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Paste</attribute>
|
||||
<attribute name="action">win.paste</attribute>
|
||||
<attribute name="accel"><Primary>v</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Help</attribute>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Help</attribute>
|
||||
<attribute name="action">win.help</attribute>
|
||||
<attribute name="accel">F1</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_About</attribute>
|
||||
<attribute name="action">win.about</attribute>
|
||||
<attribute name="accel">F7</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
</menu>
|
||||
<object class="GtkAboutDialog" id="aboutdialog1">
|
||||
<property name="program-name" translatable="yes">Builder demo</property>
|
||||
<property name="logo-icon-name" translatable="yes">gtk3-demo</property>
|
||||
@@ -37,109 +106,8 @@
|
||||
<object class="GtkBox" id="vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkMenuBar" id="menubar1">
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-menubar">
|
||||
<property name="AtkObject::accessible-name">The menubar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="label" translatable="yes">_File</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="new_item">
|
||||
<property name="label" translatable="yes">_New</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="open_item">
|
||||
<property name="label" translatable="yes">_Open</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="save_item">
|
||||
<property name="label" translatable="yes">_Save</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="save_as_item">
|
||||
<property name="label" translatable="yes">Save _As</property>
|
||||
<property name="use-underline">1</property>
|
||||
<accelerator key="s" modifiers="primary | shift-mask" signal="activate"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="quit_item">
|
||||
<property name="label" translatable="yes">_Quit</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.quit</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="label" translatable="yes">_Edit</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="copy_item">
|
||||
<property name="label" translatable="yes">_Copy</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="cut_item">
|
||||
<property name="label" translatable="yes">_Cut</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="paste_item">
|
||||
<property name="label" translatable="yes">_Paste</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="label" translatable="yes">_Help</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="help_item">
|
||||
<property name="label" translatable="yes">_Help</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.help</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="about_item">
|
||||
<property name="label" translatable="yes">_About</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.about</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkPopoverMenuBar" id="menubar1">
|
||||
<property name="menu-model">menubar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
@@ -1,6 +1,8 @@
|
||||
/* Drag-and-Drop
|
||||
*
|
||||
* I can't believe its not glade!
|
||||
*
|
||||
* Try right-clicking in the window.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
@@ -92,7 +94,7 @@ deserialize_widget (GtkDemoWidget *demo)
|
||||
static double pos_x, pos_y;
|
||||
|
||||
static void
|
||||
new_label_cb (GtkMenuItem *item,
|
||||
new_label_cb (GtkWidget *button,
|
||||
gpointer data)
|
||||
{
|
||||
GtkFixed *fixed = data;
|
||||
@@ -100,10 +102,12 @@ new_label_cb (GtkMenuItem *item,
|
||||
|
||||
widget = gtk_label_new ("Label");
|
||||
gtk_fixed_put (fixed, widget, pos_x, pos_y);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
new_spinner_cb (GtkMenuItem *item,
|
||||
new_spinner_cb (GtkWidget *button,
|
||||
gpointer data)
|
||||
{
|
||||
GtkFixed *fixed = data;
|
||||
@@ -113,33 +117,39 @@ new_spinner_cb (GtkMenuItem *item,
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "demo");
|
||||
gtk_spinner_start (GTK_SPINNER (widget));
|
||||
gtk_fixed_put (fixed, widget, pos_x, pos_y);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
copy_cb (GtkWidget *child)
|
||||
copy_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
GtkDemoWidget *demo;
|
||||
|
||||
g_print ("Copy %s\n", G_OBJECT_TYPE_NAME (child));
|
||||
|
||||
demo = serialize_widget (child);
|
||||
|
||||
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
|
||||
gdk_clipboard_set (clipboard, GTK_TYPE_DEMO_WIDGET, demo);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
delete_cb (GtkWidget *child)
|
||||
delete_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
gtk_widget_destroy (child);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
cut_cb (GtkWidget *child)
|
||||
cut_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
copy_cb (child);
|
||||
delete_cb (child);
|
||||
copy_cb (button, child);
|
||||
delete_cb (button, child);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -175,7 +185,7 @@ value_read (GObject *source,
|
||||
}
|
||||
|
||||
static void
|
||||
paste_cb (GtkWidget *fixed)
|
||||
paste_cb (GtkWidget *button, GtkWidget *fixed)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
|
||||
@@ -187,6 +197,8 @@ paste_cb (GtkWidget *fixed)
|
||||
}
|
||||
else
|
||||
g_print ("Don't know how to handle clipboard contents\n");
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -205,7 +217,7 @@ edit_label_done (GtkWidget *entry, gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
edit_cb (GtkWidget *child)
|
||||
edit_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
GtkWidget *fixed = gtk_widget_get_parent (child);
|
||||
int x, y;
|
||||
@@ -219,6 +231,7 @@ edit_cb (GtkWidget *child)
|
||||
g_object_set_data (G_OBJECT (entry), "label", child);
|
||||
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_label_get_text (GTK_LABEL (child)));
|
||||
gtk_editable_set_width_chars (GTK_EDITABLE (entry), 12);
|
||||
g_signal_connect (entry, "activate", G_CALLBACK (edit_label_done), NULL);
|
||||
gtk_fixed_put (GTK_FIXED (fixed), entry, x, y);
|
||||
gtk_widget_grab_focus (entry);
|
||||
@@ -230,6 +243,9 @@ edit_cb (GtkWidget *child)
|
||||
g_object_get (child, "active", &active, NULL);
|
||||
g_object_set (child, "active", !active, NULL);
|
||||
}
|
||||
|
||||
if (button)
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -247,65 +263,65 @@ pressed_cb (GtkGesture *gesture,
|
||||
|
||||
if (gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)) == GDK_BUTTON_SECONDARY)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *box;
|
||||
GtkWidget *item;
|
||||
GdkClipboard *clipboard;
|
||||
|
||||
pos_x = x;
|
||||
pos_y = y;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
item = gtk_menu_item_new_with_label ("New Label");
|
||||
g_signal_connect (item, "activate", G_CALLBACK (new_label_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
item = gtk_menu_item_new_with_label ("New Spinner");
|
||||
g_signal_connect (item, "activate", G_CALLBACK (new_spinner_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
menu = gtk_popover_new (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);
|
||||
gtk_container_add (GTK_CONTAINER (menu), box);
|
||||
|
||||
item = gtk_separator_menu_item_new ();
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
item = gtk_button_new_with_label ("New Label");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (new_label_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("New Spinner");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (new_spinner_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_menu_item_new_with_label ("Edit");
|
||||
item = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_button_new_with_label ("Edit");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect_swapped (item, "activate", G_CALLBACK (edit_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (edit_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_separator_menu_item_new ();
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
item = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_menu_item_new_with_label ("Cut");
|
||||
item = gtk_button_new_with_label ("Cut");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect_swapped (item, "activate", G_CALLBACK (cut_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
item = gtk_menu_item_new_with_label ("Copy");
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (cut_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("Copy");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect_swapped (item, "activate", G_CALLBACK (copy_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
item = gtk_menu_item_new_with_label ("Paste");
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (copy_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("Paste");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
|
||||
gtk_widget_set_sensitive (item,
|
||||
gdk_content_formats_contain_gtype (gdk_clipboard_get_formats (clipboard), GTK_TYPE_DEMO_WIDGET));
|
||||
g_signal_connect_swapped (item, "activate", G_CALLBACK (paste_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
item = gtk_menu_item_new_with_label ("Delete");
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (paste_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("Delete");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect_swapped (item, "activate", G_CALLBACK (delete_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (menu), item);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (delete_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
rect.width = 0;
|
||||
rect.height = 0;
|
||||
|
||||
gtk_menu_popup_at_rect (GTK_MENU (menu),
|
||||
gtk_native_get_surface (gtk_widget_get_native (widget)),
|
||||
&rect,
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
NULL);
|
||||
|
||||
return;
|
||||
gtk_popover_popup (GTK_POPOVER (menu));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +341,7 @@ released_cb (GtkGesture *gesture,
|
||||
if (gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)) == GDK_BUTTON_PRIMARY)
|
||||
{
|
||||
if (child != NULL && child != widget)
|
||||
edit_cb (child);
|
||||
edit_cb (NULL, child);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -122,7 +122,6 @@ do_filtermodel (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/filtermodel/filtermodel.ui");
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -226,8 +226,8 @@ set_widget_type (GtkFishbowl *fishbowl,
|
||||
}
|
||||
|
||||
void
|
||||
next_button_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
fishbowl_next_button_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkFishbowl *fishbowl = user_data;
|
||||
int new_index;
|
||||
@@ -241,8 +241,8 @@ next_button_clicked_cb (GtkButton *source,
|
||||
}
|
||||
|
||||
void
|
||||
prev_button_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
fishbowl_prev_button_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkFishbowl *fishbowl = user_data;
|
||||
int new_index;
|
||||
@@ -256,8 +256,8 @@ prev_button_clicked_cb (GtkButton *source,
|
||||
}
|
||||
|
||||
void
|
||||
changes_toggled_cb (GtkToggleButton *button,
|
||||
gpointer user_data)
|
||||
fishbowl_changes_toggled_cb (GtkToggleButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (gtk_toggle_button_get_active (button))
|
||||
gtk_button_set_icon_name (GTK_BUTTON (button), "changes-prevent");
|
||||
@@ -288,12 +288,6 @@ do_fishbowl (GtkWidget *do_widget)
|
||||
g_type_ensure (GTK_TYPE_FISHBOWL);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/fishbowl/fishbowl.ui");
|
||||
gtk_builder_add_callback_symbols (builder,
|
||||
"next_button_clicked_cb", G_CALLBACK (next_button_clicked_cb),
|
||||
"prev_button_clicked_cb", G_CALLBACK (prev_button_clicked_cb),
|
||||
"changes_toggled_cb", G_CALLBACK (changes_toggled_cb),
|
||||
NULL);
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
@@ -15,13 +15,13 @@
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<signal name="clicked" handler="prev_button_clicked_cb" object="bowl" swapped="no"/>
|
||||
<signal name="clicked" handler="fishbowl_prev_button_clicked_cb" object="bowl" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<signal name="clicked" handler="next_button_clicked_cb" object="bowl" swapped="no"/>
|
||||
<signal name="clicked" handler="fishbowl_next_button_clicked_cb" object="bowl" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -50,7 +50,7 @@
|
||||
<object class="GtkToggleButton" id="changes_allow">
|
||||
<property name="icon-name">changes-allow</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="notify::active" handler="changes_toggled_cb"/>
|
||||
<signal name="notify::active" handler="fishbowl_changes_toggled_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="tooltip-text">Reset</property>
|
||||
<signal name="clicked" handler="reset" swapped="no"/>
|
||||
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">view-refresh-symbolic</property>
|
||||
@@ -42,7 +42,7 @@
|
||||
<property name="receives-default">1</property>
|
||||
<property name="font">Sans 12</property>
|
||||
<property name="level">family|style|size|variations|features</property>
|
||||
<signal name="font-set" handler="font_changed" swapped="no"/>
|
||||
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -63,7 +63,7 @@
|
||||
<object class="GtkComboBox" id="script_lang">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="margin-top">10</property>
|
||||
<signal name="changed" handler="script_changed" swapped="no"/>
|
||||
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
@@ -137,7 +137,7 @@
|
||||
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
||||
|
||||
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
|
||||
<signal name="activate" handler="stop_edit"/>
|
||||
<signal name="activate" handler="font_features_stop_edit"/>
|
||||
<property name="valign">start</property>
|
||||
<property name="width-chars">50</property>
|
||||
</object>
|
||||
@@ -181,7 +181,7 @@
|
||||
<property name="icon-name">document-edit-symbolic</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">end</property>
|
||||
<signal name="toggled" handler="toggle_edit"/>
|
||||
<signal name="toggled" handler="font_features_toggle_edit"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -880,7 +880,7 @@ add_instance (hb_face_t *face,
|
||||
name_id = hb_ot_var_named_instance_get_subfamily_name_id (face, index);
|
||||
hb_ot_name_get_utf8 (face, name_id, HB_LANGUAGE_INVALID, &name_len, name);
|
||||
|
||||
instance->name = g_strdup_printf (name);
|
||||
instance->name = g_strdup (name);
|
||||
instance->index = index;
|
||||
|
||||
g_hash_table_add (instances, instance);
|
||||
@@ -1109,23 +1109,23 @@ done:
|
||||
g_free (design_coords);
|
||||
}
|
||||
|
||||
static void
|
||||
font_changed (void)
|
||||
void
|
||||
font_features_font_changed (void)
|
||||
{
|
||||
update_script_combo ();
|
||||
update_features ();
|
||||
update_font_variations ();
|
||||
}
|
||||
|
||||
static void
|
||||
script_changed (void)
|
||||
void
|
||||
font_features_script_changed (void)
|
||||
{
|
||||
update_features ();
|
||||
update_display ();
|
||||
}
|
||||
|
||||
static void
|
||||
reset_features (void)
|
||||
void
|
||||
font_features_reset_features (void)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
@@ -1170,8 +1170,8 @@ switch_to_label (void)
|
||||
update_display ();
|
||||
}
|
||||
|
||||
static void
|
||||
toggle_edit (void)
|
||||
void
|
||||
font_features_toggle_edit (void)
|
||||
{
|
||||
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (stack)), "label") == 0)
|
||||
switch_to_entry ();
|
||||
@@ -1179,8 +1179,8 @@ toggle_edit (void)
|
||||
switch_to_label ();
|
||||
}
|
||||
|
||||
static void
|
||||
stop_edit (void)
|
||||
void
|
||||
font_features_stop_edit (void)
|
||||
{
|
||||
g_signal_emit_by_name (edit_toggle, "clicked");
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ entry_key_press (GtkEventController *controller,
|
||||
if (keyval == GDK_KEY_Escape)
|
||||
{
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), text);
|
||||
stop_edit ();
|
||||
font_features_stop_edit ();
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
@@ -1215,14 +1215,6 @@ do_font_features (GtkWidget *do_widget)
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/font_features/font-features.ui");
|
||||
|
||||
gtk_builder_add_callback_symbol (builder, "update_display", update_display);
|
||||
gtk_builder_add_callback_symbol (builder, "font_changed", font_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "script_changed", script_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "reset", reset_features);
|
||||
gtk_builder_add_callback_symbol (builder, "stop_edit", G_CALLBACK (stop_edit));
|
||||
gtk_builder_add_callback_symbol (builder, "toggle_edit", G_CALLBACK (toggle_edit));
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
|
||||
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"));
|
||||
@@ -1236,7 +1228,7 @@ do_font_features (GtkWidget *do_widget)
|
||||
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", controller, g_object_unref);
|
||||
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);
|
||||
|
||||
@@ -1339,12 +1331,14 @@ do_font_features (GtkWidget *do_widget)
|
||||
else
|
||||
g_hash_table_remove_all (axes);
|
||||
|
||||
font_changed ();
|
||||
font_features_font_changed ();
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
update_display ();
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "fontplane.h"
|
||||
|
||||
#include "gtk.h"
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_WEIGHT_ADJUSTMENT,
|
||||
|
@@ -248,7 +248,6 @@ do_fontrendering (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/fontrendering/fontrendering.ui");
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -165,10 +165,11 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<style><class name="linked"/></style>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="text_radio">
|
||||
<property name="draw-indicator">0</property>
|
||||
@@ -183,7 +184,7 @@
|
||||
</object>
|
||||
</child>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
<property name="column-span">7</property>
|
||||
</layout>
|
||||
|
@@ -414,7 +414,7 @@ draw_menubar (GtkWidget *widget,
|
||||
frame_context = get_style (NULL, "frame");
|
||||
border_context = get_style (frame_context, "border");
|
||||
|
||||
/* This information is taken from the GtkMenuBar docs, see "CSS nodes" */
|
||||
/* 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");
|
||||
|
@@ -169,9 +169,9 @@ set_widget_type (int type)
|
||||
tick_cb = gtk_widget_add_tick_callback (window, scroll_cb, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
next_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
void
|
||||
iconscroll_next_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
{
|
||||
int new_index;
|
||||
|
||||
@@ -184,9 +184,9 @@ next_clicked_cb (GtkButton *source,
|
||||
set_widget_type (new_index);
|
||||
}
|
||||
|
||||
static void
|
||||
prev_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
void
|
||||
iconscroll_prev_clicked_cb (GtkButton *source,
|
||||
gpointer user_data)
|
||||
{
|
||||
int new_index;
|
||||
|
||||
@@ -206,11 +206,6 @@ do_iconscroll (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/iconscroll/iconscroll.ui");
|
||||
gtk_builder_add_callback_symbols (builder,
|
||||
"next_clicked_cb", G_CALLBACK (next_clicked_cb),
|
||||
"prev_clicked_cb", G_CALLBACK (prev_clicked_cb),
|
||||
NULL);
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
@@ -15,13 +15,13 @@
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<signal name="clicked" handler="prev_clicked_cb"/>
|
||||
<signal name="clicked" handler="iconscroll_prev_clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<signal name="clicked" handler="next_clicked_cb"/>
|
||||
<signal name="clicked" handler="iconscroll_next_clicked_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -31,9 +31,12 @@
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<property name="hadjustment"><object class="GtkAdjustment" id="hadjustment"/></property>
|
||||
<property name="vadjustment"><object class="GtkAdjustment" id="vadjustment"/></property>
|
||||
<property name="hadjustment">
|
||||
<object class="GtkAdjustment" id="hadjustment"/>
|
||||
</property>
|
||||
<property name="vadjustment">
|
||||
<object class="GtkAdjustment" id="vadjustment"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -97,6 +97,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
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_info_bar_set_default_response (GTK_INFO_BAR (bar), GTK_RESPONSE_OK);
|
||||
|
||||
button = gtk_toggle_button_new_with_label ("Question");
|
||||
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
@@ -1,19 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface domain="gtk40">
|
||||
<object class="GtkMenu" id="menu1">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem1">
|
||||
<property name="label" translatable="yes">Email message</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem2">
|
||||
<property name="label" translatable="yes">Embed message</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<menu id="menu1">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Email message</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Embed message</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<template class="GtkMessageRow" parent="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
@@ -171,7 +167,7 @@
|
||||
<object class="GtkMenuButton" id="more-button">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="popup">menu1</property>
|
||||
<property name="menu-model">menu1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="label" translatable="yes">More...</property>
|
||||
</object>
|
||||
|
@@ -1003,32 +1003,6 @@ row_activated_cb (GtkWidget *tree_view,
|
||||
run_example_for_row (window, model, &iter);
|
||||
}
|
||||
|
||||
static void
|
||||
start_cb (GtkMenuItem *item, GtkWidget *scrollbar)
|
||||
{
|
||||
GtkAdjustment *adj;
|
||||
|
||||
adj = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
|
||||
gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj));
|
||||
}
|
||||
|
||||
static void
|
||||
end_cb (GtkMenuItem *item, GtkWidget *scrollbar)
|
||||
{
|
||||
GtkAdjustment *adj;
|
||||
|
||||
adj = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
|
||||
gtk_adjustment_set_value (adj, gtk_adjustment_get_upper (adj) - gtk_adjustment_get_page_size (adj));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
scrollbar_popup (GtkWidget *scrollbar, GtkWidget *menu)
|
||||
{
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -1037,23 +1011,12 @@ activate (GApplication *app)
|
||||
GtkWidget *widget;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
GError *error = NULL;
|
||||
GtkWidget *sw;
|
||||
GtkWidget *scrollbar;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *item;
|
||||
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "run", activate_run, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_resource (builder, "/ui/main.ui", &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
g_critical ("%s", error->message);
|
||||
exit (1);
|
||||
}
|
||||
builder = gtk_builder_new_from_resource ("/ui/main.ui");
|
||||
|
||||
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
|
||||
gtk_application_add_window (GTK_APPLICATION (app), window);
|
||||
@@ -1069,21 +1032,6 @@ activate (GApplication *app)
|
||||
treeview = (GtkWidget *)gtk_builder_get_object (builder, "treeview");
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
|
||||
|
||||
sw = (GtkWidget *)gtk_builder_get_object (builder, "source-scrolledwindow");
|
||||
scrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (sw));
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
|
||||
item = gtk_menu_item_new_with_label ("Start");
|
||||
g_signal_connect (item, "activate", G_CALLBACK (start_cb), scrollbar);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
item = gtk_menu_item_new_with_label ("End");
|
||||
g_signal_connect (item, "activate", G_CALLBACK (end_cb), scrollbar);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
|
||||
g_signal_connect (scrollbar, "popup-menu", G_CALLBACK (scrollbar_popup), menu);
|
||||
|
||||
load_file (gtk_demos[0].name, gtk_demos[0].filename);
|
||||
|
||||
populate_model (model);
|
||||
|
@@ -1,147 +0,0 @@
|
||||
/* Menus
|
||||
*
|
||||
* There are several widgets involved in displaying menus. The
|
||||
* GtkMenuBar widget is a menu bar, which normally appears horizontally
|
||||
* at the top of an application, but can also be layed out vertically.
|
||||
* The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar
|
||||
* and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains
|
||||
* menu items (GtkMenuItem). Each menu item contains text and/or images
|
||||
* and can be selected by the user.
|
||||
*
|
||||
* There are several kinds of menu item, including plain GtkMenuItem,
|
||||
* GtkCheckMenuItem which can be checked/unchecked, GtkRadioMenuItem
|
||||
* which is a check menu item that's in a mutually exclusive group,
|
||||
* GtkSeparatorMenuItem which is a separator bar, GtkTearoffMenuItem
|
||||
* which allows a GtkMenu to be torn off, and GtkImageMenuItem which
|
||||
* can place a GtkImage or other widget next to the menu text.
|
||||
*
|
||||
* A GtkMenuItem can have a submenu, which is simply a GtkMenu to pop
|
||||
* up when the menu item is selected. Typically, all menu items in a menu bar
|
||||
* have submenus.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static GtkWidget *
|
||||
create_menu (gint depth)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkRadioMenuItem *last_item;
|
||||
char buf[32];
|
||||
int i, j;
|
||||
|
||||
if (depth < 1)
|
||||
return NULL;
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
last_item = NULL;
|
||||
|
||||
for (i = 0, j = 1; i < 5; i++, j++)
|
||||
{
|
||||
GtkWidget *menu_item;
|
||||
|
||||
sprintf (buf, "item %2d - %d", depth, j);
|
||||
|
||||
menu_item = gtk_radio_menu_item_new_with_label_from_widget (NULL, buf);
|
||||
gtk_radio_menu_item_join_group (GTK_RADIO_MENU_ITEM (menu_item), last_item);
|
||||
last_item = GTK_RADIO_MENU_ITEM (menu_item);
|
||||
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
if (i == 3)
|
||||
gtk_widget_set_sensitive (menu_item, FALSE);
|
||||
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), create_menu (depth - 1));
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
static void
|
||||
change_orientation (GtkWidget *button,
|
||||
GtkWidget *menubar)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
GtkOrientation orientation;
|
||||
|
||||
parent = gtk_widget_get_parent (menubar);
|
||||
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (parent));
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (parent), 1 - orientation);
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
do_menus (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *box1;
|
||||
GtkWidget *box2;
|
||||
GtkWidget *button;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *menubar;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
GtkAccelGroup *accel_group;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Menus");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK(gtk_widget_destroyed), &window);
|
||||
|
||||
accel_group = gtk_accel_group_new ();
|
||||
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (box), box1);
|
||||
|
||||
menubar = gtk_menu_bar_new ();
|
||||
gtk_widget_set_hexpand (menubar, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box1), menubar);
|
||||
|
||||
menu = create_menu (2);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("test\nline2");
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("foo");
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (3));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_label ("bar");
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (4));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
|
||||
|
||||
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
|
||||
gtk_container_add (GTK_CONTAINER (box1), box2);
|
||||
|
||||
button = gtk_button_new_with_label ("Flip");
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (change_orientation), menubar);
|
||||
gtk_container_add (GTK_CONTAINER (box2), button);
|
||||
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
G_CALLBACK(gtk_widget_destroy), window);
|
||||
gtk_container_add (GTK_CONTAINER (box2), button);
|
||||
gtk_window_set_default_widget (GTK_WINDOW (window), button);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -4,7 +4,6 @@ demos = files([
|
||||
'application_demo.c',
|
||||
'assistant.c',
|
||||
'builder.c',
|
||||
'changedisplay.c',
|
||||
'clipboard.c',
|
||||
'colorsel.c',
|
||||
'combobox.c',
|
||||
@@ -44,7 +43,6 @@ demos = files([
|
||||
'flowbox.c',
|
||||
'list_store.c',
|
||||
'markup.c',
|
||||
'menus.c',
|
||||
'modelbutton.c',
|
||||
'overlay.c',
|
||||
'overlay2.c',
|
||||
|
@@ -14,8 +14,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
tool_clicked (GtkButton *button)
|
||||
void
|
||||
modelbutton_tool_clicked (GtkButton *button)
|
||||
{
|
||||
gboolean active;
|
||||
|
||||
@@ -40,8 +40,6 @@ do_modelbutton (GtkWidget *do_widget)
|
||||
GActionGroup *actions;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/modelbutton/modelbutton.ui");
|
||||
gtk_builder_add_callback_symbol (builder, "tool_clicked", G_CALLBACK (tool_clicked));
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -101,21 +101,21 @@
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Hammer</property>
|
||||
<property name="role">check</property>
|
||||
<signal name="clicked" handler="tool_clicked"/>
|
||||
<signal name="clicked" handler="modelbutton_tool_clicked"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Screwdriver</property>
|
||||
<property name="role">check</property>
|
||||
<signal name="clicked" handler="tool_clicked"/>
|
||||
<signal name="clicked" handler="modelbutton_tool_clicked"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Drill</property>
|
||||
<property name="role">check</property>
|
||||
<signal name="clicked" handler="tool_clicked"/>
|
||||
<signal name="clicked" handler="modelbutton_tool_clicked"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -69,7 +69,6 @@ do_revealer (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/revealer/revealer.ui");
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -18,7 +18,6 @@ do_scale (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/scale/scale.ui");
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -75,11 +75,11 @@
|
||||
<property name="adjustment">adjustment2</property>
|
||||
<property name="hexpand">1</property>
|
||||
<marks>
|
||||
<mark value="0" position="bottom"/>
|
||||
<mark value="1" position="bottom"/>
|
||||
<mark value="2" position="bottom"/>
|
||||
<mark value="3" position="bottom"/>
|
||||
<mark value="4" position="bottom"/>
|
||||
<mark value="0" position="bottom"></mark>
|
||||
<mark value="1" position="bottom"></mark>
|
||||
<mark value="2" position="bottom"></mark>
|
||||
<mark value="3" position="bottom"></mark>
|
||||
<mark value="4" position="bottom"></mark>
|
||||
</marks>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label_marks"/>
|
||||
@@ -115,11 +115,11 @@
|
||||
<relation type="labelled-by" target="label_discrete"/>
|
||||
</accessibility>
|
||||
<marks>
|
||||
<mark value="0" position="bottom"/>
|
||||
<mark value="1" position="bottom"/>
|
||||
<mark value="2" position="bottom"/>
|
||||
<mark value="3" position="bottom"/>
|
||||
<mark value="4" position="bottom"/>
|
||||
<mark value="0" position="bottom"></mark>
|
||||
<mark value="1" position="bottom"></mark>
|
||||
<mark value="2" position="bottom"></mark>
|
||||
<mark value="3" position="bottom"></mark>
|
||||
<mark value="4" position="bottom"></mark>
|
||||
</marks>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
|
@@ -25,44 +25,44 @@ show_shortcuts (GtkWidget *window,
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
||||
static void
|
||||
builder_shortcuts (GtkWidget *window)
|
||||
void
|
||||
shortcuts_builder_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-builder", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gedit_shortcuts (GtkWidget *window)
|
||||
void
|
||||
shortcuts_gedit_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-gedit", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
clocks_shortcuts (GtkWidget *window)
|
||||
void
|
||||
shortcuts_clocks_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-clocks", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
clocks_shortcuts_stopwatch (GtkWidget *window)
|
||||
void
|
||||
shortcuts_clocks_shortcuts_stopwatch (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-clocks", "stopwatch");
|
||||
}
|
||||
|
||||
static void
|
||||
boxes_shortcuts (GtkWidget *window)
|
||||
void
|
||||
shortcuts_boxes_shortcuts (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-boxes", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
boxes_shortcuts_wizard (GtkWidget *window)
|
||||
void
|
||||
shortcuts_boxes_shortcuts_wizard (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-boxes", "wizard");
|
||||
}
|
||||
|
||||
static void
|
||||
boxes_shortcuts_display (GtkWidget *window)
|
||||
void
|
||||
shortcuts_boxes_shortcuts_display (GtkWidget *window)
|
||||
{
|
||||
show_shortcuts (window, "shortcuts-boxes", "display");
|
||||
}
|
||||
@@ -86,16 +86,6 @@ do_shortcuts (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/shortcuts/shortcuts.ui");
|
||||
gtk_builder_add_callback_symbols (builder,
|
||||
"builder_shortcuts", G_CALLBACK (builder_shortcuts),
|
||||
"gedit_shortcuts", G_CALLBACK (gedit_shortcuts),
|
||||
"clocks_shortcuts", G_CALLBACK (clocks_shortcuts),
|
||||
"clocks_shortcuts_stopwatch", G_CALLBACK (clocks_shortcuts_stopwatch),
|
||||
"boxes_shortcuts", G_CALLBACK (boxes_shortcuts),
|
||||
"boxes_shortcuts_wizard", G_CALLBACK (boxes_shortcuts_wizard),
|
||||
"boxes_shortcuts_display", G_CALLBACK (boxes_shortcuts_display),
|
||||
NULL);
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -10,43 +10,43 @@
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Builder</property>
|
||||
<signal name="clicked" handler="builder_shortcuts" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_builder_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">GEdit</property>
|
||||
<signal name="clicked" handler="gedit_shortcuts" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_gedit_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Clocks - All</property>
|
||||
<signal name="clicked" handler="clocks_shortcuts" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_clocks_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Clocks - Stopwatch</property>
|
||||
<signal name="clicked" handler="clocks_shortcuts_stopwatch" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_clocks_shortcuts_stopwatch" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Boxes</property>
|
||||
<signal name="clicked" handler="boxes_shortcuts" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_boxes_shortcuts" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Boxes - Wizard</property>
|
||||
<signal name="clicked" handler="boxes_shortcuts_wizard" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_boxes_shortcuts_wizard" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Boxes - Display</property>
|
||||
<signal name="clicked" handler="boxes_shortcuts_display" swapped="1" object="window1"/>
|
||||
<signal name="clicked" handler="shortcuts_boxes_shortcuts_display" swapped="1" object="window1"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -11,9 +11,9 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static gint
|
||||
hex_spin_input (GtkSpinButton *spin_button,
|
||||
gdouble *new_val)
|
||||
gint
|
||||
spinbutton_hex_spin_input (GtkSpinButton *spin_button,
|
||||
gdouble *new_val)
|
||||
{
|
||||
const gchar *buf;
|
||||
gchar *err;
|
||||
@@ -28,8 +28,8 @@ hex_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
hex_spin_output (GtkSpinButton *spin_button)
|
||||
gint
|
||||
spinbutton_hex_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
gchar *buf;
|
||||
@@ -48,9 +48,9 @@ hex_spin_output (GtkSpinButton *spin_button)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
time_spin_input (GtkSpinButton *spin_button,
|
||||
gdouble *new_val)
|
||||
gint
|
||||
spinbutton_time_spin_input (GtkSpinButton *spin_button,
|
||||
gdouble *new_val)
|
||||
{
|
||||
const gchar *text;
|
||||
gchar **str;
|
||||
@@ -87,8 +87,8 @@ time_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
time_spin_output (GtkSpinButton *spin_button)
|
||||
gint
|
||||
spinbutton_time_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
gchar *buf;
|
||||
@@ -121,9 +121,9 @@ static gchar *month[12] = {
|
||||
"December"
|
||||
};
|
||||
|
||||
static gint
|
||||
month_spin_input (GtkSpinButton *spin_button,
|
||||
gdouble *new_val)
|
||||
gint
|
||||
spinbutton_month_spin_input (GtkSpinButton *spin_button,
|
||||
gdouble *new_val)
|
||||
{
|
||||
gint i;
|
||||
gchar *tmp1, *tmp2;
|
||||
@@ -150,8 +150,8 @@ month_spin_input (GtkSpinButton *spin_button,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
month_spin_output (GtkSpinButton *spin_button)
|
||||
gint
|
||||
spinbutton_month_spin_output (GtkSpinButton *spin_button)
|
||||
{
|
||||
GtkAdjustment *adjustment;
|
||||
gdouble value;
|
||||
@@ -191,15 +191,6 @@ do_spinbutton (GtkWidget *do_widget)
|
||||
GtkWidget *label;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/spinbutton/spinbutton.ui");
|
||||
gtk_builder_add_callback_symbols (builder,
|
||||
"hex_spin_input", G_CALLBACK (hex_spin_input),
|
||||
"hex_spin_output", G_CALLBACK (hex_spin_output),
|
||||
"time_spin_input", G_CALLBACK (time_spin_input),
|
||||
"time_spin_output", G_CALLBACK (time_spin_output),
|
||||
"month_spin_input", G_CALLBACK (month_spin_input),
|
||||
"month_spin_output", G_CALLBACK (month_spin_output),
|
||||
NULL);
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -83,8 +83,8 @@
|
||||
<property name="halign">start</property>
|
||||
<property name="width-chars">4</property>
|
||||
<property name="adjustment">hex_adjustment</property>
|
||||
<signal name="input" handler="hex_spin_input"/>
|
||||
<signal name="output" handler="hex_spin_output"/>
|
||||
<signal name="input" handler="spinbutton_hex_spin_input"/>
|
||||
<signal name="output" handler="spinbutton_hex_spin_output"/>
|
||||
<property name="wrap">1</property>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -119,8 +119,8 @@
|
||||
<property name="halign">start</property>
|
||||
<property name="width-chars">5</property>
|
||||
<property name="adjustment">time_adjustment</property>
|
||||
<signal name="input" handler="time_spin_input"/>
|
||||
<signal name="output" handler="time_spin_output"/>
|
||||
<signal name="input" handler="spinbutton_time_spin_input"/>
|
||||
<signal name="output" handler="spinbutton_time_spin_output"/>
|
||||
<property name="wrap">1</property>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
@@ -154,8 +154,8 @@
|
||||
<object class="GtkSpinButton" id="month_spin">
|
||||
<property name="halign">start</property>
|
||||
<property name="width-chars">9</property>
|
||||
<signal name="input" handler="month_spin_input"/>
|
||||
<signal name="output" handler="month_spin_output"/>
|
||||
<signal name="input" handler="spinbutton_month_spin_input"/>
|
||||
<signal name="output" handler="spinbutton_month_spin_output"/>
|
||||
<property name="adjustment">month_adjustment</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="update-policy">if-valid</property>
|
||||
|
@@ -18,7 +18,6 @@ do_stack (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/stack/stack.ui");
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -6,236 +6,235 @@
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="show-title-buttons">1</property>
|
||||
<child type="end">
|
||||
<object class="GtkLabel" id="fps">
|
||||
</object>
|
||||
<object class="GtkLabel" id="fps"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="margin">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="show-arrow">0</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="margin">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="invisible-char">•</property>
|
||||
<property name="placeholder-text" translatable="yes">Search...</property>
|
||||
<property name="secondary-icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Hi, I am a button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">And I'm another button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">This is a button party!</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<style>
|
||||
<class name="inline-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">go-up-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Plain</property>
|
||||
<property name="halign">end</property>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="show-arrow">0</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="invisible-char">•</property>
|
||||
<property name="placeholder-text" translatable="yes">Search...</property>
|
||||
<property name="secondary-icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Destructive</property>
|
||||
<object class="GtkBox">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Hi, I am a button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">And I'm another button</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">This is a button party!</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="receives-default">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Suggested</property>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
<class name="inline-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">go-up-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Plain</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Destructive</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">Suggested</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@@ -2,6 +2,7 @@
|
||||
<interface>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
@@ -92,6 +93,7 @@
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
|
@@ -5,9 +5,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Drag 'n Drop */
|
||||
static const char *target_table[] = {
|
||||
"text/uri-list"
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -76,30 +73,11 @@ search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
gtk_tree_model_filter_refilter (win->filter_model);
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
get_icon (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
GtkIconInfo *info;
|
||||
GtkStyleContext *context;
|
||||
GdkTexture *texture;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
context = gtk_widget_get_style_context (image);
|
||||
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, size, 0);
|
||||
texture = GDK_TEXTURE (gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL));
|
||||
pixbuf = gdk_pixbuf_get_from_texture (texture);
|
||||
g_object_unref (texture);
|
||||
g_object_unref (info);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
{
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), name);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
|
||||
gtk_drag_source_set_icon_name (image, name);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -365,78 +343,107 @@ search_mode_toggled (GObject *searchbar, GParamSpec *pspec, IconBrowserWindow *w
|
||||
gtk_list_box_unselect_all (GTK_LIST_BOX (win->context_list));
|
||||
}
|
||||
|
||||
static void
|
||||
get_image_data (GtkWidget *widget,
|
||||
GdkDrag *drag,
|
||||
GtkSelectionData *selection,
|
||||
guint target_info,
|
||||
gpointer data)
|
||||
static GdkPaintable *
|
||||
get_image_paintable (GtkImage *image)
|
||||
{
|
||||
GtkWidget *image;
|
||||
const gchar *name;
|
||||
gint size;
|
||||
GdkPixbuf *pixbuf;
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconInfo *icon_info;
|
||||
int size;
|
||||
|
||||
image = gtk_bin_get_child (GTK_BIN (widget));
|
||||
|
||||
name = gtk_image_get_icon_name (GTK_IMAGE (image));
|
||||
size = gtk_image_get_pixel_size (GTK_IMAGE (image));
|
||||
|
||||
pixbuf = get_icon (image, name, size);
|
||||
gtk_selection_data_set_pixbuf (selection, pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
{
|
||||
case GTK_IMAGE_PAINTABLE:
|
||||
return g_object_ref (gtk_image_get_paintable (image));
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
icon_name = gtk_image_get_icon_name (image);
|
||||
size = gtk_image_get_pixel_size (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, size,
|
||||
GTK_ICON_LOOKUP_FORCE_SIZE | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
|
||||
if (icon_info == NULL)
|
||||
return NULL;
|
||||
return gtk_icon_info_load_icon (icon_info, NULL);
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
get_scalable_image_data (GtkWidget *widget,
|
||||
GdkDrag *drag,
|
||||
GtkSelectionData *selection,
|
||||
guint target_info,
|
||||
gpointer data)
|
||||
drag_begin (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
gchar *uris[2];
|
||||
GtkIconInfo *info;
|
||||
GtkWidget *image;
|
||||
GFile *file;
|
||||
const gchar *name;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
image = gtk_bin_get_child (GTK_BIN (widget));
|
||||
name = gtk_image_get_icon_name (GTK_IMAGE (image));
|
||||
paintable = get_image_paintable (GTK_IMAGE (widget));
|
||||
if (paintable)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
w = gdk_paintable_get_intrinsic_width (paintable);
|
||||
h = gdk_paintable_get_intrinsic_height (paintable);
|
||||
gtk_drag_source_set_icon (source, paintable, w, h);
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
}
|
||||
|
||||
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 void
|
||||
get_file (GValue *value,
|
||||
gpointer data)
|
||||
{
|
||||
const char *name;
|
||||
GtkIconInfo *info;
|
||||
GFile *file;
|
||||
|
||||
name = gtk_image_get_icon_name (GTK_IMAGE (data));
|
||||
|
||||
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, -1, 0);
|
||||
file = g_file_new_for_path (gtk_icon_info_get_filename (info));
|
||||
uris[0] = g_file_get_uri (file);
|
||||
uris[1] = NULL;
|
||||
|
||||
gtk_selection_data_set_uris (selection, uris);
|
||||
|
||||
g_free (uris[0]);
|
||||
g_object_unref (info);
|
||||
g_value_set_object (value, file);
|
||||
g_object_unref (file);
|
||||
g_object_unref (info);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_image_dnd (GtkWidget *image)
|
||||
{
|
||||
gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, GDK_ACTION_COPY);
|
||||
gtk_drag_source_add_image_targets (image);
|
||||
g_signal_connect (image, "drag-data-get", G_CALLBACK (get_image_data), NULL);
|
||||
GdkContentProvider *content;
|
||||
GtkDragSource *source;
|
||||
|
||||
source = gtk_drag_source_new ();
|
||||
content = gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
|
||||
gtk_drag_source_set_content (source, content);
|
||||
g_object_unref (content);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
}
|
||||
|
||||
static void
|
||||
setup_scalable_image_dnd (GtkWidget *image)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
GdkContentFormats *targets;
|
||||
GdkContentProvider *content;
|
||||
GtkDragSource *source;
|
||||
|
||||
parent = gtk_widget_get_parent (image);
|
||||
targets = gdk_content_formats_new (target_table, G_N_ELEMENTS (target_table));
|
||||
gtk_drag_source_set (parent, GDK_BUTTON1_MASK,
|
||||
targets,
|
||||
GDK_ACTION_COPY);
|
||||
gdk_content_formats_unref (targets);
|
||||
source = gtk_drag_source_new ();
|
||||
content = gdk_content_provider_new_with_callback (G_TYPE_FILE, get_file, image);
|
||||
gtk_drag_source_set_content (source, content);
|
||||
g_object_unref (content);
|
||||
|
||||
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_scalable_image_data), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -446,8 +453,7 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (win));
|
||||
|
||||
list = gdk_content_formats_new (NULL, 0);
|
||||
list = gtk_content_formats_add_text_targets (list);
|
||||
list = gdk_content_formats_new_for_gtype (G_TYPE_STRING);
|
||||
gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (win->list),
|
||||
GDK_BUTTON1_MASK,
|
||||
list,
|
||||
@@ -459,7 +465,6 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
setup_image_dnd (win->image3);
|
||||
setup_image_dnd (win->image4);
|
||||
setup_image_dnd (win->image5);
|
||||
setup_image_dnd (win->image6);
|
||||
setup_scalable_image_dnd (win->image6);
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, context_free);
|
||||
|
@@ -1053,27 +1053,6 @@ row_activated (GtkListBox *box, GtkListBoxRow *row)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
set_accel (GtkApplication *app, GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *accel_label;
|
||||
const gchar *action;
|
||||
gchar **accels;
|
||||
guint key;
|
||||
GdkModifierType mods;
|
||||
|
||||
accel_label = gtk_bin_get_child (GTK_BIN (widget));
|
||||
g_assert (GTK_IS_ACCEL_LABEL (accel_label));
|
||||
|
||||
action = gtk_actionable_get_action_name (GTK_ACTIONABLE (widget));
|
||||
accels = gtk_application_get_accels_for_action (app, action);
|
||||
|
||||
gtk_accelerator_parse (accels[0], &key, &mods);
|
||||
gtk_accel_label_set_accel (GTK_ACCEL_LABEL (accel_label), key, mods);
|
||||
|
||||
g_strfreev (accels);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkTextView tv;
|
||||
@@ -1663,6 +1642,7 @@ static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkBuilderScope *scope;
|
||||
GtkWindow *window;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *widget2;
|
||||
@@ -1715,21 +1695,25 @@ activate (GApplication *app)
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/org/gtk/WidgetFactory4/widget-factory.ui");
|
||||
gtk_builder_add_callback_symbol (builder, "on_entry_icon_release", (GCallback)on_entry_icon_release);
|
||||
gtk_builder_add_callback_symbol (builder, "on_scale_button_value_changed", (GCallback)on_scale_button_value_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_scale_button_query_tooltip", (GCallback)on_scale_button_query_tooltip);
|
||||
gtk_builder_add_callback_symbol (builder, "on_record_button_toggled", (GCallback)on_record_button_toggled);
|
||||
gtk_builder_add_callback_symbol (builder, "on_page_combo_changed", (GCallback)on_page_combo_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_range_from_changed", (GCallback)on_range_from_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "on_range_to_changed", (GCallback)on_range_to_changed);
|
||||
gtk_builder_add_callback_symbol (builder, "tab_close_cb", (GCallback)tab_close_cb);
|
||||
gtk_builder_add_callback_symbol (builder, "increase_icon_size", (GCallback)increase_icon_size);
|
||||
gtk_builder_add_callback_symbol (builder, "decrease_icon_size", (GCallback)decrease_icon_size);
|
||||
gtk_builder_add_callback_symbol (builder, "reset_icon_size", (GCallback)reset_icon_size);
|
||||
gtk_builder_add_callback_symbol (builder, "osd_frame_pressed", (GCallback)osd_frame_pressed);
|
||||
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
builder = gtk_builder_new ();
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
|
||||
"on_entry_icon_release", (GCallback)on_entry_icon_release,
|
||||
"on_scale_button_value_changed", (GCallback)on_scale_button_value_changed,
|
||||
"on_scale_button_query_tooltip", (GCallback)on_scale_button_query_tooltip,
|
||||
"on_record_button_toggled", (GCallback)on_record_button_toggled,
|
||||
"on_page_combo_changed", (GCallback)on_page_combo_changed,
|
||||
"on_range_from_changed", (GCallback)on_range_from_changed,
|
||||
"on_range_to_changed", (GCallback)on_range_to_changed,
|
||||
"tab_close_cb", (GCallback)tab_close_cb,
|
||||
"increase_icon_size", (GCallback)increase_icon_size,
|
||||
"decrease_icon_size", (GCallback)decrease_icon_size,
|
||||
"reset_icon_size", (GCallback)reset_icon_size,
|
||||
"osd_frame_pressed", (GCallback)osd_frame_pressed,
|
||||
NULL);
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
g_object_unref (scope);
|
||||
gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", NULL);
|
||||
|
||||
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
|
||||
gtk_application_add_window (GTK_APPLICATION (app), window);
|
||||
@@ -1858,13 +1842,6 @@ activate (GApplication *app)
|
||||
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
||||
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
|
||||
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "searchmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "darkmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "aboutmenuitem")));
|
||||
set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "bgmenuitem")));
|
||||
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton1");
|
||||
|
@@ -598,10 +598,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="active">1</property>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -666,8 +662,8 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="active">1</property>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
@@ -740,7 +736,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="active">1</property>
|
||||
<layout>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
@@ -971,11 +966,11 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
<property name="restrict-to-fill-level">0</property>
|
||||
<marks>
|
||||
<mark value="0" position="bottom"/>
|
||||
<mark value="1" position="bottom"/>
|
||||
<mark value="2" position="bottom"/>
|
||||
<mark value="3" position="bottom"/>
|
||||
<mark value="4" position="bottom"/>
|
||||
<mark value="0" position="bottom"></mark>
|
||||
<mark value="1" position="bottom"></mark>
|
||||
<mark value="2" position="bottom"></mark>
|
||||
<mark value="3" position="bottom"></mark>
|
||||
<mark value="4" position="bottom"></mark>
|
||||
</marks>
|
||||
</object>
|
||||
</child>
|
||||
@@ -1575,7 +1570,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="icon-name">org.gtk.WidgetFactory4</property>
|
||||
<property name="pixel-size">256</property>
|
||||
<style>
|
||||
<class name="icon-dropshadow" />
|
||||
<class name="icon-dropshadow"/>
|
||||
</style>
|
||||
</object>
|
||||
</property>
|
||||
@@ -1819,261 +1814,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="menu-model">menu_bar_model</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuBar">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem1">
|
||||
<property name="label" translatable="yes">File</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu1">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem101">
|
||||
<property name="label" translatable="yes">_New</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem102">
|
||||
<property name="label" translatable="yes">_Open</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem103">
|
||||
<property name="label" translatable="yes">_Save</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem104">
|
||||
<property name="label" translatable="yes">Save _As</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem" id="separatormenuitem1"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="quitmenuitem">
|
||||
<property name="label" translatable="yes">_Quit</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">app.quit</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem2">
|
||||
<property name="label" translatable="yes">Edit</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu2">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem106">
|
||||
<property name="label" translatable="yes">Cu_t</property>
|
||||
<property name="can-focus">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem107">
|
||||
<property name="label" translatable="yes">_Copy</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem108">
|
||||
<property name="label" translatable="yes">_Paste</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="deletemenuitem">
|
||||
<property name="label" translatable="yes">_Delete</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.delete</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="searchmenuitem">
|
||||
<property name="label" translatable="yes">_Search</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.search</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="checksmenuitem">
|
||||
<property name="label">_Checks</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="checkssubmenu">
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="checkmenuitem1">
|
||||
<property name="label">_Check</property>
|
||||
<property name="active">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="checkmenuitem2">
|
||||
<property name="label">_Check</property>
|
||||
<property name="active">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="checkmenuitem3">
|
||||
<property name="label">_Check</property>
|
||||
<property name="inconsistent">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="checkmenuitem4">
|
||||
<property name="label">_Check</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="checkmenuitem5">
|
||||
<property name="label">_Check</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="checkmenuitem6">
|
||||
<property name="label">_Check</property>
|
||||
<property name="inconsistent">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="radiosmenuitem">
|
||||
<property name="label">_Radios</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="radiossubmenu">
|
||||
<child>
|
||||
<object class="GtkRadioMenuItem" id="radiomenuitem1">
|
||||
<property name="label">_Radio</property>
|
||||
<property name="active">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioMenuItem" id="radiomenuitem2">
|
||||
<property name="label">_Radio</property>
|
||||
<property name="active">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioMenuItem" id="radiomenuitem3">
|
||||
<property name="label">_Radio</property>
|
||||
<property name="inconsistent">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioMenuItem" id="radiomenuitem4">
|
||||
<property name="label">_Radio</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioMenuItem" id="radiomenuitem5">
|
||||
<property name="label">_Radio</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioMenuItem" id="radiomenuitem6">
|
||||
<property name="label">_Radio</property>
|
||||
<property name="inconsistent">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="use-underline">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
FOO
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem3">
|
||||
<property name="label" translatable="yes">View</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="view-menu">
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="darkmenuitem">
|
||||
<property name="label">_Dark theme</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.dark</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="toolbarmenuitem">
|
||||
<property name="label">_Toolbar</property>
|
||||
<property name="active">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.toolbar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckMenuItem" id="statusbarmenuitem">
|
||||
<property name="label">_Statusbar</property>
|
||||
<property name="active">1</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.statusbar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="bgmenuitem">
|
||||
<property name="label">_Select Background</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">win.background</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem4">
|
||||
<property name="label" translatable="yes">Help</property>
|
||||
<property name="use-underline">1</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu3">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="aboutmenuitem">
|
||||
<property name="label" translatable="yes">_About</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="action-name">app.about</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar" id="toolbar">
|
||||
<child>
|
||||
@@ -2134,13 +1874,10 @@ FOO
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
</object>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="shadow-type">none</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="MyTextView" id="text3">
|
||||
@@ -2155,9 +1892,7 @@ FOO
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
</object>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="statusbar"/>
|
||||
@@ -2449,11 +2184,9 @@ FOO
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="halign">fill</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="lockbox">
|
||||
<property name="halign">fill</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
@@ -2530,9 +2263,6 @@ FOO
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">view-more-symbolic</property>
|
||||
<property name="popover">new_style_menu</property>
|
||||
<!--
|
||||
<property name="menu-model">new_style_menu_model</property>
|
||||
-->
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -3367,10 +3097,6 @@ bad things might happen.</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="open_popover_entry"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3382,7 +3108,6 @@ bad things might happen.</property>
|
||||
<relation type="label-for" target="open_popover_textview"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
@@ -3417,7 +3142,6 @@ bad things might happen.</property>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="column-span">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
@@ -3456,7 +3180,6 @@ bad things might happen.</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="open_popover_button">
|
||||
<property name="halign">fill</property>
|
||||
<property name="label">_Open</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
@@ -3505,7 +3228,7 @@ bad things might happen.</property>
|
||||
<property name="autohide">0</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">You're in too deep!</property>
|
||||
<property name="label">You're in too deep!</property>
|
||||
<accessibility>
|
||||
<role type="static"/>
|
||||
</accessibility>
|
||||
@@ -3516,7 +3239,6 @@ bad things might happen.</property>
|
||||
<property name="autohide">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Hidden gems:</property>
|
||||
@@ -3536,219 +3258,246 @@ bad things might happen.</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopoverMenu" id="new_style_menu">
|
||||
<object class="GtkPopover" id="new_style_menu">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="name">main</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<object class="GtkStack">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="halign">fill</property>
|
||||
<style>
|
||||
<class name="circular-buttons"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">printer-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.print</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">main</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="circular-buttons"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon">
|
||||
<object class="GThemedIcon">
|
||||
<property name="name">printer-symbolic</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.print</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon">
|
||||
<object class="GThemedIcon">
|
||||
<property name="name">emblem-shared-symbolic</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.share</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Open in New Window</property>
|
||||
<property name="action-name">app.open-in</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="inline-buttons"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkLabel" id="cut_copy_paste_filler"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Edit</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon">
|
||||
<object class="GThemedIcon">
|
||||
<property name="name">edit-cut-symbolic</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="iconic">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon">
|
||||
<object class="GThemedIcon">
|
||||
<property name="name">edit-copy-symbolic</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="iconic">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon">
|
||||
<object class="GThemedIcon">
|
||||
<property name="name">edit-paste-symbolic</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="iconic">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Pin</property>
|
||||
<property name="action-name">app.pin</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Select Labels…</property>
|
||||
<property name="action-name">app.labels</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Share…</property>
|
||||
<property name="action-name">app.share</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Basement</property>
|
||||
<property name="menu-name">basement</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Large</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'large'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Medium</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'medium'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Small</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'small'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Move to Trash</property>
|
||||
<property name="action-name">win.delete</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">emblem-shared-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.share</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">basement</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Basement</property>
|
||||
<property name="role">title</property>
|
||||
<property name="menu-name">main</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Berk</property>
|
||||
<property name="action-name">app.berk</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Broni</property>
|
||||
<property name="action-name">app.broni</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Drutt</property>
|
||||
<property name="action-name">app.drutt</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">The Thing Upstairs</property>
|
||||
<property name="action-name">app.upstairs</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Open in New Window</property>
|
||||
<property name="action-name">app.open-in</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="inline-buttons"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkLabel" id="cut_copy_paste_filler">
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Edit</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">edit-cut-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">edit-copy-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="icon"><object class="GThemedIcon"><property name="name">edit-paste-symbolic</property></object></property>
|
||||
<property name="iconic">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Pin</property>
|
||||
<property name="action-name">app.pin</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Select Labels…</property>
|
||||
<property name="action-name">app.labels</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Share…</property>
|
||||
<property name="action-name">app.share</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Basement</property>
|
||||
<property name="menu-name">basement</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Large</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'large'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Medium</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'medium'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Small</property>
|
||||
<property name="action-name">app.size</property>
|
||||
<property name="action-target">'small'</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Move to Trash</property>
|
||||
<property name="action-name">win.delete</property>
|
||||
<property name="indicator-size-group">main-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="name">basement</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Basement</property>
|
||||
<property name="role">title</property>
|
||||
<property name="menu-name">main</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Berk</property>
|
||||
<property name="action-name">app.berk</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Broni</property>
|
||||
<property name="action-name">app.broni</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">Drutt</property>
|
||||
<property name="action-name">app.drutt</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="text">The Thing Upstairs</property>
|
||||
<property name="action-name">app.upstairs</property>
|
||||
<property name="indicator-size-group">basement-indicators</property>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkSizeGroup" id="main-indicators">
|
||||
<property name="mode">horizontal</property>
|
||||
<widgets>
|
||||
<widget name="cut_copy_paste_filler"/>
|
||||
</widgets>
|
||||
</object>
|
||||
<object class="GtkSizeGroup" id="basement-indicators">
|
||||
<property name="mode">horizontal</property>
|
||||
</object>
|
||||
<object class="GtkSizeGroup" id="basement-indicators"/>
|
||||
<menu id="new_style_menu_model">
|
||||
<section>
|
||||
<attribute name="display-hint">circular-buttons</attribute>
|
||||
@@ -3838,10 +3587,10 @@ bad things might happen.</property>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Move to Trash</attribute>
|
||||
<attribute name="action">win.delete</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Move to Trash</attribute>
|
||||
<attribute name="action">win.delete</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="new_style_context_menu_model">
|
||||
@@ -4032,14 +3781,13 @@ bad things might happen.</property>
|
||||
<attribute name="action">win.background</attribute>
|
||||
</item>
|
||||
</section>
|
||||
|
||||
</submenu>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">_Help</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">About</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">About</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</submenu>
|
||||
</menu>
|
||||
</interface>
|
||||
|
@@ -192,8 +192,8 @@ gdk_surface_is_destroyed
|
||||
gdk_surface_is_visible
|
||||
gdk_surface_is_viewable
|
||||
gdk_surface_get_state
|
||||
gdk_surface_iconify
|
||||
gdk_surface_deiconify
|
||||
gdk_surface_minimize
|
||||
gdk_surface_unminimize
|
||||
gdk_surface_stick
|
||||
gdk_surface_unstick
|
||||
gdk_surface_maximize
|
||||
@@ -544,8 +544,6 @@ GdkSeatCapabilities
|
||||
GdkGrabStatus
|
||||
GdkSeatGrabPrepareFunc
|
||||
gdk_seat_get_display
|
||||
gdk_seat_grab
|
||||
gdk_seat_ungrab
|
||||
gdk_seat_get_capabilities
|
||||
gdk_seat_get_pointer
|
||||
gdk_seat_get_keyboard
|
||||
@@ -789,8 +787,6 @@ gdk_drop_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>gdk/gdkx.h</INCLUDE>
|
||||
<TITLE>X Window System Interaction</TITLE>
|
||||
<FILE>x_interaction</FILE>
|
||||
GDK_SURFACE_XID
|
||||
GDK_DISPLAY_XDISPLAY
|
||||
@@ -941,8 +937,6 @@ gdk_surface_impl_x11_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>gdk/gdkwayland.h</INCLUDE>
|
||||
<TITLE>Wayland Interaction</TITLE>
|
||||
<FILE>wayland_interaction</FILE>
|
||||
gdk_wayland_seat_get_wl_seat
|
||||
gdk_wayland_device_get_wl_keyboard
|
||||
|
@@ -30,6 +30,7 @@ GskRenderNodeType
|
||||
gsk_render_node_get_node_type
|
||||
gsk_render_node_draw
|
||||
GskSerializationError
|
||||
GskParseErrorFunc
|
||||
gsk_render_node_serialize
|
||||
gsk_render_node_deserialize
|
||||
gsk_render_node_write_to_file
|
||||
|
@@ -314,8 +314,8 @@
|
||||
be connected to an action just by setting the ::action-name
|
||||
property. If the action has a parameter, you will also need
|
||||
to set the ::action-target property.
|
||||
Widgets that implement GtkAction include GtkSwitch, GtkButton,
|
||||
GtkMenuItem and their respective subclasses.
|
||||
Widgets that implement GtkActionable include GtkSwitch, GtkButton,
|
||||
and their respective subclasses.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@@ -49,12 +49,16 @@
|
||||
<xi:include href="xml/gtkmaplistmodel.xml" />
|
||||
<xi:include href="xml/gtkslicelistmodel.xml" />
|
||||
<xi:include href="xml/gtksortlistmodel.xml" />
|
||||
<xi:include href="xml/gtktreelistmodel.xml" />
|
||||
<xi:include href="xml/gtkselectionmodel.xml" />
|
||||
<xi:include href="xml/gtknoselection.xml" />
|
||||
<xi:include href="xml/gtksingleselection.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="Trees">
|
||||
<xi:include href="xml/gtktreelistrow.xml" />
|
||||
<xi:include href="xml/gtktreelistmodel.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="Application">
|
||||
<title>Application support</title>
|
||||
<xi:include href="xml/gtkapplication.xml" />
|
||||
@@ -66,11 +70,13 @@
|
||||
<title>Interface builder</title>
|
||||
<xi:include href="xml/gtkbuilder.xml" />
|
||||
<xi:include href="xml/gtkbuildable.xml" />
|
||||
<xi:include href="xml/gtkbuilderscope.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="WindowWidgets">
|
||||
<title>Windows</title>
|
||||
<xi:include href="xml/gtkroot.xml" />
|
||||
<xi:include href="xml/gtknative.xml" />
|
||||
<xi:include href="xml/gtkwindow.xml" />
|
||||
<xi:include href="xml/gtkdialog.xml" />
|
||||
<xi:include href="xml/gtkmessagedialog.xml" />
|
||||
@@ -149,7 +155,6 @@
|
||||
<xi:include href="xml/gtkscalebutton.xml" />
|
||||
<xi:include href="xml/gtkvolumebutton.xml" />
|
||||
<xi:include href="xml/gtklockbutton.xml" />
|
||||
<xi:include href="xml/gtkmodelbutton.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="NumericEntry">
|
||||
@@ -212,12 +217,6 @@
|
||||
<title>Menus, Combo Box, Toolbar</title>
|
||||
<xi:include href="xml/gtkcombobox.xml" />
|
||||
<xi:include href="xml/gtkcomboboxtext.xml" />
|
||||
<xi:include href="xml/gtkmenu.xml" />
|
||||
<xi:include href="xml/gtkmenubar.xml" />
|
||||
<xi:include href="xml/gtkmenuitem.xml" />
|
||||
<xi:include href="xml/gtkradiomenuitem.xml" />
|
||||
<xi:include href="xml/gtkcheckmenuitem.xml" />
|
||||
<xi:include href="xml/gtkseparatormenuitem.xml" />
|
||||
<xi:include href="xml/gtktoolshell.xml" />
|
||||
<xi:include href="xml/gtktoolbar.xml" />
|
||||
<xi:include href="xml/gtktoolitem.xml" />
|
||||
@@ -306,7 +305,6 @@
|
||||
<xi:include href="xml/gtkwidget.xml" />
|
||||
<xi:include href="xml/gtkcontainer.xml" />
|
||||
<xi:include href="xml/gtkbin.xml" />
|
||||
<xi:include href="xml/gtkmenushell.xml" />
|
||||
<xi:include href="xml/gtkrange.xml" />
|
||||
<xi:include href="xml/gtkimcontext.xml" />
|
||||
<xi:include href="xml/gtknativedialog.xml" />
|
||||
@@ -346,6 +344,13 @@
|
||||
<xi:include href="xml/gtkpadcontroller.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
<title>Data exchange, clipboards and Drag-and-Drop</title>
|
||||
<xi:include href="xml/gtkdragsource.xml"/>
|
||||
<xi:include href="xml/gtkdragicon.xml"/>
|
||||
<xi:include href="xml/gtkdroptarget.xml"/>
|
||||
</chapter>
|
||||
|
||||
</part>
|
||||
|
||||
<part id="gtkbase">
|
||||
@@ -354,7 +359,6 @@
|
||||
<xi:include href="xml/gtkfeatures.xml" />
|
||||
<xi:include href="xml/gtkaccelgroup.xml" />
|
||||
<xi:include href="xml/gtkaccelmap.xml" />
|
||||
<xi:include href="xml/gtkdnd.xml" />
|
||||
<xi:include href="xml/gtksettings.xml" />
|
||||
<xi:include href="xml/gtkbindings.xml" />
|
||||
<xi:include href="xml/gtkenums.xml" />
|
||||
|
@@ -213,7 +213,6 @@ gtk_adjustment_get_type
|
||||
<TITLE>GtkAssistant</TITLE>
|
||||
GtkAssistant
|
||||
GtkAssistantPage
|
||||
GtkAssistantClass
|
||||
gtk_assistant_new
|
||||
gtk_assistant_get_page
|
||||
gtk_assistant_get_pages
|
||||
@@ -258,7 +257,6 @@ gtk_assistant_get_type
|
||||
<FILE>gtkaspectframe</FILE>
|
||||
<TITLE>GtkAspectFrame</TITLE>
|
||||
GtkAspectFrame
|
||||
GtkAspectFrameClass
|
||||
gtk_aspect_frame_new
|
||||
gtk_aspect_frame_set
|
||||
<SUBSECTION Standard>
|
||||
@@ -369,7 +367,6 @@ gtk_center_layout_get_type
|
||||
<FILE>gtklistbox</FILE>
|
||||
<TITLE>GtkListBox</TITLE>
|
||||
GtkListBox
|
||||
GtkListBoxClass
|
||||
GtkListBoxRow
|
||||
GtkListBoxRowClass
|
||||
GtkListBoxFilterFunc
|
||||
@@ -516,19 +513,41 @@ GTK_BUILDABLE_CLASS
|
||||
GTK_BUILDABLE_GET_IFACE
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkbuilderscope</FILE>
|
||||
<TITLE>GtkBuilderScope</TITLE>
|
||||
gtk_builder_cscope_new
|
||||
gtk_builder_cscope_add_callback_symbol
|
||||
gtk_builder_cscope_add_callback_symbols
|
||||
gtk_builder_cscope_lookup_callback_symbol
|
||||
<SUBSECTION Standard>
|
||||
GTK_BUILDER_SCOPE
|
||||
GTK_IS_BUILDER_SCOPE
|
||||
GTK_TYPE_BUILDER_SCOPE
|
||||
GTK_BUILDER_SCOPE_INTERFACE
|
||||
GTK_IS_BUILDER_SCOPE_INTERFACE
|
||||
GTK_BUILDER_SCOPE_GET_INTERFACE
|
||||
GTK_BUILDER_CSCOPE
|
||||
GTK_IS_BUILDER_CSCOPE
|
||||
GTK_TYPE_BUILDER_CSCOPE
|
||||
GTK_BUILDER_CSCOPE_CLASS
|
||||
GTK_IS_BUILDER_CSCOPE_CLASS
|
||||
GTK_BUILDER_CSCOPE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_builder_scope_get_type
|
||||
gtk_builder_cscope_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkbuilder</FILE>
|
||||
<TITLE>GtkBuilder</TITLE>
|
||||
GtkBuilder
|
||||
GtkBuilderConnectFunc
|
||||
GtkBuilderError
|
||||
gtk_builder_new
|
||||
gtk_builder_new_from_file
|
||||
gtk_builder_new_from_resource
|
||||
gtk_builder_new_from_string
|
||||
gtk_builder_add_callback_symbol
|
||||
gtk_builder_add_callback_symbols
|
||||
gtk_builder_lookup_callback_symbol
|
||||
gtk_builder_create_closure
|
||||
gtk_builder_add_from_file
|
||||
gtk_builder_add_from_resource
|
||||
gtk_builder_add_from_string
|
||||
@@ -539,12 +558,12 @@ gtk_builder_extend_with_template
|
||||
gtk_builder_get_object
|
||||
gtk_builder_get_objects
|
||||
gtk_builder_expose_object
|
||||
gtk_builder_connect_signals
|
||||
gtk_builder_connect_signals_full
|
||||
gtk_builder_set_current_object
|
||||
gtk_builder_get_current_object
|
||||
gtk_builder_set_scope
|
||||
gtk_builder_get_scope
|
||||
gtk_builder_set_translation_domain
|
||||
gtk_builder_get_translation_domain
|
||||
gtk_builder_set_application
|
||||
gtk_builder_get_application
|
||||
gtk_builder_get_type_from_name
|
||||
gtk_builder_value_from_string
|
||||
gtk_builder_value_from_string_type
|
||||
@@ -561,7 +580,6 @@ GTK_BUILDER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_builder_get_type
|
||||
gtk_builder_error_quark
|
||||
GtkBuilderPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -656,34 +674,6 @@ GTK_CHECK_BUTTON_GET_CLASS
|
||||
gtk_check_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkcheckmenuitem</FILE>
|
||||
GtkCheckMenuItem
|
||||
GtkCheckMenuItemClass
|
||||
<TITLE>GtkCheckMenuItem</TITLE>
|
||||
gtk_check_menu_item_new
|
||||
gtk_check_menu_item_new_with_label
|
||||
gtk_check_menu_item_new_with_mnemonic
|
||||
gtk_check_menu_item_get_active
|
||||
gtk_check_menu_item_set_active
|
||||
gtk_check_menu_item_toggled
|
||||
gtk_check_menu_item_get_inconsistent
|
||||
gtk_check_menu_item_set_inconsistent
|
||||
gtk_check_menu_item_set_draw_as_radio
|
||||
gtk_check_menu_item_get_draw_as_radio
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CHECK_MENU_ITEM
|
||||
GTK_IS_CHECK_MENU_ITEM
|
||||
GTK_TYPE_CHECK_MENU_ITEM
|
||||
GTK_CHECK_MENU_ITEM_CLASS
|
||||
GTK_IS_CHECK_MENU_ITEM_CLASS
|
||||
GTK_CHECK_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkCheckMenuItemPrivate
|
||||
gtk_check_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkcolorbutton</FILE>
|
||||
<TITLE>GtkColorButton</TITLE>
|
||||
@@ -1111,7 +1101,6 @@ gtk_entry_completion_get_type
|
||||
<FILE>gtkexpander</FILE>
|
||||
<TITLE>GtkExpander</TITLE>
|
||||
GtkExpander
|
||||
GtkExpanderClass
|
||||
gtk_expander_new
|
||||
gtk_expander_new_with_mnemonic
|
||||
gtk_expander_set_expanded
|
||||
@@ -1258,7 +1247,6 @@ GtkFileChooserDialogPrivate
|
||||
<FILE>gtkfilechooserwidget</FILE>
|
||||
<TITLE>GtkFileChooserWidget</TITLE>
|
||||
GtkFileChooserWidget
|
||||
GtkFileChooserWidgetClass
|
||||
gtk_file_chooser_widget_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_FILE_CHOOSER_WIDGET
|
||||
@@ -1276,7 +1264,6 @@ GtkFileChooserWidgetPrivate
|
||||
<FILE>gtkfilechooserbutton</FILE>
|
||||
<TITLE>GtkFileChooserButton</TITLE>
|
||||
GtkFileChooserButton
|
||||
GtkFileChooserButtonClass
|
||||
gtk_file_chooser_button_new
|
||||
gtk_file_chooser_button_new_with_dialog
|
||||
gtk_file_chooser_button_get_title
|
||||
@@ -1452,7 +1439,6 @@ gtk_font_chooser_get_type
|
||||
<FILE>gtkfontchooserwidget</FILE>
|
||||
<TITLE>GtkFontChooserWidget</TITLE>
|
||||
GtkFontChooserWidget
|
||||
GtkFontChooserWidgetClass
|
||||
gtk_font_chooser_widget_new
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -1472,7 +1458,6 @@ gtk_font_chooser_widget_get_type
|
||||
<FILE>gtkfontchooserdialog</FILE>
|
||||
<TITLE>GtkFontChooserDialog</TITLE>
|
||||
GtkFontChooserDialog
|
||||
GtkFontChooserDialogClass
|
||||
gtk_font_chooser_dialog_new
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -1777,7 +1762,6 @@ GtkLabelSelectionInfo
|
||||
<FILE>gtklinkbutton</FILE>
|
||||
<TITLE>GtkLinkButton</TITLE>
|
||||
GtkLinkButton
|
||||
GtkLinkButtonClass
|
||||
gtk_link_button_new
|
||||
gtk_link_button_new_with_label
|
||||
gtk_link_button_get_uri
|
||||
@@ -1818,80 +1802,15 @@ GTK_MAP_LIST_MODEL_GET_CLASS
|
||||
gtk_map_list_model_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmenu</FILE>
|
||||
<TITLE>GtkMenu</TITLE>
|
||||
GtkMenu
|
||||
gtk_menu_new
|
||||
gtk_menu_new_from_model
|
||||
GtkPopoverMenuFlags
|
||||
gtk_menu_new_from_model_full
|
||||
gtk_menu_reorder_child
|
||||
gtk_menu_popup_at_rect
|
||||
gtk_menu_popup_at_widget
|
||||
gtk_menu_popup_at_pointer
|
||||
gtk_menu_set_accel_group
|
||||
gtk_menu_get_accel_group
|
||||
gtk_menu_set_accel_path
|
||||
gtk_menu_get_accel_path
|
||||
gtk_menu_set_monitor
|
||||
gtk_menu_get_monitor
|
||||
gtk_menu_place_on_monitor
|
||||
gtk_menu_set_reserve_toggle_size
|
||||
gtk_menu_get_reserve_toggle_size
|
||||
<SUBSECTION>
|
||||
gtk_menu_popdown
|
||||
gtk_menu_reposition
|
||||
gtk_menu_get_active
|
||||
gtk_menu_set_active
|
||||
gtk_menu_attach_to_widget
|
||||
gtk_menu_detach
|
||||
gtk_menu_get_attach_widget
|
||||
gtk_menu_get_for_attach_widget
|
||||
GtkMenuDetachFunc
|
||||
<SUBSECTION Standard>
|
||||
GTK_MENU
|
||||
GTK_IS_MENU
|
||||
GTK_TYPE_MENU
|
||||
GTK_MENU_CLASS
|
||||
GTK_IS_MENU_CLASS
|
||||
GTK_MENU_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuPrivate
|
||||
gtk_menu_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmenubar</FILE>
|
||||
<TITLE>GtkMenuBar</TITLE>
|
||||
GtkMenuBar
|
||||
gtk_menu_bar_new
|
||||
gtk_menu_bar_new_from_model
|
||||
<SUBSECTION Standard>
|
||||
GTK_MENU_BAR
|
||||
GTK_IS_MENU_BAR
|
||||
GTK_TYPE_MENU_BAR
|
||||
GTK_MENU_BAR_CLASS
|
||||
GTK_IS_MENU_BAR_CLASS
|
||||
GTK_MENU_BAR_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuBarPrivate
|
||||
gtk_menu_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmenubutton</FILE>
|
||||
<TITLE>GtkMenuButton</TITLE>
|
||||
GtkMenuButton
|
||||
gtk_menu_button_new
|
||||
gtk_menu_button_set_popup
|
||||
gtk_menu_button_get_popup
|
||||
gtk_menu_button_set_popover
|
||||
gtk_menu_button_get_popover
|
||||
gtk_menu_button_set_menu_model
|
||||
gtk_menu_button_get_menu_model
|
||||
gtk_menu_button_set_use_popover
|
||||
gtk_menu_button_get_use_popover
|
||||
GtkArrowType
|
||||
gtk_menu_button_set_direction
|
||||
gtk_menu_button_get_direction
|
||||
@@ -1905,6 +1824,7 @@ gtk_menu_button_set_relief
|
||||
gtk_menu_button_get_relief
|
||||
gtk_menu_button_popup
|
||||
gtk_menu_button_popdown
|
||||
GtkMenuButtonCreatePopupFunc
|
||||
gtk_menu_button_set_create_popup_func
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MENU_BUTTON
|
||||
@@ -1918,72 +1838,6 @@ GtkMenuButtonPrivate
|
||||
gtk_menu_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmenuitem</FILE>
|
||||
<TITLE>GtkMenuItem</TITLE>
|
||||
GtkMenuItem
|
||||
GtkMenuItemClass
|
||||
gtk_menu_item_new
|
||||
gtk_menu_item_new_with_label
|
||||
gtk_menu_item_new_with_mnemonic
|
||||
gtk_menu_item_get_label
|
||||
gtk_menu_item_set_label
|
||||
gtk_menu_item_get_use_underline
|
||||
gtk_menu_item_set_use_underline
|
||||
gtk_menu_item_set_submenu
|
||||
gtk_menu_item_get_submenu
|
||||
gtk_menu_item_set_accel_path
|
||||
gtk_menu_item_get_accel_path
|
||||
gtk_menu_item_select
|
||||
gtk_menu_item_deselect
|
||||
gtk_menu_item_activate
|
||||
gtk_menu_item_toggle_size_request
|
||||
gtk_menu_item_toggle_size_allocate
|
||||
gtk_menu_item_get_reserve_indicator
|
||||
gtk_menu_item_set_reserve_indicator
|
||||
<SUBSECTION Standard>
|
||||
GTK_MENU_ITEM
|
||||
GTK_IS_MENU_ITEM
|
||||
GTK_TYPE_MENU_ITEM
|
||||
GTK_MENU_ITEM_CLASS
|
||||
GTK_IS_MENU_ITEM_CLASS
|
||||
GTK_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuItemPrivate
|
||||
gtk_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmenushell</FILE>
|
||||
<TITLE>GtkMenuShell</TITLE>
|
||||
GtkMenuShell
|
||||
gtk_menu_shell_append
|
||||
gtk_menu_shell_prepend
|
||||
gtk_menu_shell_insert
|
||||
gtk_menu_shell_deactivate
|
||||
gtk_menu_shell_select_item
|
||||
gtk_menu_shell_select_first
|
||||
gtk_menu_shell_deselect
|
||||
gtk_menu_shell_activate_item
|
||||
gtk_menu_shell_cancel
|
||||
gtk_menu_shell_set_take_focus
|
||||
gtk_menu_shell_get_take_focus
|
||||
gtk_menu_shell_get_selected_item
|
||||
gtk_menu_shell_get_parent_shell
|
||||
gtk_menu_shell_bind_model
|
||||
GtkMenuDirectionType
|
||||
<SUBSECTION Standard>
|
||||
GTK_MENU_SHELL
|
||||
GTK_IS_MENU_SHELL
|
||||
GTK_TYPE_MENU_SHELL
|
||||
GTK_MENU_SHELL_CLASS
|
||||
GTK_IS_MENU_SHELL_CLASS
|
||||
GTK_MENU_SHELL_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuShellPrivate
|
||||
gtk_menu_shell_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmessagedialog</FILE>
|
||||
<TITLE>GtkMessageDialog</TITLE>
|
||||
@@ -2246,31 +2100,6 @@ GtkRadioButtonPrivate
|
||||
gtk_radio_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkradiomenuitem</FILE>
|
||||
<TITLE>GtkRadioMenuItem</TITLE>
|
||||
GtkRadioMenuItem
|
||||
gtk_radio_menu_item_new
|
||||
gtk_radio_menu_item_new_with_label
|
||||
gtk_radio_menu_item_new_with_mnemonic
|
||||
gtk_radio_menu_item_new_from_widget
|
||||
gtk_radio_menu_item_new_with_label_from_widget
|
||||
gtk_radio_menu_item_new_with_mnemonic_from_widget
|
||||
gtk_radio_menu_item_set_group
|
||||
gtk_radio_menu_item_get_group
|
||||
gtk_radio_menu_item_join_group
|
||||
<SUBSECTION Standard>
|
||||
GTK_RADIO_MENU_ITEM
|
||||
GTK_IS_RADIO_MENU_ITEM
|
||||
GTK_TYPE_RADIO_MENU_ITEM
|
||||
GTK_RADIO_MENU_ITEM_CLASS
|
||||
GTK_IS_RADIO_MENU_ITEM_CLASS
|
||||
GTK_RADIO_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkRadioMenuItemPrivate
|
||||
gtk_radio_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkrange</FILE>
|
||||
<TITLE>GtkRange</TITLE>
|
||||
@@ -2472,7 +2301,6 @@ gtk_scrollbar_get_type
|
||||
<FILE>gtkscrolledwindow</FILE>
|
||||
<TITLE>GtkScrolledWindow</TITLE>
|
||||
GtkScrolledWindow
|
||||
GtkScrolledWindowClass
|
||||
gtk_scrolled_window_new
|
||||
gtk_scrolled_window_get_hadjustment
|
||||
gtk_scrolled_window_set_hadjustment
|
||||
@@ -2524,7 +2352,6 @@ GtkScrolledWindowPrivate
|
||||
<FILE>gtksearchbar</FILE>
|
||||
<TITLE>GtkSearchBar</TITLE>
|
||||
GtkSearchBar
|
||||
GtkSearchBarClass
|
||||
gtk_search_bar_new
|
||||
gtk_search_bar_connect_entry
|
||||
gtk_search_bar_get_search_mode
|
||||
@@ -2579,23 +2406,6 @@ gtk_separator_get_type
|
||||
GtkSeparatorPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkseparatormenuitem</FILE>
|
||||
<TITLE>GtkSeparatorMenuItem</TITLE>
|
||||
GtkSeparatorMenuItem
|
||||
GtkSeparatorMenuItemClass
|
||||
gtk_separator_menu_item_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_SEPARATOR_MENU_ITEM
|
||||
GTK_SEPARATOR_MENU_ITEM_CLASS
|
||||
GTK_SEPARATOR_MENU_ITEM_GET_CLASS
|
||||
GTK_IS_SEPARATOR_MENU_ITEM
|
||||
GTK_IS_SEPARATOR_MENU_ITEM_CLASS
|
||||
GTK_TYPE_SEPARATOR_MENU_ITEM
|
||||
<SUBSECTION Private>
|
||||
gtk_separator_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtksettings</FILE>
|
||||
<TITLE>GtkSettings</TITLE>
|
||||
@@ -2603,11 +2413,6 @@ GtkSettings
|
||||
GtkSettingsValue
|
||||
gtk_settings_get_default
|
||||
gtk_settings_get_for_display
|
||||
gtk_rc_property_parse_color
|
||||
gtk_rc_property_parse_enum
|
||||
gtk_rc_property_parse_flags
|
||||
gtk_rc_property_parse_requisition
|
||||
gtk_rc_property_parse_border
|
||||
gtk_settings_reset_property
|
||||
<SUBSECTION Standard>
|
||||
GtkSettingsClass
|
||||
@@ -3097,8 +2902,6 @@ gtk_text_view_get_iter_at_location
|
||||
gtk_text_view_get_iter_at_position
|
||||
gtk_text_view_buffer_to_window_coords
|
||||
gtk_text_view_window_to_buffer_coords
|
||||
gtk_text_view_set_border_window_size
|
||||
gtk_text_view_get_border_window_size
|
||||
gtk_text_view_forward_display_line
|
||||
gtk_text_view_backward_display_line
|
||||
gtk_text_view_forward_display_line_end
|
||||
@@ -3277,9 +3080,8 @@ gtk_tool_item_get_orientation
|
||||
gtk_tool_item_get_toolbar_style
|
||||
gtk_tool_item_get_text_alignment
|
||||
gtk_tool_item_get_text_orientation
|
||||
gtk_tool_item_retrieve_proxy_menu_item
|
||||
gtk_tool_item_get_proxy_menu_item
|
||||
gtk_tool_item_set_proxy_menu_item
|
||||
gtk_tool_item_set_overflow_text
|
||||
gtk_tool_item_get_overflow_text
|
||||
gtk_tool_item_rebuild_menu
|
||||
gtk_tool_item_toolbar_reconfigured
|
||||
gtk_tool_item_get_text_size_group
|
||||
@@ -3301,7 +3103,6 @@ GtkToolItemPrivate
|
||||
<FILE>gtkseparatortoolitem</FILE>
|
||||
<TITLE>GtkSeparatorToolItem</TITLE>
|
||||
GtkSeparatorToolItem
|
||||
GtkSeparatorToolItemClass
|
||||
gtk_separator_tool_item_new
|
||||
gtk_separator_tool_item_set_draw
|
||||
gtk_separator_tool_item_get_draw
|
||||
@@ -3353,10 +3154,9 @@ GtkToolButtonPrivate
|
||||
<FILE>gtkmenutoolbutton</FILE>
|
||||
<TITLE>GtkMenuToolButton</TITLE>
|
||||
GtkMenuToolButton
|
||||
GtkMenuToolButtonClass
|
||||
gtk_menu_tool_button_new
|
||||
gtk_menu_tool_button_set_menu
|
||||
gtk_menu_tool_button_get_menu
|
||||
gtk_menu_tool_button_set_popover
|
||||
gtk_menu_tool_button_get_popover
|
||||
gtk_menu_tool_button_set_arrow_tooltip_text
|
||||
gtk_menu_tool_button_set_arrow_tooltip_markup
|
||||
|
||||
@@ -3435,6 +3235,29 @@ GTK_TOOLTIP
|
||||
gtk_tooltip_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktreelistrow</FILE>
|
||||
<TITLE>GtkTreeListRow</TITLE>
|
||||
gtk_tree_list_row_get_item
|
||||
gtk_tree_list_row_set_expanded
|
||||
gtk_tree_list_row_get_expanded
|
||||
gtk_tree_list_row_is_expandable
|
||||
gtk_tree_list_row_get_position
|
||||
gtk_tree_list_row_get_depth
|
||||
gtk_tree_list_row_get_children
|
||||
gtk_tree_list_row_get_parent
|
||||
gtk_tree_list_row_get_child_row
|
||||
<SUBSECTION Standard>
|
||||
GTK_TREE_LIST_ROW
|
||||
GTK_IS_TREE_LIST_ROW
|
||||
GTK_TYPE_TREE_LIST_ROW
|
||||
GTK_TREE_LIST_ROW_CLASS
|
||||
GTK_IS_TREE_LIST_ROW_CLASS
|
||||
GTK_TREE_LIST_ROW_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_tree_list_row_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktreelistmodel</FILE>
|
||||
<TITLE>GtkTreeListModel</TITLE>
|
||||
@@ -3448,18 +3271,6 @@ gtk_tree_list_model_set_autoexpand
|
||||
gtk_tree_list_model_get_autoexpand
|
||||
gtk_tree_list_model_get_child_row
|
||||
gtk_tree_list_model_get_row
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_tree_list_row_get_item
|
||||
gtk_tree_list_row_set_expanded
|
||||
gtk_tree_list_row_get_expanded
|
||||
gtk_tree_list_row_is_expandable
|
||||
gtk_tree_list_row_get_position
|
||||
gtk_tree_list_row_get_depth
|
||||
gtk_tree_list_row_get_children
|
||||
gtk_tree_list_row_get_parent
|
||||
gtk_tree_list_row_get_child_row
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TREE_LIST_MODEL
|
||||
GTK_IS_TREE_LIST_MODEL
|
||||
@@ -3467,14 +3278,7 @@ GTK_TYPE_TREE_LIST_MODEL
|
||||
GTK_TREE_LIST_MODEL_CLASS
|
||||
GTK_IS_TREE_LIST_MODEL_CLASS
|
||||
GTK_TREE_LIST_MODEL_GET_CLASS
|
||||
GTK_TREE_LIST_ROW
|
||||
GTK_IS_TREE_LIST_ROW
|
||||
GTK_TYPE_TREE_LIST_ROW
|
||||
GTK_TREE_LIST_ROW_CLASS
|
||||
GTK_IS_TREE_LIST_ROW_CLASS
|
||||
GTK_TREE_LIST_ROW_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_tree_list_model_get_type
|
||||
gtk_tree_list_row_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -3620,7 +3424,6 @@ gtk_tree_model_filter_get_type
|
||||
<FILE>gtktreeselection</FILE>
|
||||
<TITLE>GtkTreeSelection</TITLE>
|
||||
GtkTreeSelection
|
||||
GtkTreeSelectionClass
|
||||
GtkTreeSelectionFunc
|
||||
GtkTreeSelectionForeachFunc
|
||||
gtk_tree_selection_set_mode
|
||||
@@ -3822,7 +3625,6 @@ gtk_tree_view_column_get_type
|
||||
<TITLE>GtkTreeView</TITLE>
|
||||
GtkTreeView
|
||||
GtkTreeViewDropPosition
|
||||
GtkTreeViewPrivate
|
||||
GtkTreeViewColumnDropFunc
|
||||
GtkTreeViewMappingFunc
|
||||
GtkTreeViewSearchEqualFunc
|
||||
@@ -3897,9 +3699,6 @@ gtk_tree_view_get_search_equal_func
|
||||
gtk_tree_view_set_search_equal_func
|
||||
gtk_tree_view_get_search_entry
|
||||
gtk_tree_view_set_search_entry
|
||||
GtkTreeViewSearchPositionFunc
|
||||
gtk_tree_view_get_search_position_func
|
||||
gtk_tree_view_set_search_position_func
|
||||
gtk_tree_view_get_fixed_height_mode
|
||||
gtk_tree_view_set_fixed_height_mode
|
||||
gtk_tree_view_get_hover_selection
|
||||
@@ -3938,7 +3737,6 @@ gtk_tree_view_get_type
|
||||
<FILE>gtkcellview</FILE>
|
||||
<TITLE>GtkCellView</TITLE>
|
||||
GtkCellView
|
||||
GtkCellViewClass
|
||||
gtk_cell_view_new
|
||||
gtk_cell_view_new_with_context
|
||||
gtk_cell_view_new_with_text
|
||||
@@ -4086,7 +3884,6 @@ GtkCellAreaContextPrivate
|
||||
<FILE>gtkcellareabox</FILE>
|
||||
<TITLE>GtkCellAreaBox</TITLE>
|
||||
GtkCellAreaBox
|
||||
GtkCellAreaBoxClass
|
||||
gtk_cell_area_box_new
|
||||
gtk_cell_area_box_pack_start
|
||||
gtk_cell_area_box_pack_end
|
||||
@@ -4366,7 +4163,6 @@ gtk_list_store_get_type
|
||||
<FILE>gtkviewport</FILE>
|
||||
<TITLE>GtkViewport</TITLE>
|
||||
GtkViewport
|
||||
GtkViewportClass
|
||||
gtk_viewport_new
|
||||
gtk_viewport_set_shadow_type
|
||||
gtk_viewport_get_shadow_type
|
||||
@@ -4672,7 +4468,7 @@ gtk_widget_class_bind_template_child_internal_private
|
||||
gtk_widget_class_bind_template_child_full
|
||||
gtk_widget_class_bind_template_callback
|
||||
gtk_widget_class_bind_template_callback_full
|
||||
gtk_widget_class_set_connect_func
|
||||
gtk_widget_class_set_template_scope
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_widget_observe_children
|
||||
@@ -4740,8 +4536,8 @@ gtk_window_set_default_widget
|
||||
gtk_window_present
|
||||
gtk_window_present_with_time
|
||||
gtk_window_close
|
||||
gtk_window_iconify
|
||||
gtk_window_deiconify
|
||||
gtk_window_minimize
|
||||
gtk_window_unminimize
|
||||
gtk_window_stick
|
||||
gtk_window_unstick
|
||||
gtk_window_maximize
|
||||
@@ -5205,56 +5001,10 @@ GTK_TYPE_SELECTION_DATA
|
||||
gtk_selection_data_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkdnd</FILE>
|
||||
<TITLE>Drag and Drop</TITLE>
|
||||
GtkDestDefaults
|
||||
GtkDragResult
|
||||
|
||||
<SUBSECTION Destination Side>
|
||||
gtk_drag_dest_set
|
||||
gtk_drag_dest_unset
|
||||
gtk_drag_dest_find_target
|
||||
gtk_drag_dest_get_target_list
|
||||
gtk_drag_dest_set_target_list
|
||||
gtk_drag_dest_add_text_targets
|
||||
gtk_drag_dest_add_image_targets
|
||||
gtk_drag_dest_add_uri_targets
|
||||
gtk_drag_dest_set_track_motion
|
||||
gtk_drag_dest_get_track_motion
|
||||
gtk_drag_get_data
|
||||
gtk_drag_get_source_widget
|
||||
gtk_drag_highlight
|
||||
gtk_drag_unhighlight
|
||||
|
||||
<SUBSECTION Source Side>
|
||||
gtk_drag_begin
|
||||
gtk_drag_cancel
|
||||
gtk_drag_set_icon_widget
|
||||
gtk_drag_set_icon_paintable
|
||||
gtk_drag_set_icon_name
|
||||
gtk_drag_set_icon_gicon
|
||||
gtk_drag_set_icon_default
|
||||
gtk_drag_check_threshold
|
||||
gtk_drag_source_set
|
||||
gtk_drag_source_set_icon_name
|
||||
gtk_drag_source_set_icon_gicon
|
||||
gtk_drag_source_set_icon_paintable
|
||||
gtk_drag_source_unset
|
||||
gtk_drag_source_set_target_list
|
||||
gtk_drag_source_get_target_list
|
||||
gtk_drag_source_add_text_targets
|
||||
gtk_drag_source_add_image_targets
|
||||
gtk_drag_source_add_uri_targets
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkbindings</FILE>
|
||||
<TITLE>Bindings</TITLE>
|
||||
GtkBindingSet
|
||||
GtkBindingEntry
|
||||
GtkBindingSignal
|
||||
GtkBindingArg
|
||||
gtk_binding_set_new
|
||||
gtk_binding_set_by_class
|
||||
gtk_binding_set_find
|
||||
@@ -5299,7 +5049,6 @@ GtkIconSize
|
||||
<TITLE>GtkIconTheme</TITLE>
|
||||
GtkIconInfo
|
||||
GtkIconTheme
|
||||
GtkIconThemeClass
|
||||
GtkIconLookupFlags
|
||||
GTK_ICON_THEME_ERROR
|
||||
GtkIconThemeError
|
||||
@@ -5329,7 +5078,6 @@ gtk_icon_info_get_base_size
|
||||
gtk_icon_info_get_base_scale
|
||||
gtk_icon_info_get_filename
|
||||
gtk_icon_info_load_icon
|
||||
gtk_icon_info_load_texture
|
||||
gtk_icon_info_load_icon_async
|
||||
gtk_icon_info_load_icon_finish
|
||||
gtk_icon_info_load_symbolic
|
||||
@@ -5833,7 +5581,6 @@ gtk_print_job_get_type
|
||||
<FILE>gtkpagesetupunixdialog</FILE>
|
||||
<TITLE>GtkPageSetupUnixDialog</TITLE>
|
||||
GtkPageSetupUnixDialog
|
||||
GtkPageSetupUnixDialogClass
|
||||
gtk_page_setup_unix_dialog_new
|
||||
gtk_page_setup_unix_dialog_set_page_setup
|
||||
gtk_page_setup_unix_dialog_get_page_setup
|
||||
@@ -6044,7 +5791,6 @@ gtk_grid_get_type
|
||||
<SECTION>
|
||||
<FILE>gtkswitch</FILE>
|
||||
GtkSwitch
|
||||
GtkSwitchClass
|
||||
gtk_switch_new
|
||||
gtk_switch_set_active
|
||||
gtk_switch_get_active
|
||||
@@ -6094,7 +5840,6 @@ GTK_IS_APP_CHOOSER_ONLINE_PK_CLASS
|
||||
<FILE>gtkappchooserbutton</FILE>
|
||||
<TITLE>GtkAppChooserButton</TITLE>
|
||||
GtkAppChooserButton
|
||||
GtkAppChooserButtonClass
|
||||
gtk_app_chooser_button_new
|
||||
gtk_app_chooser_button_append_custom_item
|
||||
gtk_app_chooser_button_append_separator
|
||||
@@ -6123,7 +5868,6 @@ gtk_app_chooser_button_get_type
|
||||
<FILE>gtkappchooserdialog</FILE>
|
||||
<TITLE>GtkAppChooserDialog</TITLE>
|
||||
GtkAppChooserDialog
|
||||
GtkAppChooserDialogClass
|
||||
gtk_app_chooser_dialog_new
|
||||
gtk_app_chooser_dialog_new_for_content_type
|
||||
gtk_app_chooser_dialog_get_widget
|
||||
@@ -6147,7 +5891,6 @@ gtk_app_chooser_dialog_get_type
|
||||
<FILE>gtkappchooserwidget</FILE>
|
||||
<TITLE>GtkAppChooserWidget</TITLE>
|
||||
GtkAppChooserWidget
|
||||
GtkAppChooserWidgetClass
|
||||
gtk_app_chooser_widget_new
|
||||
gtk_app_chooser_widget_set_show_default
|
||||
gtk_app_chooser_widget_get_show_default
|
||||
@@ -6179,7 +5922,6 @@ gtk_app_chooser_widget_get_type
|
||||
<FILE>gtklockbutton</FILE>
|
||||
<TITLE>GtkLockButton</TITLE>
|
||||
GtkLockButton
|
||||
GtkLockButtonClass
|
||||
|
||||
gtk_lock_button_new
|
||||
gtk_lock_button_get_permission
|
||||
@@ -6201,7 +5943,6 @@ GtkLockButtonPrivate
|
||||
<FILE>gtkoverlay</FILE>
|
||||
<TITLE>GtkOverlay</TITLE>
|
||||
GtkOverlay
|
||||
GtkOverlayClass
|
||||
|
||||
gtk_overlay_new
|
||||
gtk_overlay_add_overlay
|
||||
@@ -6251,7 +5992,6 @@ gtk_color_chooser_get_type
|
||||
<FILE>gtkcolorchooserwidget</FILE>
|
||||
<TITLE>GtkColorChooserWidget</TITLE>
|
||||
GtkColorChooserWidget
|
||||
GtkColorChooserWidgetClass
|
||||
gtk_color_chooser_widget_new
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -6411,7 +6151,6 @@ gtk_stack_switcher_get_type
|
||||
<FILE>gtkrevealer</FILE>
|
||||
<TITLE>GtkRevealer</TITLE>
|
||||
GtkRevealer
|
||||
GtkRevealerClass
|
||||
gtk_revealer_new
|
||||
gtk_revealer_get_reveal_child
|
||||
gtk_revealer_set_reveal_child
|
||||
@@ -6518,15 +6257,11 @@ gtk_popover_set_pointing_to
|
||||
gtk_popover_get_pointing_to
|
||||
gtk_popover_set_position
|
||||
gtk_popover_get_position
|
||||
GtkPopoverConstraint
|
||||
gtk_popover_set_constrain_to
|
||||
gtk_popover_get_constrain_to
|
||||
gtk_popover_set_autohide
|
||||
gtk_popover_get_autohide
|
||||
gtk_popover_set_has_arrow
|
||||
gtk_popover_get_has_arrow
|
||||
gtk_popover_set_default_widget
|
||||
gtk_popover_get_default_widget
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER
|
||||
GTK_IS_POPOVER
|
||||
@@ -6546,18 +6281,14 @@ gtk_popover_get_type
|
||||
<FILE>gtkpopovermenu</FILE>
|
||||
<TITLE>GtkPopoverMenu</TITLE>
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_new_from_model
|
||||
gtk_popover_menu_add_submenu
|
||||
gtk_popover_menu_open_submenu
|
||||
gtk_popover_menu_set_menu_model
|
||||
gtk_popover_menu_get_menu_model
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU
|
||||
GTK_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_popover_menu_get_type
|
||||
@@ -6580,20 +6311,6 @@ GTK_POPOVER_MENU_BAR
|
||||
gtk_popover_menu_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmodelbutton</FILE>
|
||||
<TITLE>GtkModelButton</TITLE>
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MODEL_BUTTON
|
||||
GTK_MODEL_BUTTON
|
||||
GTK_IS_MODEL_BUTTON
|
||||
<SUBSECTION Private>
|
||||
gtk_model_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkeventcontroller</FILE>
|
||||
<TITLE>GtkEventController</TITLE>
|
||||
@@ -6731,6 +6448,8 @@ GtkEventControllerMotion
|
||||
gtk_event_controller_motion_new
|
||||
gtk_event_controller_motion_get_pointer_origin
|
||||
gtk_event_controller_motion_get_pointer_target
|
||||
gtk_event_controller_motion_contains_pointer
|
||||
gtk_event_controller_motion_is_pointer
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_EVENT_CONTROLLER_MOTION
|
||||
@@ -7299,8 +7018,8 @@ gtk_fixed_layout_new
|
||||
<SUBSECTION>
|
||||
GtkFixedLayoutChild
|
||||
|
||||
gtk_fixed_layout_child_set_position
|
||||
gtk_fixed_layout_child_get_position
|
||||
gtk_fixed_layout_child_set_transform
|
||||
gtk_fixed_layout_child_get_transform
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_FIXED_LAYOUT
|
||||
@@ -7429,3 +7148,69 @@ gtk_constraint_guide_get_max_size
|
||||
GTK_TYPE_CONSTRAINT_GUIDE
|
||||
gtk_constraint_guide_get_tyoe
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkdragsource</FILE>
|
||||
GtkDragSource
|
||||
gtk_drag_source_new
|
||||
gtk_drag_source_set_content
|
||||
gtk_drag_source_get_content
|
||||
gtk_drag_source_set_actions
|
||||
gtk_drag_source_get_actions
|
||||
gtk_drag_source_set_icon
|
||||
gtk_drag_source_drag_cancel
|
||||
gtk_drag_source_get_drag
|
||||
gtk_drag_check_threshold
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_DRAG_SOURCE
|
||||
GTK_DRAG_SOURCE
|
||||
GTK_DRAG_SOURCE_CLASS
|
||||
GTK_IS_DRAG_SOURCE
|
||||
GTK_IS_DRAG_SOURCE_CLASS
|
||||
GTK_DRAG_SOURCE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_drag_source_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkdroptarget</FILE>
|
||||
GtkDropTarget
|
||||
gtk_drop_target_new
|
||||
gtk_drop_target_set_formats
|
||||
gtk_drop_target_get_formats
|
||||
gtk_drop_target_set_actions
|
||||
gtk_drop_target_get_actions
|
||||
gtk_drop_target_get_drop
|
||||
gtk_drop_target_find_mimetype
|
||||
gtk_drop_target_read_selection
|
||||
gtk_drop_target_read_selection_finish
|
||||
gtk_drag_highlight
|
||||
gtk_drag_unhighlight
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_DROP_TARGET
|
||||
GTK_DROP_TARGET
|
||||
GTK_DROP_TARGET_CLASS
|
||||
GTK_IS_DROP_TARGET
|
||||
GTK_IS_DROP_TARGET_CLASS
|
||||
GTK_DROP_TARGET_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_drop_target_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkdragicon</FILE>
|
||||
GtkDragIcon
|
||||
gtk_drag_icon_new_for_drag
|
||||
gtk_drag_icon_set_from_paintable
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_DRAG_ICON
|
||||
GTK_DRAG_ICON
|
||||
GTK_DRAG_ICON_CLASS
|
||||
GTK_IS_DRAG_ICON
|
||||
GTK_IS_DRAG_ICON_CLASS
|
||||
GTK_DRAG_ICON_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_drag_icon_get_type
|
||||
</SECTION>
|
||||
|
@@ -22,7 +22,9 @@ gtk_bin_get_type
|
||||
gtk_bin_layout_get_type
|
||||
gtk_box_get_type
|
||||
gtk_box_layout_get_type
|
||||
gtk_builder_cscope_get_type
|
||||
gtk_builder_get_type
|
||||
gtk_builder_scope_get_type
|
||||
gtk_buildable_get_type
|
||||
gtk_button_get_type
|
||||
gtk_calendar_get_type
|
||||
@@ -42,7 +44,6 @@ gtk_cell_renderer_text_get_type
|
||||
gtk_cell_renderer_toggle_get_type
|
||||
gtk_cell_view_get_type
|
||||
gtk_check_button_get_type
|
||||
gtk_check_menu_item_get_type
|
||||
gtk_color_button_get_type
|
||||
gtk_color_chooser_get_type
|
||||
gtk_color_chooser_dialog_get_type
|
||||
@@ -56,7 +57,10 @@ gtk_constraint_target_get_type
|
||||
gtk_container_get_type
|
||||
gtk_css_provider_get_type
|
||||
gtk_dialog_get_type
|
||||
gtk_drag_icon_get_type
|
||||
gtk_drag_source_get_type
|
||||
gtk_drawing_area_get_type
|
||||
gtk_drop_target_get_type
|
||||
gtk_editable_get_type
|
||||
gtk_entry_buffer_get_type
|
||||
gtk_entry_completion_get_type
|
||||
@@ -72,8 +76,10 @@ gtk_file_chooser_dialog_get_type
|
||||
gtk_file_chooser_get_type
|
||||
gtk_file_chooser_widget_get_type
|
||||
gtk_file_filter_get_type
|
||||
gtk_filter_list_model_get_type
|
||||
gtk_fixed_get_type
|
||||
gtk_fixed_layout_get_type
|
||||
gtk_flatten_list_model_get_type
|
||||
gtk_flow_box_get_type
|
||||
gtk_flow_box_child_get_type
|
||||
gtk_font_button_get_type
|
||||
@@ -111,19 +117,16 @@ gtk_list_store_get_type
|
||||
gtk_list_box_get_type
|
||||
gtk_list_box_row_get_type
|
||||
gtk_lock_button_get_type
|
||||
gtk_map_list_model_get_type
|
||||
gtk_media_controls_get_type
|
||||
gtk_media_file_get_type
|
||||
gtk_media_stream_get_type
|
||||
gtk_menu_bar_get_type
|
||||
gtk_menu_button_get_type
|
||||
gtk_menu_get_type
|
||||
gtk_menu_item_get_type
|
||||
gtk_menu_shell_get_type
|
||||
gtk_menu_tool_button_get_type
|
||||
gtk_message_dialog_get_type
|
||||
gtk_model_button_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_native_get_type
|
||||
gtk_no_selection_get_type
|
||||
gtk_notebook_get_type
|
||||
gtk_notebook_page_get_type
|
||||
gtk_orientable_get_type
|
||||
@@ -147,7 +150,6 @@ gtk_print_settings_get_type
|
||||
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
|
||||
gtk_progress_bar_get_type
|
||||
gtk_radio_button_get_type
|
||||
gtk_radio_menu_item_get_type
|
||||
gtk_radio_tool_button_get_type
|
||||
gtk_range_get_type
|
||||
gtk_recent_manager_get_type
|
||||
@@ -162,7 +164,6 @@ gtk_search_bar_get_type
|
||||
gtk_search_entry_get_type
|
||||
gtk_selection_model_get_type
|
||||
gtk_separator_get_type
|
||||
gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_shortcut_label_get_type
|
||||
@@ -172,7 +173,9 @@ gtk_shortcuts_group_get_type
|
||||
gtk_shortcuts_shortcut_get_type
|
||||
gtk_single_selection_get_type
|
||||
gtk_size_group_get_type
|
||||
gtk_slice_list_model_get_type
|
||||
gtk_snapshot_get_type
|
||||
gtk_sort_list_model_get_type
|
||||
gtk_spin_button_get_type
|
||||
gtk_spinner_get_type
|
||||
gtk_stack_get_type
|
||||
@@ -199,6 +202,8 @@ gtk_tool_button_get_type
|
||||
gtk_tool_item_get_type
|
||||
gtk_tree_drag_dest_get_type
|
||||
gtk_tree_drag_source_get_type
|
||||
gtk_tree_list_model_get_type
|
||||
gtk_tree_list_row_get_type
|
||||
gtk_tree_model_filter_get_type
|
||||
gtk_tree_model_get_type
|
||||
gtk_tree_model_sort_get_type
|
||||
|
@@ -1,4 +1,6 @@
|
||||
private_headers = [
|
||||
'imm-extra.h',
|
||||
'gtkbitmaskprivateimpl.h',
|
||||
'gdkpixbufutilsprivate.h',
|
||||
'gtkaccelgroupprivate.h',
|
||||
'gtkaccelmapprivate.h',
|
||||
@@ -15,7 +17,6 @@ private_headers = [
|
||||
'gtkbuttonprivate.h',
|
||||
'gtkcellareaboxcontextprivate.h',
|
||||
'gtkcheckbuttonprivate.h',
|
||||
'gtkcheckmenuitemprivate.h',
|
||||
'gtkcolorchooserprivate.h',
|
||||
'gtkcoloreditorprivate.h',
|
||||
'gtkcolorplaneprivate.h',
|
||||
@@ -35,6 +36,7 @@ private_headers = [
|
||||
'gtkcssarrayvalueprivate.h',
|
||||
'gtkcssbgsizevalueprivate.h',
|
||||
'gtkcssbordervalueprivate.h',
|
||||
'gtkcssboxesprivate.h',
|
||||
'gtkcsscalcvalueprivate.h',
|
||||
'gtkcsscolorvalueprivate.h',
|
||||
'gtkcsscornervalueprivate.h',
|
||||
@@ -46,7 +48,6 @@ private_headers = [
|
||||
'gtkcssfontfeaturesvalueprivate.h',
|
||||
'gtkcssfontvariationsvalueprivate.h',
|
||||
'gtkcssiconthemevalueprivate.h',
|
||||
'gtkcssimagebuiltinprivate.h',
|
||||
'gtkcssimagecrossfadeprivate.h',
|
||||
'gtkcssimagefallbackprivate.h',
|
||||
'gtkcssimageiconthemeprivate.h',
|
||||
@@ -95,7 +96,6 @@ private_headers = [
|
||||
'gtkcsswidgetnodeprivate.h',
|
||||
'gtkcsswin32sizevalueprivate.h',
|
||||
'gtkdialogprivate.h',
|
||||
'gtkdndprivate.h',
|
||||
'gtkentryprivate.h',
|
||||
'gtkeventcontrollerlegacyprivate.h',
|
||||
'gtkeventcontrollerprivate.h',
|
||||
@@ -135,9 +135,6 @@ private_headers = [
|
||||
'gtkmagnifierprivate.h',
|
||||
'gtkmediafileprivate.h',
|
||||
'gtkmenubuttonprivate.h',
|
||||
'gtkmenuitemprivate.h',
|
||||
'gtkmenuprivate.h',
|
||||
'gtkmenushellprivate.h',
|
||||
'gtkmodulesprivate.h',
|
||||
'gtkmountoperationprivate.h',
|
||||
'gtknativedialogprivate.h',
|
||||
@@ -178,8 +175,10 @@ private_headers = [
|
||||
'gtktextchildprivate.h',
|
||||
'gtktextdisplayprivate.h',
|
||||
'gtktexthandleprivate.h',
|
||||
'gtktexthistoryprivate.h',
|
||||
'gtktextiterprivate.h',
|
||||
'gtktextlayoutprivate.h',
|
||||
'gtktextlinedisplaycacheprivate.h',
|
||||
'gtktextmarkprivate.h',
|
||||
'gtktexttagprivate.h',
|
||||
'gtktextviewprivate.h',
|
||||
|
@@ -305,6 +305,18 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using grabs</title>
|
||||
<para>
|
||||
GTK 4 no longer provides the gdk_device_grab() or gdk_seat_grab() apis.
|
||||
</para>
|
||||
<para>
|
||||
If you need to dismiss a popup when the user clicks outside (a common
|
||||
use for grabs), you can use the GdkSurface #GdkSurface:autohide property instead.
|
||||
GtkPopover also has a #GtkPopover:autohide property.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to coordinate API changes</title>
|
||||
<para>
|
||||
@@ -673,7 +685,7 @@
|
||||
<section>
|
||||
<title>Adapt to changes in the API of GtkEntry, GtkSearchEntry and GtkSpinButton</title>
|
||||
<para>
|
||||
The GtkEditable has been made more useful, and the core functionality of
|
||||
The GtkEditable interface has been made more useful, and the core functionality of
|
||||
GtkEntry has been broken out as a GtkText widget. GtkEntry, GtkSearchEntry,
|
||||
GtkSpinButton and the new GtkPasswordEntry now use a GtkText widget internally
|
||||
and implement GtkEditable. In particular, this means that it is no longer
|
||||
@@ -828,6 +840,100 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>The "iconified" window state has been renamed to "minimized"</title>
|
||||
<para>
|
||||
The <literal>GDK_SURFACE_STATE_ICONIFIED</literal> value of the
|
||||
#GdkSurfaceState enumeration is now %GDK_SURFACE_STATE_MINIMIZED.
|
||||
</para>
|
||||
<para>
|
||||
The #GdkSurface functions <function>gdk_surface_iconify()</function>
|
||||
and <function>gdk_surface_deiconify()</function> have been renamed to
|
||||
gdk_surface_minimize() and gdk_surface_unminimize(), respectively.
|
||||
</para>
|
||||
<para>
|
||||
The corresponding #GtkWindow functions <function>gtk_window_iconify()</function>
|
||||
and <function>gtk_window_deiconify()</function> have been renamed
|
||||
to gtk_window_minimize() and gtk_window_unminimize(), respectively.
|
||||
</para>
|
||||
<para>
|
||||
The behavior of the minimization and unminimization operations have
|
||||
not been changed, and they still require support from the underlying
|
||||
windowing system.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkMenu, GtkMenuBar and GtkMenuItem are gone</title>
|
||||
<para>
|
||||
These widgets were heavily relying on X11-centric concepts such as
|
||||
override-redirect windows and grabs, and were hard to adjust to other
|
||||
windowing systems.
|
||||
</para>
|
||||
<para>
|
||||
Menus can already be replaced using GtkPopoverMenu in GTK 3. Additionally,
|
||||
GTK 4 introduces GtkPopoverMenuBar to replace menubars. These new widgets
|
||||
can only be constructed from menu models, so the porting effort involves
|
||||
switching to menu models and actions.
|
||||
</para>
|
||||
<para>
|
||||
Since menus are gone, GtkMenuButton and GtkMenuToolButton also lost their
|
||||
ability to show menus, and need to be used with popovers in GTK 4.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkToolbar overflow handling has changed</title>
|
||||
<para>
|
||||
The handling of overflow in toolbars has been simplified.
|
||||
Instead of creating a proxy menuitem and setting it with
|
||||
gtk_tool_item_set_proxy_menu_item(), you simply provide
|
||||
a label for the overflow menu with gtk_tool_item_set_overflow_text().
|
||||
GTK will figure out itself whether to create a check- or
|
||||
radioitem as proxy.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using custom tooltip windows</title>
|
||||
<para>
|
||||
Tooltips no longer use GtkWindows in GTK 4, and it is no longer
|
||||
possible to provide a custom window for tooltips. Replacing the content
|
||||
of the tooltip with a custom widget is still possible, with
|
||||
gtk_tooltip_set_custom().
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Switch to the new DND api</title>
|
||||
<para>
|
||||
The source-side DND apis in GTK 4 have been changed to use an event controller, #GtkDragSource.
|
||||
</para>
|
||||
<para>
|
||||
Instead of calling gtk_drag_source_set() and connecting to #GtkWidget signals, you create
|
||||
a #GtkDragSource object, attach it to the widget with gtk_widget_add_controller(), and connect
|
||||
to #GtkDragSource signals. Instead of calling gtk_drag_begin() on a widget to start a drag
|
||||
manually, call gdk_drag_begin().
|
||||
</para>
|
||||
<para>
|
||||
The ::drag-data-get signal has been replaced by the #GtkDragSource::prepare signal, which
|
||||
returns a #GdkContentProvider for the drag operation.
|
||||
</para>
|
||||
<para>
|
||||
The destination-side DND apis in GTK 4 have also been changed to use and event controller,
|
||||
#GTkDropTarget.
|
||||
</para>
|
||||
<para>
|
||||
Instead of calling gtk_drag_dest_set() and connecting to #GtkWidget signals, you create
|
||||
a #GtkDropTarget object, attach it to the widget with gtk_widget_add_controller(), and
|
||||
connect to #GtkDropTarget signals.
|
||||
</para>
|
||||
<para>
|
||||
The ::drag-motion signal has been renamed to #GtkDragSource::accept, and instead of
|
||||
::drag-data-received, you need to use async read methods on the #GdkDrop object, such
|
||||
as gdk_drop_read_value_async() or gdk_drop_read_text_async().
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
@@ -162,9 +162,6 @@
|
||||
<link linkend="GtkPaned">
|
||||
<inlinegraphic fileref="panes.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkMenuBar">
|
||||
<inlinegraphic fileref="menubar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
<link linkend="GtkToolbar">
|
||||
<inlinegraphic fileref="toolbar.png" format="PNG"></inlinegraphic>
|
||||
</link>
|
||||
|
@@ -138,7 +138,7 @@ url="http://www.freedesktop.org/standards/">convention</ulink>.
|
||||
<para>
|
||||
GTK has functions for asking the window manager to do various things;
|
||||
see for example <link
|
||||
linkend="gtk-window-iconify">gtk_window_iconify()</link> or <link
|
||||
linkend="gtk-window-minimize">gtk_window_minimize()</link> or <link
|
||||
linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link
|
||||
linkend="gtk-window-set-decorated">gtk_window_set_decorated()</link>.
|
||||
Keep in mind that most window managers <emphasis>will</emphasis> ignore
|
||||
|
@@ -152,8 +152,8 @@ create_menu_button (void)
|
||||
image = gtk_image_new ();
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image), "emblem-system-symbolic");
|
||||
gtk_container_add (GTK_CONTAINER (widget), image);
|
||||
menu = gtk_menu_new ();
|
||||
gtk_menu_button_set_popup (GTK_MENU_BUTTON (widget), menu);
|
||||
menu = gtk_popover_new (NULL);
|
||||
gtk_menu_button_set_popover (GTK_MENU_BUTTON (widget), menu);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), widget);
|
||||
@@ -800,32 +800,6 @@ create_toolbar (void)
|
||||
return new_widget_info ("toolbar", widget, SMALL);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_menubar (void)
|
||||
{
|
||||
GtkWidget *widget, *vbox, *item;
|
||||
|
||||
widget = gtk_menu_bar_new ();
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("_File");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (widget), item);
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("_Edit");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (widget), item);
|
||||
|
||||
item = gtk_menu_item_new_with_mnemonic ("_Help");
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (widget), item);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
||||
gtk_widget_set_halign (widget, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), widget);
|
||||
gtk_container_add (GTK_CONTAINER (vbox),
|
||||
gtk_label_new ("Menu Bar"));
|
||||
|
||||
return new_widget_info ("menubar", vbox, SMALL);
|
||||
}
|
||||
|
||||
static WidgetInfo *
|
||||
create_message_dialog (void)
|
||||
{
|
||||
@@ -1438,7 +1412,6 @@ get_all_widgets (void)
|
||||
retval = g_list_prepend (retval, create_image ());
|
||||
retval = g_list_prepend (retval, create_label ());
|
||||
retval = g_list_prepend (retval, create_link_button ());
|
||||
retval = g_list_prepend (retval, create_menubar ());
|
||||
retval = g_list_prepend (retval, create_message_dialog ());
|
||||
retval = g_list_prepend (retval, create_notebook ());
|
||||
retval = g_list_prepend (retval, create_panes ());
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#ifndef __GDK_BROADWAY_CURSOR_H__
|
||||
#define __GDK_BROADWAY_CURSOR_H__
|
||||
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/broadway/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
@@ -40,7 +40,7 @@ G_BEGIN_DECLS
|
||||
#define GDK_IS_BROADWAY_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_CURSOR))
|
||||
#define GDK_BROADWAY_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_CURSOR, GdkBroadwayCursorClass))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
#ifdef GTK_COMPILATION
|
||||
typedef struct _GdkBroadwayCursor GdkBroadwayCursor;
|
||||
#else
|
||||
typedef GdkCursor GdkBroadwayCursor;
|
||||
|
@@ -18,15 +18,15 @@
|
||||
#ifndef __GDK_BROADWAY_DISPLAY_H__
|
||||
#define __GDK_BROADWAY_DISPLAY_H__
|
||||
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/broadway/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
#ifdef GTK_COMPILATION
|
||||
typedef struct _GdkBroadwayDisplay GdkBroadwayDisplay;
|
||||
#else
|
||||
typedef GdkDisplay GdkBroadwayDisplay;
|
||||
|
@@ -20,8 +20,8 @@
|
||||
#ifndef __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
#define __GDK_BROADWAY_DISPLAY_MANAGER_H__
|
||||
|
||||
#if !defined(__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#if !defined(__GDKBROADWAY_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/broadway/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
|
||||
#define GDK_TYPE_BROADWAY_DISPLAY_MANAGER (gdk_broadway_display_manager_get_type ())
|
||||
#define GDK_BROADWAY_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_DISPLAY_MANAGER, GdkBroadwayDisplayManager))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
#ifdef GTK_COMPILATION
|
||||
typedef struct _GdkBroadwayDisplayManager GdkBroadwayDisplayManager;
|
||||
#else
|
||||
typedef GdkDisplayManager _GdkBroadwayDisplayManager;
|
||||
|
@@ -22,8 +22,8 @@
|
||||
#ifndef __GDK_BROADWAY_MONITOR_H__
|
||||
#define __GDK_BROADWAY_MONITOR_H__
|
||||
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#error "Only <gdk/gdkbroadway.h> can be included directly."
|
||||
#if !defined (__GDKBROADWAY_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/broadway/gdkbroadway.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gdk/gdkmonitor.h>
|
||||
|
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
|
||||
#define GDK_IS_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_SURFACE))
|
||||
#define GDK_BROADWAY_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
#ifdef GTK_COMPILATION
|
||||
typedef struct _GdkBroadwaySurface GdkBroadwaySurface;
|
||||
#else
|
||||
typedef GdkSurface GdkBroadwaySurface;
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#define GDK_IS_BROADWAY_DRAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_DRAG))
|
||||
#define GDK_BROADWAY_DRAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_DRAG, GdkBroadwayDragClass))
|
||||
|
||||
#ifdef GDK_COMPILATION
|
||||
#ifdef GTK_COMPILATION
|
||||
typedef struct _GdkBroadwayDrag GdkBroadwayDrag;
|
||||
#else
|
||||
typedef GdkDrag GdkBroadwayDrag;
|
||||
|
@@ -710,7 +710,7 @@ gdk_broadway_surface_set_icon_name (GdkSurface *surface,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_iconify (GdkSurface *surface)
|
||||
gdk_broadway_surface_minimize (GdkSurface *surface)
|
||||
{
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!SURFACE_IS_TOPLEVEL (surface))
|
||||
@@ -718,7 +718,7 @@ gdk_broadway_surface_iconify (GdkSurface *surface)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_surface_deiconify (GdkSurface *surface)
|
||||
gdk_broadway_surface_unminimize (GdkSurface *surface)
|
||||
{
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!SURFACE_IS_TOPLEVEL (surface))
|
||||
@@ -1413,8 +1413,8 @@ gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *klass)
|
||||
impl_class->set_focus_on_map = gdk_broadway_surface_set_focus_on_map;
|
||||
impl_class->set_icon_list = gdk_broadway_surface_set_icon_list;
|
||||
impl_class->set_icon_name = gdk_broadway_surface_set_icon_name;
|
||||
impl_class->iconify = gdk_broadway_surface_iconify;
|
||||
impl_class->deiconify = gdk_broadway_surface_deiconify;
|
||||
impl_class->minimize = gdk_broadway_surface_minimize;
|
||||
impl_class->unminimize = gdk_broadway_surface_unminimize;
|
||||
impl_class->stick = gdk_broadway_surface_stick;
|
||||
impl_class->unstick = gdk_broadway_surface_unstick;
|
||||
impl_class->maximize = gdk_broadway_surface_maximize;
|
||||
|
@@ -57,7 +57,7 @@ libgdk_broadway = static_library('gdk-broadway',
|
||||
gdk_broadway_sources, gdkconfig, gdkenum_h,
|
||||
include_directories: [confinc, gdkinc],
|
||||
c_args: [
|
||||
'-DGDK_COMPILATION',
|
||||
'-DGTK_COMPILATION',
|
||||
'-DG_LOG_DOMAIN="Gdk"',
|
||||
] + common_cflags,
|
||||
link_args: common_ldflags,
|
||||
@@ -71,6 +71,6 @@ executable('gtk4-broadwayd',
|
||||
clienthtml_h, broadwayjs_h,
|
||||
'broadwayd.c', 'broadway-server.c', 'broadway-output.c',
|
||||
include_directories: [confinc, gdkinc, include_directories('.')],
|
||||
c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ],
|
||||
c_args: ['-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ],
|
||||
dependencies : [broadwayd_syslib, gdk_deps],
|
||||
install : true)
|
||||
|
447
gdk/filetransferportal.c
Normal file
447
gdk/filetransferportal.c
Normal file
@@ -0,0 +1,447 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Matthias Clasen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
|
||||
#include <gio/gunixfdlist.h>
|
||||
|
||||
#ifndef O_PATH
|
||||
#define O_PATH 0
|
||||
#endif
|
||||
|
||||
#ifndef O_CLOEXEC
|
||||
#define O_CLOEXEC 0
|
||||
#else
|
||||
#define HAVE_O_CLOEXEC 1
|
||||
#endif
|
||||
|
||||
#include "filetransferportalprivate.h"
|
||||
|
||||
static GDBusProxy *file_transfer_proxy = NULL;
|
||||
static gboolean done;
|
||||
static guint timeout_id;
|
||||
|
||||
static void
|
||||
got_proxy (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
file_transfer_proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
|
||||
if (!file_transfer_proxy)
|
||||
{
|
||||
g_message ("failed to get file transfer portal proxy: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
if (timeout_id)
|
||||
{
|
||||
g_source_remove (timeout_id);
|
||||
timeout_id = 0;
|
||||
}
|
||||
|
||||
done = TRUE;
|
||||
g_main_context_wakeup (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
got_bus (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GDBusConnection **bus = data;
|
||||
GError *error = NULL;
|
||||
|
||||
*bus = g_bus_get_finish (result, &error);
|
||||
if (!*bus)
|
||||
{
|
||||
g_message ("failed to get session bus connection: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
if (timeout_id)
|
||||
{
|
||||
g_source_remove (timeout_id);
|
||||
timeout_id = 0;
|
||||
}
|
||||
|
||||
done = TRUE;
|
||||
g_main_context_wakeup (NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
give_up_on_proxy (gpointer data)
|
||||
{
|
||||
GCancellable *cancellable = data;
|
||||
|
||||
g_cancellable_cancel (cancellable);
|
||||
|
||||
timeout_id = 0;
|
||||
|
||||
done = TRUE;
|
||||
g_main_context_wakeup (NULL);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static GDBusProxy *
|
||||
ensure_file_transfer_portal (void)
|
||||
{
|
||||
if (file_transfer_proxy == NULL)
|
||||
{
|
||||
GCancellable *cancellable;
|
||||
GDBusConnection *bus = NULL;
|
||||
|
||||
cancellable = g_cancellable_new ();
|
||||
|
||||
done = FALSE;
|
||||
timeout_id = g_timeout_add (500, give_up_on_proxy, cancellable);
|
||||
g_bus_get (G_BUS_TYPE_SESSION,
|
||||
cancellable,
|
||||
got_bus,
|
||||
&bus);
|
||||
|
||||
while (!done)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
if (bus)
|
||||
{
|
||||
done = FALSE;
|
||||
timeout_id = g_timeout_add (500, give_up_on_proxy, cancellable);
|
||||
g_dbus_proxy_new (bus,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
|
||||
| G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS
|
||||
| G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||
NULL,
|
||||
"org.freedesktop.portal.Documents",
|
||||
"/org/freedesktop/portal/documents",
|
||||
"org.freedesktop.portal.FileTransfer",
|
||||
cancellable,
|
||||
got_proxy,
|
||||
NULL);
|
||||
|
||||
while (!done)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
g_clear_object (&bus);
|
||||
}
|
||||
|
||||
g_clear_object (&cancellable);
|
||||
}
|
||||
|
||||
if (file_transfer_proxy)
|
||||
{
|
||||
char *owner = g_dbus_proxy_get_name_owner (file_transfer_proxy);
|
||||
|
||||
if (owner)
|
||||
{
|
||||
g_free (owner);
|
||||
return file_transfer_proxy;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
file_transfer_portal_available (void)
|
||||
{
|
||||
gboolean available;
|
||||
|
||||
ensure_file_transfer_portal ();
|
||||
|
||||
available = file_transfer_proxy != NULL;
|
||||
|
||||
g_clear_object (&file_transfer_proxy);
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GTask *task;
|
||||
const char **files;
|
||||
int len;
|
||||
int start;
|
||||
} AddFileData;
|
||||
|
||||
static void add_files (GDBusProxy *proxy,
|
||||
AddFileData *afd);
|
||||
|
||||
static void
|
||||
add_files_done (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GDBusProxy *proxy = G_DBUS_PROXY (object);
|
||||
AddFileData *afd = data;
|
||||
GError *error = NULL;
|
||||
GVariant *ret;
|
||||
|
||||
ret = g_dbus_proxy_call_with_unix_fd_list_finish (proxy, NULL, result, &error);
|
||||
if (ret == NULL)
|
||||
{
|
||||
g_task_return_error (afd->task, error);
|
||||
g_object_unref (afd->task);
|
||||
g_free (afd);
|
||||
return;
|
||||
}
|
||||
|
||||
g_variant_unref (ret);
|
||||
|
||||
if (afd->start >= afd->len)
|
||||
{
|
||||
g_task_return_boolean (afd->task, TRUE);
|
||||
g_object_unref (afd->task);
|
||||
g_free (afd);
|
||||
return;
|
||||
}
|
||||
|
||||
add_files (proxy, afd);
|
||||
}
|
||||
|
||||
/* We call AddFiles in chunks of 16 to avoid running into
|
||||
* the per-message fd limit of the bus.
|
||||
*/
|
||||
static void
|
||||
add_files (GDBusProxy *proxy,
|
||||
AddFileData *afd)
|
||||
{
|
||||
GUnixFDList *fd_list;
|
||||
GVariantBuilder fds;
|
||||
int i;
|
||||
char *key;
|
||||
|
||||
g_variant_builder_init (&fds, G_VARIANT_TYPE ("ah"));
|
||||
fd_list = g_unix_fd_list_new ();
|
||||
|
||||
for (i = 0; afd->files[afd->start + i]; i++)
|
||||
{
|
||||
int fd;
|
||||
int fd_in;
|
||||
GError *error = NULL;
|
||||
|
||||
if (i == 16)
|
||||
break;
|
||||
|
||||
fd = open (afd->files[afd->start + i], O_PATH | O_CLOEXEC);
|
||||
if (fd == -1)
|
||||
{
|
||||
g_task_return_new_error (afd->task, G_IO_ERROR, g_io_error_from_errno (errno),
|
||||
"Failed to open %s", afd->files[afd->start + i]);
|
||||
g_object_unref (afd->task);
|
||||
g_free (afd);
|
||||
g_object_unref (fd_list);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef HAVE_O_CLOEXEC
|
||||
fcntl (fd, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
fd_in = g_unix_fd_list_append (fd_list, fd, &error);
|
||||
close (fd);
|
||||
|
||||
if (fd_in == -1)
|
||||
{
|
||||
g_task_return_error (afd->task, error);
|
||||
g_object_unref (afd->task);
|
||||
g_free (afd);
|
||||
g_object_unref (fd_list);
|
||||
return;
|
||||
}
|
||||
|
||||
g_variant_builder_add (&fds, "h", fd_in);
|
||||
}
|
||||
|
||||
afd->start += 16;
|
||||
|
||||
key = (char *)g_object_get_data (G_OBJECT (afd->task), "key");
|
||||
|
||||
g_dbus_proxy_call_with_unix_fd_list (proxy,
|
||||
"AddFiles",
|
||||
g_variant_new ("(sah)", key, &fds),
|
||||
0, -1,
|
||||
fd_list,
|
||||
NULL,
|
||||
add_files_done, afd);
|
||||
|
||||
g_object_unref (fd_list);
|
||||
}
|
||||
|
||||
static void
|
||||
start_session_done (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GDBusProxy *proxy = G_DBUS_PROXY (object);
|
||||
AddFileData *afd = data;
|
||||
GError *error = NULL;
|
||||
GVariant *ret;
|
||||
const char *key;
|
||||
|
||||
ret = g_dbus_proxy_call_finish (proxy, result, &error);
|
||||
if (ret == NULL)
|
||||
{
|
||||
g_task_return_error (afd->task, error);
|
||||
g_object_unref (afd->task);
|
||||
g_free (afd);
|
||||
return;
|
||||
}
|
||||
|
||||
g_variant_get (ret, "(&s)", &key);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (afd->task), "key", g_strdup (key), g_free);
|
||||
|
||||
g_variant_unref (ret);
|
||||
|
||||
add_files (proxy, afd);
|
||||
}
|
||||
|
||||
void
|
||||
file_transfer_portal_register_files (const char **files,
|
||||
gboolean writable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
GTask *task;
|
||||
GDBusProxy *proxy;
|
||||
AddFileData *afd;
|
||||
GVariantBuilder options;
|
||||
|
||||
task = g_task_new (NULL, NULL, callback, data);
|
||||
|
||||
proxy = ensure_file_transfer_portal ();
|
||||
|
||||
if (proxy == NULL)
|
||||
{
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
"No portal found");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
afd = g_new (AddFileData, 1);
|
||||
afd->task = task;
|
||||
afd->files = files;
|
||||
afd->len = g_strv_length ((char **)files);
|
||||
afd->start = 0;
|
||||
|
||||
g_variant_builder_init (&options, G_VARIANT_TYPE_VARDICT);
|
||||
g_variant_builder_add (&options, "{sv}", "writable", g_variant_new_boolean (writable));
|
||||
g_variant_builder_add (&options, "{sv}", "autostop", g_variant_new_boolean (TRUE));
|
||||
|
||||
g_dbus_proxy_call (proxy, "StartTransfer",
|
||||
g_variant_new ("(a{sv})", &options),
|
||||
0, -1, NULL, start_session_done, afd);
|
||||
}
|
||||
|
||||
gboolean
|
||||
file_transfer_portal_register_files_finish (GAsyncResult *result,
|
||||
char **key,
|
||||
GError **error)
|
||||
{
|
||||
if (g_task_propagate_boolean (G_TASK (result), error))
|
||||
{
|
||||
*key = g_strdup (g_object_get_data (G_OBJECT (result), "key"));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
retrieve_files_done (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GDBusProxy *proxy = G_DBUS_PROXY (object);
|
||||
GTask *task = data;
|
||||
GError *error = NULL;
|
||||
GVariant *ret;
|
||||
char **files;
|
||||
|
||||
ret = g_dbus_proxy_call_finish (proxy, result, &error);
|
||||
if (ret == NULL)
|
||||
{
|
||||
g_task_return_error (task, error);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
g_variant_get (ret, "(^a&s)", &files);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (task), "files", g_strdupv (files), (GDestroyNotify)g_strfreev);
|
||||
|
||||
g_variant_unref (ret);
|
||||
|
||||
g_task_return_boolean (task, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
file_transfer_portal_retrieve_files (const char *key,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
GDBusProxy *proxy;
|
||||
GTask *task;
|
||||
GVariantBuilder options;
|
||||
|
||||
task = g_task_new (NULL, NULL, callback, data);
|
||||
|
||||
proxy = ensure_file_transfer_portal ();
|
||||
|
||||
if (proxy == NULL)
|
||||
{
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
"No portal found");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
g_variant_builder_init (&options, G_VARIANT_TYPE_VARDICT);
|
||||
g_dbus_proxy_call (proxy,
|
||||
"RetrieveFiles",
|
||||
g_variant_new ("(sa{sv})", key, &options),
|
||||
0, -1, NULL,
|
||||
retrieve_files_done, task);
|
||||
}
|
||||
|
||||
gboolean
|
||||
file_transfer_portal_retrieve_files_finish (GAsyncResult *result,
|
||||
char ***files,
|
||||
GError **error)
|
||||
{
|
||||
if (g_task_propagate_boolean (G_TASK (result), error))
|
||||
{
|
||||
*files = g_strdupv (g_object_get_data (G_OBJECT (result), "files"));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif /* G_OS_UNIX */
|
39
gdk/filetransferportalprivate.h
Normal file
39
gdk/filetransferportalprivate.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Matthias Clasen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FILE_TRANSFER_PROTOCOL_H__
|
||||
#define __FILE_TRANSFER_PROTOCOL_H__
|
||||
|
||||
|
||||
gboolean file_transfer_portal_available (void);
|
||||
void file_transfer_portal_register_files (const char **files,
|
||||
gboolean writable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer data);
|
||||
gboolean file_transfer_portal_register_files_finish (GAsyncResult *result,
|
||||
char **key,
|
||||
GError **error);
|
||||
|
||||
void file_transfer_portal_retrieve_files (const char *key,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer data);
|
||||
gboolean file_transfer_portal_retrieve_files_finish (GAsyncResult *result,
|
||||
char ***files,
|
||||
GError **error);
|
||||
|
||||
|
||||
#endif
|
@@ -15,7 +15,7 @@
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef __GDK_APP_LAUNCH_CONTEXT_H__
|
||||
#define __GDK_APP_LAUNCH_CONTEXT_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef __GDK_CAIRO_H__
|
||||
#define __GDK_CAIRO_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef __GDK_CAIRO_CONTEXT__
|
||||
#define __GDK_CAIRO_CONTEXT__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -1054,6 +1054,7 @@ gdk_clipboard_write_serialize_done (GObject *content,
|
||||
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_clipboard_write_async (GdkClipboard *clipboard,
|
||||
const char *mime_type,
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#ifndef __GDK_CLIPBOARD_H__
|
||||
#define __GDK_CLIPBOARD_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef __GDKCONFIG_H__
|
||||
#define __GDKCONFIG_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
@@ -14,7 +14,6 @@ G_BEGIN_DECLS
|
||||
#mesondefine GDK_WINDOWING_BROADWAY
|
||||
#mesondefine GDK_WINDOWING_WAYLAND
|
||||
#mesondefine GDK_WINDOWING_WIN32
|
||||
#mesondefine GDK_WINDOWING_MIR
|
||||
|
||||
#mesondefine GDK_RENDERING_VULKAN
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#ifndef __GDKCONFIG_H__
|
||||
#define __GDKCONFIG_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#ifndef __GDKCONFIG_H__
|
||||
#define __GDKCONFIG_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -22,7 +22,9 @@
|
||||
#include "gdkcontentdeserializer.h"
|
||||
|
||||
#include "gdkcontentformats.h"
|
||||
#include "filetransferportalprivate.h"
|
||||
#include "gdktexture.h"
|
||||
#include "gdkrgbaprivate.h"
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
@@ -690,6 +692,95 @@ string_deserializer (GdkContentDeserializer *deserializer)
|
||||
g_object_unref (filter);
|
||||
}
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
static void
|
||||
portal_finish (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer deserializer)
|
||||
{
|
||||
char **files = NULL;
|
||||
GError *error = NULL;
|
||||
GValue *value;
|
||||
|
||||
if (!file_transfer_portal_retrieve_files_finish (result, &files, &error))
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
}
|
||||
|
||||
value = gdk_content_deserializer_get_value (deserializer);
|
||||
if (G_VALUE_HOLDS (value, G_TYPE_FILE))
|
||||
{
|
||||
if (files[0] != NULL)
|
||||
g_value_take_object (value, g_file_new_for_path (files[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
GSList *l = NULL;
|
||||
gsize i;
|
||||
|
||||
for (i = 0; files[i] != NULL; i++)
|
||||
l = g_slist_prepend (l, g_file_new_for_path (files[i]));
|
||||
g_value_take_boxed (value, g_slist_reverse (l));
|
||||
}
|
||||
g_strfreev (files);
|
||||
|
||||
gdk_content_deserializer_return_success (deserializer);
|
||||
}
|
||||
|
||||
static void
|
||||
portal_file_deserializer_finish (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer deserializer)
|
||||
{
|
||||
GOutputStream *stream = G_OUTPUT_STREAM (source);
|
||||
GError *error = NULL;
|
||||
gssize written;
|
||||
char *key;
|
||||
|
||||
written = g_output_stream_splice_finish (stream, result, &error);
|
||||
if (written < 0)
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
}
|
||||
|
||||
/* write terminating NULL */
|
||||
if (!g_output_stream_write (stream, "", 1, NULL, &error))
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
}
|
||||
|
||||
key = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (stream));
|
||||
if (key == NULL)
|
||||
{
|
||||
deserialize_not_found (deserializer);
|
||||
return;
|
||||
}
|
||||
|
||||
file_transfer_portal_retrieve_files (key, portal_finish, deserializer);
|
||||
gdk_content_deserializer_set_task_data (deserializer, key, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
portal_file_deserializer (GdkContentDeserializer *deserializer)
|
||||
{
|
||||
GOutputStream *output;
|
||||
|
||||
output = g_memory_output_stream_new_resizable ();
|
||||
|
||||
g_output_stream_splice_async (output,
|
||||
gdk_content_deserializer_get_input_stream (deserializer),
|
||||
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
|
||||
gdk_content_deserializer_get_priority (deserializer),
|
||||
gdk_content_deserializer_get_cancellable (deserializer),
|
||||
portal_file_deserializer_finish,
|
||||
deserializer);
|
||||
g_object_unref (output);
|
||||
}
|
||||
#endif /* G_OS_UNIX */
|
||||
|
||||
static void
|
||||
file_uri_deserializer_finish (GObject *source,
|
||||
GAsyncResult *result,
|
||||
@@ -758,6 +849,63 @@ file_uri_deserializer (GdkContentDeserializer *deserializer)
|
||||
g_object_unref (output);
|
||||
}
|
||||
|
||||
static void
|
||||
color_deserializer_finish (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer deserializer)
|
||||
{
|
||||
GOutputStream *stream = G_OUTPUT_STREAM (source);
|
||||
GError *error = NULL;
|
||||
gssize written;
|
||||
|
||||
written = g_output_stream_splice_finish (stream, result, &error);
|
||||
if (written < 0)
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
}
|
||||
else if (written == 0)
|
||||
{
|
||||
GdkRGBA black = GDK_RGBA ("000");
|
||||
|
||||
/* Never return NULL, we only return that on error */
|
||||
g_value_set_boxed (gdk_content_deserializer_get_value (deserializer), &black);
|
||||
}
|
||||
else
|
||||
{
|
||||
guint16 *data;
|
||||
GdkRGBA rgba;
|
||||
|
||||
data = (guint16 *)g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (stream));
|
||||
rgba.red = data[0] / 65535.0;
|
||||
rgba.green = data[1] / 65535.0;
|
||||
rgba.blue = data[2] / 65535.0;
|
||||
rgba.alpha = data[3] / 65535.0;
|
||||
|
||||
g_value_set_boxed (gdk_content_deserializer_get_value (deserializer), &rgba);
|
||||
}
|
||||
gdk_content_deserializer_return_success (deserializer);
|
||||
}
|
||||
|
||||
static void
|
||||
color_deserializer (GdkContentDeserializer *deserializer)
|
||||
{
|
||||
GOutputStream *output;
|
||||
guint16 *data;
|
||||
|
||||
data = g_new0 (guint16, 4);
|
||||
output = g_memory_output_stream_new (data, 4 * sizeof (guint16), NULL, g_free);
|
||||
|
||||
g_output_stream_splice_async (output,
|
||||
gdk_content_deserializer_get_input_stream (deserializer),
|
||||
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
|
||||
gdk_content_deserializer_get_priority (deserializer),
|
||||
gdk_content_deserializer_get_cancellable (deserializer),
|
||||
color_deserializer_finish,
|
||||
deserializer);
|
||||
g_object_unref (output);
|
||||
}
|
||||
|
||||
static void
|
||||
init (void)
|
||||
{
|
||||
@@ -816,11 +964,31 @@ init (void)
|
||||
|
||||
g_slist_free (formats);
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
gboolean has_portal = file_transfer_portal_available ();
|
||||
if (has_portal)
|
||||
gdk_content_register_deserializer ("application/vnd.portal.files",
|
||||
GDK_TYPE_FILE_LIST,
|
||||
portal_file_deserializer,
|
||||
NULL,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
gdk_content_register_deserializer ("text/uri-list",
|
||||
GDK_TYPE_FILE_LIST,
|
||||
file_uri_deserializer,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
if (has_portal)
|
||||
gdk_content_register_deserializer ("application/vnd.portal.files",
|
||||
G_TYPE_FILE,
|
||||
portal_file_deserializer,
|
||||
NULL,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
gdk_content_register_deserializer ("text/uri-list",
|
||||
G_TYPE_FILE,
|
||||
file_uri_deserializer,
|
||||
@@ -846,5 +1014,11 @@ init (void)
|
||||
string_deserializer,
|
||||
(gpointer) "ASCII",
|
||||
NULL);
|
||||
|
||||
gdk_content_register_deserializer ("application/x-color",
|
||||
GDK_TYPE_RGBA,
|
||||
color_deserializer,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef __GTK_CONTENT_DESERIALIZER_H__
|
||||
#define __GTK_CONTENT_DESERIALIZER_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef __GTK_CONTENT_FORMATS_H__
|
||||
#define __GTK_CONTENT_FORMATS_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -347,7 +347,7 @@ gdk_content_provider_write_mime_type_finish (GdkContentProvider *provider,
|
||||
* @error: a #GError location to store the error occurring, or %NULL to
|
||||
* ignore.
|
||||
*
|
||||
* Gets the convtents of @provider stored in @value.
|
||||
* Gets the contents of @provider stored in @value.
|
||||
*
|
||||
* The @value will have been initialized to the #GType the value should be
|
||||
* provided in. This given #GType does not need to be listed in the formats
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#ifndef __GDK_CONTENT_PROVIDER_H__
|
||||
#define __GDK_CONTENT_PROVIDER_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "gdkcontentprovider.h"
|
||||
|
||||
#include "gdkcontentformats.h"
|
||||
#include "gdkcontentserializer.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdkcontentproviderimpl.h"
|
||||
|
||||
@@ -280,3 +281,232 @@ gdk_content_provider_new_for_bytes (const char *mime_type,
|
||||
|
||||
return GDK_CONTENT_PROVIDER (content);
|
||||
}
|
||||
|
||||
#define GDK_TYPE_CONTENT_PROVIDER_CALLBACK (gdk_content_provider_callback_get_type ())
|
||||
#define GDK_CONTENT_PROVIDER_CALLBACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CONTENT_PROVIDER_CALLBACK, GdkContentProviderCallback))
|
||||
|
||||
typedef struct _GdkContentProviderCallback GdkContentProviderCallback;
|
||||
typedef struct _GdkContentProviderCallbackClass GdkContentProviderCallbackClass;
|
||||
|
||||
struct _GdkContentProviderCallback
|
||||
{
|
||||
GdkContentProvider parent;
|
||||
|
||||
GType type;
|
||||
GdkContentProviderGetValueFunc func;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
struct _GdkContentProviderCallbackClass
|
||||
{
|
||||
GdkContentProviderClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_content_provider_callback_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_DEFINE_TYPE (GdkContentProviderCallback, gdk_content_provider_callback, GDK_TYPE_CONTENT_PROVIDER)
|
||||
|
||||
static GdkContentFormats *
|
||||
gdk_content_provider_callback_ref_formats (GdkContentProvider *provider)
|
||||
{
|
||||
GdkContentProviderCallback *callback = GDK_CONTENT_PROVIDER_CALLBACK (provider);
|
||||
|
||||
return gdk_content_formats_new_for_gtype (callback->type);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_content_provider_callback_get_value (GdkContentProvider *provider,
|
||||
GValue *value,
|
||||
GError **error)
|
||||
{
|
||||
GdkContentProviderCallback *callback = GDK_CONTENT_PROVIDER_CALLBACK (provider);
|
||||
|
||||
if (G_VALUE_HOLDS (value, callback->type) && callback->func != NULL)
|
||||
{
|
||||
callback->func (value, callback->data);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return GDK_CONTENT_PROVIDER_CLASS (gdk_content_provider_callback_parent_class)->get_value (provider, value, error);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_content_provider_callback_class_init (GdkContentProviderCallbackClass *class)
|
||||
{
|
||||
GdkContentProviderClass *provider_class = GDK_CONTENT_PROVIDER_CLASS (class);
|
||||
|
||||
provider_class->ref_formats = gdk_content_provider_callback_ref_formats;
|
||||
provider_class->get_value = gdk_content_provider_callback_get_value;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_content_provider_callback_init (GdkContentProviderCallback *content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_content_provider_new_for_callback:
|
||||
* @type: the type that the callback provides
|
||||
* @func: callback to populate a #GValue
|
||||
* @data: (closure): data that gets passed to @func
|
||||
*
|
||||
* Create a content provider that provides data that is provided via a callback.
|
||||
*
|
||||
* Returns: a new #GdkContentProvider
|
||||
**/
|
||||
GdkContentProvider *
|
||||
gdk_content_provider_new_with_callback (GType type,
|
||||
GdkContentProviderGetValueFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
GdkContentProviderCallback *content;
|
||||
|
||||
content = g_object_new (GDK_TYPE_CONTENT_PROVIDER_CALLBACK, NULL);
|
||||
content->type = type;
|
||||
content->func = func;
|
||||
content->data = data;
|
||||
|
||||
return GDK_CONTENT_PROVIDER (content);
|
||||
}
|
||||
|
||||
#define GDK_TYPE_CONTENT_PROVIDER_CALLBACK2 (gdk_content_provider_callback2_get_type ())
|
||||
#define GDK_CONTENT_PROVIDER_CALLBACK2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CONTENT_PROVIDER_CALLBACK2, GdkContentProviderCallback2))
|
||||
|
||||
typedef struct _GdkContentProviderCallback2 GdkContentProviderCallback2;
|
||||
typedef struct _GdkContentProviderCallback2Class GdkContentProviderCallback2Class;
|
||||
|
||||
struct _GdkContentProviderCallback2
|
||||
{
|
||||
GdkContentProvider parent;
|
||||
|
||||
GdkContentFormats *formats;
|
||||
GdkContentProviderGetBytesFunc func;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
struct _GdkContentProviderCallback2Class
|
||||
{
|
||||
GdkContentProviderClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_content_provider_callback2_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_DEFINE_TYPE (GdkContentProviderCallback2, gdk_content_provider_callback2, GDK_TYPE_CONTENT_PROVIDER)
|
||||
|
||||
static GdkContentFormats *
|
||||
gdk_content_provider_callback2_ref_formats (GdkContentProvider *provider)
|
||||
{
|
||||
GdkContentProviderCallback2 *callback = GDK_CONTENT_PROVIDER_CALLBACK2 (provider);
|
||||
|
||||
return gdk_content_formats_ref (callback->formats);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_content_provider_callback2_write_mime_type_done (GObject *stream,
|
||||
GAsyncResult *result,
|
||||
gpointer task)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_output_stream_write_all_finish (G_OUTPUT_STREAM (stream), result, NULL, &error))
|
||||
g_task_return_error (task, error);
|
||||
else
|
||||
g_task_return_boolean (task, TRUE);
|
||||
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_content_provider_callback2_write_mime_type_async (GdkContentProvider *provider,
|
||||
const char *mime_type,
|
||||
GOutputStream *stream,
|
||||
int io_priority,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GdkContentProviderCallback2 *content = GDK_CONTENT_PROVIDER_CALLBACK2 (provider);
|
||||
GTask *task;
|
||||
GBytes *bytes;
|
||||
|
||||
task = g_task_new (content, cancellable, callback, user_data);
|
||||
g_task_set_priority (task, io_priority);
|
||||
g_task_set_source_tag (task, gdk_content_provider_callback2_write_mime_type_async);
|
||||
|
||||
if (!gdk_content_formats_contain_mime_type (content->formats, mime_type))
|
||||
{
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
_("Cannot provide contents as “%s”"), mime_type);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
bytes = content->func (mime_type, content->data);
|
||||
if (!bytes)
|
||||
{
|
||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||
_("Failed to get contents as “%s”"), mime_type);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
g_object_set_data_full (G_OBJECT (task), "bytes", bytes, (GDestroyNotify)g_bytes_unref);
|
||||
|
||||
g_output_stream_write_all_async (stream,
|
||||
g_bytes_get_data (bytes, NULL),
|
||||
g_bytes_get_size (bytes),
|
||||
io_priority,
|
||||
cancellable,
|
||||
gdk_content_provider_callback2_write_mime_type_done,
|
||||
task);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_content_provider_callback2_write_mime_type_finish (GdkContentProvider *provider,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (result, provider), FALSE);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gdk_content_provider_callback2_write_mime_type_async, FALSE);
|
||||
|
||||
return g_task_propagate_boolean (G_TASK (result), error);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_content_provider_callback2_class_init (GdkContentProviderCallback2Class *class)
|
||||
{
|
||||
GdkContentProviderClass *provider_class = GDK_CONTENT_PROVIDER_CLASS (class);
|
||||
|
||||
provider_class->ref_formats = gdk_content_provider_callback2_ref_formats;
|
||||
provider_class->write_mime_type_async = gdk_content_provider_callback2_write_mime_type_async;
|
||||
provider_class->write_mime_type_finish = gdk_content_provider_callback2_write_mime_type_finish;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_content_provider_callback2_init (GdkContentProviderCallback2 *content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_content_provider_new_with_formats:
|
||||
* @formats: formats to advertise
|
||||
* @func: callback to populate a #GValue
|
||||
* @data: data that gets passed to @func
|
||||
*
|
||||
* Create a content provider that provides data that is provided via a callback.
|
||||
*
|
||||
* Returns: a new #GdkContentProvider
|
||||
**/
|
||||
GdkContentProvider *
|
||||
gdk_content_provider_new_with_formats (GdkContentFormats *formats,
|
||||
GdkContentProviderGetBytesFunc func,
|
||||
gpointer data)
|
||||
{
|
||||
GdkContentProviderCallback2 *content;
|
||||
content = g_object_new (GDK_TYPE_CONTENT_PROVIDER_CALLBACK2, NULL);
|
||||
content->formats = gdk_content_formats_union_serialize_mime_types (gdk_content_formats_ref (formats));
|
||||
content->func = func;
|
||||
content->data = data;
|
||||
|
||||
return GDK_CONTENT_PROVIDER (content);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#ifndef __GDK_CONTENT_PROVIDER_IMPL_H__
|
||||
#define __GDK_CONTENT_PROVIDER_IMPL_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,21 @@ GDK_AVAILABLE_IN_ALL
|
||||
GdkContentProvider * gdk_content_provider_new_for_bytes (const char *mime_type,
|
||||
GBytes *bytes);
|
||||
|
||||
typedef void (*GdkContentProviderGetValueFunc) (GValue *value,
|
||||
gpointer data);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkContentProvider * gdk_content_provider_new_with_callback (GType type,
|
||||
GdkContentProviderGetValueFunc func,
|
||||
gpointer data);
|
||||
|
||||
typedef GBytes * (*GdkContentProviderGetBytesFunc) (const char *mime_type,
|
||||
gpointer data);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkContentProvider * gdk_content_provider_new_with_formats (GdkContentFormats *formats,
|
||||
GdkContentProviderGetBytesFunc func,
|
||||
gpointer data);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -23,7 +23,9 @@
|
||||
|
||||
#include "gdkcontentformats.h"
|
||||
#include "gdkpixbuf.h"
|
||||
#include "filetransferportalprivate.h"
|
||||
#include "gdktextureprivate.h"
|
||||
#include "gdkrgba.h"
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <string.h>
|
||||
@@ -431,7 +433,7 @@ lookup_serializer (const char *mime_type,
|
||||
|
||||
/**
|
||||
* gdk_content_formats_union_serialize_gtypes:
|
||||
* @formats: a #GdkContentFormats
|
||||
* @formats: (transfer full): a #GdkContentFormats
|
||||
*
|
||||
* Add GTypes for the mime types in @formats for which serializers are
|
||||
* registered.
|
||||
@@ -466,7 +468,7 @@ gdk_content_formats_union_serialize_gtypes (GdkContentFormats *formats)
|
||||
|
||||
/**
|
||||
* gdk_content_formats_union_serialize_mime_types:
|
||||
* @formats: a #GdkContentFormats
|
||||
* @formats: (transfer full): a #GdkContentFormats
|
||||
*
|
||||
* Add mime types for GTypes in @formats for which serializers are
|
||||
* registered.
|
||||
@@ -701,6 +703,65 @@ file_serializer_finish (GObject *source,
|
||||
gdk_content_serializer_return_success (serializer);
|
||||
}
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
static void
|
||||
portal_ready (GObject *object,
|
||||
GAsyncResult *result,
|
||||
gpointer serializer)
|
||||
{
|
||||
GError *error = NULL;
|
||||
char *key;
|
||||
|
||||
if (!file_transfer_portal_register_files_finish (result, &key, &error))
|
||||
{
|
||||
gdk_content_serializer_return_error (serializer, error);
|
||||
return;
|
||||
}
|
||||
|
||||
g_output_stream_write_all_async (gdk_content_serializer_get_output_stream (serializer),
|
||||
key,
|
||||
strlen (key) + 1,
|
||||
gdk_content_serializer_get_priority (serializer),
|
||||
gdk_content_serializer_get_cancellable (serializer),
|
||||
file_serializer_finish,
|
||||
serializer);
|
||||
gdk_content_serializer_set_task_data (serializer, key, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
portal_file_serializer (GdkContentSerializer *serializer)
|
||||
{
|
||||
GFile *file;
|
||||
const GValue *value;
|
||||
GPtrArray *files;
|
||||
|
||||
files = g_ptr_array_new_with_free_func (g_free);
|
||||
|
||||
value = gdk_content_serializer_get_value (serializer);
|
||||
|
||||
if (G_VALUE_HOLDS (value, G_TYPE_FILE))
|
||||
{
|
||||
file = g_value_get_object (gdk_content_serializer_get_value (serializer));
|
||||
if (file)
|
||||
g_ptr_array_add (files, g_file_get_path (file));
|
||||
g_ptr_array_add (files, NULL);
|
||||
}
|
||||
else if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = g_value_get_boxed (value); l; l = l->next)
|
||||
g_ptr_array_add (files, g_file_get_path (l->data));
|
||||
|
||||
g_ptr_array_add (files, NULL);
|
||||
}
|
||||
|
||||
/* this call doesn't copy the strings, so keep the array around until the registration is done */
|
||||
file_transfer_portal_register_files ((const char **)files->pdata, TRUE, portal_ready, serializer);
|
||||
gdk_content_serializer_set_task_data (serializer, files, (GDestroyNotify)g_ptr_array_unref);
|
||||
}
|
||||
#endif /* G_OS_UNIX */
|
||||
|
||||
static void
|
||||
file_uri_serializer (GdkContentSerializer *serializer)
|
||||
{
|
||||
@@ -802,6 +863,48 @@ file_text_serializer (GdkContentSerializer *serializer)
|
||||
gdk_content_serializer_set_task_data (serializer, path, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
color_serializer_finish (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer serializer)
|
||||
{
|
||||
GOutputStream *stream = G_OUTPUT_STREAM (source);
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_output_stream_write_all_finish (stream, result, NULL, &error))
|
||||
gdk_content_serializer_return_error (serializer, error);
|
||||
else
|
||||
gdk_content_serializer_return_success (serializer);
|
||||
}
|
||||
|
||||
static void
|
||||
color_serializer (GdkContentSerializer *serializer)
|
||||
{
|
||||
const GValue *value;
|
||||
GdkRGBA *rgba;
|
||||
guint16 *data;
|
||||
|
||||
value = gdk_content_serializer_get_value (serializer);
|
||||
rgba = g_value_get_boxed (value);
|
||||
data = g_new0 (guint16, 4);
|
||||
if (rgba)
|
||||
{
|
||||
data[0] = (guint16) (rgba->red * 65535);
|
||||
data[1] = (guint16) (rgba->green * 65535);
|
||||
data[2] = (guint16) (rgba->blue * 65535);
|
||||
data[3] = (guint16) (rgba->alpha * 65535);
|
||||
}
|
||||
|
||||
g_output_stream_write_all_async (gdk_content_serializer_get_output_stream (serializer),
|
||||
data,
|
||||
4 * sizeof (guint16),
|
||||
gdk_content_serializer_get_priority (serializer),
|
||||
gdk_content_serializer_get_cancellable (serializer),
|
||||
color_serializer_finish,
|
||||
serializer);
|
||||
gdk_content_serializer_set_task_data (serializer, data, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
init (void)
|
||||
{
|
||||
@@ -863,6 +966,17 @@ init (void)
|
||||
|
||||
g_slist_free (formats);
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
gboolean has_portal = file_transfer_portal_available ();
|
||||
|
||||
if (has_portal)
|
||||
gdk_content_register_serializer (G_TYPE_FILE,
|
||||
"application/vnd.portal.files",
|
||||
portal_file_serializer,
|
||||
NULL,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
gdk_content_register_serializer (G_TYPE_FILE,
|
||||
"text/uri-list",
|
||||
file_uri_serializer,
|
||||
@@ -873,6 +987,16 @@ init (void)
|
||||
file_text_serializer,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
if (has_portal)
|
||||
gdk_content_register_serializer (GDK_TYPE_FILE_LIST,
|
||||
"application/vnd.portal.files",
|
||||
portal_file_serializer,
|
||||
NULL,
|
||||
NULL);
|
||||
#endif
|
||||
|
||||
gdk_content_register_serializer (GDK_TYPE_FILE_LIST,
|
||||
"text/uri-list",
|
||||
file_uri_serializer,
|
||||
@@ -903,5 +1027,11 @@ init (void)
|
||||
string_serializer,
|
||||
(gpointer) "ASCII",
|
||||
NULL);
|
||||
|
||||
gdk_content_register_serializer (GDK_TYPE_RGBA,
|
||||
"application/x-color",
|
||||
color_serializer,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef __GTK_CONTENT_SERIALIZER_H__
|
||||
#define __GTK_CONTENT_SERIALIZER_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef __GDK_CURSOR_H__
|
||||
#define __GDK_CURSOR_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef __GDK_DEVICE_H__
|
||||
#define __GDK_DEVICE_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#ifndef __GDK_DEVICE_PAD_H__
|
||||
#define __GDK_DEVICE_PAD_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef __GDK_DEVICE_TOOL_H__
|
||||
#define __GDK_DEVICE_TOOL_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#ifndef __GDK_DISPLAY_H__
|
||||
#define __GDK_DISPLAY_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef __GDK_DISPLAY_MANAGER_H__
|
||||
#define __GDK_DISPLAY_MANAGER_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -90,20 +90,30 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdkDrag, gdk_drag, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
* SECTION:dnd
|
||||
* @title: Drag And Drop
|
||||
* @short_description: Functions for controlling drag and drop handling
|
||||
* @Title: Drag And Drop
|
||||
* @Short_description: Functions for controlling drag and drop handling
|
||||
*
|
||||
* These functions provide a low level interface for drag and drop.
|
||||
* These functions provide a low-level interface for drag and drop.
|
||||
*
|
||||
* The GdkDrag object represents the source side of an ongoing DND operation.
|
||||
* It is created when a drag is started, and stays alive for duration of
|
||||
* the DND operation.
|
||||
* the DND operation. After a drag has been started with gdk_drag_begin(),
|
||||
* the caller gets informed about the status of the ongoing drag operation
|
||||
* with signals on the #GtkDrag object.
|
||||
*
|
||||
* The GdkDrop object represents the target side of an ongoing DND operation.
|
||||
* Possible drop sites get informed about the status of the ongoing drag operation
|
||||
* with events of type %GDK_DRAG_ENTER, %GDK_DRAG_LEAVE, %GDK_DRAG_MOTION and
|
||||
* %GDK_DROP_START. The #GdkDrop object can be obtained from these #GdkEvents
|
||||
* using gdk_event_get_drop().
|
||||
*
|
||||
* The actual data transfer is initiated from the target side via an async
|
||||
* read, using one of the GdkDrop functions for this purpose: gdk_drop_read_async(),
|
||||
* gdk_drop_read_value_async() or gdk_drop_read_text_async().
|
||||
*
|
||||
* GTK+ provides a higher level abstraction based on top of these functions,
|
||||
* and so they are not normally needed in GTK+ applications. See the
|
||||
* [Drag and Drop][gtk4-Drag-and-Drop] section of the GTK+ documentation
|
||||
* GTK provides a higher level abstraction based on top of these functions,
|
||||
* and so they are not normally needed in GTK applications. See the
|
||||
* [Drag and Drop][gtk4-Drag-and-Drop] section of the GTK documentation
|
||||
* for more information.
|
||||
*/
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef __GDK_DND_H__
|
||||
#define __GDK_DND_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef __GDK_DRAW_CONTEXT__
|
||||
#define __GDK_DRAW_CONTEXT__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -448,7 +448,10 @@ gdk_drop_get_surface (GdkDrop *self)
|
||||
* Returns the possible actions for this #GdkDrop. If this value
|
||||
* contains multiple actions - ie gdk_drag_action_is_unique()
|
||||
* returns %FALSE for the result - gdk_drag_finish() must choose
|
||||
* the action to use when accepting the drop.
|
||||
* the action to use when accepting the drop. This will only
|
||||
* happen if you passed %GDK_ACTION_ASK as one of the possible
|
||||
* actions in gdk_drag_status(). %GDK_ACTION_ASK itself will not
|
||||
* be included in the actions returned by this function.
|
||||
*
|
||||
* This value may change over the lifetime of the #GdkDrop both
|
||||
* as a response to source side actions as well as to calls to
|
||||
@@ -938,6 +941,9 @@ gdk_drop_emit_motion_event (GdkDrop *self,
|
||||
{
|
||||
GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
|
||||
GdkEvent *event;
|
||||
int x, y;
|
||||
|
||||
gdk_surface_get_origin (priv->surface, &x, &y);
|
||||
|
||||
event = gdk_event_new (GDK_DRAG_MOTION);
|
||||
event->any.surface = g_object_ref (priv->surface);
|
||||
@@ -945,6 +951,8 @@ gdk_drop_emit_motion_event (GdkDrop *self,
|
||||
event->dnd.time = time;
|
||||
event->dnd.x_root = x_root;
|
||||
event->dnd.y_root = y_root;
|
||||
event->dnd.x = x_root - x;
|
||||
event->dnd.y = y_root - y;
|
||||
gdk_event_set_device (event, priv->device);
|
||||
|
||||
gdk_drop_do_emit_event (event, dont_queue);
|
||||
@@ -976,6 +984,9 @@ gdk_drop_emit_drop_event (GdkDrop *self,
|
||||
{
|
||||
GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
|
||||
GdkEvent *event;
|
||||
int x, y;
|
||||
|
||||
gdk_surface_get_origin (priv->surface, &x, &y);
|
||||
|
||||
event = gdk_event_new (GDK_DROP_START);
|
||||
event->any.surface = g_object_ref (priv->surface);
|
||||
@@ -983,8 +994,37 @@ gdk_drop_emit_drop_event (GdkDrop *self,
|
||||
event->dnd.time = time;
|
||||
event->dnd.x_root = x_root;
|
||||
event->dnd.y_root = y_root;
|
||||
event->dnd.x = x_root - x;
|
||||
event->dnd.y = y_root - y;
|
||||
gdk_event_set_device (event, priv->device);
|
||||
|
||||
gdk_drop_do_emit_event (event, dont_queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_drop_has_value:
|
||||
* @self: a #GdkDrop
|
||||
* @type: the type to check
|
||||
*
|
||||
* Returns whether calling gdk_drop_read_value_async() for @type
|
||||
* can succeed.
|
||||
*
|
||||
* Returns: %TRUE if the data can be deserialized to the given type
|
||||
*/
|
||||
gboolean
|
||||
gdk_drop_has_value (GdkDrop *self,
|
||||
GType type)
|
||||
{
|
||||
GdkContentFormats *formats;
|
||||
gboolean ret;
|
||||
|
||||
formats = gdk_content_formats_ref (gdk_drop_get_formats (self));
|
||||
formats = gdk_content_formats_union_deserialize_gtypes (formats);
|
||||
|
||||
ret = gdk_content_formats_contain_gtype (formats, type);
|
||||
|
||||
gdk_content_formats_unref (formats);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef __GDK_DROP_H__
|
||||
#define __GDK_DROP_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
@@ -92,6 +92,9 @@ char * gdk_drop_read_text_finish (GdkDrop
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_drop_has_value (GdkDrop *self,
|
||||
GType type);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#ifndef __GDK_ENUM_TYPES_H__
|
||||
#define __GDK_ENUM_TYPES_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
@@ -947,6 +947,13 @@ gdk_event_get_coords (const GdkEvent *event,
|
||||
x = event->touchpad_pinch.x;
|
||||
y = event->touchpad_pinch.y;
|
||||
break;
|
||||
case GDK_DRAG_ENTER:
|
||||
case GDK_DRAG_LEAVE:
|
||||
case GDK_DRAG_MOTION:
|
||||
case GDK_DROP_START:
|
||||
x = event->dnd.x;
|
||||
y = event->dnd.y;
|
||||
break;
|
||||
default:
|
||||
fetched = FALSE;
|
||||
break;
|
||||
@@ -1006,6 +1013,13 @@ gdk_event_set_coords (GdkEvent *event,
|
||||
event->touchpad_pinch.x = x;
|
||||
event->touchpad_pinch.y = y;
|
||||
break;
|
||||
case GDK_DRAG_ENTER:
|
||||
case GDK_DRAG_LEAVE:
|
||||
case GDK_DRAG_MOTION:
|
||||
case GDK_DROP_START:
|
||||
event->dnd.x = x;
|
||||
event->dnd.y = y;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#ifndef __GDK_EVENTS_H__
|
||||
#define __GDK_EVENTS_H__
|
||||
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gdk/gdk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user